Strange doubling of values in circle packing function

Hi there,

I tried circle-packing for the first time, and am struggling quite a bit. I followed the instructions in a video besides some of my own applications, but there’s an issue with the list length. The list for radius values output by the solver is the double of the amount of points output by the same, which again is the double of the amount of points on the input.

When applying irregularity in circle sizes by using “mesh colors” for the mesh input, you can see the problem.
First, this resulted in each point containing 2 circles and maximum and minimum value adjustments would effect the size of these pairs roughly equally. Now there is a cluster of circles in the top-left corner, which I assume is the last index in the list used for each of the remaining radii.

Either way, this is unwanted behaviour. I don’t know how to fix this issue. I don’t understand what could be wrong to be honest. Please help :slight_smile:


circle packer duplicate error.7z (20.7 KB)

Hi @moau_kanea

Sorry I missed this post earlier.
Here’s your file fixed, with the changes highlighted
circle packer duplicate error.gh (29.3 KB)

The first issue was that there were 2 meshes, causing the ImgCirclePacking part to run twice on all points. Joining them a single mesh fixes this (in Rhino you can have a ‘disjoint’ mesh consisting of multiple parts, yet behaving as a single data item in Grasshopper).

The other issue was the ‘removeDuplicates’ after the solver, I guess an attempt to fix the results of the first issue, but here it’s actually creating a new problem, because removing duplicates changes the list order, and the particle list and radius list are already in a matching order from the solver output.
So here the fix is just to skip that remove duplicates step.

1 Like

Thank you so much. I imagined the problem was due to there being 2 meshes, but had no idea how to solve it. That’s very cool, reimagining 2 meshes as one disjointed mesh. Almost poetic haha.

Yeah, that makes sense, that “removeDuplicates” would change the list order. And yes, you are definitely right it was an attempt to curb the problem.

Thanks a lot

1 Like

Hey there, I’ve run into an issue quite soon after moving one with the project. When I try to map an image to the vertices, this is what happens. I’m using the vertex output of the the “deconstruct mesh” object and letting it run through an image sampler of which the output is input into the “mesh colours” object.

The two meshes are animatable as you may see in the difference between this image and the original file. Most of the time the vertex mapping appears as the lower half in the example. In other words: totally random.

Any idea how to fix this?