Forum archiveIssue archiveOther usage issues

Archived discussion

Normal vector of a Face or Surface

Other usage issuesThu, 06/17/2004 - 17:088 replies

Browse this forum
QuestionAuthor

Hi again!

How can I easily calculate the direction of the normal to a TopoDS_Face or Geom_Surface?

Discussion

8 archived replies

Posts are displayed in their archived order.

01Commenter-1

Look at GeomLProp_SLProps::Normal. This requires you to set the location at which you require the normal using U,V parameters on the surface. You can use BRep_Tool::Surface to get the surface for a face and BRepTools::UVBounds to get the parametric limits on the surface.

02Commenter-2

Thank you!

Here is the result:
TopoDS_Face aCurrentFace = [..];
Standard_Real umin, umax, vmin, vmax;
BRepTools::UVBounds(aCurrentFace,umin, umax, vmin, vmax);
Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aCurrentFace);
GeomLProp_SLProps props(aSurface, umin, vmin,1, 0.01);
gp_Dir normal = props.Normal();

03Commenter-3

does one surface have only one vector?
i think planes have only one vector?
am i wrong?

04Commenter-4

yes a single vector

05Commenter-3

but a surface can be something like this
http://t3.gstatic.com/images?q=tbn:ANd9GcTZmX6H8E2ZAKCdS2o2HOIZ_rCC8iDiJ...

am i wrong, am i wrong with the concept of "surface"?

a surface like the one at the pic has lots of tangent planes, thus surface should have lots of normals?

06Commenter-3

http://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/Surface_normal....

one surface must have a set of normals, must have one normal for its every point.

07Commenter-4

there is an infinity of normals on a brep / nurbs surface, since the set of possible points is endless.
the wiki image is that of a mesh, which is a discrete representation of a surface, hence with finite normals.
so its a little confusing.
as mentioned before, you can lookup the normals of the surface for every u,v position.
really easy...

08Commenter-3

thanks