Salome HOME
Mantis issue 0021703: [CEA 577] Boolean operations on groups.
[modules/geom.git] / doc / salome / gui / GEOM / input / tui_transformation_operations.doc
index a05846a7904dd23e791f754c2b1332d3aa6936e6..09744cddfffe8d8ebc4365e0fcfd605bbff59b04 100644 (file)
@@ -27,12 +27,14 @@ cylinder = geompy.MakeCylinder(p1, v, radius1, height)
 translation1 = geompy.MakeTranslationTwoPoints(cylinder, p1, p3)
 translation2 = geompy.MakeTranslation(cylinder, 40, 40, 0)
 translation3 = geompy.MakeTranslationVector(cylinder, vt)
+translation4 = geompy.MakeTranslationVectorDistance(cylinder, vt, 200)
 
 # add objects in the study
 id_cylinder = geompy.addToStudy(cylinder, "Cylinder")
 id_translation1 = geompy.addToStudy(translation1, "Translation1")
 id_translation2 = geompy.addToStudy(translation2, "Translation2")
 id_translation3 = geompy.addToStudy(translation3, "Translation3")
+id_translation4 = geompy.addToStudy(translation4, "Translation4")
 
 # display the results
 gg.createAndDisplayGO(id_cylinder)
@@ -43,6 +45,8 @@ gg.createAndDisplayGO(id_translation2)
 gg.setDisplayMode(id_translation2,1)
 gg.createAndDisplayGO(id_translation3)
 gg.setDisplayMode(id_translation3,1) 
+gg.createAndDisplayGO(id_translation4)
+gg.setDisplayMode(id_translation4,1) 
 \endcode
 
 \anchor tui_rotation
@@ -111,6 +115,7 @@ v = geompy.MakeVector(p1, p2)
 height = 35
 radius1 = 20
 cylinder = geompy.MakeCylinder(p1, v, radius1, height)
+circle   = geompy.MakeCircle(p2, v, radius1)
 
 # create local coordinate systems
 cs1 = geompy.MakeMarker( 0, 0, 0, 1,0,0, 0,1,0)
@@ -118,18 +123,25 @@ cs2 = geompy.MakeMarker(30,40,40, 1,0,0, 0,1,0)
 
 # modify the location of the given object
 position = geompy.MakePosition(cylinder, cs1, cs2)
+position2 = geompy.PositionAlongPath(position, circle, 0.75, 1, 1)
 
 # add objects in the study
 id_cs1 = geompy.addToStudy(cs1, "Coordinate system 1")
 id_cs2 = geompy.addToStudy(cs2, "Coordinate system 2")
 id_cylinder = geompy.addToStudy(cylinder, "Cylinder")
+id_circle = geompy.addToStudy(circle, "Circle")
 id_position = geompy.addToStudy(position, "Position")
+id_position2 = geompy.addToStudy(position2, "PositionAlongPath")
 
 # display the results
 gg.createAndDisplayGO(id_cylinder)
 gg.setDisplayMode(id_cylinder,1)
 gg.createAndDisplayGO(id_position)
 gg.setDisplayMode(id_position,1)
+gg.createAndDisplayGO(id_circle)
+gg.setDisplayMode(id_circle,1)
+gg.createAndDisplayGO(id_position2)
+gg.setDisplayMode(id_position2,1)
 \endcode
 
 \anchor tui_mirror
@@ -234,6 +246,41 @@ gg.setDisplayMode(id_box,1)
 gg.createAndDisplayGO(id_offset) 
 \endcode
 
+\anchor tui_projection
+<br><h2>Projection</h2>
+
+\code
+import geompy
+import salome
+
+# create a cylindric face and a curve(edge)
+cylinder = geompy.MakeCylinderRH(100, 300)
+[face_cyl] = geompy.SubShapes(cylinder, [3])
+
+p1 = geompy.MakeVertex(200, 0, 100)
+p2 = geompy.MakeVertex(200, 80, 100)
+p3 = geompy.MakeVertex(200, 80, 180)
+p4 = geompy.MakeVertex(130, 80, 180)
+p5 = geompy.MakeVertex(90, 80, 240)
+
+curve = geompy.MakeInterpol([p1, p2, p3, p4, p5], False, False)
+
+# create a new object as projection of the
+# given curve on the given cylindric face
+projection = geompy.MakeProjection(curve, face_cyl)
+
+# add objects in the study
+geompy.addToStudy(cylinder, "cylinder")
+geompy.addToStudyInFather(cylinder, face_cyl, "face_cyl")
+geompy.addToStudy(p1, "p1")
+geompy.addToStudy(p2, "p2")
+geompy.addToStudy(p3, "p3")
+geompy.addToStudy(p4, "p4")
+geompy.addToStudy(p5, "p5")
+geompy.addToStudy(curve, "curve")
+geompy.addToStudy(projection, "projection")
+\endcode
+
 \anchor tui_multi_translation 
 <br><h2>Multi Translation</h2>
 
@@ -337,6 +384,50 @@ gg.createAndDisplayGO(id_rot2d)
 gg.setDisplayMode(id_rot2d,1) 
 \endcode
 
+\anchor tui_fillet2d
+<br><h2>Fillet 2D</h2>
+
+\code
+import geompy
+import salome
+gg = salome.ImportComponentGUI("GEOM")
+
+# create a face in OXY plane
+face = geompy.MakeFaceHW(100, 100, 1)
+fillet2d = geompy.MakeFillet2D(face, 30, [7, 9])
+
+# add objects in the study
+id_face  = geompy.addToStudy(face,"Face_1")
+id_fillet2d  = geompy.addToStudy(fillet2d,"Fillet 2D_1")
+
+# display disks
+gg.createAndDisplayGO(id_face)
+gg.createAndDisplayGO(id_fillet2d)
+\endcode
+
+\anchor tui_fillet1d
+<br><h2>Fillet 1D</h2>
+
+\code
+import geompy
+import salome
+gg = salome.ImportComponentGUI("GEOM")
+
+# create box
+Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
+# take box edges to create custom complex wire
+[Edge_1,Edge_2,Edge_3,Edge_4,Edge_5,Edge_6,Edge_7,Edge_8,Edge_9,Edge_10,Edge_11,Edge_12] = geompy.SubShapeAllSortedCentres(Box_1, geompy.ShapeType["EDGE"])
+# create wire
+Wire_1 = geompy.MakeWire([Edge_12, Edge_7, Edge_11, Edge_6, Edge_1,Edge_4])
+# make fillet at given wire vertices with giver radius
+Fillet_1D_1 = geompy.MakeFillet1D(Wire_1, 55, [3, 4, 6, 8, 10])
+
+
+# display disks
+gg.createAndDisplayGO(Wire_1)
+gg.createAndDisplayGO(Fillet_1D_1)
+\endcode
+
 \anchor tui_fillet
 <br><h2>Fillet</h2>
 
@@ -368,7 +459,7 @@ face = geompy.MakeFace(wire, 1)
 prism = geompy.MakePrismVecH(face, vz, 100.0)
 
 # get the list of IDs (IDList) for the fillet
-prism_edges = geompy.SubShapeAllSorted(prism, ShapeTypeEdge)
+prism_edges = geompy.SubShapeAllSortedCentres(prism, ShapeTypeEdge)
 IDlist_e = []
 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[0]))
 IDlist_e.append(geompy.GetSubShapeID(prism, prism_edges[1]))
@@ -426,7 +517,7 @@ face = geompy.MakeFace(wire, 1)
 prism = geompy.MakePrismVecH(face, vz, 100.0)
 
 # get the list of IDs (IDList) for the chamfer
-prism_faces = geompy.SubShapeAllSorted(prism, ShapeTypeFace)
+prism_faces = geompy.SubShapeAllSortedCentres(prism, ShapeTypeFace)
 f_ind_1 = geompy.GetSubShapeID(prism, prism_faces[0])
 f_ind_2 = geompy.GetSubShapeID(prism, prism_faces[1])
 IDlist_f = [f_ind_1, f_ind_2]
@@ -461,4 +552,4 @@ gg.createAndDisplayGO(id_chamfer_all)
 gg.setDisplayMode(id_chamfer_all,1) 
 \endcode
 
-*/
\ No newline at end of file
+*/