geom/doc/salome/examples/topological_geom_objs_ex02.py

29 lines
629 B
Python
Raw Normal View History

2013-02-12 17:35:16 +06:00
# Creation of a Wire
import salome
salome.salome_init()
import GEOM
from salome.geom import geomBuilder
2017-06-13 14:57:14 +05:00
geompy = geomBuilder.New()
2013-02-12 17:35:16 +06:00
gg = salome.ImportComponentGUI("GEOM")
# create vertices
px = geompy.MakeVertex(100., 0. , 0. )
py = geompy.MakeVertex(0. , 100., 0. )
pz = geompy.MakeVertex(0. , 0. , 100.)
# create a vector from two points
vxy = geompy.MakeVector(px, py)
# create an arc from three points
arc = geompy.MakeArc(py, pz, px)
# create a wire
wire = geompy.MakeWire([vxy, arc])
# add an object in the study
id_wire = geompy.addToStudy(wire,"Wire")
# display the wire
gg.createAndDisplayGO(id_wire)