]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/examples/topological_geom_objs_ex02.py
Salome HOME
bos #29468: Advanced geometry features: distance Edge-Edge & Face-Face
[modules/geom.git] / doc / salome / examples / topological_geom_objs_ex02.py
1 # Creation of a Wire
2
3 import salome
4 salome.salome_init_without_session()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New()
8 gg = salome.ImportComponentGUI("GEOM")
9
10 # create vertices
11 px   = geompy.MakeVertex(100., 0.  , 0.  )
12 py   = geompy.MakeVertex(0.  , 100., 0.  )
13 pz   = geompy.MakeVertex(0.  , 0.  , 100.)
14
15 # create a vector from two points
16 vxy = geompy.MakeVector(px, py)
17
18 # create an arc from three points
19 arc = geompy.MakeArc(py, pz, px)
20
21 # create a wire
22 wire = geompy.MakeWire([vxy, arc])
23
24 # add an object in the study
25 id_wire = geompy.addToStudy(wire,"Wire")
26
27 # display the wire
28 gg.createAndDisplayGO(id_wire)