Shadow boundary for 2D cnc

Does anyone have a script that will produce a 2D outline of a solid object?

Imagine a truncated cone that leans over so that in plan the top surface is partially leaning out over the base.

Consider also that is a vertical cylindrical hole cutting through the object.

I need a script for 2D cnc cutting where the result will give me the projected outline (topview) of the maximum perimeter and will also outline the holes and include the projected tangent lines.

The attached model is typical, however there are over 300 unique pieces to do at once.

Thanks for any help you can give.

Billtruncated cone.3dm (19.2 KB)

Hi, if polylines are fine then you can use the _MeshOutline command from Top view. It is using the render mesh so you might adjust that to get the resolution you need.

Thanks Jess,

I was hoping to get something that wouldn’t break up into hundreds of short segments.

I am having to use MeshOutline as a stopgap until I find a better method.

Hi Bill,

Also check out the Silhouette command

Unfortunately there is no scripting equivalent AFAIK


Well to get smooth outlines you might try _Make2D or the _Silhouette command.
But both results need additional clean up with this kind of geometry.

Thanks Willem,

The Silhouette command creates edge curves of all the surfaces making up each solid. These are 3D curves. Using projecttocplane or setpt will flatten them but you still need to resolve duplicates and create an overall outline. I have found the ceateoutline.rvb file but you still need to go through the silhouette stage and flatten the curves first, but the result loses the hole details.

I have been told there is a ‘boundary’ command in AutoCAD that will do it but I can’t find the equivalent in Rhino.

Thanks again.

Hi Jess,

I tried that. It’s just too slow on 1200 objects at once.

Make 2D shows all visible edges, not just the overall boundaries.


How about getting MeshOutline and running Rebuild command on the result, with Degree 3 and 20-30 points?
Depending on the scale of your project, the deviation is minimal and you will get rid of the segmented outlines.

I’d still have to go around and split all the corners before rebuilding otherwise they would round off.

I’d then have to rejoin to get closed loops.

The attached screenshot shows a few of the real objects. There are 322 in this file Each piece is 18mm thick with curved sloping sides at varying angles. They are not vertical, All pieces have at least 2 x 12mm diameter holes. The attached image does not show all the holes because of the resolution.

In the largest model, yet to be considered, there will be over 1200 pieces.

The problem is so large that I really am looking for a script such as that described in my original post. I have tried various stopgaps and workarounds but it is still a very long process.

Thanks for all your suggestions.

Here is a script that would do rebuild of multiple curves based on the max. distance between curve points and will keep the corners (based on the threshold angle). It may work for you if you use MeshOutline and then run the script on the result to get rid of the segmentation.

SmartRebuild.rvb (2.5 KB)

Hi Bill,

The problem stuck with me today, are you going to script this yourself?

first to make sure I have the conditions right:
You have 18 mm thick polysurfaces with both circular and rectangular holes.
Are all the holes (circular and rectangular) are vertically extruded (or can they be sheared as well?)
The polysurfaces are all ‘laying flat’ on the XY plane

What you need is the maximum perimeter of te polysurface and the outline of the vertical holes all as curves on a flat plane XY plane.

I think it can be scripted like so:
2 step approach:

Step 1:
Via the silhouette command coupled with a CurveBooleanUnion you get the outline of the object ( no holes yet)

Step 2:
Extract all the edge curves of the bottom surface and delete only those that intersect with the found perimeter in step 1.Thus leaving the hole curves as they do not intersect the perimeter.

Would that provide what you need?


Hi Jarek,

Thanks for help.

I couldn’t get this script to run. It kept throwing up error messages.

Hi Willem,

I am afraid I do not do scripting. About as far as I go is writing macros.

I like your thinking.

All the circular holes are vertical. All the none circular holes are sheared except where chance might create the rare exception.

I got so far as to use the silhouette command, project the curves to the CPlane, then run createoutline.rvb from Pascals list.

That resulted in the the overall boundary but deleted all the holes.

The idea of finding intersects with the base surface boundaries, sounds good.

That would appear to give me the result I need.

Thanks for your help.

I’ll see if I can learn how to script this.

Can you elaborate on the final goal with these curves? Are they to create the base objects for further milling?

I wish I could offer you my time and do it for you but I do not have that at the moment.
What time-frame are you in need for this?


Thanks Willem,

The final structure is to be assembled from layers of plywood but only 3 axis machining is available. The idea is to cut the shapes out with entirely vertical cuts in one pass following the boundary shapes. The round holes will be drilled and will enable the use of dowels to keep the parts correctly aligned. The larger ‘rectangular’ cuts are to reduce weight.

The final assembly will be ‘stepped’. The next stage is a lots of planing and sanding.

Time scale ? I am in the middle of it right now. I didn’t have this problem until I started it.

Thanks again.

If doing this without a script, perhaps Make2D instead of silhouette would be better because silhouette will create 3 curves at each dowel hole, whereas Make2d will create one, which will make later selection easier in the following method:

Make2d your solids in top view;
Create polylines or rectangles to suit, around all or parts of the geometry;
CurveBoolean onto a new layer for the external boundaries;
CurveBoolean again into the large lightening openings;
Finally move all the dowel circles onto the new layer, this may take a while, but if the new layer is turned off you will see them disappearing which speeds things up in your head…

Sorry Brian,

I have tried all that. I really am looking for a script.

Hi Bill, actually it is possible to cut the sloped edges with a 3 axis machine. You just cannot do the undercuts. For these you’ll have to flip the plates and use the holes for positioning. It will save a lot of manual work.

However, it is easily possible to do what you are looking for with a combination of some scripting and a bit of manual modeling. It may be hard to develop a “foolproof” fully automatic tool. It depends a bit on the quality and consistency of the model geometry.

So the question is: Do you plan to do this frequently or is it just a one-time job?

Sorry Jess, but there are reasons why the job will be cut with vertical cuts in one pass only.

One Off? There are about 2100 unique parts in this one off job. If the job is repeated it won’t be the same but will be another unique set of parts.

Hi Bill,

I could not resist to spend some time on it. (3.6 KB)

It’s not a fullproof script but it might do the job, I do have some error checking and reporting build in in case no outlines are found.
To run it: open python editor: _EditPythonScript
open the saved scriptfile via File menu
Next run the script via the green arrow button

follow the instruction in the commandline
First dialog is to make sure you are working in topview with correct cplane.

Let me know how it runs.