6 gg = salome.ImportComponentGUI("GEOM")
8 # create a vertex and a vector
9 p1 = geompy.MakeVertex(10, 40, 0)
10 p2 = geompy.MakeVertex( 0, 0, 50)
11 p3 = geompy.MakeVertex(10, 50,-20)
12 p4 = geompy.MakeVertex(10, 50, 60)
13 v = geompy.MakeVector(p1, p2)
14 vr = geompy.MakeVector(p3, p4)
19 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
21 # rotate the given object around the given axis by the given angle
22 rotation1 = geompy.MakeRotation(cylinder, vr, math.pi)
23 rotation2 = geompy.MakeRotationThreePoints(cylinder, p4, p1, p2)
25 # add objects in the study
26 id_vr = geompy.addToStudy(vr, "Rotation 1 axis")
27 id_p4 = geompy.addToStudy(p4, "Rotation 2 center")
28 id_p1 = geompy.addToStudy(p1, "Rotation 2 point 1")
29 id_p2 = geompy.addToStudy(p2, "Rotation 2 point 2")
30 id_cylinder = geompy.addToStudy(cylinder, "Cylinder")
31 id_rotation1 = geompy.addToStudy(rotation1, "Rotation 1")
32 id_rotation2 = geompy.addToStudy(rotation2, "Rotation 2")
35 gg.createAndDisplayGO(id_vr)
36 gg.createAndDisplayGO(id_p4)
37 gg.createAndDisplayGO(id_p1)
38 gg.createAndDisplayGO(id_p2)
39 gg.createAndDisplayGO(id_cylinder)
40 gg.setDisplayMode(id_cylinder,1)
41 gg.createAndDisplayGO(id_rotation1)
42 gg.createAndDisplayGO(id_rotation2)
43 gg.setDisplayMode(id_rotation1,1)
44 gg.setDisplayMode(id_rotation2,1)