mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-26 17:30:35 +05:00
7961b83044
This reverts commit 3cd92817cb
.
22 lines
546 B
Python
22 lines
546 B
Python
# Normal to a Face
|
|
|
|
import salome
|
|
salome.salome_init()
|
|
import GEOM
|
|
from salome.geom import geomBuilder
|
|
geompy = geomBuilder.New(salome.myStudy)
|
|
import math
|
|
|
|
# create a box
|
|
box = geompy.MakeBoxDXDYDZ(100,30,100)
|
|
|
|
faces = geompy.SubShapeAllSortedCentres(box, geompy.ShapeType["FACE"])
|
|
face0 = faces[0]
|
|
vnorm = geompy.GetNormal(face0)
|
|
if vnorm is None:
|
|
raise RuntimeError, "GetNormal(face0) failed"
|
|
else:
|
|
geompy.addToStudy(face0, "Face0")
|
|
geompy.addToStudy(vnorm, "Normale to Face0")
|
|
print "\nNormale of face has been successfully obtained"
|