mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-28 10:20:35 +05:00
28 lines
665 B
Python
28 lines
665 B
Python
|
# 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)
|