Unlike Rhino 5, the Make2d command in Rhino 6 and 7 is multi-threaded. I’m going to speculate the the slowness you are seeing, in your small model, is the time it takes to setup threading and the booking keeping to support it.
The Make2d functionality is available in RhinoCommon, where you can choose to have the solution computed with our without multiple threads. You might try rolling your own, non-threaded version and see if it works better for your situation.
While it is about 20% faster comparing to directly scripting make2d command, it is unfortunately still ~4x slower (on average) than scripted make2d in rhino5.
I will send you the script by email.
There are some parts of the code in the examples (and in my script) that I did not fully understood.
Tweaking the code may bring further speed increase, but I doubt it can come anywhere close to rhino5 speed.
I will try to find some other way to achieve the goal, not by using make2d.
I managed to make the python script to perform “custom” make2d command
( the script will come to you by wetransfer , as well as one more test file )
The script is just a sub that replaces the scripted make2d in my plugin command, so I made a “wrapper” to provide the input data it needs to perform
It returns the curves which are then processed further
Honestly, I did not understood fully the examples you provided, so I may did some parts not as efficient as is could be, but I doubt it can change the speed dramatically
I did measures on 2 separate models, each consisting of approx. 800 solids…
My command takes each solid, one by one, and finds the intersection lines for it and the neighbouring solids. Then the ‘make2d’ is performed on the solid and the created intersection lines…
here are the measurement results:
Rhino 5 scripted make2d 166 s
Rhino 7 custom make2d multithreading=false 698 s
Rhino 7 custom make2d multithreading=true 706 s
Rhino 7 scripted make2d 892 s
Rhino 5 scripted make2d 401 s
Rhino 7 custom make2d multithreading=false 1452 s
Rhino 7 custom make2d multithreading=true 1525 s
Rhino 7 scripted make2d 1911 s
given times are for the complete command to finish. In the entire command only the make2d part is replaced for each test case, the rest of the command is unchanged.
This should lead to the conclusion that time difference is mainly due to the different make2d