Grasshopper

algorithmic modeling for Rhino

Hi all,
how would it be possible to subdivide a curve with 3 predetermined lengths that alternate randomly.

Any help would be greatly appreciated.

Mirco

Views: 190

Replies to This Discussion

See if the attached works for you. The only think that might be worth explaining is the little VB component that I wrote. It simply keeps a cumulative sum of the list at each point, which essentially allows you to figure out when the random values total a length that's longer than the curve in question. This could probably be done through native GH components, but the code is quick and simple and its getting late.

Also, more random numbers are generated than needed, so that list is trimmed by figuring out at which of the cumulative lengths are longer than the curve length an culling the list based on that. Although this technically isn't required, it will cause some downstream components to turn orange (which looks bad), and has the potential to cause issues with periodic curves.
Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service