Grasshopper

algorithmic modeling for Rhino

Greetings fellow Grasshopper users,

I am working on a studio project which involves explorations of point fields derived from different input systems. These point fields will end up being a driver for spatial studies farther down the road, but I digress; on to my Grasshopper script:

I've built a Grasshopper script that will display a point field for a given topography map (curves extracted from contour lines). The idea here is to display higher levels of density where the highest slopes are within a given topo map.

The file works, but I'm wondering if there is a simpler way of going about this, since my file contains so much redundant info (open the cluster "Pt:50" to see what I mean). My Grasshopper Kung-Fu skills aren't anywhere near expert yet, so I defer to the experts out there for a simpler solution. Here's my breakdown:

1. Start at curve start point, and find closest point within the group of curves.

2. Get distance to that closest point, and find second point along said curve at that distance.

3. Repeat process along curve starting at each new point at each new process.

Thanks in advance for any suggestions/comments!

Cheers,

cb

Views: 2096

Attachments:

Replies to This Discussion

Hi Christopher,

if you want your point distribution to be exactly like the algorithm described (measure distance to nearest curve, add point on curve based on that distance, repeat until end of curve has been reached), then it will be quite difficult. This is an iterative process where the next iteration depends on the results in the previous one. Grasshopper is notoriously bad at this sort of looping. If you want to solve it cleanly like this, then you'll either have to use HoopSnake or custom code (see attached).

If you're willing to consider other kinds of point distribution algorithms then it would open a few doors that may be interesting. Are you?

--

David Rutten

david@mcneel.com

Tirol, Austria

Attachments:

Thanks for the quick response; I'm definitely interested in other kinds of point distribution; I'm using this uni project to jump headfirst into all things related to these issues so I can get a firm hold on how they work within the program. Any and all paths/methods are welcome.

What doors can be opened?

cb

Well, I thought this might work, but it doesn't. The basic idea was:

  1. Sample each curve at N points (say, 100)
  2. For each point, find the distances to all the curves.
  3. Sort these distances.
  4. Pick the second distance (the first distance should always be zero, as that relates to the curve that spawned the point).
  5. Move the point up by that amount.
  6. Interpolate the moved points.
  7. Contour the elevated curves.
  8. Pull the contour points back onto the original curves.

The contouring is causing all kinds of horrible side-effects though...

--

David Rutten

david@mcneel.com

Tirol, Austria

Attachments:

Hi David,

Im really interested in your attached VB script, may I have the full break down component of it?

thanks in advance!

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