mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-26 17:30:35 +05:00
7c036f24ff
- Part 2: introduce CheckSelfIntersectionsFast function
22 lines
529 B
Python
22 lines
529 B
Python
# Detect Self-intersections
|
|
|
|
import salome
|
|
salome.salome_init()
|
|
import GEOM
|
|
from salome.geom import geomBuilder
|
|
geompy = geomBuilder.New(salome.myStudy)
|
|
|
|
# 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.CheckSelfIntersections(compound)
|
|
if not IsValid:
|
|
print "Shape is self-intersected!"
|
|
else:
|
|
print "No self-intersection detected in a shape"
|