Make2d speed test

Hello ,

I made a python script for rhino5 which uses scripted make2d command.
Since Rhino 7 is out I have adopted the script and it now scripts make2d under rhino7

However, it turns out that scripted make2d in Rhino7 much slower than it was in Rhino5.

The script works in a loop and does a lot of make2d, one after another, each consists of a solid and multiple curves

speed difference goes up to 5-6x depending on the objects selected for make2d

here are the both scripted commands, the rest of the script is identical so no side effects should influence the result

Rhino 5 version:

start = time.time()
rs.Command ("-Make2D DrawingLayout=CurrentCPlane ShowTangentEdges=No CreateHiddenLines=Yes MaintainSourceLayers=Yes Enter ", echo=False)
print time.time()-start

Rhino 7 version:

start = time.time()
rs.Command("-_Make2D Layout=CPlane Properties=MaintainSourceLayers CreateHiddenLines=Yes ShowTangents=No CreateSceneSilhouette=No GroupOutput=No Enter Enter", False)
print time.time()-start

I know that Rhino 7 has api for make2d, but I was looking for the “quick” solution to translate the script from v5 to v7

any guidelines?

If I create a “proper” script using api in rhino 7, can I expect speed increase?

thanks in advance

Hi @AleksandarSM,

Please share a sample 3dm file that demonstrates the slowness you’ve observed.


– Dale

Hello Dale,

I will send it to by email at your email address


Hi @AleksandarSM,

Thanks for the files.

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.

HiddenLineDrawing is the RhinoCommon class you will want to use.

And here is a command sample:


Hope this helps.

– Dale

Thanks for the reply.

Is there by any chance some rhinocommon python sample available?


You can try parsing this:

– Dale

Thanks Dale!

Hello Dale,

I made a script based on info you provided.

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.


Hello Dale,

As mentioned in the post

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



@GregArden - can you chime in here?