geom/doc/salome/examples/repairing_operations_ex08.py

34 lines
879 B
Python
Raw Permalink Normal View History

2013-02-12 17:35:16 +06:00
# Glue Edges
import salome
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 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():
salome.sg.updateObjBrowser(1)