2015-04-28 13:21:22 +05:00
|
|
|
# Detect Self-intersections fast
|
|
|
|
|
|
|
|
import salome
|
2021-08-12 11:43:44 +05:00
|
|
|
salome.salome_init_without_session()
|
2015-04-28 13:21:22 +05:00
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 14:57:14 +05:00
|
|
|
geompy = geomBuilder.New()
|
2015-04-28 13:21:22 +05:00
|
|
|
|
|
|
|
# create a box
|
|
|
|
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.CheckSelfIntersectionsFast(compound)
|
|
|
|
if not IsValid:
|
2017-02-10 21:07:24 +05:00
|
|
|
print("Shape is self-intersected!")
|
2015-04-28 13:21:22 +05:00
|
|
|
else:
|
2017-02-10 21:07:24 +05:00
|
|
|
print("No self-intersection detected in a shape")
|