MantisBT - Community
View Issue Details
0030825Community[OCCT] OCCT:Modeling Algorithmspublic2019-07-02 15:492020-01-22 10:12
abezotosniy 
bugmaster 
normalminor 
closedfixed 
[OCCT] 7.3.0 
[OCCT] 7.4.0 
0030825: Crash during use BRepOffsetAPI_MakePipeShell
I got a crash at the time when I expect a result or an error message when using BRepOffsetAPI_MakePipeShell for attached input data.
1. Download path_profile.brep and put it into ${opencascade-7.3.0}\data\occ

2. Replace corresponding method in ${opencascade-7.3.0}\samples\mfc\standard\02_Modeling\src\ModelingDoc.cpp

void CModelingDoc::OnPipe()
{
    AIS_ListOfInteractive aList;
    myAISContext->DisplayedObjects(aList);
    AIS_ListIteratorOfListOfInteractive aListIterator;
    for(aListIterator.Initialize(aList);aListIterator.More();aListIterator.Next()){
        myAISContext->Remove (aListIterator.Value(), Standard_False);
    }

    // Read arguments
    TopoDS_Shape compound;
    {
        std::filebuf aFileBuf;
        std::istream aStream(&aFileBuf);

        CString tool_file;
        tool_file.GetEnvironmentVariable(L"CSF_OCCTDataPath");
        tool_file += "\\occ\\path_profile.brep";

        if(!aFileBuf.open(tool_file, ios::in))
        {
            AfxMessageBox(L"File not found");
            return;
        }

        BRep_Builder aBuilder;
        BRepTools::Read(compound, aStream, aBuilder);
    }

    std::vector<TopoDS_Shape> path_profile;
    for(TopoDS_Iterator exp(compound); exp.More(); exp.Next())
    {
        path_profile.push_back(exp.Value());
    }

    if(path_profile.size() != 2)
    {
        AfxMessageBox(L"Invalid number of arguments");
        return;
    }

    TopoDS_Shape path = path_profile[0];
    {
        Handle(AIS_Shape) ais = new AIS_Shape(path);
        myAISContext->SetColor(ais, Quantity_NOC_GREEN, Standard_False);
        myAISContext->Display(ais, Standard_False);
        Fit();
        Sleep(1000);
    }

    TopoDS_Shape profile = path_profile[1];
    {
        Handle(AIS_Shape) ais = new AIS_Shape(profile);
        myAISContext->SetColor(ais, Quantity_NOC_MATRABLUE, Standard_False);
        myAISContext->Display(ais, Standard_False);
        Fit();
        Sleep(1000);
    }

    TopoDS_Wire path_wire = TopoDS::Wire(path);
    BRepOffsetAPI_MakePipeShell sweep(path_wire);

    TopExp_Explorer exp(path, TopAbs_EDGE);
    TopoDS_Vertex vertex = TopExp::FirstVertex(TopoDS::Edge(exp.Current()), Standard_True);

    sweep.SetTransitionMode(BRepBuilderAPI_TransitionMode::BRepBuilderAPI_RightCorner);
    sweep.Add(profile, vertex, Standard_False, Standard_False);
    sweep.Build();
}
No tags attached.
? path_profile.brep (1,688) 2019-07-02 15:49
https://tracker.dev.opencascade.org/
Issue History
2019-07-02 15:49abezotosniyNew Issue
2019-07-02 15:49abezotosniyAssigned To => msv
2019-07-02 15:49abezotosniyFile Added: path_profile.brep
2020-01-21 13:54abezotosniyNote Added: 0089981
2020-01-21 15:16msvNote Added: 0089983
2020-01-21 15:16msvAssigned Tomsv => bugmaster
2020-01-21 15:16msvStatusnew => feedback
2020-01-22 10:12bugmasterStatusfeedback => closed
2020-01-22 10:12bugmasterResolutionopen => fixed
2020-01-22 10:12bugmasterFixed in Version => 7.4.0

Notes
(0089981)
abezotosniy   
2020-01-21 13:54   
Fixed in 7.4.0
(0089983)
msv   
2020-01-21 15:16   
Then I propose to close it.