Grasshopper

algorithmic modeling for Rhino

Hello all, 

I am trying to recreate what would be the path of water across this triangulated terrain.

For this I need to find the line segments that represent the ditches/canals. 

These would be where two faces of opposite direction meet: 

Thank you. 

Views: 2095

Attachments:

Replies to This Discussion

IT would be easier to use a loop for that. Check out anemone looping plug in for GH. I am pretty sure it has a water drainage example file. 

Attached is the drainage example file in case you cannot find it.

Attachments:

Hi Michael, thank you. I have anemone and could run the example file. But I am afraid it does not work ok with meshes. Tried modifying the file but no luck.

Still the curves might not be exactly what I am after, I specifically need those ditch segments. Just need a way of recognizing which lines are concave or convex.

Try this, the idea is to move the point in the direction of the slope in x and y.

Attachments:

If you replace de [Amplitude] by [Multiplication] for example, you can make it advance faster where there is more slope.

Hey Daniel, thank you, but in the end this gives me a visual recognition of the ditch places right? How could I grab these "ditches" axis?

Oh sorry, I forgot to mention that. On hoopsnake double click, you will get a window, there you have a loop button. I have used Hoopsnake here precisely because it has that button, because it is a slow process due to the need to take small steps for when it reaches the edges.
But you can replace it with anemone if you prefer.

I been doing some research on how to test whether an edge is concave or convex and found this:

https://www.gamedev.net/forums/topic/508442-determining-whether-an-...

If na and nb are the normals of the both adjacent faces, and pa and pb vertices of the both faces that are not connected to the edge in question, wherein na and pa belongs to the face A, and nb and pb to the face B, then

( pb - pa ) . na <= 0 => ridge edge

as well as

( pb - pa ) . na > 0 => valley edge

Seems to work, (trying with two faces) but now I need to translate it to the whole mesh.

Attachments:

Any ideas?

Assuming the mesh is always triangulated - the 'HingePoints' component in Kangaroo extracts the 2 points at the end of each non-boundary edge, and the points at the tips of the 2 adjacent triangles. From this you can get the normals of the 2 triangles, and then whether the cross product of these is in the same or opposite direction as the edge tells you if it is concave or convex.

Attachments:

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