DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0026283

Fusing BRepOffsetAPI_MakePipeShell and BRepPrimAPI_MakeRevol Fails

CommunityOCCT:Modeling Algorithmsclosed2 public notes

Search issues

Description

Fusing the shapes generated by this tow function fails. But if the same shape is also generated by BRepOffsetAPI_MakePipeShell, fuse operation works.

Steps to reproduce

double R1 = 100, R2 = 20;

    gp_Circ circleSection1(gp_Ax2(gp_Pnt(R1,0,0),gp_Dir(0,1,0)),R2);
    gp_Circ circleSpine(gp_Ax2(gp_Pnt(),gp_Dir(0,0,1)),R1);
    TopoDS_Wire section1Wire = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circleSection1));
    TopoDS_Wire spine1Wire = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circleSpine,0,M_PI));
    BRepOffsetAPI_MakePipeShell pipeBuilder1(spine1Wire);
    pipeBuilder1.Add(section1Wire);
    pipeBuilder1.Build();
    pipeBuilder1.MakeSolid();

    gp_Circ circleSection2(gp_Ax2(gp_Pnt(R1-R2,0,0),gp_Dir(0,1,0)),R2/3.);
    TopoDS_Wire section2Wire = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circleSection2));
    gp_Trsf rotZ;
    rotZ.SetRotation(gp_Ax1(gp_Pnt(),gp_Dir(0,0,1)),M_PI_4);
    section2Wire.Move(rotZ);
    BRepPrimAPI_MakeRevol revol(section2Wire,gp_Ax1(gp_Pnt(),gp_Dir(0,0,1)), M_PI_2);

    BRepAlgoAPI_Fuse fuseOp1(pipeBuilder1.Shape(),revol.Shape());
    bool isOk1 = fuseOp1.IsDone();
    if(isOk1) std::cout << "fuseOp1 ok";

    TopoDS_Wire spine2Wire = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(circleSpine,M_PI_4,3 * M_PI_4));
    BRepOffsetAPI_MakePipeShell pipeBuilder2(spine2Wire);
    pipeBuilder2.Add(section2Wire);
    pipeBuilder2.Build();
    pipeBuilder2.MakeSolid();

    BRepAlgoAPI_Fuse fuseOp2(pipeBuilder1.Shape(),pipeBuilder2.Shape());
    bool isOk2 = fuseOp2.IsDone();
    if(isOk2) std::cout << "fuseOp2 ok";

Public activity

2 archived notes

Participants are labeled by their role within this record.

01Commenter 1
class BRepPrimAPI_MakeRevol creates SHELL, when input parameter is WIRE, but operation "fuse" needs SOLID for input.
To create SOLID by revol it is necessary to use FACE as input, something like that:
...
  TopoDS_Face F = BRepBuilderAPI_MakeFace(section2Wire, Standard_True);
  //BRepPrimAPI_MakeRevol revol(section2Wire,gp_Ax1(gp_Pnt(),gp_Dir(0,0,1)), M_PI_2);
  BRepPrimAPI_MakeRevol revol(F,gp_Ax1(gp_Pnt(),gp_Dir(0,0,1)), M_PI_2);
...
02Author
Thanks, sorry for the inconvenience.