2013-02-12 17:35:16 +06:00
|
|
|
# Glue Edges
|
|
|
|
|
|
|
|
import salome
|
2013-04-04 13:06:43 +06:00
|
|
|
salome.salome_init()
|
|
|
|
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 all compound's edges
|
|
|
|
tolerance = 1e-5
|
|
|
|
glue1 = geompy.MakeGlueEdges(compound, tolerance)
|
|
|
|
|
|
|
|
# glue some compound's edges
|
|
|
|
list_edges = geompy.GetGlueEdges(compound, tolerance)
|
|
|
|
glue2 = geompy.MakeGlueEdgesByList(compound, tolerance, [list_edges[0], list_edges[2]])
|
|
|
|
|
|
|
|
# add objects in study
|
|
|
|
geompy.addToStudy(box1, "Box1")
|
|
|
|
geompy.addToStudy(box2, "Box2")
|
|
|
|
geompy.addToStudy(compound, "Compound")
|
|
|
|
geompy.addToStudy(glue1, "Glue all edges")
|
|
|
|
geompy.addToStudy(glue2, "Glue two edges")
|
|
|
|
|
|
|
|
if salome.sg.hasDesktop():
|
2017-06-13 14:57:14 +05:00
|
|
|
salome.sg.updateObjBrowser()
|