Is there a way to track face normals and flip them through NXOpen. I cant seem to find any information on it. Want to be able to flip face normals to make sure a face blend always works. I could do this TRYing all options but I dont want to do a brute force method and sometimes it might work in the wrong orrientation. Thanks.
Solved! Go to Solution.
The .AskFaceProps method will return the normal direction information at a user specified UV location. Interactive NX has a "reverse normal" command; there should be an API function equivalent, but I don't know the function name off the top of my head.
Thanks. This does end up working. Copying this here for others to see if they had similar concerns.
Dim pt(2) As Double Dim u1(2) As Double Dim v1(2) As Double Dim u2(2) As Double Dim v2(2) As Double Dim norm(2) As Double Dim radii(1) As Double Dim param(1) As Double theUfSession.Modl.AskFaceParm(facetag, cp , param, pt) theUfSession.Modl.AskFaceProps(facetag, param, pt, u1, v1, u2, v2, norm, radii)
The interactive face normal was where i first started but I couldnt get this to output into a journal so not quite sure what command it. While looking for how to use AskFaceProps I also found another way that would work which was using the associative line builder endoption.normal as well as
, PointOnFace, NXOpen.Sense.Forward, NXOpen.SmartObject.UpdateOption.WithinModeling)
At a given point, there are two common "normal" vectors that you might want to use.
(1) The "natural" normal, which is the cross product of the partial derivatives at the point, and
(2) The "outward" normal -- the one that points away from material, into air.
To understand the difference, it might be useful to read the material in the SNAP Reference Guide, specifically you might read about the Snap.NX.Face.Normal function and the Snap.NX.Face.Sense property.
I have incuded some of the text below, but the formatting is pretty messed up. The original SNAP doc is easier to read and includes code examples.
Normal Method (uv)
Evaluates the face normal at given (u,v) parameter values
Public Function Normal (
ParamArray uv As Double()
) As Vector
Dim instance As Face
Dim uv As Double()
Dim returnValue As Vector
returnValue = instance.Normal(uv)
The (u,v) parameter values -- not normalized to the range [0,1]
Vector Face normal at the given (u,v) parameter values (a unit vector)
This function returns the "natural" normal vector, which is parallel to the cross product of the partial derivatives. Typically, Normal(uv) is a unit vector parallel to Cross(DerivDu(uv), DerivDv(uv). However, sometimes one of the partial derivatives is zero. In this case the cross product will also be zero, and will provide no useful information. This function will return a correct surface normal vector even in these unpleasant cases.
The natural face normal directions for some common surface types are as follows:
It is often useful to compute an "outward" normal on the surface of a solid object (i.e. a normal vector that points away from material, towards empty space). To do this, you compute a natural normal vector using this function, and then adjust its sense using the Face.Sense property.
The sense of the outward face normal
Public ReadOnly Property Sense As Sense
Dim instance As Face
Dim value As Sense
value = instance.Sense
This property helps you determine on which side of a face material lies.
To compute an outward normal, you first get the "natural" normal by calling the Face.Normal function, and then you multiply this by Face.Sense.
On a cylindrical face, the natural normal points away from the centerline. So, if a cylindrical face has Face.Sense = Sense.Positive, this means that the outward normal also points away from the centerline, so the face must be part of a boss. Similarly, if a cylindrical face has Face.Sense = Sense.Negative, it must be part of a hole.