MantisBT - Open CASCADE
View Issue Details
0031296Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2020-01-13 14:092020-01-22 10:11
szy 
bugmaster 
normalminor 
closedno change required 
[OCCT] 7.4.0 
[OCCT] 7.5.0* 
0031296: Possible bug in BRepBuilderAPI_MakeFace
Complaint from the customer.

"There is a critical bug that we saw in generating face from wire that includes segments constructed by 3 points arc. We managed to isolate this bug into the sample project in C++.
So, the wire itself is good, but the face is bad. The interesting/weird thing is that when we take the face and make a prism with (BRepPrimAPI_MakePrism) we get it good again.
We need a solution for that ASAP. Version 7.3 works well with this code."
BRepBuilderAPI_MakeWire makeWire;

        gp_Pnt2d P1(-103.26571872383029, 39.221900326227335);
        gp_Pnt2d P2(-102.8970266913477, 38.772686946689618);
        gp_Pnt2d P3(-102.34091531178649, 38.603966442024792);

        gp_Pnt2d P4(-102.34091531178649, 37.603966442024792);
        gp_Pnt2d P5(-103.45258251508518, 37.941238899401739);
        gp_Pnt2d P6(-104.18959825634157, 38.83921689386225);

        Handle(Geom2d_Curve) C = GCE2d_MakeArcOfCircle(P1, P2, P3).Value();
        BRepBuilderAPI_MakeEdge2d makeEdge2D(C);
        makeWire.Add(makeEdge2D.Edge());

        makeEdge2D.Init(GCE2d_MakeSegment(P3, P4).Value());
        makeWire.Add(makeEdge2D.Edge());

        C = GCE2d_MakeArcOfCircle(P4, P5, P6).Value();
        makeEdge2D.Init(C);
        makeWire.Add(makeEdge2D.Edge());

        makeEdge2D.Init(GCE2d_MakeSegment(P6, P1).Value());
        makeWire.Add(makeEdge2D.Edge());

        Handle(AIS_Shape) ais = new AIS_Shape(makeWire.Wire());
        myAISContext->SetMaterial(ais, Graphic3d_NOM_ALUMINIUM, Standard_False);
        myAISContext->SetDisplayMode(ais, 1, Standard_False);
        myAISContext->Display(ais, Standard_True);

        BRepBuilderAPI_MakeFace fb(makeWire.Wire());
        ais = new AIS_Shape(fb.Face());
        myAISContext->SetMaterial(ais, Graphic3d_NOM_BRONZE, Standard_False);
        myAISContext->SetDisplayMode(ais, 1, Standard_False);
        myAISContext->Display(ais, Standard_True);

No tags attached.
Issue History
2020-01-13 14:09szyNew Issue
2020-01-13 14:09szyAssigned To => msv
2020-01-14 12:23utverdovAssigned Tomsv => ifv
2020-01-14 14:32ifvNote Added: 0089884
2020-01-14 14:32ifvAssigned Toifv => msv
2020-01-14 14:32ifvStatusnew => resolved
2020-01-14 15:18msvNote Added: 0089886
2020-01-14 15:18msvAssigned Tomsv => bugmaster
2020-01-14 15:18msvStatusresolved => feedback
2020-01-14 15:19msvResolutionopen => no change required
2020-01-22 10:11bugmasterStatusfeedback => closed

Notes
(0089884)
ifv   
2020-01-14 14:32   
The code has a drawback: edges has no 3d curves, so result face, as well as initial wire are wrong.
To fix this it is enough to build 3d curves by method BRepLib::BuildCurves3d(...):

  TopoDS_Wire aWire = makeWire.Wire();
  BRepLib::BuildCurves3d(aWire);

 and use updated wire to build face:

  BRepBuilderAPI_MakeFace fb(aWire);
(0089886)
msv   
2020-01-14 15:18   
It is not a bug. Please close.