mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-28 10:20:35 +05:00
31 lines
811 B
Python
31 lines
811 B
Python
|
# Creation of a Circle
|
||
|
|
||
|
import geompy
|
||
|
import salome
|
||
|
gg = salome.ImportComponentGUI("GEOM")
|
||
|
|
||
|
# create vertices
|
||
|
p0 = geompy.MakeVertex(0., 0., 0.)
|
||
|
px = geompy.MakeVertex(100., 0. , 0. )
|
||
|
py = geompy.MakeVertex(0. , 100., 0. )
|
||
|
pz = geompy.MakeVertex(0. , 0. , 100.)
|
||
|
|
||
|
# create a vector on two points
|
||
|
vxy = geompy.MakeVector(px, py)
|
||
|
|
||
|
# create a circle from a point, a vector and a radius
|
||
|
circle1 = geompy.MakeCircle(pz, vxy, 30)
|
||
|
|
||
|
#create a circle from three points
|
||
|
circle2 = geompy.MakeCircleThreePnt(p0, px, py)
|
||
|
|
||
|
# add objects in the study
|
||
|
id_vxy = geompy.addToStudy(vxy, "Vector")
|
||
|
id_circle1 = geompy.addToStudy(circle1,"Circle1")
|
||
|
id_circle2 = geompy.addToStudy(circle2,"Circle2")
|
||
|
|
||
|
# display circles
|
||
|
gg.createAndDisplayGO(id_vxy)
|
||
|
gg.createAndDisplayGO(id_circle1)
|
||
|
gg.createAndDisplayGO(id_circle2)
|