turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-13-2017 07:15 PM

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 **TRY**ing 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.

3 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-14-2017 08:46 AM

**.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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-14-2017 02:51 PM

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

workPart.Directions.CreateDirection(faceOfInterest, PointOnFace, NXOpen.Sense.Forward, NXOpen.SmartObject.UpdateOption.WithinModeling)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-18-2017 04:11 AM - edited 07-18-2017 04:13 AM

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)**

Namespaces ► Snap.NX ► Face ► Normal(array<Double>)

Evaluates the face normal at given (u,v) parameter values

Declaration Syntax

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)

Parameters

uv (array<Double>[]()[][])

The (u,v) parameter values -- not normalized to the range [0,1]

Return Value

Vector Face normal at the given (u,v) parameter values (a unit vector)

Remarks

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:

**Cylinder:**Away from its centerline**Cone:**Away from its centerline**Sphere:**Away from its center

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.

**Sense Property **

Namespaces ► Snap.NX ► Face ► Sense

The sense of the outward face normal

Declaration Syntax

Public ReadOnly Property Sense As Sense

Get

Dim instance As Face

Dim value As Sense

value = instance.Sense

Property Value

Remarks

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.

yamada

Follow Siemens PLM Software

© 2018 Siemens Product Lifecycle Management Software Inc