]> SALOME platform Git repositories - modules/geom.git/blob - doc/salome/examples/check_self_intersections.py
Salome HOME
Merge V9_dev branch into master
[modules/geom.git] / doc / salome / examples / check_self_intersections.py
1 # Detect Self-intersections
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.CheckSelfIntersections(compound)
18 if not IsValid:
19     print("Shape is self-intersected!")
20 else:
21     print("No self-intersection detected in a shape")