Create a surface from a point cloud - C#


I am trying to get from a point cloud to a surface - I want the bounds of the surface to match the boundary of the point cloud. I’m not sure where to start! I’ve loaded the points into a Rhino.Geometry.PointCloud and passed that to Rhino.Geometry.Brep.CreatePatch - which creates a surface that covers the points but the boundaries are not right. Is CreatePatch the right way to go or is there something else I should be trying. This was the initial lead I was following

Rhino.Geometry.PointCloud kerbcloud = new Rhino.Geometry.PointCloud();

//some code to load up the kerbcloud

//creating the array of point clouds
Rhino.Geometry.PointCloud[] cloudarray = new Rhino.Geometry.PointCloud1;
cloudarray[0] = kerbcloud;

Brep brep = Rhino.Geometry.Brep.CreatePatch(cloudarray, 20,20, 0.1);
Surface srf = brep.Surfaces[0];

Any help would be greatly appreciated.

Hi Hannah,

Before we go too far, please understand that if you trying to reverse engineer large point clouds (into meshes to surfaces), then native Rhino is not enough. There are other tools and add-ons that can help with reverse engineering.

That said, ignoring RhinoCommon, have you used the Patch command on your point cloud? Does the command do what you want?

HI Dale,

Thanks for the reply.

Patch doesn’t do what I want it to - but as you say, that’s because I am expecting too much of it. I shall investigate the other tools and add-ons - I’ve got RhinoResurf so I’ll try that (and also working around the problem a different way!)