Salome HOME
Implementation of the "0020839: EDF 1370 DOC : Update of the TUI features documentati...
[modules/geom.git] / doc / salome / gui / GEOM / input / tui_advanced_geom_objs.doc
index f9f402a7e158b66f7f93d10c051aba80c37da6a9..1be354d79b83999c631bd04c9c99b796ec727eaf 100644 (file)
@@ -10,6 +10,10 @@ import geompy
 import salome
 gg = salome.ImportComponentGUI("GEOM")
 
+#
+# create edge by two points
+#
+
 # create vertices
 p0   = geompy.MakeVertex(0.  , 0.  , 0.  )
 pxyz = geompy.MakeVertex(100., 100., 100.)
@@ -18,10 +22,46 @@ pxyz = geompy.MakeVertex(100., 100., 100.)
 edge = geompy.MakeEdge(p0, pxyz)
 
 # add object in the study
-id_edge = geompy.addToStudy(edge,"Edge")
+id_edge = geompy.addToStudy(edge,"Edge_1")
+
+# display an edge
+gg.createAndDisplayGO(id_edge) 
+
+#
+# create edge from wire
+#
+
+# create a circle
+c = geompy.MakeCircle(None, None, 100)
+
+# create a wire
+w = geompy.MakeWire([c], 1e-07)
+
+# create an edge from wire
+edge = geompy.MakeEdgeWire(w)
+
+# add object in the study
+id_edge = geompy.addToStudy(edge,"Edge_2")
+
+# display an edge
+gg.createAndDisplayGO(id_edge) 
+
+#
+# create edge from existing curve and a length
+#
+
+# create a circle
+c = geompy.MakeCircle(None, None, 100)
+
+# create an edge of length 25.0 from the circle
+edge = geompy.MakeEdgeOnCurveByLength(c, 25.0)
+
+# add object in the study
+id_edge = geompy.addToStudy(edge,"Edge_3")
 
 # display an edge
 gg.createAndDisplayGO(id_edge) 
+
 \endcode
  
 \anchor tui_creation_wire
@@ -132,7 +172,7 @@ face = geompy.MakeFaces([sketcher1, sketcher2],isPlanarFace)
 prism = geompy.MakePrism(face, p0, pxyz)
 
 # explode the prism into faces
-prism_faces = geompy.SubShapeAllSorted(prism, geompy.ShapeType["FACE"])
+prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
 
 # create a shell from a set of faces
 shell = geompy.MakeShell([prism_faces[0], prism_faces[2], prism_faces[3],
@@ -168,7 +208,7 @@ face = geompy.MakeFace(sketcher,1)
 prism = geompy.MakePrism(face, p0, pz)
 
 # explode the prism into faces
-prism_faces = geompy.SubShapeAllSorted(prism, geompy.ShapeType["FACE"])
+prism_faces = geompy.SubShapeAllSortedCentres(prism, geompy.ShapeType["FACE"])
 
 # create a shell from a set of faces
 shell = geompy.MakeShell([prism_faces[0], prism_faces[1],