algorithmic modeling for Rhino
I try here to answer from a question on discourse
https://discourse.mcneel.com/t/fill-an-rectangular-area-with-predef...
Fill an rectangular area with predefined elements
https://discourse.mcneel.com/t/subdivide-given-area-into-randomly-s...
I add some difficulties to resist and to do it with Grasshopper and Anemone. I know it is surely more simple in C# or other program. Peter Fotiadis will be sad, but I did it in GH, it is quite long but it seems to work. The idea is to generate a grid of point, to take a random point on it, to generate a rectangle with a random incremental size (1, 2, 3, 4 in width and the same in height in my example) so look if this rectangle contains all the points of the grid, if yes put this rectangle on memory, destroy the points on contact and redo it until grid is empty.
Tags:
OK, it works great thing !
I know I have no right to ask for anything, this is already pretty cool, but could this also work with a number of predefined blocks?
I really feel stupid because I cannot do it myself, is there maybe something else I could do for you? At least I can send you a bottle of wine?
best
Andreas
Yes you have right to ask. There are many passionate on this forum.
It is surely possible and seems "quite" simple, but not before tonight or tomorrow night. GH is just for my free time.
The idea is make a heap (2 lists/tree) with big rectangle first, then the medium, then the littles ...
so do a list/tree like that
{4 4
4 4
...
1 1 }
try to place the first => if OK delete first item of list if NOK retry with first ... it must work but it also surely could be blocked in some cases.
Ok it is done, you will have to fill 3 gene pool with same number of line. Each for one shape, one for the width (in number of cells), the other the height (in number of cells) and the last the number of shapes types. Begin by the shapes with bigger surfaces. I suppress "physical" size of cell, not very useful, you just need to make a scale. I will try to update the script to count for try and if too many try suppress the shape.
Hello Laurent,
I am playing with it for an hour now... it is great!,
maybe I am too stupid to understand, or I was not making myself clear enough, but Is it possible to modify it in a way that the algorithm would produce rhino blocks ( which then could be modified / replaced later on in rhino) instead of surfaces ?
Again, please excuse me asking without beeing able to contribute in this case...
best
Andreas
I was able to transform surface in blocks. You will need Panda plugin because I didn't find other block components.
Here, I assume that the block base point is on the middle. All the blocks are moved on {0,0,0}
To classify the surface in sets I transformed a surface in an integer that will be the same for one type of surface. I used here (Width+10*Height) of each surface. If width is less than 10 it will be OK. With this integer I get an index for each set.
I have 6 types of surfaces and so 6 blocks. The genepool is used to make a relation between one block and one type of surface.
Hope it is clear !
I am downloading your new version ...will post feedback ASAP
thanks!
Andreas
I just saw your mrssage. Can you post on discourse?
Yes it is possible on whatever shape. On my phone at the moment.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson.
Powered by