algorithmic modeling for Rhino
Tags:
Hi John,
If you are doing it for a Cartesian grid, and you want to keep it 2D then just do distance calculation from the center point of each cell to all the other center points, and sort them. The first 4 with minimum distances are your neighbors. You can do a vector angle analysis afterward to find which one is on what direction. You will face special cases for edge conditions though.
A better way I think is to extrude all your geometries for the same heights, and for each side surface trace a ray from the center of the surface, and find the intersection with other geometries. The first geometry that intersects with the ray is the neighbor on that side. If you get no intersection, you are testing an edge surface.
Well... another way that I can think of is to make a mesh from the points and then use: Rhino.Geometry.Collections.MeshFaceList.AdjacentFaces
...
Hope it helps,
Mostapha
Thanks Mostapha, in the attached jpg is a attempt to achieve what i wanted with on 2D but it doesnt seem to work out, i agree the better test would be to test the heights of each neighbor
Hey John... Do you want to attach your grasshopper file too? It would be easier to check the code then.
see attached files
John,
As Mostapha suggested there are several ways to do this (mesh topology, distance, etc.) Your process is built off of a surface which has uv coordinates that you use to organize and create the grid. This same logic can be used to organize the neighboring cells. Attached is an example.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by