Grasshopper

algorithmic modeling for Rhino

How to constrain Polyline to draw only orthogonal lines

Hi All,

I have a collection of points in the same plane that I'd like to draw a Polyline through. The caveat is that I'm trying to to connect these points only with orthogonal lines. See image below:

Result of polyline command (undesired result):

What i'm trying to do (orthogonal lines):

Currently trying to solve this by drawing orthogonal lines through each existing point. Then solving the intersection of those orthogonal lines. Then drawing a polyline through new and existing points. No success yet. Anybody have a better way?

Views: 1745

Attachments:

Replies to This Discussion

hello

cool question quite simple to answer with good tools => Manhattan distance

Attachments:

Just in case you will see that there is 2 roads possible => So if you prefer a logic, an attractor it will be possible to make some choice (red or green road) 

Thanks for your reply! This looks like exactly what I need. I'm still a bit new to grasshopper - looks like I need to install a separate plug-in in order to access the Manhattan component?

Me I am quite a bit old, but it is interesting to answer questions in order to learn.

Yes you have to install some plugin, just 2 components, they will go on Vector Tab, an Point.  Go to the link provided and put Metric.gha on your canvas to install it. 

I'm working now on trying to choose the right Manhattan Path now. Each of the two Manhattan Components has chosen one correct right angle and one wrong. I need to overlap the two and choose the right path from each? 

 

So far I've tried measuring the distance from the vertices of the Manhattan components polyline output to a point I manually placed. I hoped that this would give me a list of points with minimum z coordinates (a.k.a smallest distance away from the point I've place - The line is oriented vertically in my model fyi) I've tried several other ideas but to no success. It appears that I'm stuck here - is this the best way to progress?

 

hello,

I think you need the lower curve. In order to get it you have to find a metric related to height (mass center of gravity) ... I choose the mass addition of Z value. 

Attachments:

Oh!! That's how you do it. This is perfect. Thank you so much. I am still learning about data flow / trees + branches. This is really helpful

- Matt

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service