Nesting / packing groups of curves

Is there a way to nest groups of curves in closed curve? I’ve tried opennest but it works only with single closed curves. With group of curves it fails. (27.2 KB)

I don’t have the thing that your def is using … but are you after doing an HAC type of clustering based on nested containments? If so I could provide some hints about how to do it (if you speak C#) but not the C# (is strictly internal).

See some demo captures to get the gist of FLAT > HAC clustering:

  1. Do a classic containment matrix and a FLAT tree (If you have polys or the majority of your curves are polys AVOID at any cost treating the polys as curves and then using RegionContainment: that’s slower than any Harley Davidson).

  1. Then do the HAC part (recursion on the FLAT tree as above):

  1. More complex cases (polys that yield many HAC clusters: an HAC cluster is the collection of branches that have the same primary dimension - Note: each item contained in these branches is a single one: i.e. contains nothing):

Curves are internalised in uploaded definition. Anyway I’m looking for solution based on generally public available components. C# is to hard for now.

If by that you mean native GH components … it’s impossible to do it (the HAC part, that is) or - maybe - is doable with an Anemone controlled recursion (but I can’t imagine how: components is not my game at all).

If you mean some sort of add-on that maybe doesn’t work (or has some sort of bugs) … contact the fella who did it.

I’ve found this in C# by @laurent_delrieu It works as I want but it operates on meshes. Is there easy way to convert it to operates on group of curves?

Like this:

No need for any c#, just use the Transform output of the Nest component. (24.9 KB)


Nice. Thanks!

I have one more issue. It is extremely slow at some shapes and impossible to toggle boolean switch to stop running. Is it solver issue or something with curves? Maybe because of arcs?

gwiazdki 001_tmn.3dm (74.0 KB) (53.2 KB) (59.6 KB)

Just dont nest curved objects, but simplify them.

The difference is minimal but the speed increase is huge.

I attached the fix.

If you nest object with hole convert polylines to planar surfaces.

In the component I then identify the hole from surface.

2 Likes (38.1 KB) If you want real nesting don’t use my code. It duplicates shapes. So you don’t control how much shapes will go inside the shape.

If you want rotations you will have to rotate yourself the meshes. If you need group use the index output. Index output refers to the index of the input. (43.5 KB)