Finding if a point is on a circular face

I have a circular face and I need to find out that picked up point is on this face or not.

An easy method would be to measure the distance from the point to the surface; if the distance is <= the modeling tolerance, the point is on the surface. You can get the current modeling tolerance with the following code:


Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim myModelingTolerance As Double
theUfSession.Modl.AskDistanceTolerance(myModelingTolerance)

Actually, this is not something which I am looking for. I have picked up a point and a circular surface also, now I have to find if the picked up point is on that circular surface or not?

Please help.

~ Ankita

Life is beautiful. :)

If the point is within some tolerance distance, then for all intents and purposes it is on the surface. Record a journal to see how to measure distances, and use the modeling tolerance (as shown above) to see if it is near (on) the surface.

If this isn't what you were looking for, you will need to provide more information...

We have a requirement to highlight the face of a circular body. The user first selects body and then coordinate systems.
By using the below code, I can get faces related to HostBody. And from this face list, I need to find out which face is there for the given CSYS.

theUFSession.Modl.AskBodyFaces(hostBody.Tag, out face_list);

For planar face : I picked up the origin of CSYS (Coordinate System) and checked if that origin is in that face, using the below code. If the origin is in that face, I am highlighting the face.

int pt = -1;
theUFSession.Modl.AskPointContainment(point, t, out pt);
where t = Face.Tag; from face_list

For circular face: For circular face, finding the origin of Coordinate System will not work. Is there any other method to find feature from face or any relation between face and Coordinate System in a given hostBody?
I hope I am now able to explain my doubt.

~ Ankita

Life is beautiful. :)

How is the circular face and csys object related? I imagine the csys origin is on the face axis and one of the vectors is parallel to it?

What is the purpose of this journal? Perhaps there is an easier way to achieve the end goal.

How is the circular face and csys object related? - I need to create the udf using the base coordiante system as given csys and on the circular face (outermost). Hence I need to find outermost circular face from a given host body. I can filter all circular faces but need to find radius of faces to point out outermost face.

Please help.

~ Ankita

Life is beautiful. :)

I am looking to complete something similar to this but our bodies have several thousand faces. Are there any methods that might allow me to only check faces within a certain distance from the point or something that will allow me to complete this more efficiently?

DHuskic
Nx 9 VB

I'm not sure what you are after exactly, but I did write some code a while back that would process tens of thousands of face objects in a matter of seconds. For what it's worth, it can be found here:
http://nxjournaling.com/content/find-duplicate-sheet-bodies

You can speed up this sort of code by checking against bounding boxes. If the given point does not lie near the bounding box of a face (a quick easy check), then there's no point in checking whether the point lies on the face. To do the bounding box test, you'll need to call one of the NXOpen.UF.UFModl.AskBoundingBox functions. Or, if you have SNAP, you can just use the face.Box property.