Circle Y axis efficiency

Howdy, I have a line of circles shown below. If a circle is a certain width I want to move it to the left and shuffle the circles up. Keen for this to work with any random size list of circles. This could mean you have 4 in a row which are over the certain size so every second one has to move left and the rest shuffle up. Also it gets rather confusing thinking about how to shuffle them up to the ratio of the circle below and above :smiling_face_with_tear: Any ideas? :man_dancing:

Heres an example of what I’d want it to do to these. But any instance of size circles could happen. There will always be space on the right of the circle for a tag. Two circles that are moved back could be to big and overlap each other when shuffled up. Maybe its not worth the headache


Haha sounds fun.
Can you attach the .dyn

Also, what is the minimum spacing between the circle geometry and what is the size requirement for offset?

@vanman Challenge acepted, share the .dyn!! :metal: :sunglasses:

What do you mean by shuffle the circles up?

If you mean shuffle like you might have with a List.Shuffle node, there is never a reason to shuffle more than once, as the first shuffle is sufficiently random for all outcomes. Assuming you want to ā€˜stack’ circles on top of each other after shuffling, try this:

  1. Shuffle the circles and move them to the ’origin’. Get their radii and multiply by two. You now have a list of diameters which is the same order as the list of circles.
  2. Get the mass addition for the list of diameters by dropping items from the list and taking the sum of the sublist. Something like this should work: Math.Sum(List.DropItems(lst, -List.Count(lst)..0));
  3. Generate a vector using the mass addition values as the Y component.
  4. Take the list of diameters (step 1) and test them for equality to your width. Any which passes gets a value of it’s diameter, any other distance gets a value of 0 (test? diameter: 0;).
  5. Build a vector of -1,0,0 and scale it by the filtered diameters list.
  6. Add the Y component vectors to the X component vectors.
  7. Translate the circles from the origin by the combined vectors.

Haha sorry! My terminology is terrible. Shuffle like scoot :joy: like squish :roll_eyes: get them closer together to be a better legend but still ordered. The reorder in the title isn’t helping either. Appreciate the help. I shall try what you’re saying tomorrow and post the script where I’m up too.

So you want to keep it random? Or actually sort them by radius?

And do you want to split your line into multiple ā€˜columns’ with all bottoms of the circles aligned (ā€˜rows’)?

I think I’d summarize this as ā€œI have a list of circles, and I want to move them as close together as possible after offsetting circles over a given size to the left by their diameterā€.

You an use some trig, or you can leverage Dynashapes to do some circle packing for you. :slight_smile:

Oooooh like close packing but then for circles?

That seems easy. Just consider the circles like squares. and use Pythagoras.
However if you have 3 circles almost the same size as 1 big one, do you want to align or do you want to have the densest packing of completely randomized radius circles?

1 Like

@vanman

here is a similar topic… so when 2 circles are ā€œtoo close make oneā€ maybe thats some kind of insparation

Thanks for all the feedback. Got a picture below of a sample finished result. The idea is to get the legend as efficient as possible along the Y axis in length. There is a possibility the tag could be up to 3 lines long.

Got a script to sample the random sizes of circles you could end up with and was thinking if somethings greater then a certain input it moves across. However might be a smarter way to achieve Y axis efficiency.

Circle Y axis efficiency legend sample.dyn (47.1 KB)

Are these plants for a planting schedule?

I feel like this style of legend will be harder to read than two columns, which would be more efficient in authoring process or Y dimension. Or better still use a color based legend or even a schedule…

That said I’ll think on this one.

1 Like

For a legend to go alongside a schedule. Some more insight below.

The colored plants have to be 80% percent transparent in plans. I made images of the 80% colour plants and put them in the family for a schedule as a symbol. But this becomes tedious and the variety of plants can blow out. Think we went through a few other things and decided putting the used plant types in a content phase for tagging and having correct symbolic sizing is the best bet for what we need. (view as legend).

I’m working with people to give them what they want and facilitate it best I can with BIM, however I don’t always agree on there approach to communicating certain things, that’s up to them and I try give them the easiest way to achieve that. Always looking for smarter ways I could offer up though :slight_smile: This approach we currently have will give us a sturdy system to achieve what we want across variety of jobs.

You could be right with two columns but it could encroach on the plan on sheets. The method I’ve shown is what they’ve done prior to Revit and seem to like

1 Like

Ok, so here is the math (or I think it is - best to confirm yourself) to ā€˜stack’ the circles with one side aligned. If you want a gap on the side put more value into the Rn - Rn₁, and if you want a ā€˜gap’ between the two values add it to the Rn + Rn₁ bit.


To get Rn and Rn+₁ I find it helps to use a List.DropItems node with a -1 and a 1.

6 Likes

Thanks Jacob! I shall see what I can get done

Simplifies to x = 2 * math.sqrt(r1 * r2)

2 Likes