Salome HOME
80a814a303913a9a47ff8997878eb5b407ab88f4
[modules/geom.git] / doc / salome / examples / repairing_operations_ex12.py
1 # Remove internal(shared) faces from a compound
2
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
8
9 # create solids with some coincident faces
10 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
11 Translation_1 = geompy.MakeTranslation(Box_1, 200, 0, 0)
12 Translation_2 = geompy.MakeTranslation(Box_1, 200, 200, 0)
13
14 geompy.addToStudy(Box_1, 'Box_1')
15 geompy.addToStudy(Translation_1, 'Translation_1')
16 geompy.addToStudy(Translation_2, 'Translation_2')
17
18 # partition three solids to obtain shared faces
19 Partition_1 = geompy.MakePartition([Box_1, Translation_1, Translation_2])
20 geompy.addToStudy(Partition_1, 'Partition_1')
21
22 # remove shared faces to obtain one solid instead of three
23 Joined_1 = geompy.RemoveInternalFaces(Partition_1)
24 geompy.addToStudy(Joined_1, 'Joined_1')
25
26 salome.sg.updateObjBrowser(1)