Grasshopper

algorithmic modeling for Rhino

hi all,

i'm just picking up grasshopper and finding it to be a really amazing tool for design.
but i'm really confused on this simple prob, of trying to offset lines generated from a 2D voronoi formula, so i can get something like a "structural frame", much like the facade of the water cube, Beijing National Aquatics Center.

how do i set a parameter for distance of offseting the lines, as well as a thickness for extruding the surface in the z-direction?

your help will be much appreciated on this.Thanks in advance.

Views: 7966

Attachments:

Replies to This Discussion

Hi Michael,

once you have your curves generated by the Voronoi component (I see you are using a Script component to do this instead of the in-build Voronoi component), you feed them into the Offser curve component and they will be offsetted.

Now, the Rhino curve offset logic is actually pretty lame and since Voronoi cells tend to be polylines with very short segments it quite often fails.


--
David Rutten
david@mcneel.com
Seattle, WA
Thanks David for your swift reply! Appreciate your help.
now i still have more queries.

using the voronoi component, how do i set the bounding box? i tried setting multiple points and linking to the 'b' of the voronoi component but i wouldn't work.

Also, how do i make a surface out of the offset lines so i can extrude them later?

Thanks and appreciate for any help rendered!!
Attachments:
Hi Michael,

you cannot supply a custom outline for the diagram. Technically, any convex polyline would work, but since there is no way to limit curves to closed, convex polylines in Grasshopper I chose to not expose the boundary condition as a curve parameter. You have to supply a Box instead. You can set the box simply by clicking the right mouse button over the "B" parameter and choose the "Set one Box" menu item. The intersection between the Box and the Plane will become the outline condition.

Extruding the shapes is a bit trickier, it involves manipulating Data tree structures. This is not trivial, but it is important. Your best friend here is the ParamViewer object (Params -> Special). It allows you to inspect the layout of a data structure in memory.

First of all, lets perform the Voronoi + Offset operation and see what we get:


The ParamViewer object that is plugged into the Voronoi output states that the data is structured in a single list of 17 items. The path of this list is {0:0}, but we'll deal with that later. The output of the Offset component is not the same at all. That output is stored as 17 different lists with one item each. The reason for this is that it is technically possible to offset a single curve and get more than 1 result. This is why Offset complicates the data structure.

Before we can turn the curves into surfaces, we need to make sure that the layout of the two data structures (the voronoi curves and the offset curves) is identical. We can achieve this with 3 additional components:


The Graft component complicates the voronoi curves in the same way as the Offset component did. The Simplify component removes all redundant branching information from a data structure, so we are left with the simplest representation that still maintains all the information.

Now we have both curve sets stored in identical lists, which means that when we feed them both into a Planar Srf component, it will treat each voronoi curve and the associated offset curve together:



I'm not surprised this is confusing you. It is a very complicated topic. We'll probably need to come up with better matching algorithms for data structures, better ways to display the data in a human-friendly form, better ways to manipulate the structures. If you have any suggestions, I'd be happy to hear them.

--
David Rutten
david@mcneel.com
Seattle, WA
wow.. thanks so much! tt's exactly what i was hoping to get!
yes, i think it's quite hard to interprete the data for begininer like me.yup, if i have any suggestions i'll let you know. Hopefully with more practice, i'll get the hang of it, and be more familiar with grasshopper. It's great that we have this forum, where newbies can come and learn from the others.
Thanks again for your time and careful explanation!
Hi David, I'm afraid I can't duplicate your definition - I keep getting different data in the second param viewer. Any ideas?

Thx..
Attachments:
I was doing the same exact thing last week - and managed to get this far - but as soon as a single offset 'fails' and generates more than 1 output curve for the closed input curve (vornoi cell), the two lists get un-synced.

Is there a way to avoid this? I know you can check if a curve is closed, so you can purge the 'broken' lines from the offset output, but I can't figure out a way to match that purged list to the original list of input curves... since the list length is different and the indexes no longer match.

I imagine there's a way, with data trees, to have the offset component output each individual offset operation to its own path, but I'm not sure how to do that. Any ideas? does this make sense?
Michael,

This example I put together a while back is similar to what you are trying to do.

It could be helpful, but basically it just adds some bells and whistles to what David has already described in detail.

Voronoi Surface

-taz
Taz! Thanks for your definition. i learnt alot from experimenting with it.
and you've a great website, the tutorials are really helpful. thanks 4 taking time to do those.
i'll be visiting it regularly.

Act i do have a more complicated qn now regarding a 3D voronoi, will be gr8 if you can help me out with it. guess i'll post it in a new thread.

Thanks again!
Thanks to all - this is exactly what I was looking for. Now for play time!
Thanks for this Taz. Is there an easy way to extract the top surface only? Like the original poster, I would like a single flat surface to work with.

Thx..
See the last image posted by david.
hey man, I downloaded this but for some reason it doesn't work, it's like no matter what I select, there is no afect in grasshopper. I tried adding a new surface just to check, and it wouldn't even select that, unconnected to anything..is it a version problem?is the file corrupt?

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service