import salome
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
box = geompy.MakeBoxDXDYDZ(100,100,100)
cylinder = geompy.MakeCylinderRH(100, 300)
compound = geompy.MakeCompound([box, cylinder])
IsValid = geompy.CheckSelfIntersectionsFast(compound)
if not IsValid:
print("Shape is self-intersected!")
else:
print("No self-intersection detected in a shape")
Download this script