Grasshopper

algorithmic modeling for Rhino

Hi all, I'm trying to adapt included definition to stack balls along a given curve. Having difficulties to making them stack neatly. Any help would be great! Definition included.

Views: 581

Attachments:

Replies to This Discussion

There's no neat way to do this. You'll need an iterative process that may work as follows:

  1. Place Sphere S0 (ie. the first one)
  2. Place another sphere X0 with the same centre point but whose radius is R0+R1 (ie. the radius of the first sphere plus the radius of the second).
  3. Intersect X0 with the curve.
  4. In case of no intersections, you're done.
  5. In case of one or more intersections, pick the one with the lowest curve parameter.
  6. Place Sphere S1 on top of the intersection point.
  7. Then repeat with X1 (R1+R2).

The above means that the centre of the next sphere is guaranteed to be both on the curve and the exact right distance from the previous sphere to result in them being tangent.

Another possible approach is to move each successive sphere/shape until it is exactly tangent to the previous one. This is much harder conceptually but it allows for shapes other than spheres.

RSS

About

Translate

Search

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service