Extend Pockets where touching exterior contour?

Hi. I do need to extend some pockets only on the edges that are touching the exterior contour and I can’t find an algorithm to do so. Basically I do have the pockets (Green colour) that I do need to extend only the edges that are touching the exterior contour of the shapes (the Blue colour) to result a shape that resembles the Red colour ones.

Any help will be appreciated. Best regards.


Extend Pockets.3dm (671.2 KB)

Hi @Cumberland ,

How about this?

From the looks of your file it appears that that is a milling tool path?
So I’m assuming you are just trying to extend the tool path to ensure clean edge cuts/material removal?

You had a couple unneeded mid points in the sub curves of your “Initial Pocket” polylines & your “Contour” polylines.

I went ahead and deleted those from the Rhino polylines FYI to simplify the logic.

Graph Space (Left):

Graph Space (Right):

Model Space:

This Slider controls the offset distance:

20230803_Pocket_Curves_Extension_Response_01b.gh (21.9 KB)

Let me know if you have any questions!

@michaelvollrath there’s always a lot to learn from your definitions, so I went ahead and lurked also this one :slight_smile: but for some reason this pops up when trying to open it:

image

it seems I’m just not able to get them… Area and Custom Preview look pretty standard ones… no idea what’s going on

by the way, replacing those with “standard” ones makes the whole definition work as illustrated :+1: but I’d like to understand why that is happening

@inno oh sorry about that! And I appreciate the kinds words!
I was using Rhino 8 and I forgot that it won’t default to the older version of the area component and I guess Custom Curve Preview isn’t available either.

Here’s the R7 compatible version:
20230803_Pocket_Curves_Extension_Response_01b_R7.gh (20.5 KB)

You shouldn’t get any component errors with that one; if that’s not the case, please let me know!

oh yeah :+1:

1 Like

From the looks of your file it appears that that is a milling tool path?
So I’m assuming you are just trying to extend the tool path to ensure clean edge cuts/material removal?

Yes, this is the intention, to have clear cuts without rounded corners where the pockets are touching the exterior contour.

Your definition it is a good start, but unfortunately it is not perfect. I just tested with another sample file and I do get some funky results.

Extend Pockets_test2.3dm (94.4 KB)

Ok, hopefully I do found a working solution in any situation. It is using one component from Vipers at the end to create a closed curve from segments.

Needs further testing.


Extend Pockets_v2.gh (20.8 KB)

Hi @Cumberland ,

Make sure your polylines are “clean” without all these extra midpoints you don’t need:

image

Also, this is going to be a failure (you have two separate rectangles here and a few other places):

Those are the issues in your geometry and in the script I provided the issue was that, in the new file you shared, some of the “plates” did not have tool paths, resulting in null branches in the data tree structure which I did not account for.

I added a small update in the script to handle this and with that addition and providing it clean contour and pocket polylines the script is still working as intended.

Case To Remove Null Branches:
image

Correct Result:

Grasshopper Script:
20230804_Pocket_Curves_Extension_Response_01c_R7.gh (21.9 KB)

Your cleaned up Rhino Geometry file:
Extend Pockets_test2b.3dm (92.0 KB)

Hope this helps you

2 Likes