Grasshopper

algorithmic modeling for Rhino

Hi,

I have a generic surface which has been divided into sub surfaces. I would like to know slope and area of each subsurface. With the definition attached, I end up with two list: area and degrees (slope). I want to find out compute the total area of panels which have (for example) a slope less than 15 deg, 15 -30 deg, and greater than 30 deg.

Can someone tell me how I can sort these list so that I can get surface area data based on the slope of the surface?

(I ultimately want to assign a color to the sub surface based on the slope range that it falls into and also get percentages of the slope categories compared to total surface area.)

Thanks for any ideas.

Matthew

Views: 11273

Attachments:

Replies to This Discussion

Hi Matthew,

You could use an Includes Component to test for the domains and then cull the lists on a Flipped set of these results to get three separate lists of colour bands.

Attachments:

Attached two files, one for assigning colours based on slope, the other for removing facets based on slope.

I also changed your slope calculation to work directly on the z-component of the facet normal vector. I operate on the Absolute of the z-component, so it no longer matters whether the surface is upside-down or not.

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Attachments:

The ColourBySlope def has been very helpful. Is the output from the F(x) component in degrees (slope) or does the Z normal need to be converted into degrees?

it appears to be in degrees

I have a question related to the ColorBySlope command you attached here.  Is it possible to take the gradient you generate and use that to limit where, say, a curve (or set of curves) would be projected onto a surface?  For example, if you drew a series of curves parametrically on the world plane, and then wanted to project those curves onto the surface, but only on the parts where the slope is a certain angle/color (in this example, the color of the surface represents a certain angle normal to the ground plane).

Danny and David,

Thanks for your replies. Both of these definitions are very helpful (and increased my understanding of angle and area functions).

Cheers, Matthew

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service