A Simple Button Macro
If your animations include a lot of science fiction work, or other instances where a push button is part of the scene, this short macro will do a bit of the work for you. #macro RoundButton(pB, pT, rB, rE, dD, fM) #local hB = vlength(pT - pB); #local vY = vnormalize(pT - pB); #local vX = vnormalize(vcross(vY, <vY.y,vY.z,-vY.x>)); #local vZ = vnormalize(vcross(vX, vY)); #if (fM) merge #else union #end { #if (dD < 0) #local rD = (2 * rB * rE - rB * rB - rE * rE - dD * dD) / 2 / dD - rE; difference { lathe { 5, <0,0>, <rB,0>, <rB, hB - rE>, <rB - rE, hB - rE>, <0, hB + rD + dD> } sphere { y * (hB + rD + dD), rD } bounded_by { cylinder { 0, y * hB, rB } } } #elseif (dD > 0) #local hB = hB - dD; #local rD = (rB * rB + rE * rE + dD * dD - 2 * rB * rE) / 2 / dD + rE; intersection { lathe { 6, <0,0>, <rB,0>, <rB, hB - rE>, <rB - rE, hB - rE>, <...