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

Showing results for

- Siemens PLM Community
- NX Customization and Programming
- NX Programming & Customization Forum
- Get points on surface

- 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
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-24-2016 01:17 PM

I try to find points which is located on surfase. I use AskFaceUvMinmax and AskFaceProps functions that find U, V points. But some of them doesnt lie on the green face.

I tried to use AskPointsContainment but I was failed.

Please, help me to find a solution.

5 REPLIES

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

06-24-2016 01:52 PM

"I tried to use AskPointsContainment but I was failed."

What do you mean by 'failed'? Did you get an error message? If so, what did it say?

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

06-24-2016 02:17 PM

Hello AntonAus!

Perhaps you are dealing with a so-called 'trimmed surface'.

Try to imagine a surface like a function from R^2 -> R^3, so e.g. F(u,v) = (x,y,z).

When using the method AskFaceUvMinmax you are asking NX to give you

the domain of F. Often (especially for non-periodic surfaces) the domain

is [0,1] x [0,1]. That means, that your domain is rectangular.

To deal with a non-rectangular image (e.g. a circle in your example) NX has

to cut the domain (internally):

In this figure, I marked to (u,v)-values.

If you are asking NX to give you the point (1,1), it will give you the point in the upper right corner which is not on the visible object, but defined for the function F(u,v).

Unfortunately I don't know a simple solution but a (very dirty) work-around:

You can ask the uv-MinMax values and make a sampling, say a 10x10 grid (0,0),(0,0.1),(0.1,0.1),etc.

Then you can use AskFaceProps to get the image-Point in 3D-Space.

To check if this point is ON the visible surface you can use:

Point3d myPointIn3DSpace = (0,0,0);

NXOpen.Point myBufferPoint = workPart.Points.CreatePoint(myPointIn3DSpace);

curUfSession.Modl.AskMinimumDist(curFace.Tag, myBufferPoint.Tag, ...);

Here NX is computing the minimal distance of two objects (your 3D point and the visible surface). If you get a value >0 it is outside your trimmed area, otherwise it's inside.

Attention: This workflow will NOT give you an uniformly distributed sampling on the surface, this is difficult in general! :-D I guess NX is using some Newton-Method to compute the distance, so if you are using that method with let's say 10000 points, it will be a lot of non-linear work to do for NX...

If your surfaces are planar (e.g. in the xy-plane) you could extract the edges (ExtractGeometry) to

create other methods to get a sampling on the surface.

Hope that helps!

Bye,

flo

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

06-24-2016 04:00 PM

Many thanks for your answer. I already knew (found out when trying create solution) about u and v. But I thought that there is some function that can help me. Measuring closest distance may be helpful.. Of course it will cost much time

As described in docs https://docs.plm.automation.siemens.com/data_servi

"""

Overview

Determines if a set of 2D points lie inside, outside or on the boundary (vertex/edge)

of a face.

If this function will be called multiple times for the same face then performance can

be improved by using UF_MODL_set_containment and UF_MODL_unset_containment.

"""

this function can return statuses of points that lie on the surface or I understood it incorrect?

But I couldn't use it, I don't know how.

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

06-24-2016 08:17 PM

I found the solution:

If status == 1 - the point inside the surface.

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

06-28-2016 03:03 AM - edited 06-28-2016 11:38 PM

If you have access to the SNAP API, it's every easy. Given a face myFace and a (u,v) pair, you write (in C#, in this example):

bool inside = myFace.ContainsPoint(u,v);

This will return "true" if the point corresponding to the given (u,v) parameters is inside the face.

yamada

Follow Siemens PLM Software

© 2017 Siemens Product Lifecycle Management Software Inc