2D drawings of cuts and pockets off 3D parts for cnc machining

Hello,

A little background:

In my company, we machine a lot of parts using CNC. Our machinist uses DXF files that we send him from the 3D volume. So we have to create these 2D DXF files (which takes a lot of time) that include all the cutting information (drilling, external cutting, internal cutting, pockets…).

Some time ago I created a python script that works most of the time, but we’d like to recreate it in grasshopper so we can use it directly in our other parametric models.

I’m not a grasshopper expert but I spent a few hours trying to create this definition (.gh link below). My aim is, from a part with cut-outs and pockets, to obtain a 2D curve of the underside (which gives me the outer contours + drillings) as well as the 2D curves of my pockets. I don’t need the top face curve (which I tried to do on my gh file). I need the curves to be projected flat on an XY plane.

Finally, I’ll need to offset all the pocket curves that overlap with the bottom face curve (image below). I need this small offset so that the router bit machines the pocket a little further than the outer cutout to get a clean finish. I haven’t come close to a solution on this point.

Any help is welcome!

Thank you,



POCKET.gh (69.8 KB)

Brice.

Is this what you need?

  • Brep Edges gets all the edges out of your brep. (just as it says :slight_smile: )
  • Project these on the XY plane
    Erratum:
    I did write
    - Join the curves to get rid of the duplicates.
    Is not correct. It is more a cosmetic change. It looks like the duplicates are gone, but as @Joseph_Oster demonstrated, they are still there.

POCKET_EW.gh (56.3 KB)

Join does no such thing :red_exclamation_mark: Why Project Along instead of Project to a plane?

This is not a solution, merely an illustration. The spec is poor.


POCKET_JO.gh (40.7 KB)

2 Likes

This purple group is copied from my previous post, with preview disabled on ColorJa.

It is not intended as a solution but reduces the number of projected edge curves from 108 to 78. The white group uses them to split a surface.


POCKET_2025Jun30a.gh (47.5 KB)

1 Like

I see three cases here. A boundary pocket, thru pocket and an interior pocket. 2D curves don’t seem incredibly helpful. One can easily check the part to determine the pocket outline and depth of cut. Grasshopper can solve all the math you need and collect that data into whatever format your machine might need.

If you are cutting ferros materials it sounds like you might want better CAM software. Many packages have automatic toolpath creation that would work for a simple part like this. Rhino has an addon.

I responded to the wrong post. My mistake.

@brice1 are you using V carve?

In this version, Cull Pattern (yellow group) eliminates the vertical edges, reducing the projected edges further, from 78 to 42.


POCKET_2025Jun30b.gh (48.6 KB)

Dot Product might need to be rounded to work the edges that are not vertical?

P.S.


POCKET_2025Jun30cc.gh (39.2 KB)

1 Like

This sort of manual (or in this case artisanally automated) translation from model to manufacturing is a rather obsolete way of working isn’t it? I only have a hobbiest’s experience using Fusion 360 and VCarve, but I go straight from model to tool paths, with no intermediate 2D step. You could probably save yourself (and your machinist) a lot of time! Some starting points here: Free CNC Software (reputable source!)

2 Likes

More often than not, there are multiple employees involved in these processes and not one who does or even just could do it all. In some cases the process is split into tasks to keep employees busy and charge more as a consequence.

Yes, we use Vcarve most of the time, sometimes fusion360.

You’re absolutely right about that. My company was small 5 years ago, it has grown very quickly (from about 10 people to over 50 today). A lot of people are still used to “ artisanal ” methods and are not familiar with automation processes on a larger scale.

We have a design office that creates the 3D files and a machining office that handles the encoding part. We separate the two to be able to go faster, but it’s far from efficient. If it were up to me, I’d use RhinoCAM or Fusion360, but I just don’t have the time to do it.

We’re currently changing processes to avoid DXF files, but it’s quite complicated to change the habits of dozens of employees at once.

2 Likes

Thank you very much, i will take a look and try to make it work with my models.
I’ll get back to you when I have some time to devote to it.

This explains a LOT :grin:
10 people can muddle by but 50 people need processes and nobody has the time or inclination to implement them while the whole company is accelerating. Meanwhile the founding employees (who have the most authority to make changes) are settled in their way of working. You have my sympathies, and good luck with your habit-changing program!

1 Like

I tried some stuff, not sure how much robust it is… tried to create a custom Brep to test it, looks like it’s working fine, but to be fair it would be much useful if you could supply many of your plates to test different scenarios

POCKET_inno.gh (53.4 KB)

2 Likes

As long as you’re not milling miter cuts with a 3-axis cnc and ball end bit, this is all fine.

Hi @brice,

I’m the developer of KaroroCAM, a new cross platform CNC machining/gcode plugin for Rhino - available on the Package Manger:

https://www.food4rhino.com/en/app/karorocam-cnc-gcode-cam-plugin-rhino-8?lang=en

I specifically developed KaroroCAM to replace Fusion360 in my own work flow and remove the export/import time suck that using Fusion for CAM added to my day.

I’d be more than happy to give you a trial license and work with you to setup test tool paths to see if this may be a suitable route for you/your business.

Best regards,

David Kay

1 Like

Let me give a second try to improve what I did.

  • As you will see, a lot is done with:
  • using midpoints of curves!
  • get Z values, lengths, distances to “anchor points” you choose
    then test/compare and select what you need.

A bit depending on how close next project of you are, it could be more automated (replace sliders with logic). But I think the approach is rather clear and easy to use as a starters for coming projects.

Regards, Eef



POCKET_EWII.gh (77.9 KB)

1 Like

Hi,

very interesting thank you!
I’ve shared the plug-in link with my colleagues, we’ll take a look. I’ll send you a message if we have any questions.

1 Like

Thank you very much.

I’ve just tested your definition on several of our parts, there are sometimes a couple of errors. I’m going to collect several pieces and share them here.
On our simplest pieces it seems to work very well though! It’ll save us time already.

I’m wondering: do you think it would be possible to set multiple Breps instead of just one?

Thank you, i will take a look !

yes for sure, but not in the state it currently is because I didn’t really put efforts and I violated all the rules of building a good definition :slight_smile: that was just a dirty sketch

if you collect many samples for which it fails, it would be much useful data :+1:


[edit] @brice1 this version works (only) on multiple Breps (nothing else changed: it will still fail where the one-brep version was already failing)

POCKET_inno_multiple_Breps.gh (27.4 KB)

2 Likes