pythonCascade Sample Problems

Topology Transformations: Translation



        self.Initialize()

        self.interactive_context.EraseAll(0,1)

 

        S = BRepPrimAPI_MakeWedge(6.,10.,8.,2.).Shape()

        ais1 = AIS_Shape(S)

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

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

        self.interactive_context.SetColor(ais1,Quantity_NOC_GREEN,0)

        self.interactive_context.Display(ais1,1)

 

        theTransformation = gp_Trsf()

 

        theVectorOfTranslation = gp_Vec(-6,-6,6)

        theTransformation.SetTranslation(theVectorOfTranslation)

 

        aDirection1 = AIS_Direction(gp_Pnt(0,0,0),theVectorOfTranslation)

        self.interactive_context.Display(aDirection1,1)

       

        myBRepTransformation = BRepBuilderAPI_Transform(S,theTransformation)

        S2 = myBRepTransformation.Shape()

 

        ais2 = AIS_Shape(S2)

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

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

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

        self.interactive_context.Display(ais2,1)