[b][size=150]Setup Scripting[/size][/b][br][br][b]Create LM60[/b][br][br]#==========================================================[br]# 60 elements of Icosahedral symmetry: 60 Rotation matrices[br]#==========================================================[br]ζ = angle((1,0,0),(0,0,0),(1+sqrt(5),2,0))[br]SetConditionToShowObject(ζ,false)[br]Mζ = {{cos(ζ),sin(ζ),0},{-sin(ζ),cos(ζ),0},{0,0,1}}[br]Lα = {1,2,3}*72°[br]LA3 = zip(Invert(Mζ)*{{1,0,0},{0,cos(α),-sin(α)},{0,sin(α),cos(α)}}*Mζ,α,Lα)[br]LM3 = {{{1,0,0},{0,1,0},{0,0,1}},{{0,0,1},{1,0,0},{0,1,0}},{{0,1,0},{0,0,1},{1,0,0}}}[br]LM30= Join({LM3, Join(Zip(Join(Zip(LM3*A3, A3,LA3))*M3, M3,LM3))})[br]MrO = {{-1,0,0},{0,-1,0},{0,0,-1}}*Invert(LA3(1))*{{1,0,0},{0,-1,0},{0,0,1}}*LA3(1)[br]LM60= Join({LM30,Reverse(LM30 MrO)})[br][br][b]SetUp Bands[/b][br][br]#========================================================[br]# Rotegrity 3v{3,0} : 270 Bands[br]# https://www.deviantart.com/taffgoch/art/Rotegrity-3v-0-3-625452129[br]# https://groups.google.com/g/geodesichelp/c/RFBZ6uFmsjU/m/QfiMqboLBAAJ[br]#[br]# 5 * 12 (vertices) = 60 Red bands[br]# 5 * 12 (vertices) = 60 Green bands[br]# 6 * 20 (triangles)= 120 Blue bands (60 Blue + 60 Cyan)[br]# 1 * 30 (edges) = 30 Yellow bands[br]#========================================================[br][br]ϕ = (1+sqrt(5))/2[br]Bi = (1,0,ϕ)/sqrt(ϕ+2)[br]Ci = (ϕ,1,0)/sqrt(ϕ+2)[br]C5Axis = Line(O,Ci)[br][br]red = 0.132549689951321[br]green = 0.153966415801835[br]blue = 0.158785990386417[br]yellow = 0.156558417905753[br][br]#========================================================[br]# First create the RGBCY bandpoints[br]# with center Red-pentagon on (0,0,1)[br]#========================================================[br][br]#--------------------------------------------------------[br]# Red Band[br]#--------------------------------------------------------[br][br]angZ= -asin(sqrt((1-cos(red)) / (1-cos(72°))))[br][br]vR1 = Vector(Rotate(Ci,angZ,zAxis))[br]vR2 = Rotate(vR1, -72°, C5Axis)[br]AxisR = Line(O, Vector(vR1 ⊗ vR2))[br]LvR = Sequence(Rotate(vR1, k*red, AxisR), k,0,3)[br]LpR = Zip(Point(O,v), v, LvR)[br][br]#--------------------------------------------------------[br]# Green Band[br]#--------------------------------------------------------[br][br]vG1 = Rotate(Vector(O,LpR(3)),-72°, C5Axis)[br]vG3 = Vector(O,LpR(4))[br]AxisG = Line(O, Vector(vG1 ⊗ vG3))[br]LvG = Sequence(Rotate(vG1, k*green, AxisG), k,0,3)[br]LpG = Zip(Point(O,v), v, LvG)[br][br]#========================================================[br]# Spherical trigonometry : Cosine rules[br]# https://en.wikipedia.org/wiki/Spherical_trigonometry[br]#--------------------------------------------------------[br]# cos(A) = ( cos(a) - cos(b)*cos(c) ) / ( sin(b)*sin(c) )[br]#========================================================[br][br]hg = 2*green[br]hb = 2*blue[br]hB = acos( (cos(hb)-cos(hb)*cos(hg)) / (sin(hb)*sin(hg)) )[br][br]#--------------------------------------------------------[br]# Blue Band[br]#--------------------------------------------------------[br][br]vB1 = Vector(O,LpG(2))[br]vB2 = Rotate(vG3,-hB, Line(O,LpG(2)))[br]AxisB = Line(O, Vector(vB1 ⊗ vB2))[br]LvB = Sequence(Rotate(vB1, k*blue, AxisB), k,0,3)[br]LpB = Zip(Point(O,v), v, LvB)[br][br]#--------------------------------------------------------[br]# Cyan Band (Second blue)[br]#--------------------------------------------------------[br][br]vC1 = Vector(O,LpB(3))[br]vC3 = Vector(O,LpG(4))[br]AxisC = Line(O, Vector(vC1 ⊗ vC3))[br]LvC = Sequence(Rotate(vC1, k*blue, AxisC), k,0,3)[br]LpC = Zip(Point(O,v), v, LvC)[br][br]#--------------------------------------------------------[br]# yellow Band[br]#--------------------------------------------------------[br][br]vY1 = Rotate(Vector(O,LpB(2)),72°, C5Axis)[br]vY2 = Vector(O,LpC(4))[br]AxisY = Line(O, Vector(vY1 ⊗ vY2))[br]LvY = Sequence(Rotate(vY1, k*yellow, AxisY), k,0,3)[br]LpY = Zip(Point(O,v), v, LvY)[br][br]#========================================================[br]# Rotate all Band points to Icosahedron orientation[br]# conform Cubic system[br]#========================================================[br][br]Ymid= Rotate(LpY(1), 1.5yellow, AxisY)[br]angC = Angle(Plane(O,Ci,Bi),Plane(O,Ci,Ymid))[br][br]LR = Rotate(LpR, angC, C5Axis)[br]LG = Rotate(LpG, angC, C5Axis)[br]LB = Rotate(LpB, angC, C5Axis)[br]LC = Rotate(LpC, angC, C5Axis)[br]LY = Rotate(LpY, angC, C5Axis)[br][br]#========================================================[br]# Create sphere[br]#========================================================[br][br]Rarc = CircularArc(O, LR(1), LR(4), Plane(O, Ci, Bi))[br]Garc = CircularArc(O, LG(1), LG(4), Plane(O, Ci, Bi))[br]Barc = CircularArc(O, LB(1), LB(4), Plane(O, Ci, Bi))[br]Carc = CircularArc(O, LC(1), LC(4), Plane(O, Ci, Bi))[br]Yarc = CircularArc(O, LY(1), LY(4), Plane(O, Ci, Bi))[br][br]Rarc60 = Zip(ApplyMatrix(M,Rarc), M,LM60)[br]Garc60 = Zip(ApplyMatrix(M,Garc), M,LM60)[br]Barc60 = Zip(ApplyMatrix(M,Barc), M,LM60)[br]Carc60 = Zip(ApplyMatrix(M,Carc), M,LM60)[br]Yarc60 = Zip(ApplyMatrix(M,Yarc), M,LM60)[br][br]#========================================================[br]# Properties[br]#========================================================[br][br]#--- Color, and Label ---#[br][br]Red = "Red"[br]Green = "Green"[br]Blue = "Blue"[br]Cyan = "Cyan"[br]Yellow= "Yellow"[br][br]SetColor(Rarc60,"Red")[br]SetColor(Garc60,"Green")[br]SetColor(Barc60,"Blue")[br]SetColor(Carc60,"Cyan")[br]SetColor(Yarc60,"Yellow")[br][br]#--- Visibility en Color ---#[br][br]List={"Bi","Ci","C5Axis"}[br]Execute(Zip("SetConditionToShowObject("+obj+",false)", obj,List))[br][br]List={"vR1","vR2","AxisR","LvR","LpR","LR","Rarc","angC"}[br]Execute(Zip("SetConditionToShowObject("+obj+",false)", obj,List))[br]Execute(Zip("SetColor("+obj+","+Red+")", obj,List))[br][br]List={"vG1","vG3","AxisG","LvG","LpG","LG","Garc"}[br]Execute(Zip("SetConditionToShowObject("+obj+",false)", obj,List))[br]Execute(Zip("SetColor("+obj+","+Green+")", obj,List))[br][br]List={"vB1","vB2","AxisB","LvB","LpB","LB","Barc"}[br]Execute(Zip("SetConditionToShowObject("+obj+",false)", obj,List))[br]Execute(Zip("SetColor("+obj+","+Blue+")", obj,List))[br][br]List={"vC1","vC3","AxisC","LvC","LpC","LC","Carc"}[br]Execute(Zip("SetConditionToShowObject("+obj+",false)", obj,List))[br]Execute(Zip("SetColor("+obj+","+Cyan+")", obj,List))[br][br]List={"vY1","vY2","AxisY","LvY","LpY","LY","Yarc","Ymid"}[br]Execute(Zip("SetConditionToShowObject("+obj+",false)", obj,List))[br]Execute(Zip("SetColor("+obj+","+Yellow+")", obj,List))[br][br]List={"Red", "Green", "Blue", "Cyan", "Yellow", "List"}[br]Execute(Zip("Delete("+obj+")", obj,List))[br][br][b]Setup Sphere[br][/b][br]#======================================[br]# SetUp Sphere: LM60[br]#======================================[br]O = (0, 0, 0)[br]sph = Sphere(O,1)[br]cX = Circle(O,1,xAxis)[br]cY = Circle(O,1,yAxis)[br]cZ = Circle(O,1,zAxis)[br][br]Mi = (1,1,1)/sqrt(3)[br]M3Axis= Line(O,Mi)[br]ϕ = (1+sqrt(5))/2[br]Ai = (0,ϕ,1)/sqrt(ϕ+2)[br]Bi = (1,0,ϕ)/sqrt(ϕ+2)[br]Ci = (ϕ,1,0)/sqrt(ϕ+2)[br]A5Axis = Line(O,Ai)[br]B5Axis = Line(O,Bi)[br]C5Axis = Line(O,Ci)[br]a2Axis = Line(O,Midpoint(Bi,Ci))[br]b2Axis = Line(O,Midpoint(Ci,Ai))[br]c2Axis = Line(O,Midpoint(Ai,Bi))[br][br]arc = CircularArc(O,Bi,Ai)[br]icosi = Zip(ApplyMatrix(M, arc), M, LM60)[br][br]#========================================================[br]# Settings[br]#========================================================[br][br]SetActiveView(-1)[br]SetBackgroundColor("#202020")[br]ShowAxes(false)[br]ShowGrid(false)[br]CenterView(O)[br][br]SetActiveView(1)[br]ShowAxes(false)[br]ShowGrid(false)[br]CenterView(O)[br][br]#========================================================[br]# Properties[br]#========================================================[br][br]#--- Visibility ---#[br]List={"O","Ai","Bi","Ci","Mi","arc"}[br]Execute(Zip("SetConditionToShowObject("+obj+",false)", obj,List))[br]onIcosi= Checkbox("Icosaeder",{icosi})[br][br]List={cX,cY,cZ, M3Axis, A5Axis,B5Axis,C5Axis, a2Axis,b2Axis,c2Axis}[br]onSymm = Checkbox("Symmetry",List)[br]SetValue(onSymm,false)[br][br]List={"O","Ci","cZ","C5Axis","icosi"}[br]Execute(Zip("SetVisibleInView("+obj+",1,false)", obj,List))[br][br]#--- Color, Filling and Label ---#[br]SetColor(sph,"White")[br]SetFilling(sph,1)[br][br]Black="Black"[br]List={"O","Mi","M3Axis","arc","icosi"}[br]Execute(Zip("SetColor("+obj+","+Black+")", obj,List))[br]Execute(Zip("ShowLabel("+obj+",false)", obj,List))[br][br]Red="Red"[br]List={"cX","Ai","A5Axis","a2Axis"}[br]Execute(Zip("SetColor("+obj+","+Red+")", obj,List))[br]Execute(Zip("ShowLabel("+obj+",false)", obj,List))[br][br]Green="Green"[br]List={"cY","Bi","B5Axis","b2Axis"}[br]Execute(Zip("SetColor("+obj+","+Green+")", obj,List))[br]Execute(Zip("ShowLabel("+obj+",false)", obj,List))[br][br]Blue="Blue"[br]List={"cZ","Ci","C5Axis","c2Axis"}[br]Execute(Zip("SetColor("+obj+","+Blue+")", obj,List))[br]Execute(Zip("ShowLabel("+obj+",false)", obj,List))[br][br]#--- LineThickness ---#[br]List={"cX","cY","cZ","M3Axis","a2Axis","b2Axis","c2Axis","A5Axis","B5Axis","C5Axis"}[br]Execute(Zip("SetLineThickness("+obj+",3)", obj,List))[br]List={"arc","icosi"}[br]Execute(Zip("SetLineThickness("+obj+",2)", obj,List))[br][br]#--- PointSize ---#[br]List={"O","Mi","Ai","Bi","Ci"}[br]Execute(Zip("SetPointSize("+obj+",2)", obj,List))[br][br]List={"Black","Red","Green","Blue","List"}[br]Execute(Zip("Delete("+obj+")", obj,List))[br][br][b]SetUp Struts[/b][br]#========================================================[br]# LsFree strut-points : list dimension (5,2)[br]# LnFree nexor-points : list dimension (5,4,2)[br]#--------------------------------------------------------[br]# Needed Axes: C5Axis M3Axis a2Axis[br]# Bandpointlists: LR LG LB LC LY[br]#========================================================[br][br]LRs = {LR(1),LR(4)}[br]LGs = {LG(1),LG(4)}[br]LBs = {LB(1),LB(4)}[br]LCs = {LC(1),LC(4)}[br]LYs = {LY(1),LY(4)}[br][br]LRa = Rotate(LRs, 72°, C5Axis)[br]LRb = Reverse(Rotate(LRs,-72°, C5Axis))[br]LRc = Rotate(LGs, 72°, C5Axis)[br]LRd = LGs[br][br]LGa = Reverse(Rotate(LRs,-72°, C5Axis))[br]LGb = Reverse(LBs)[br]LGc = Reverse(LRs)[br]LGd = LCs[br][br]LBa = LGs[br]LBb = Reverse(Rotate(LYs,-72°, C5Axis))[br]LBc = LCs[br]LBd = Reverse(Rotate(LCs,120°, M3Axis))[br][br]LCa = Reverse(LBs)[br]LCb = Rotate(LBs, -120°, M3Axis)[br]LCc = Reverse(LGs)[br]LCd = Reverse(LYs)[br][br]LYa = Rotate(LBs, 72°, C5Axis)[br]LYb = LCs[br]LYc = Reverse(Rotate(LYb,180°, a2Axis))[br]LYd = Reverse(Rotate(LYa,180°, a2Axis))[br][br]LRn = {LRa, LRb, LRc, LRd}[br]LGn = {LGa, LGb, LGc, LGd}[br]LBn = {LBa, LBb, LBc, LBd}[br]LCn = {LCa, LCb, LCc, LCd}[br]LYn = {LYa, LYb, LYc, LYd}[br][br]LsFree = CopyFreeObject({LRs,LGs,LBs,LCs,LYs})[br]LnFree = CopyFreeObject({LRn,LGn,LBn,LCn,LYn})[br][br]List={"LRs", "LGs", "LBs", "LCs","LYs", "List"}[br]Execute(Zip("Delete("+obj+")", obj,List))