Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / check_compound_of_blocks.py
1 # Check Compound of Blocks
2
3 import geompy
4 import salome
5 gg = salome.ImportComponentGUI("GEOM")
6
7 # create boxes
8 box1 = geompy.MakeBox(0,0,0,100,50,100)
9 box2 = geompy.MakeBox(100,0,0,250,50,100)
10
11 # make a compound
12 compound = geompy.MakeCompound([box1, box2])
13
14 # glue the faces of the compound
15 tolerance = 1e-5
16 glue = geompy.MakeGlueFaces(compound, tolerance)
17 IsValid = geompy.CheckCompoundOfBlocks(glue)
18 if IsValid == 0:
19     raise RuntimeError, "Invalid compound created"
20 else:
21     print "\nCompound is valid"