Grasshopper

algorithmic modeling for Rhino

I have a set of curves. They form islands in some parts which include closed curves.

 I would like to start raising the curves like a mountain as if they were contours of something. So starting from the outer curve and going to the inner ones you raise each curve by one step. I didn't manage to find how to describe this to gh. Has anyone faced the same question?

Views: 1170

Replies to This Discussion

Quite easy, actually.  Sort the 'Area' of the surface defined by each curve and move each surface in 'Z' according to its area: smallest the most, largest not at all.

It gets more complicated with multiple "mountains", since you have to determine which curves are contained within each other, essentially creating stacks of parents and children.

Are you working from random topographic curves or do you know more about which curves belong in each "stack"?

Thanks Joseph. Some times there more than one curve included in each curve so then if I sort them by area (I had this idea to sort the curves by curvelength), they won't be in the same level as they should. So as you said its the second case that you described. multiple mountains, multiple islands, parents, children.

I generated some field curves. Which I eventually want to use as contours.

The "parents" with more than one child result in two separate stacks, with the parent(s) replicated...  Sort of like this, with some clever code (Pieter?) to detect nesting bounding boxes:

Attachments:

Here's one that uses 'Area' instead of 'BBox', but it results in some duplicate "stacks":

Attachments:

thats a nice idea thank you very much. Do you think i have to work more on data management in the first part of the def in order to avoid the so many duplicates it generates, as the file gets really heavy then and it starts getting really slow?

that seems really tricky...

Yes, "data (list/tree) management" is the key to understanding Grasshopper.

Here's a simple solution. It might bog down with large number of curves but works well for me. 

The idea is simple - take a point on each curve, and then check how many curves it's inside. Use the count of curves it's inside to drive a Z displacement. 

Attachments:

Very nice!!

Thank you Andrew. I worked a bit on your def so that somebody could configure the distance between the contours. here it is.

Attachments:

@ Andrew: thanks for refreshing my memory :)
@ etsim: that could be simplified to this for instance:

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service