Grasshopper

algorithmic modeling for Rhino

I'd like to share here a few new examples of scripting with the Kangaroo2 library.

Starting with some custom goals (these will probably be included as standard components in later releases, but I'm posting them here first for anyone interested in seeing the code), to be followed by some examples of custom loops.

First, a simple wind goal. This is one that existed in Kangaroo 1, but I hadn't got around to making a version for K2 until recently. It is very similar to the pressure goal, except here the magnitude of the force is dependent on the orientation of the face relative to the wind vector.

The cross product of 2 edges of a triangle give us a vector in the direction perpendicular to its face, and with a length proportional to the area. This is exactly what we need for the pressure. To convert that into something dependent on the wind, we take a dot product with the wind vector (so the pressure will be zero when the face is exactly aligned with the wind, and at its maximum when it is perpendicular to the wind).

Finally, we divide the result over the 3 vertices of the triangle.

Views: 3612

Attachments:

Replies to This Discussion

Thank you Daniel!

Amazing examples, thanks for sharing! I'll try to combine the line growth example with the OnMesh constraint from the pointcreation script next..

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