I would like to create this ‘algorithm’ in grasshopper using hoopSnake I guess…
It will take a rectangle and then divide it either horizontal or vertical, then it will take the newly created ‘rectangles’ and do it again until at a minimum size is reached… I hope somebody can help me to figure out how to do this. I have tried, but without succes.
And this is an example of piece of furniture I build where I manually created the grid… This is what this solution should be used for, to give some context. Don’t mind the ‘gap’ with the lamp on the floor, it would be nice if it could work just from a rectangle, and end up with vertical and horizontal lines.
I matched your input values (white group) as best I could but you removed the ‘0 to 300’ domain for the Random component so I don’t know what domain you are using for that? Or what other changes you may have made to my code? (I don’t read icons very well.)
The big blue area is probably because you need to increase the range/value of the ‘Repeat’ slider?
As to being too small, yes, that’s a problem caused by using area to measure minimum size instead of length of shortest side. I’ll take another look at that.
As always though, when you modify code, you own it.
This version is much better. The ‘minSize’ slider specifies the minimum length of either edge (horizontal or vertical) of the resulting boxes. Please explore all of the parameter inputs (white group)except for the ‘0 to 300’ domain before making any changes to the code.
P.S. I left some tools on the canvas in the previous version, not shown in the image. This is only the iterative division code. div_rectangle_2020Sep13a2.gh (16.5 KB)
A key feature to making this work is the sFace(Shrink Faces) component, a single line of C# code, used twice.
This was exactly what I was searching for… The only thing which I will have to change is that it will export lines instead of rectangles… I can do that with the ‘Typologizer’ plugin. Maybe you have a better solution?
Otherwise you answered my question so nice. It even works with polylines as input instead of rectangles.
I think I got it. The yellow group at first appears to do the trick but those are “dirty polylines” that double back on themselves with overlapping segments. The orange group fixes them by using Discontinuity to get visually accurate end points and recreating each line.
Curve End Points were useless for this task because they were usually somewhere in the middle of the dirty polylines. I tried various ways to find the pair most distant from each other and stumbled on Discontinuity for that job. Not quite sure why it works…?
There are still problems due to material thickness, when two elements are within materialthickness from one and other it will not work in the real world…
If not for the removal of a few edges (3?) here and there, wouldn’t it be easier to use the rectangles from Loop End to build a bunch of boxes and glue them all together? Trim pieces around the outside edges would match their thickness to that of the adjacent boxes. What provides shear strength?