Grasshopper

algorithmic modeling for Rhino

Hello everybody,

Im currently trying to find the shortest walk/path along a surface to the center of polygons adjacent to this planar surface.

I am aware the shortest walk component uses a network of curves to work, but I got nothing like that in this option. Just a starting point, where to go, and along where to move.

I dont know.... is it even possible?

Im uploading the internalized geometry if anyone is willing to try.

Thanks for any ideas.

Shynn


Edit: Doing some digging I found this thread about extracting the axial curve of a 3D mesh: http://www.grasshopper3d.com/forum/topics/code-to-extract-center-cu...

Obviously this is much less complex as its just a planar surface. Hopefully this will illustrate better what Im trying to do.

Views: 6715

Attachments:

Replies to This Discussion

Impossible as it is since ExoW is a bit temperamental (reports frequently engulfing issues ... where they are none around) not to mention that - in the as above test case - there's 3191 lines around.

But a 1000++ times faster way is (after sampling the lines into proper Polyline/Points Lists):

A simplification of the points, then make nurbs and then make some tubes out of them (nodes require some attention).

I did quite a bit of work on this a few years back. You might find this paper that we wrote helpful, in particular the bit about algorithms for reducing and simplifying the medial axis after construction. There's also some examples of 2.5D and multi-story solutions in there, as well as a discussion of relevant graph measures in the context of analysing the built environment. Also, I ended up using a Python module for constructing the Voronoi diagram, as I was having some precision issues with the GH one on very high resolution solutions (attached this module). Everything else is all RhinoCommon/GHPython/networkx. Hope that helps..

Attachments:

Interesting paper that one.

Indeed one needs coding for the Voronoi part (using the GH component for test: see where the cursor is: a valence > 2  situation is reported due to "asymptotic" lines in the graph [poor Sandbox is malfunctioning for good reason]).

So this is resulting to be much more complicated than what I thought it was. Thanks to your def Peter, I was able to find the medial axis of my surface.

Then I manually polished the curves and splitted them in each intersection to make it work with shortest walk component.

Made the shortest walk component work, it generated the lines, but naturally they dont get to the center of the boxes as the intersection is not done yet.

Now I was trying to make lines from the centers of the boxes into touching this medial axis curve. I got the end points of the shortest walk curves and projected them into the boxes. Problem is sometimes a line goes across the boxes instead of going in the right direction:

So Im completely stuck now, maybe this isnt the best approach? How would I tell grasshopper not to generate lines that cross the adjacent boxes? Like there is a wall there.....

File with internalized geo:

Attachments:

Well ... the bad news (to you) are that anything is extremely simple (good news: to me) if dealt with code. 

But I guess that you don't want another "black box" on that matter.

For instance and for some freaky occasions there's a very handy Line.ClosestPoint Method that accepts a limitToFiniteSegment Boolean flag: if properly used it can address [+ some other stuff] a variety of freaky situations ... etc ,etc, etc.

I'll try to do it with components and if not > the black box.

Peter, I dont think I have the right of adding conditionals when you are dedicating time to help me, a solution is a solution, and thats all I need, no matter if its with native components or scripted.

I guess the only downside is not being able to completely understand in order to learn, but oh well.

OK,

1. I don;t have the Shortest Walk thingy (since I have 10+ C# that do anything imaginable).

2. Since this is NOT very simple (ALWAYS a case that appears very easy proves to be the ultimate nightmare) get a black box on an abstract collection of curves (VS a SINGLE path, Lists not added yet) and post your comments/wishes especially stuff that you want to do with regard the connections: like some particular condition/mode for connecting a particular building etc etc etc.

How it works:

It finds the closest distance between the mid point of any Polyline segments (VS the path), picks the shortest and adds a Polyline to a tree. Then it splits the path in order to be used ...er... for something/whatever.

BTW: Here's why the simplest of cases are the worst (what exactly to do in a similar condition? (a) the obvious, (b) some other ??):

Attachments:

Er... hmm... due to lack of espresso (and cigars) there's a very stupid bug on the previous def with regard the split.

Recycle it ASAP.

Attachments:

Found a couple of minutes to add the List of paths ability. It works OK (3 paths used as demo):

But ... well ... since AI is not (yet) arrived to the masses ... here's why simple cases are the ones that I hate the most.

For instance for this building the logic center-proxEdgeMidPoint-pathClosestPt appears at least naive:

And for that ... well ... maybe is OK maybe not:

Moral: I hate computers.

Attachments:

BTW: With regard medial axis matters there's another way faster version that abandons curves and works with BrepFaces (with any number of holes) but that uses solely C# and ... er ... I'm not willing to share my graph connectivity stuff meaning that I should rely on Sandbox for that matter (for (a) finding and then (b)"smoothing"/reducing the polylines) ... but Sandbox doesn't handle line graph trees in a clear manner - try it and see the results (some coding is required in order to sort onions from sardines).

Hey Peter, this is working superb, except for one tiny detail. There are some cases where the shortest path is a "hallway" and thus the script connects to this hallway across other boxes, that should not be possible.

This was what I was talking about before: (about there being theoretical walls)

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