@inno can I please ask why you used the flip matrix there after you constructed the rectangle grids? I can’t seem to be able to tell what it’s doing there
hi @laurent_delrieu I’ve seen quite a few great answers from you while searching for some related “packing” method.
@inno has summarised extremely well and shared with us all his research/discovery! It’s worth looking into when you have some time. The method he described worked well from the look of it too.
I guess I’m now leaning towards learning how to achieve something like the golden cinema as mentioned above in gh…
Would be happy for you to share your thoughts when you are free
Even if you don’t have time, can you give us your precious opinion on how you would tackle the matter?
Iterative? Random attempts + check? … something else?
Replicating 1:1 the same idea of that museum is sort of sad… I’m purposely not trying to force it to be same-looking…
What I’m thinking is an “algorithm” like this (which will be probably fully inside a c# script):
Main input are:
- a list of curves, each curve is a row of bricks.
- a black-white colored mesh that exist near the the list of curves, it defines the likeliness the script will attempt to skip some space before putting a brick (so it’s a “void”)
- a list of numbers defining the possible brick lengths
- an interval, defining the shortest and largest void
Main output will be sub-curves, each sub-curve will be a brick.
For each curve (or brick row/layer), iteratively “eat” a chunk of the curve to create bricks or void. Each “byte” length and type is dependant on some random and the local color of the mesh, each byte have to “avoid” points of previous row/layer. Each brick start/end (maybe mortar also) will be marked with a point, and each void will filled with points.
I’m really excited to see how you work it out! Sounds way beyond what I can do in gh, let alone C#…
Meanwhile if you could for the same of it - “force it to be” similar-looking to the golden cinema case that will be appreciated! @maje90
the output list C of a Grid component has a different branch for each column-array of cells (along the Y axis of the plane they are created on)
because the pattern was repeating horizontally, I wanted them to be organized by rows instead of columns, and flipping the List does exactly that
Thanks for your explanation! That makes sense.
I figured out most of your script except for the part where you had 70 (input for numbers of rows) wired to a random, and there are some other repeat by 100 (columns) which is splited into 3 groups - I already understand the 3 ranges to move to avoid having 2 voids on top of each other so what’s the purpose of these “repeat, random, list item and mass addtion”, and we can’t we just directly input the 3 ranges as variable to move the starting point of each cell?
Sorry I already shut down my laptop and typing on phone… I can add in the screenshot tomorrow if this is confusing!
Check this using Random many times
bricks.gh (19.6 KB)
the whole (A) exists to create a list of 0s, 1s, 2s with the amount of 0s, 1s, 2s I want
as it is depicted it’s adding 70x number 2, 18x number 0, 12x number 1
this way I can decide ahead how many times the next pattern will fall on case0, case1, case2 (I wanted case2 to be 70%, case0 to be 3/5 of the remaining, and case1 to be whatever else remaining [2/5] )
the thing is that this list is merged, so numbers are not shuffled but just 70x 2s, then 18x 0s and 12x 1s: Jitter (B) shuffles the list so I have a somehow random order of 0, 1, 2 (of course 2s are still 70% of the total so…)
(C) generates one value in the range [0,1] per row
(D) assigns a numeric range to the numbers shuffled in (B)
(E) applies the random [0,1] number from (C) to the right range in (D)
in such a way when I get for instance 0.35 of caseX, it will calculate the actual amount of shift that correpsonds to the pattern being shifted 35% of the total available shifting length of caseX
(F) calculates the partial shifts -stacked over each other- that are then applied to the various rows in the original Grid
perhaps this plugin could be useful ?
thanks @seghierkhaled ! I’ve been busy today so will take a look at this and get back to you - still a tiny bit of voids on top of each other but yes it’s very close to the result!! Thanks again for sharing
holy cow @inno - hats off to you SIR!
I’ve been so busy at work today - I will take a proper look later tonight but I think this makes a lot more sense already! Also I learnt what “mass addition” does too - just - it helps with the issue I had previously where I couldn’t figure out how to add the next one on top of the previous one (again maybe I’m wrong but this is more or less what I understood from a friend).
What’s “trash” in someone’s eys is “gold” for people who needs it like me!
it helps with the issue I had previously where I couldn’t figure out how to add the next one on top of the previous one
and this “0” that is added to the Partial Result output of the Mass Addition that goes to the X-vector is there to add a zero-length vector as first item, in such a way the very first pattern is shifted by 0 units, and all the next ones are shifted by the partial-sum of all the previous ones
that said, it would be better to add at least that modulus component that trims the length of the shifts in such a way you don’t get a final pattern that moves in a diagonal fashion around the screen…
still, very poorly implemented