geom/doc/salome/examples/topological_geom_objs_ex01.py
2013-02-12 11:35:16 +00:00

58 lines
1.0 KiB
Python

# Creation of an Edge
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.)
# create an edge
edge = geompy.MakeEdge(p0, pxyz)
# add object in the study
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)