2013-02-12 17:35:16 +06:00
|
|
|
# Offset Surface
|
|
|
|
|
|
|
|
import salome
|
2013-04-04 13:06:43 +06:00
|
|
|
salome.salome_init()
|
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
|
|
|
geompy = geomBuilder.New(salome.myStudy)
|
2013-02-12 17:35:16 +06:00
|
|
|
gg = salome.ImportComponentGUI("GEOM")
|
|
|
|
|
|
|
|
# create a box and a sphere
|
|
|
|
box = geompy.MakeBox(20, 20, 20, 200, 200, 200)
|
|
|
|
|
|
|
|
# create a new object as offset of the given object
|
2017-12-21 21:13:17 +05:00
|
|
|
offset = geompy.MakeOffset(box, 70.)
|
|
|
|
offset2 = geompy.MakeOffsetIntersectionJoin(box, 70.)
|
2013-02-12 17:35:16 +06:00
|
|
|
|
|
|
|
# add objects in the study
|
|
|
|
id_box = geompy.addToStudy(box, "Box")
|
|
|
|
id_offset = geompy.addToStudy(offset, "Offset")
|
2017-12-21 21:13:17 +05:00
|
|
|
id_offset2 = geompy.addToStudy(offset2, "Offset_intersection_join")
|
2013-02-12 17:35:16 +06:00
|
|
|
|
|
|
|
# display the results
|
|
|
|
gg.createAndDisplayGO(id_box)
|
|
|
|
gg.setDisplayMode(id_box,1)
|
2017-12-21 21:13:17 +05:00
|
|
|
gg.createAndDisplayGO(id_offset)
|
|
|
|
gg.createAndDisplayGO(id_offset2)
|