# How to use the "NurbsSurface.ByPoints" node?

I am trying to create a surface from a survey point cloud, and came across the “NurbsSurface.ByPoints” note, I’ve try many times, but it just doesn’t work.

And I searched that somebody the following about the node:

NurbsSurface.ByPoints also needs a list of list of points (rows), not just a flat list of points. You probably need to order the list into x and z coordinate sorted rows/columns order to make a nurbssurface, using a combination of Point.X, Point.Z, SortByKey, and GroupByKey.

Can anyone give me a very simple example on this, I Just cannot understand this statement.

With many thanks!!!

You need to create a 2D list of points (a list of lists). The list has to be rectangular (i.e. equal number of items in each sublist): Imagine an excel spread sheet. Each row is a sublist and each cell is a container to store an object. In your case that object is a point (to be able to create a nurbs surface). The number of cells in each row has to be equal, i.e. ‘rectangular’.

If you have a 1D list, you could use `List.Chop` which will convert it into a 2D list, but this wont order the points - that’ll be your next challenge

@pccheung

Do you specifically want a NURBS surface ?
As Thomas says- it has to be a rectangular list

Due to the nature of pointcloud data, surfaces are often triangulated

There are some methods to do this in Dynamo- such as Mesh Toolkit and I believe there are other nodes for delaunay triangulation of points

Andrew

@Thomas_Mahon
I did try to use the List.chop to make it rectangular, If I don’t get it wrong , its like a MxN matrix arrangement of points, right? But it fails, I get the points like this(shown in picture). Can points like this be able to rationalize its
order?

As shown in the picture, all I want to do is to get the skin of the man, but the information available is only points!!!.
Is there any algorithm for forming the mesh with points. I think its easier to get a mesh from a surface(then the vertex of mesh). But its more difficult to get a surface from points, especially irregular one.

Thx commenting!.

This is the second (and biggest) challenge. Survey points will never be in order without some form of post processing. As you can see in your image, without post processing, chopping the list into 3’s is never going to yeild the correct result since: 1. The points are not organised in clusters of 3, 2. Points have to be reused to create seamless facets.

This is a highly complex task with tons of pitfalls. For example, you could write (this is going to require coding - visual programming is never going to cut it unfortunately) a function which samples each point and finds its three closes neighbours. But you’re also going to need to check for self intersections as you iterate over the points (the closest three may result in facets that intersect other facets) plus where you get crevasses the closest points algorithm is going to yield an incorrect result and cause ‘webbing’ instead of the desired result.

There are algorithms out there that can solve this, but it might be worth rethinking how the points are generated in the first place. If you are scanning them see if your scanner software provides this functionality.

I agree with Thomas.

On the surface, this appear like a straightforward thing- but gets more complicated the more you look into it…Dynamo is not the best tool for this task.

• If you have Rhino/Grasshopper, then there are both in-built tools & add-ins
• Otherwise, MeshLab is a little clunky- but free and worth a look. Refer link
• Depending on your Autodesk subscription- you might has access to the Recap ‘scan to mesh’ service

Andrew

@ Thomas

Thx for your insight, I think it is a bit complicated for a node to apply the algorithm of the formation of TIN network through points. Maybe I should preprocess the point cloud with some surveying/laser scanning software as you mentioned before loading it into Revit.

Thx a lot,its insightful.

Thx for your comments, Mr Andrew, I would like to give it a trial on Recap and Meshlab, thx autodesk for the 3 years student version for my school project. I would like to share if I could luckily make some breakthrough.