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