geom/doc/salome/examples/primitives_ex01.py

28 lines
665 B
Python
Raw Normal View History

2013-02-12 17:35:16 +06:00
# Creation of a Box
import geompy
import salome
gg = salome.ImportComponentGUI("GEOM")
# create vertices
p0 = geompy.MakeVertex(15, 25, 35)
p70 = geompy.MakeVertex(70, 70, 70)
# create boxes
box1 = geompy.MakeBoxDXDYDZ(10, 20, 30)
box2 = geompy.MakeBox(10,20,30, 15,25,35)
box3 = geompy.MakeBoxTwoPnt(p0, p70)
# add objects in the study
id_box1 = geompy.addToStudy(box1,"Box1")
id_box2 = geompy.addToStudy(box2,"Box2")
id_box3 = geompy.addToStudy(box3,"Box3")
# display the boxes
gg.createAndDisplayGO(id_box1)
gg.setDisplayMode(id_box1,1)
gg.createAndDisplayGO(id_box2)
gg.setDisplayMode(id_box2,1)
gg.createAndDisplayGO(id_box3)
gg.setDisplayMode(id_box3,1)