MelonBP

Platonic solid generators

Oct 18th, 2020
1,202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. # Description
  2. Commands that generate the Platonic solids inside your selection (except for the cube because it's boring). No variables for any.
  3.  
  4. # The commands
  5. - Tetrahedron: //g [block] sqrt(x^2+z^2)<=(1-y)/1.41*cos(pi/3)/cos(2/3*asin(cos(3/2*atan2(z,x))))&&y>=-1/3
  6. - Octahedron: //g [block] abs(x)+abs(y)+abs(z)<=1
  7. - Dodecahedron: //g [block] sqrt(x^2+z^2)<=(1+y/1.619)*cos(pi/5)/cos(2/5*asin(cos(5/2*atan2(z,x))))/0.85&&sqrt(x^2+z^2)<=(1-y/1.619)*cos(pi/5)/cos(2/5*asin(cos(5/2*(atan2(z,x)-pi))))/0.85&&abs(y)<=0.8
  8. - Icosahedron: //g [block] a=abs(y)>0.45?0.618:1;b=abs(y)>0.45?1:5.618;a*sqrt(x^2+z^2)<=(1+y/b)*cos(pi/5)/cos(2/5*asin(cos(5/2*atan2(z,x))))/0.98&&a*sqrt(x^2+z^2)<=(1-y/b)*cos(pi/5)/cos(2/5*asin(cos(5/2*(atan2(z,x)-pi))))/0.98
Advertisement
Add Comment
Please, Sign In to add comment