2013-02-12 17:35:16 +06:00
|
|
|
# Glue Faces
|
|
|
|
|
|
|
|
import salome
|
2021-08-12 11:43:44 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:06:43 +06:00
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 14:57:14 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-02-12 17:35:16 +06:00
|
|
|
gg = salome.ImportComponentGUI("GEOM")
|
|
|
|
|
|
|
|
# create boxes
|
|
|
|
box1 = geompy.MakeBox(0,0,0,100,50,100)
|
|
|
|
box2 = geompy.MakeBox(100,0,0,250,50,100)
|
|
|
|
|
|
|
|
# make compound
|
|
|
|
compound = geompy.MakeCompound([box1, box2])
|
|
|
|
|
|
|
|
# glue compound's faces
|
|
|
|
tolerance = 1e-5
|
|
|
|
glue = geompy.MakeGlueFaces(compound, tolerance)
|
|
|
|
|
|
|
|
# add objects in study
|
|
|
|
id_box1 = geompy.addToStudy(box1, "Box1")
|
|
|
|
id_box2 = geompy.addToStudy(box2, "Box2")
|
|
|
|
id_compound = geompy.addToStudy(compound, "Compound")
|
|
|
|
id_glue = geompy.addToStudy(glue, "Glue faces")
|
|
|
|
|
|
|
|
# display results
|
|
|
|
gg.createAndDisplayGO(id_box1)
|
|
|
|
gg.setDisplayMode(id_box1,1)
|
|
|
|
gg.createAndDisplayGO(id_box2)
|
|
|
|
gg.setDisplayMode(id_box2,1)
|
|
|
|
gg.createAndDisplayGO(id_compound)
|
|
|
|
gg.setDisplayMode(id_compound,1)
|
|
|
|
gg.createAndDisplayGO(id_glue)
|
|
|
|
gg.setDisplayMode(id_glue,1)
|