diff --git a/zhedra-min.js b/zhedra-min.js index 94e9516..4e9fea2 100644 --- a/zhedra-min.js +++ b/zhedra-min.js @@ -1 +1 @@ -var Zdog,Zhedra={Tetra:class{constructor(t){this.children="WIP";let o,r=["addTo","color","fill","stroke","colors"],s=Math.cos(Zdog.TAU/6)/2,a=.5+s;this.anchor=new Zdog.Anchor({addTo:t.addTo,translate:t.translate||{x:0,y:0,z:0},rotate:t.rotate||{x:0,y:0,z:0},scale:t.scale||{x:0,y:0,z:0}});let e=this.anchor;o=Zdog.TAU/3,this.anchor1=[new Zdog.Anchor({addTo:e,rotate:{y:-0*o}}),new Zdog.Anchor({addTo:e,rotate:{y:-1*o}}),new Zdog.Anchor({addTo:e,rotate:{y:-2*o}})];let l=this.anchor1;o=-1*Math.acos(1/3)+Zdog.TAU/4,this.anchor2=[new Zdog.Anchor({addTo:l[0],translate:{z:s,y:a/2},rotate:{x:o}}),new Zdog.Anchor({addTo:l[1],translate:{z:s,y:a/2},rotate:{x:o}}),new Zdog.Anchor({addTo:l[2],translate:{z:s,y:a/2},rotate:{x:o}})],l=null;let c=this.anchor2;this.parts=[new Zdog.Polygon({addTo:e,translate:{y:a/2},rotate:{x:-Zdog.TAU/4,z:-Zdog.TAU/2},radius:.5,sides:3,color:t.colors?t.colors[0]:t.color,fill:t.fill,stroke:t.stroke}),new Zdog.Polygon({addTo:c[0],translate:{y:-s},radius:.5,sides:3,color:t.colors?t.colors[1]:t.color,fill:t.fill,stroke:t.stroke}),new Zdog.Polygon({addTo:c[1],translate:{y:-s},radius:.5,sides:3,color:t.colors?t.colors[2]:t.color,fill:t.fill,stroke:t.stroke}),new Zdog.Polygon({addTo:c[2],translate:{y:-s},radius:.5,sides:3,color:t.colors?t.colors[3]:t.color,fill:t.fill,stroke:t.stroke})],c=null;let i=t.translate||{};this._translate=this.anchor.translate={x:i.x?i.x:0,y:i.y?i.y:0,z:i.z?i.z:0},i=t.rotate||{},this._rotate=this.anchor.rotate={x:i.x?i.x:0,y:i.y?i.y:0,z:i.z?i.z:0},i=t.scale,this._scale=this.anchor.scale="object"==typeof i?{x:i.x?i.x:0,y:i.y?i.y:0,z:i.z?i.z:0}:i;for(let o=0;o