pythonCascade Sample Problems

Topology Primitives: Pipe creation


 

        CurvePoles = []

        CurvePoles.append(gp_Pnt(0.,0.,0.))

        CurvePoles.append(gp_Pnt(20.,50.,0.))

        CurvePoles.append(gp_Pnt(60.,100.,0.))

        CurvePoles.append(gp_Pnt(150.,0.,0.))

        curve = Geom_BezierCurve(CurvePoles)

 

        E = BRepBuilderAPI_MakeEdge(curve).Edge()

        W = BRepBuilderAPI_MakeWire(E).Wire()

 

        ais1 = AIS_Shape(W)

        self.interactive_context.Display(ais1,1)

 

        c = gp_Circ(gp_Ax2(gp_Pnt(0.,0.,0.),gp_Dir(0.,1.,0.)),10.)

        Ec = BRepBuilderAPI_MakeEdge(c).Edge()

        Wc = BRepBuilderAPI_MakeWire(Ec).Wire()

        ais3 = AIS_Shape(Wc)

        self.interactive_context.Display(ais3,1)

 

        F = BRepBuilderAPI_MakeFace(gp_Pln(gp_Ax3(gp().ZOX())),Wc,1).Face()

        S = BRepOffsetAPI_MakePipe(W,F).Shape()

        ais2 = AIS_Shape(S)

        self.interactive_context.SetMaterial(ais2,Graphic3d_NOM_PLASTIC,0)

        self.interactive_context.SetColor(ais2,Quantity_NOC_MATRABLUE,0)

        self.interactive_context.SetDisplayMode(ais2,AIS_Shaded,0)

        self.interactive_context.Display(ais2,1)