5 gg = salome.ImportComponentGUI("GEOM")
8 # create vertices and vectors
9 p0 = geompy.MakeVertex( 0., 0., 0.)
10 px = geompy.MakeVertex(20., 0., 0.)
11 py = geompy.MakeVertex( 0., 20., 0.)
12 pz = geompy.MakeVertex( 0., 0., 20.)
13 pxyz = geompy.MakeVertex( 50., 50., 10.)
14 vz = geompy.MakeVector(p0, pz)
15 vxy = geompy.MakeVector(px, py)
16 vrot = geompy.MakeVector(p0, pxyz)
19 arc = geompy.MakeArc(py, pz, px)
22 wire = geompy.MakeWire([vxy, arc])
24 # create a planar face
25 face = geompy.MakeFace(wire, 1)
28 prism = geompy.MakePrismVecH(face, vz, 20.0)
30 # 1. Rotate the prism around the axis vrot 4 times
32 # rotation angle = 2 * PI / 4
33 rot1da = geompy.MultiRotate1DNbTimes(prism, vrot, 4)
35 # by the given angle of 30 degrees
36 rot1db = geompy.MultiRotate1DByStep(prism, vrot, math.pi/6., 4)
38 # 2. Rotate the prism around the axis vrot 4 times
39 # and translate the result of each rotation 5 times on distance 50
41 # rotation angle = 2 * PI / 4
42 rot2da = geompy.MultiRotate2DNbTimes(prism, vrot, 4, 50, 5)
44 # by the given angle of 60 degrees
45 rot2db = geompy.MultiRotate2DByStep(prism, vrot, math.pi/3., 4, 50, 5)
47 # add objects in the study
48 id_prism = geompy.addToStudy(prism,"Prism")
49 id_rot1da = geompy.addToStudy(rot1da,"Rotation 1D Nb.Times")
50 id_rot1db = geompy.addToStudy(rot1db,"Rotation 1D By Step")
51 id_rot2da = geompy.addToStudy(rot2da,"Rotation 2D Nb.Times")
52 id_rot2db = geompy.addToStudy(rot2db,"Rotation 2D By Step")
54 # display the prism and the results of fillet operation
55 gg.createAndDisplayGO(id_prism)
56 gg.setDisplayMode(id_prism,1)
57 gg.createAndDisplayGO(id_rot1da)
58 gg.setDisplayMode(id_rot1da,1)
59 gg.createAndDisplayGO(id_rot1db)
60 gg.setDisplayMode(id_rot1db,1)
61 gg.createAndDisplayGO(id_rot2da)
62 gg.setDisplayMode(id_rot2da,1)
63 gg.createAndDisplayGO(id_rot2db)
64 gg.setDisplayMode(id_rot2db,1)