mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-11-14 17:48:34 +05:00
30 lines
883 B
Python
30 lines
883 B
Python
# Offset Surface
|
|
|
|
import salome
|
|
salome.salome_init_without_session()
|
|
import GEOM
|
|
from salome.geom import geomBuilder
|
|
geompy = geomBuilder.New()
|
|
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
|
|
offset = geompy.MakeOffset(box, 70.)
|
|
offset2 = geompy.MakeOffsetIntersectionJoin(box, 70.)
|
|
offset3 = geompy.MakeOffsetPartial(box, 70., [13, 33])
|
|
|
|
# add objects in the study
|
|
id_box = geompy.addToStudy(box, "Box")
|
|
id_offset = geompy.addToStudy(offset, "Offset")
|
|
id_offset2 = geompy.addToStudy(offset2, "Offset_intersection_join")
|
|
id_offset3 = geompy.addToStudy(offset3, "Offset_Partial")
|
|
|
|
# display the results
|
|
gg.createAndDisplayGO(id_box)
|
|
gg.setDisplayMode(id_box,1)
|
|
gg.createAndDisplayGO(id_offset)
|
|
gg.createAndDisplayGO(id_offset2)
|
|
gg.createAndDisplayGO(id_offset3)
|