Grasshopper

algorithmic modeling for Rhino

Hi all,

Please forgive me if this a simple question, I began learning Grasshopper only recently. I’ve created a simple model where I want to calculate and display distance along a grid of 200 meter blocks. The problem is that right now the distance is being calculated using a direct line from the centerpoint to each intersection point; I’d like the distance to be calculated following the paths of the grid instead.

I appreciate the help, I hope someone with the knowledge to solve this is out there somewhere. Both the Rhino and Grasshopper files are attached.

Views: 1115

Replies to This Discussion

Or I suppose if my attached files are a little bit convoluted (i'm sure they are!), maybe a simpler question would be: how can I create a grid and then measure the distance between a reference point and all other points at the intersections of the grid lines *following* the grid, not just as a straight-arrow vector from point to point?

Thanks a great deal to anyone who can help with this.  

Hi Andrew,

Have a look at Taxicab geometry, you can calculate the distance for each of your grid points adding the distance in x and the distance in y from your reference point. Let me know if it's not clear!

I did known this called as "manhattan distance"...

http://en.wikipedia.org/wiki/Taxicab_geometry

(only) For a standard orthogonal grid, with "infinite roads", no curves, just squares or rectangles, you can calculate the vector TO each point, which is already a difference of x and y coordinates of point A and B, deconstruct the vector to components and sum the absolutes of x and y to get the value.

For a different/more complex urban layout you will need a really different solution, like a pathfinding or such...

Thank you both for the quick responses! Let me look into this and I'll post here if I have any issues. Appreciated! Eventually, I will certainly need to get into tackling a more complex layout and pathfinding. 

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service