Salome HOME
Merge Python 3 porting.
[modules/geom.git] / doc / salome / examples / check_self_intersections_fast.py
1 # Detect Self-intersections fast
2
3 import salome
4 salome.salome_init()
5 import GEOM
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New()
8
9 # create a box
10 box = geompy.MakeBoxDXDYDZ(100,100,100)
11 # create a cylinder
12 cylinder = geompy.MakeCylinderRH(100, 300)
13 # make a compound
14 compound = geompy.MakeCompound([box, cylinder])
15
16 # check self-intersection
17 IsValid = geompy.CheckSelfIntersectionsFast(compound)
18 if not IsValid:
19     print("Shape is self-intersected!")
20 else:
21     print("No self-intersection detected in a shape")