turn on suggestions

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
- How to create point cloud on each face of a model ...

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

12-18-2015 07:36 AM

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

Solved! Go to Solution.

8 REPLIES

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

12-18-2015 01:51 PM

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

Production:NX10.0.3.5 MP5 + patch/TC11.2

I'd rather be e-steemed than e-diseaseled

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

12-25-2015 12:36 AM

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

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

12-25-2015 06:49 AM

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

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

12-25-2015 06:50 AM

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

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

12-25-2015 10:06 AM

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.

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

12-28-2015 09:25 AM

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

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

12-28-2015 12:39 PM

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?

Production:NX10.0.3.5 MP5 + patch/TC11.2

I'd rather be e-steemed than e-diseaseled

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

12-30-2015 12:35 AM

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

Follow Siemens PLM Software

© 2017 Siemens Product Lifecycle Management Software Inc