T-pyramid (3D T-square)
by NightElfik
Short link: http://malsys.cz/g/Ay2MOWVT
Loading 3D model
of T-pyramid (3D T-square)
Comments
comments powered by DisqusSource code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | lsystem TPyramid extends Branches { let size = 64; set symbols axiom = F(size) f(-size/2) + f(size/2) + + [ X(size/2) ] f(size) + [ X(size/2) ] f(size) + [ X(size/2) ] f(size) + X(size/2); set iterations = 5; set cameraPosition = {72, 79, 24}; set cameraUpVector = {-0.49, 0.81, -0.33}; set cameraTarget = {8, -14, 6}; interpret F(x) as lsystem Pyramid(x); interpret f as MoveForward; interpret + as Yaw(90); rewrite X(s) with h = s / 2 to F(s) f(-h) + f(h) + + [ X(h) ] f(s) + [ X(h) ] f(s) + X(h); } abstract lsystem Pyramid(size = 20, color = #F3E3B9) extends StdLsystem3D { let h = size / 2; let sq = h * sqrt(3); let a = 90 - rad2deg(asin(sqrt(2/3))); set symbols axiom = [ ^(90) f(h) &(90) +(45) [ <(color) . &(a) f(sq) . ^(a) +(135) f(size) . > ] +(90) [ <(color) . &(a) f(sq) . ^(a) +(135) f(size) . > ] +(90) [ <(color) . &(a) f(sq) . ^(a) +(135) f(size) . > ] +(90) [ <(color) . &(a) f(sq) . ^(a) +(135) f(size) . > ] ]; } process all with ThreeJsRenderer; |
Thumbnail extension
1 2 | process all with ThreeJsRenderer set iterations = 4; |