// Arrows // Last edited on 2012-09-29 06:16:15 by stolfilocal #macro arrow(va,ra) // An arrow from origin. // {va} Coords of tip of arrow. // {ra} Radius of shaft. #local da = vlength(va); // Total length of arrow. #local dh = 16.0*ra; // Length of arrowhead. #if (da > 0.001*ra) #local vs = va*(da - 0.95*dh)/da; // Coords of end of shaft. #local vh = va*(da - dh)/da; // Coords of base of head. #local rh = 4*ra; // Radius of base of head. difference{ union{ cylinder{ <0,0,0>, vs, ra } cone{ vh,rh, va,0 } } plane{ va,0 } } #end #end