Author:
Thijs
Topic:
Cylinder
Setup φ = (sqrt(5)-1)/2 O = (0,0,0) A = (φ,φ,φ) B = (0,-1,φ^2) α =-5.1962266529614° r = 0.064020717953368 f = Slider(1,1.2,0.01, 1, 80, false, true, false) SetValue(f,1.1) Af = Rotate(Dilate(A,f,B), α, Line(O,A+B)) Bf = Rotate(Dilate(B,f,A), α, Line(O,A+B)) L3 = Zip(Rotate(Cylinder(Af,Bf,r), k*120°, Line(O,A)), k,0…2) c4 = Rotate(L3(1), 120°, Line(O, B)) tetra = Join({L3, Zip(Rotate(c4, k*120°, Line(O,A)), k,0…2)}) Execute(Zip("obj"+k+"=Rotate(tetra,"+k+"*72°, Line(O,(1,0,φ)))", k,1..5)) obj6 = Sphere(O, Distance(O,Segment(A,B)) - r) Q=UnicodeToLetter(34) List={"Red","Orange","Yellow","Green","Cyan","Sphere"} Execute(Zip("on"+k+"=Checkbox("+Q+txt+Q+",{obj"+k+"})",k,1..6, txt,List)) #------------------------ # Settings #------------------------ SetActiveView(-1) CenterView(O) SetBackgroundColor("Dark Gray") SetSpinSpeed(2) Execute(Zip("SetLineThickness(obj"+k+",1)",k,1..5)) Execute(Zip("SetFilling(obj"+k+",1)",k,1..6)) SetActiveView(1) SetBackgroundColor("Dark Gray") SetColor(f,"White") List={"Red","Orange","Yellow","Green","Cyan","White"} Execute(Zip("SetColor(obj"+k+","+Q+col+Q+")", k,1..6, col,List)) Execute(Zip("SetColor(on"+k+","+Q+col+Q+")", k,1..6, col,List)) SetCoords(f,20,100) Execute(Zip("SetCoords(on"+k+",12,"+k+"*35+90)", k,1..6)) List={"O","A","Af","B","Bf","L3","c4","tetra"} Execute(Zip("SetConditionToShowObject("+obj+",false)",obj,List)) Delete(List)