mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-12 00:29:18 +05:00
31 lines
787 B
Python
31 lines
787 B
Python
|
# Close Contour
|
||
|
|
||
|
import geompy
|
||
|
import salome
|
||
|
gg = salome.ImportComponentGUI("GEOM")
|
||
|
|
||
|
# create vertices and vectors
|
||
|
p0 = geompy.MakeVertex( 0., 0., 0.)
|
||
|
px = geompy.MakeVertex(100., 0., 0.)
|
||
|
py = geompy.MakeVertex( 0., 100., 0.)
|
||
|
py1 = geompy.MakeVertex( 0., 140., 0.)
|
||
|
pz = geompy.MakeVertex( 0., 0., 100.)
|
||
|
vxy = geompy.MakeVector(px, py)
|
||
|
|
||
|
# create an arc
|
||
|
arc = geompy.MakeArc(py1, pz, px)
|
||
|
|
||
|
# create a wire
|
||
|
wire = geompy.MakeWire([vxy, arc])
|
||
|
|
||
|
# close an open wire by creation of an edge between ends
|
||
|
wire_close = geompy.CloseContour(wire, [1], 0)
|
||
|
|
||
|
# add objects in the study
|
||
|
id_wire = geompy.addToStudy(wire, "Wire")
|
||
|
id_wire_close = geompy.addToStudy(wire_close, "Wire close")
|
||
|
|
||
|
# display the results
|
||
|
gg.createAndDisplayGO(id_wire)
|
||
|
gg.createAndDisplayGO(id_wire_close)
|