Random Strip Widths
Planks are in 3 different widths which has to be randomly divided over the length of the wall: 145 mm - 50%, 95 mm - 30%, 46 mm - 20% and the gap between planks is 10 mm.
1
//Facade dimensions
2
l = 2;
3
h = 2;
4
5
//Panel widths
6
pw1 = 0.145;
7
pw2 = 0.095;
8
pw3 = 0.046;
9
spc = 0.010;
10
11
pw11 = pw1+spc;
12
pw21 = pw2+spc;
13
pw31 = pw3+spc;
14
15
//Panel count percentage
16
pwn1 = Math.Floor((0.5*l)/pw11);
17
pwn2 = Math.Floor((0.3*l)/pw21);
18
pwn3 = Math.Floor((0.2*l)/pw31);
19
20
pw12 = List.Cycle(pw11,pwn1);
21
pw22 = List.Cycle(pw21,pwn2);
22
pw32 = List.Cycle(pw31,pwn3);
23
24
a = List.Shuffle(Flatten({pw12,pw22,pw32}));
25
b = Math.Sum(List.TakeItems(a,1..List.Count(a))<1>);
26
c = b - a;
27
d = b - spc;
28
29
bp = Point.Origin();
30
dr = Vector.XAxis();
31
32
st = bp.Translate(dr,c);
33
en = bp.Translate(dr,d);
34
ln = Line.ByStartPointEndPoint(st,en);
35
sr = ln.Extrude(Vector.ZAxis(),h);
Copied!
Copy link