algorithmic modeling for Rhino
Hello everybody, here is a randomness problem again.
Pattern generation is easy with grasshopper, but when it comes to random sized rectangles, well, things get tricky.
I managed to randomly populate a 2d space with random rectangles, but what I need now is to somehow stack them together. I tried RhinoNest, but it creates a very smart and patterned nesting (large objects first, then smaller), Then I looked at Kangaroo to try and let the rectangles gravitate to one another, but so far I found only how to do this with circles. Not sure if Packrat is what I need, because I'm working with 2d shapes and making them 3d just to pack feels a bit like complicating things, but if there is not way around maybe it's the way???
At this point I've been working on a problem for so long I don't see obvious solutions for the problem, please nudge me in a right direction or give me a hug.
Sorry for not posting pictures, but this is as simple as a rectangle populated with random rectangles with no intersections, done by hoopsnake or anemone. I'll upload a screenshot however, as soon as get back to office.
Tags:
Well ... efficient packing algos (this is what you need) are something that you can't find easily around ... for more than obvious reasons (these things are weapons in the right hands and are made in the majority of cases solely via code [a rather complex one for other type of "shapes"]).
For instance, lets say, this type of rectangle "packing" stuff (BTW: NOT 100% packing in the true sense, but anyway: spot the waste percentage):
So I could "pack" your rectangles (if you provide them in a Rhino file) but NOT post the above (sorry)
Hey, yeah, I thought about implementing it with grasshopper stuff aaaand, not a simple job to do, unfortunately I can't code it myself (yet). But I see the logic and understand why it is not a handout)))
Just a curious notion, does your script stack the rectangles in two directions first (I can see them neatly packed in x and y) and then just tries to fit the rest inside?
I'll try Packrat now and if don't get the result, post my rectangles here.
Stack the rectangles:
Well ... (this works either with external data or if you don't provide any ... creates "demo" cases just for fun) after finding (hopefully) some solution it can store it in a parameter (as persistent data) kinda a "variant". Then these "variants" are indeed "stacked" in Z for clarification purposes (otherwise they'll be a terrible mess: one solution "over" the other etc etc).
You can delete. recall or reset any variant as well.
BTW: if you get your hands dirty with code some day ... this (the "variant" approach, that is) is something that I can post and help you to get the gist of the whole procedure (that is critical in a zillion other cases as well: for instance modifying "manually" items in collections on a per item basis etc etc).
BTW: In general packing algos are a bit of a handful ... I wouldn't recommend to start your code adventures with things like these. But due to the advent of liquid madness these days they are essential part of any design proccess (you wouldn't like to dream some titanium skin for a blob ... only to discover that these "pieces" yield an average of ,say, 20% waste area [a total disaster given the titanium "modest" pricing]).
BTW: Plan Z: well ... maybe Daniel (K1/K2) has something to say on that matter: can K2 pack stuff? quite probably it can (but I have never attempt it). Anyway it's worth exploiting such a possibility and avoid endless nights questioning were a division by zero occured (or other ugly stuff, he he).
This is without packing, looks pretty dense if you give it enough time, but not dense enough.
Basically the idea was to envelope a museum building into some kind shading structure, call it parametric louvers homework XD. Trivial logic associate museum with pictures and pictures with picture frames, boom, you have a stupid idea for the louvers, feel free to throw poopies, criticism, we get that a lot in architecture.
Anyway, no matter how stupid the idea is, implementation is interesting and later development is also very interesting. Imagine a number of unique shapes being sweeped randomly along the frames (creating an actual solid frame, although you won't see shit from afar), random/patterned colors can be assigned, inside of each frame there will be a "canvas" of "bimetals" so you won't need to motorize anything. If you have an interesting idea, throw it along with the poopies.
Well ... if this is perforation (but who's bothering other than the laser people? - just sandblast some glass and have the panels) ... then yes. If is "packing" for getting the pieces ... don't show this to the client, he he.
But if you ask me and since we are heading towards solid state solutions (in the occasion of shading: smart glass and the likes) any shading attempt serves almost solely for decoration purposes (or at least it could appear like that in a few years from now - nothing fades faster than the ephemeral).
But if on the other hand you are after that long forgotten immortal "form follows function" thingy, go there, spend some time, get the whole gist of the tech (or order the wonder "demo" kit and enjoy) and imagine:
mmmm, I like dat stuff. No perforation and no client, academic project, that means infinite budget, sweet)))
ResetNowForEver:
Forget breathing buildings and all that #$#%$ stuff > forget perforations > forget you > call Solaronix > pay some cash > create a NON blob (be the next Frank Gehry in the inverse sense) > make a carbon FLAT truss (be brave) > buy hollow poly carbonate fins > stuff them with the wonder material > make electricity out of nothing > sell the whole idea to BP (or Exxon) > get the zillions > go to Monaco > roll the bones.
But... I like blobs.
I'd rather use these gazillions to design my own casino with blackjack and hookers XD, but for now, perforating stuff, hoho.
Hello Tim,
PackRat works indeed on 3D shapes, but turning 2D rectangles in volumes is not that complicated. I had a 2D packing problem like yours and used PackRat. It was really simple and I got good results.
Maybe you should give it a try.
Hug !
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