Auto locate dowels on multi-strata object

I’m trying to automate strata-based milling of 3D objects, and got all the slicing shenanigans sorted out thanks to @magicteddy and @Joseph_Oster.

Now I need to find “good” locations for the dowel holes that will allow me to align my parts properly to form my milling stock ; the number of holes being at least 2, so that rotation is locked.
The idea is to create points that are both far appart and far from the edges, locally.
I was about to try the Kangaroo approach, as it smells like a form-finding problem, but I was wondering if there could be an easier way to get suitable hole locations, with random shapes.
Any ideas ?
230224_IMG_Section samples.3dm (84.2 KB)

A couple more section samples
230224_IMG_Region (39.1 KB)

Medial lines - Grasshopper - McNeel Forum

Have you seen the discussions about Medial lines, old town roofs / sand dunes?

Aha ! Creating slopes inwards from the boundaries ; good idea.
The examples I see are really squarish though.
Pufferfish has a “Extrude tapered” component, but it fails quite fast…

230224_IMG_Region samples (41.5 KB)

Raw idea.

For more slices/layer you could do all the same but let kangaroo use a single sphere collide with all the points.
To tune layer<>layer interaction, temporary distance the layer each-other until sphere collision make the pins distance enough but not too much. Then re-project the points on their correct plane.

… what a mess! :sweat_smile:

1 Like

Looks cool ! I’ll check it out after lunchtime.
I was headed in this direction :

Can you give us clean data please? Surfaces in GH, not curves in Rhino or internalized curves in GH that have duplicates in two of the four branches. I’d rather not squander my time in data cleanup.

P.S. The quick and dirty method wasn’t that hard but it was a distraction! :man_facepalming:

clean_data (106.3 KB)

Here’s an idea for a different approach, using the polylabel script for finding the pole of inaccessibility I posted here.
It first gets this pole, then splits the curve where the largest circle touches, takes the larger part and gets the pole of that: (20.0 KB)


230224_IMG_Region (90.3 KB)

What I posted was better because it kept one branch per layer. One branch/layer has two surfaces.

How did you get yourself into this mess?

Actually, I’m not sure the way the obects are structured is very relevant since I need 2 dowel holes per object.

Hey, that’s smart ! Thanks Daniel.
I also like Khaled’s Kangaroo hack.

Sadly, the C# component assumes the curves are on the XP plane and projects the poles there…

I guess I can work around this by transforming the curves so they are on the XY plane, performing the script, and then reversing the transformation.

Yes - I usually find it simpler to work like this when dealing with a 2d problem - transform it to XY, do whatever process is needed, then transform back at the end.

1 Like

OK, done, but I realize it’s working on curves individually.
If I try to place two curves in a branch (region with a hole), it falls apart.
In this post, it seemed to work though.

EDIT : Actually, it does work with regions that have holes ; it’s the rest of the definition that falls apart, as it’s not robust enough to deal with this kind of topology, I guess.

yes the script works for finding the pole on surfaces with holes, you just need to adjust the splitting part, since one cut won’t divide an annulus into separate regions. It’s not a big change - just add another splitting line.

Moreover, it seems to find a local maximum in this case, but not the global one.

230224_PROG_Local (18.8 KB)

This is proving to be tricky, and probably won’t be very robust.
I’ll try out Khaled’s idea instead.

No kidding! The white curves show the edges of the original surfaces, the extruded bits are the intersections between one layer and the next. I haven’t even tried to locate “dowels”. Code is a mess.


Don’t bother with the correspondence between stratas ; I’ve sorted that out already.
The issue is finding two “good” locations given a region, which may or may not have holes.