Hi,
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
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.
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.
It is probably better to not add each point to the document individually using this line:
doc.Objects.AddPoint(point);
If you really want to create point objects, use this instead, without iterating over the points you allready have:
doc.Objects.AddPoints(points);
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.