Project points to a polysurface

I have to project 6-9mio points to a polysurface and export them to a pointcloud *.txt file.
When I use the _Project command it takes a very long time.
Is there a way to write a Rhino-Plugin in C# to reduce the time?

Sorry for my english, it is not the yellow of the egg :smile:

best regards,

Yes, it can be done in c# using Brep.ClosestPoint function. Still, 6-9 mio points can take a while…

1 Like

Do you have a sample how to do this with Brep.ClosestPoint function?
I don’t know how to start with this function…

I’m not in the position to write code at the moment, sorry…


below is a python example using Brep.ClosestPoint function. It took 62sec to pull a pointcloud with 10Mio points to a simple brep using 8 cpu cores. The brep i´ve tried with was just a rounded cube.

To export the resulting pointcloud as *.txt file, just use the _Export command and use the Points(.txt) extension. (875 Bytes)



Hi Daniel,

Keep in mind that Brep.ClosestPoint is like the Pull command

To Project you need another function:
Rhino.Geometry.Intersect.Intersection.ProjectPointsToBreps(breps, pts, direction, tolerance)



I think I can work with this. :wink:

Are there any books to learn more about the Rhino SDK?
Because I’m new to this and want to become better


Hi Daniel, below are some recources you might start with:

btw. the remark of @Willem is correct. In case you want to project, you can find example code here.


BTW: Are there recommended settings in Rhino or Windows to get more performance while projecting?

Not that i know of. But i am not shure if lowering the absolute unit tolerance or setting the option Loose=No affects projection speed. You might time it to check for a difference.


1 Like

OK, I will test this.

My C# program works fine, but it is still slow…
Maybe it is possible to optimize the script…

Neues Textdokument.txt (2.1 KB)

Hi Daniel,

It is probably better to not add each point to the document individually using this line:


If you really want to create point objects, use this instead, without iterating over the points you allready have:


You might get more speed by adding a new pointcloud from the points and add the pointcloud to the document. Exporting this pointcloud using the points(.txt) extension will output the coordinates just like points do.


Or make a pointcloud