2013-02-12 17:35:16 +06:00
|
|
|
# Detect Self-intersections
|
|
|
|
|
2013-04-04 13:06:43 +06:00
|
|
|
import salome
|
|
|
|
salome.salome_init()
|
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
|
|
|
geompy = geomBuilder.New(salome.myStudy)
|
2013-02-12 17:35:16 +06:00
|
|
|
|
|
|
|
# create a box
|
2015-04-28 13:21:22 +05:00
|
|
|
box = geompy.MakeBoxDXDYDZ(100,100,100)
|
|
|
|
# create a cylinder
|
|
|
|
cylinder = geompy.MakeCylinderRH(100, 300)
|
|
|
|
# make a compound
|
|
|
|
compound = geompy.MakeCompound([box, cylinder])
|
|
|
|
|
|
|
|
# check self-intersection
|
|
|
|
IsValid = geompy.CheckSelfIntersections(compound)
|
|
|
|
if not IsValid:
|
2017-02-10 21:07:24 +05:00
|
|
|
print("Shape is self-intersected!")
|
2013-02-12 17:35:16 +06:00
|
|
|
else:
|
2017-02-10 21:07:24 +05:00
|
|
|
print("No self-intersection detected in a shape")
|