Salome HOME
Mantis issue 0021703: [CEA 577] Boolean operations on groups.
[modules/geom.git] / doc / salome / gui / GEOM / input / tui_basic_geom_objs.doc
index a6eb9bf182cbfb769878b7aa7face89e62758bb9..7f230b14265d8baea6289e7a7da29e9745c0a988 100644 (file)
@@ -16,10 +16,29 @@ p100 = geompy.MakeVertexWithRef(p0, 100., 100., 100.)
 px = geompy.MakeVertex(100., 0., 0.)
 py = geompy.MakeVertex(0., 100., 0.)
 pz = geompy.MakeVertex(0., 0., 100.)
+p1 = geompy.MakeVertex(50., 50., 30.)
 
-# create a curve and a vertex on it
+# create a curve and vertices on it
 Arc = geompy.MakeArc(py, pz, px)
+# create a vertex by parameter
 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
+# create a vertex by length
+p_on_arc2 = geompy.MakeVertexOnCurveByLength(Arc, 50., None)
+#create a vertex by point projection
+p_on_arc3 = geompy.MakeVertexOnCurveByCoord(Arc, 100, -10, 10)
+
+# create 2 lines and make a point on its intersection
+line_1 = geompy.MakeLineTwoPnt(p0, p100)
+line_2 = geompy.MakeLineTwoPnt(p1, pz)
+p_inter = geompy.MakeVertexOnLinesIntersection(line_1, line_2)
+
+# create a face and vertices on it
+Add_line = geompy.MakeLineTwoPnt(px, py)
+arc_face = geompy.MakeFaceWires([Arc, Add_line], 1)
+p_on_face1 = geompy.MakeVertexOnSurface(arc_face, 0.5, 0.5)
+p_on_face2 = geompy.MakeVertexOnSurfaceByCoord(arc_face, 35, 35, 35)
+p_on_face3 = geompy.MakeVertexInsideFace(arc_face)
+
 
 # add objects in the study
 id_p0       = geompy.addToStudy(p0,   "Vertex 0")
@@ -28,13 +47,24 @@ id_px       = geompy.addToStudy(px,   "Vertex X")
 id_py       = geompy.addToStudy(py,   "Vertex Y")
 id_pz       = geompy.addToStudy(pz,   "Vertex Z")
 id_Arc      = geompy.addToStudy(Arc,  "Arc")
-id_p_on_arc = geompy.addToStudy(p_on_arc, "Vertex on Arc")
+id_line_1   = geompy.addToStudy(line_1,  "Line 1")
+id_line_2   = geompy.addToStudy(line_2,  "Line 2")
+id_p_on_arc = geompy.addToStudy(p_on_arc, "Vertex on Arc by parameter")
+id_p_on_arc2  = geompy.addToStudy(p_on_arc2, "Vertex on Arc by length")
+id_p_on_arc3  = geompy.addToStudy(p_on_arc3, "Vertex on Arc by point projection")
+id_p_inter    = geompy.addToStudy(p_inter,   "Vertex on Lines Intersection")
+id_p_on_face1 = geompy.addToStudy(p_on_face1, "Vertex on face by parameter")
+id_p_on_face2 = geompy.addToStudy(p_on_face2, "Vertex on face by point projection")
+id_p_on_face3 = geompy.addToStudy(p_on_face3, "Vertex inside face")
 
 # display vertices
 gg.createAndDisplayGO(id_p0)
 gg.createAndDisplayGO(id_p100)
 gg.createAndDisplayGO(id_Arc)
-gg.createAndDisplayGO(id_p_on_arc) 
+gg.createAndDisplayGO(id_p_inter)
+gg.createAndDisplayGO(id_p_on_arc)
+gg.createAndDisplayGO(id_p_on_arc2)
+gg.createAndDisplayGO(id_p_on_arc3)
 \endcode
 
 \anchor tui_creation_line
@@ -199,7 +229,18 @@ polyline = geompy.MakePolyline([p0, p1, p2, p3, p4])
 bezier = geompy.MakeBezier([p0, p1, p2, p3, p4])
 
 #create a b-spline curve from a list of points
-interpol = geompy.MakeInterpol([p0, p1, p2, p3, p4])
+interpol = geompy.MakeInterpol([p0, p1, p2, p3, p4], False)
+
+#create a polyline using parametric definition of the basic points
+param_polyline = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, geompy.GEOM.Polyline, theNewMethod=True)
+
+# create a bezier curve using parametric definition of the basic points
+param_bezier = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, geompy.GEOM.Bezier, theNewMethod=True)
+
+#create a b-spline curve using parametric definition of the basic points
+param_interpol = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, geompy.GEOM.Interpolation, theNewMethod=True)
+
+
 
 # add objects in the study
 id_p0       = geompy.addToStudy(p0,       "Point1")
@@ -210,6 +251,11 @@ id_p4       = geompy.addToStudy(p4,       "Point5")
 id_polyline = geompy.addToStudy(polyline, "Polyline")
 id_bezier   = geompy.addToStudy(bezier,   "Bezier")
 id_interpol = geompy.addToStudy(interpol, "Interpol")
+id_param_polyline = geompy.addToStudy(param_polyline, "Polyline Parametric")
+id_param_bezier = geompy.addToStudy(param_bezier, "Bezier Parametric")
+id_param_interpol = geompy.addToStudy(param_interpol, "Interpol Parametric")
+
+
 
 # display the points and the curves
 gg.createAndDisplayGO(id_p0)
@@ -220,6 +266,10 @@ gg.createAndDisplayGO(id_p4)
 gg.createAndDisplayGO(id_polyline)
 gg.createAndDisplayGO(id_bezier)
 gg.createAndDisplayGO(id_interpol) 
+gg.createAndDisplayGO(id_param_polyline)
+gg.createAndDisplayGO(id_param_bezier)
+gg.createAndDisplayGO(id_param_interpol)
+
 \endcode
 
 \anchor tui_creation_vector
@@ -332,4 +382,45 @@ gg.setDisplayMode(id_plane5,1)
 gg.setTransparency(id_plane5,0.5)
 \endcode
 
+\anchor tui_creation_lcs
+<br><h2>Creation of a Local Coordinate System</h2>
+\code
+import GEOM
+import geompy
+import math
+import SALOMEDS
+
+#Create vertexes, vectors and shapes to construct local CS
+Vertex_1 = geompy.MakeVertex(50, 50, 50)
+Vertex_2 = geompy.MakeVertex(70, 70, 70)
+Vertex_3 = geompy.MakeVertex(0, 0, 0)
+Vector_X = geompy.MakeVectorDXDYDZ(50, 0, 0)
+Vector_Y = geompy.MakeVectorDXDYDZ(0, 50, 0)
+Face_1 = geompy.MakeFaceHW(100, 100, 1)
+Box_1 = geompy.MakeBoxTwoPnt(Vertex_1, Vertex_2)
+
+#Construct local CS by manual definition
+LocalCS_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
+
+#Construct local CS by center point and two vectors (X and Y directions)
+LocalCS_2 = geompy.MakeMarkerPntTwoVec(Vertex_3, Vector_X, Vector_Y)
+
+#Construct local CS from shape orientation
+LocalCS_FACE = geompy.MakeMarkerFromShape(Face_1)
+LocalCS_BOX = geompy.MakeMarkerFromShape(Box_1)
+
+#Add created object to study
+geompy.addToStudy( Face_1, "Face_1" )
+geompy.addToStudy( Vertex_1, "Vertex_1" )
+geompy.addToStudy( Vertex_2, "Vertex_2" )
+geompy.addToStudy( Box_1, "Box_1" )
+geompy.addToStudy( Vertex_3, "Vertex_3" )
+geompy.addToStudy( Vector_X, "Vector_X" )
+geompy.addToStudy( Vector_Y, "Vector_Y" )
+geompy.addToStudy( LocalCS_1, "LocalCS_1" )
+geompy.addToStudy( LocalCS_2, "LocalCS_3" )
+geompy.addToStudy( LocalCS_FACE, "LocalCS_FACE" )
+geompy.addToStudy( LocalCS_BOX, "LocalCS_BOX" )
+\endcode
+
 */