Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

How to create point cloud on each face of a model ?

Dear all,

 

I would like to generate point cloud on each face of a model. does anyone know some commands in NX which is able to do this function ?

 

Thank you in advance

xixihaha

 

 

8 REPLIES

Re: How to create point cloud on each face of a model ?

define "point cloud" :-)

 

A few options that I can think of on the spur of the moment:

1) Get the underlying surface data, create points at UV intervals.  (note: make sure points are not in a section of the surface that is "trimmed away" in actual model)

2) Use faceting to create faceted surface, then deal with vertex points (note: I'm not sure if vertexes are on the surface or if they may be off the surface by a small tolerance)

3) use CAM variable axis surface contouring, ball mill, tool axis normal to surface.  Drive methods/tolerances/etc. up to you.  CLS points should eb on the surface.

 

Ken

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Solution
Solution
Accepted by topic author xixihaha
‎12-25-2015 09:56 AM

Re: How to create point cloud on each face of a model ?

The three approaches that Ken suggested should all work.

 

Regarding approach #1:

There is a SNAP.NX.Face.PositionArray function that might do exactly what you need.

 

Regarding approach #2:

The vertices of a facetted body *will* lie on the underlying faces.

山田
yamada

Re: How to create point cloud on each face of a model ?

Yamade, thank you for your reply.

 

Considering that the shape of B-Rep surface I treated is quite complex. I first created a DatumPlane and offset the datumplane in one direction step by step and get the intersection curves between datum plane and B-rep surfaces. After getting the intersection curves, I dynamic cast the curves into spline and get length of splines in the end. After that, I created points on the splines.

 

Now I meet a question. I would be glad if you could give me some suggestions.

For me, after creating points on splines, the points lose its topology, it seems that the points itself can not find which surface do they belong to. (The Intersection curves should at least know to which surface do they belong, also for the points)

 

I want to know whether there is any function which is first able to return me the topology of the points(on which surface does it lay on). Then return me U,V(parametric value) of the point on the surface.

 

 

Thank you in advance

Re: How to create point cloud on each face of a model ?

Or maybe a function whether is able to project the points on the surface and get U,V of the point

 

Re: How to create point cloud on each face of a model ?

Hey,

 

In the end, I find the function which is able to return UV of a point on the surface.

In c++, we can use UF_MODL_ask_face_parm to get UV.

^_^

 

Here is the summary of my procedure to create point cloud:

 

1. create a datum plane, move the datum point towards surfaces and get a series of intersection curves

2. Create a series of points(with equal distance) on the intersection curves

3. project points on the surface to get UV of points

 

The only remaining problem is that in step1, I need to find a function which is able to tell me whether a plane intersects the surfaces. because in some case , the plane doesn't intersect with a surace and the program stops in that case.

 

 

Thank you very much.

 

Re: How to create point cloud on each face of a model ?

1) why do you want this in the first place ?  

( If you have the surface / face, it should be used to do ... instead of a secondary derivative of that surface.)

 

2) Be aware that your method with the intersection curves might need a distance tolerance to succeed.

 

3) interactively there is the "Point set" which can create an array of point objects on faces/ surfaces.( The Point Set is a function which has been around for ages and therefore should be available as a programming function.)

I think that the Point Set function uses the UV data of the surface to space/ place the points.

 

Regards,

 Tomas

 

 

Re: How to create point cloud on each face of a model ?

Your could try enclosing your "intersect plane with surface" code in a try...catch block.  Check the error status to see if it is "no intersection" or some other error?

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: How to create point cloud on each face of a model ?

The following code is part of the documentation for the Snap.NX.Face.ContainsPoint function. I think it does what you want.

 

 

Option Infer On
Imports Snap, Snap.Create

Public Class MyProgram

   Public Shared Sub Main()

      ' Create an example "widget" body
      Dim myWidget As NX.Body = Widget()

      ' Get the large conical face
      Dim coneFace As NX.Face = NX.Face.FindByName("TEAL_CONE")

      ' Get (u,v) bounds of face
      Dim minU, maxU, minV, maxV, dU, dV As Double
      minU = coneFace.BoxUV.MinU  :  maxU = coneFace.BoxUV.MaxU  :  dU = (maxU - minU)/20 
      minV = coneFace.BoxUV.MinV  :  maxV = coneFace.BoxUV.MaxV  :  dV = (maxV - minV)/20  

      ' Generate a 2D array of (u,v) locations
      For u = minU To maxU Step dU
         For v = minV To maxV Step dV

            ' If (u,v) location is inside cone face, create a point
            If coneFace.ContainsPoint(u,v)
               Point(coneFace.Position(u,v))
            End If

         Next v
      Next u

   End Sub

End Class
山田
yamada