Grasshopper

algorithmic modeling for Rhino

I have a series of 4-point surfaces and I am trying to classify them based on the measure of an angle. I would like to assign color to these surfaces based on the angle measurement.

0 to 5 = color 1

5 to 10 = color 2

10 to 15 = color 3

15 to 30 = color 4

....

I divide the surface by number of segments.  How can I divide the  surface by distance between

any help...

Views: 5277

Attachments:

Replies to This Discussion

Alright, well I got the first part. It is more about technique really and some ways to juggle numbers that I have found useful. If you want to include more colors I think you can adapt it quite quickly. Whats important for some of these kinds of things is to remember that "True" and "False" are treated like 0 and 1, so you can use them in calculations, which is handy.

I think the second part of your question is cut off or I dont quite understand what you mean. But the whole thing with dealing with surfaces and panelling and all that is not really what I use GH for, so maybe someone else has to solve that.

I am sure there are other ways of doing it too, but its the first one I found that works for your requirements.

Hope it helps. 

Best, Armin.

Attachments:

Hi~

I'm not sure this is a right approach or not, anyway...

I've sometimes used this method to draw a topography Gradient analysis digram.

You can compare the result with your gradient preview.

Attachments:

@Hyungsoo Kim

Damn, you always come up with such good solutions. I try to stay away from using explode tree though. Its too easy for things to break down the road if you rely on it too much. ;)

Guys, for sur it help!

your are masters! I'm novice on grasshopper and I'm very impressed about your level :)

Do you think that it's possible to determine the interval of angle like:

-for color 1, the angle has to be between 5° to 15°

-for color 2, the angle has to be between 20° to 30°

etc..

Can I subdivided the surface by type of color (exemple: color 1 will be 2 subdivision; color 2 will be 3 subdivision, ..)

many many thx for your help guys :)

Here is one way that I use.  It was driven by the notion that I wanted to be able to explicitly define slope "ranges" and then be able to isolate the areas that fell within those ranges.  I'm sure there are other ways that might accomplish the same thing.

NOTE: Visualizing slope ranges has been shown by quite a few folks in various ways: (Coloring face by slope using gradient).

http://www.grasshopper3d.com/forum/topics/area-slope-lists
http://www.grasshopper3d.com/forum/topics/color-by-slope

mostly operating off of mesh face normals measured against an absolute z vector, and passing through a gradient component.  I was never able to fully understand how the gradient "ranges" corresponded to actual values....

Anyway, here is rough example that I use.  I'm sure there is a more effective way, but this worked for us.  

The rough idea is something like this:

1 - Get percent slope of each face on mesh, convert to percent

2 - Define consecutive domains, (slope ranges), and use some path manipulation to group faces into thier respective domains

3 - Color the faces/groups

The last bit of the attached definition has a cluster that makes a legend...nothing terribly exciting.

Attached are the definition and an accompanying rhino file that has some notes regarding how slope is calculated, degree vs percent..  it's for reference.  All the data is internalized in the GH def.

Attachments:

I should add that the team over at Buro Happold has a pretty sweet toolset called smartform.  It does a ton of stuff, one of which is analyze slope.

http://www.smart-solutions-network.com/page/smartform-analyser

that is incredible ! just woaw! I could never design something like that.

it's exactly what I m looking for, do color groups and faces by defines slopes ranges :)

Do you think that it's possible with the same idea to subdivise instead color with the same logic?  subdivision by respective faces colors/ groups ? I try it on your exemple but do be honest, I'm a little lost :/ 

regards

I guess so...how do you want to subdivide?  In this image, I just used the Explode Tree component, (which outputs each branch...with each branch containing the grouped faces), then used some weaverbird components to subdivide the mesh faces.  

NOTE: in this example, the faces are already grouped into branches earlier in the definition.

yeah! it's exactly that :) I didn't have Weavebird - I 've just install it.

 how can I define the number of subdivision on this meshes.

I'm very sorry to ask all that questions - I start grasshopper a week ago ... so you can imagine my level... 

That is what this site is for...asking questions!  Not that every question will get answered....but in this case, you caught me on my lunch break.

If you right click on the Explode tree component and choose "Match Outputs", you will get the appropriate number of outputs.  As far as sub-division goes, the various weaverbird components have some inputs that describe the level of subdivision.  Just be aware that depending on how much you are doing, you may start to see some performance issues, (number of faces being subdivided, level of subdivision, etc...)

While I am certainly no expert, I would say that some of the techniques used in my example definition require some understanding of data trees.  Fear not, this is definitely one of the biggest concepts to get a handle on when learning grasshopper and it takes some practice. 

If you are just starting grasshopper, I would strongly suggest a few learning resources.  There are many tutorial sites/videos available.  I would definitely start here:

http://www.grasshopper3d.com/page/tutorials-1

I found the mode lab fundamentals extremely comprehensive.  They also have some great tutorials, (lots of them free!), on their website:

http://lab.modecollective.nu/lab/introduction-to-grasshopper/

With all of that said, when you are done this initial exploration...throw that file out and make your own!  The absolute best learning curve is when you explore/break down the problem and come to your own solution.

Hi Chris, I download your gh file and tried to test out the slope analysis, but one of the component is missing. Is that from an external plugin? Can someone please advise me the name of that key? Many thanks!

That's from UTO's mesh edit tools, (explode Mesh).  You could just use the deconstruct mesh tool...I am pretty sure that is a native GH component.

Also, this is by no means the only, or best, way to do this, it was just one example.

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