2013-02-12 11:35:16 +00:00
|
|
|
# Check Shape
|
|
|
|
|
2013-04-04 07:06:43 +00:00
|
|
|
import salome
|
2021-08-12 08:43:44 +02:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 07:06:43 +00:00
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 12:57:14 +03:00
|
|
|
geompy = geomBuilder.New()
|
2013-02-12 11:35:16 +00:00
|
|
|
|
|
|
|
# create a box
|
|
|
|
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
2014-04-04 10:44:39 +04:00
|
|
|
(IsValid, err) = geompy.CheckShape(box, 0, 2)
|
2013-02-12 11:35:16 +00:00
|
|
|
if IsValid == 0:
|
2014-12-16 19:27:28 +03:00
|
|
|
geompy.PrintShapeErrors(box, err)
|
2017-02-10 17:07:24 +01:00
|
|
|
raise RuntimeError("Invalid box created")
|
2013-02-12 11:35:16 +00:00
|
|
|
else:
|
2017-02-10 17:07:24 +01:00
|
|
|
print("\nBox is valid")
|