For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

pipe using sweep

Anonymous's picture
Forums: 

Hi all,

I am trying to create a pipe by sweeping a circle along a
wire. But, I have to construct a wire with the help of
different curve segment.
So, when I sweep along this wire I get a pipe over only
some portion of wire. Can anybody tell me why is this happening?

Here is my code where spine is nothing but a straight line (very simple case).
For this particular example my pipe starts from x=0 and ends at x=60-20=40
(this is true for all the values of x).

gp_Pnt pt1 = gp_Pnt(0.,0.,0.);
gp_Pnt pt2 = gp_Pnt(20.,0.,0.);
gp_Pnt pt3 = gp_Pnt(60.,0.,0.);

TopoDS_Vertex V1, V2, V3;
B.MakeVertex(V1,pt1,precision);
B.MakeVertex(V2,pt2,precision);
B.MakeVertex(V3,pt3,precision);

GC_MakeSegment Seg1 = GC_MakeSegment(pt1,pt2);
Handle(Geom_TrimmedCurve) HSeg1 = Seg1.Value();
GC_MakeSegment Seg2 = GC_MakeSegment(pt2,pt3);
Handle(Geom_TrimmedCurve) HSeg2 = Seg2.Value();
TopoDS_Edge E1, E2;
B.MakeEdge(E1,HSeg1,precision);
B.MakeEdge(E2,HSeg2,precision);
B.Add(E1,V1);
B.Add(E1,V2);
B.Add(E2,V2);
B.Add(E2,V3);

TopoDS_Wire W1;
B.MakeWire(W1);
B.Add(W1,E1);
B.Add(W1,E2);
gp_Circ cout1 = gp_Circ(gp_Ax2(pt1,gp_Dir(HSeg1->DN(HSeg1->FirstParameter(),1))),5.0);
TopoDS_Edge Ecout1 = BRepBuilderAPI_MakeEdge(cout1);
TopoDS_Wire Wcout1 = BRepBuilderAPI_MakeWire(Ecout1);
TopoDS_Face Fout1 = BRepBuilderAPI_MakeFace(gp_Pln(pt1,gp_Dir(HSeg1->DN(HSeg1->FirstParameter(),1))),Wcout1);
gp_Circ cin1 = gp_Circ(gp_Ax2(pt1,gp_Dir(HSeg1->DN(HSeg1->FirstParameter(),1))),2.0);
TopoDS_Edge Ecin1 = BRepBuilderAPI_MakeEdge(cin1);
TopoDS_Wire Wcin1 = BRepBuilderAPI_MakeWire(Ecin1);
TopoDS_Face Fin1 = BRepBuilderAPI_MakeFace(gp_Pln(pt1,gp_Dir(HSeg1->DN(HSeg1->FirstParameter(),1))),Wcin1);

TopoDS_Shape FaceCut1 = BRepAlgoAPI_Cut(Fout1,Fin1);
TopoDS_Shape S1 = BRepOffsetAPI_MakePipe(W1,FaceCut1);

TIA,
Ashish.