pythonCascade Sample Problems
Topology Transformations: Rotation

self.Initialize()
self.interactive_context.EraseAll(0,1)
S =
BRepPrimAPI_MakeWedge(60.,100.,80.,20.).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()
axe =
gp_Ax1(gp_Pnt(200,60,60),gp_Dir(0.,1.,0.))
Gax1 = Geom_Axis1Placement(axe)
ax1 =
AIS_Axis(Gax1)
self.interactive_context.Display(ax1,1)
theTransformation.SetRotation(axe,30*math.pi/180.0)
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)
self.view.FitAll(0.01,0)
self.view.ZFitAll(0.01)
self.view.Redraw()