Salome HOME
0022471: EDF 2604 GEOM: Suppress the boundary edges of the tools in the fuse operation
[modules/geom.git] / doc / salome / examples / basic_geom_objs_ex09.py
1 # Creation of a Local Coordinate System
2
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8 import math
9 import SALOMEDS
10
11 #Create vertexes, vectors and shapes to construct local CS
12 Vertex_1 = geompy.MakeVertex(50, 50, 50)
13 Vertex_2 = geompy.MakeVertex(70, 70, 70)
14 Vertex_3 = geompy.MakeVertex(0, 0, 0)
15 Vector_X = geompy.MakeVectorDXDYDZ(50, 0, 0)
16 Vector_Y = geompy.MakeVectorDXDYDZ(0, 50, 0)
17 Face_1 = geompy.MakeFaceHW(100, 100, 1)
18 Box_1 = geompy.MakeBoxTwoPnt(Vertex_1, Vertex_2)
19
20 #Construct local CS by manual definition
21 LocalCS_1 = geompy.MakeMarker(0, 0, 0, 1, 0, 0, 0, 1, 0)
22
23 #Construct local CS by center point and two vectors (X and Y directions)
24 LocalCS_2 = geompy.MakeMarkerPntTwoVec(Vertex_3, Vector_X, Vector_Y)
25
26 #Construct local CS from shape orientation
27 LocalCS_FACE = geompy.MakeMarkerFromShape(Face_1)
28 LocalCS_BOX = geompy.MakeMarkerFromShape(Box_1)
29
30 #Add created object to study
31 geompy.addToStudy( Face_1, "Face_1" )
32 geompy.addToStudy( Vertex_1, "Vertex_1" )
33 geompy.addToStudy( Vertex_2, "Vertex_2" )
34 geompy.addToStudy( Box_1, "Box_1" )
35 geompy.addToStudy( Vertex_3, "Vertex_3" )
36 geompy.addToStudy( Vector_X, "Vector_X" )
37 geompy.addToStudy( Vector_Y, "Vector_Y" )
38 geompy.addToStudy( LocalCS_1, "LocalCS_1" )
39 geompy.addToStudy( LocalCS_2, "LocalCS_3" )
40 geompy.addToStudy( LocalCS_FACE, "LocalCS_FACE" )
41 geompy.addToStudy( LocalCS_BOX, "LocalCS_BOX" )