Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Detect Self-intersections
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(salome.myStudy)
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"

Download this script