--------------------------------------------------------------------------------
------------- CAJEADO CIRCULAR ----------------------------------------
--------------------------------------------------------------------------------
{--
La siguiente es una funcion auxiliar para hacer cortes circulares de
forma iterativa
--}
FAUX_DrawCylinder :: (Float, Float, Float, Float, Float, Float, Float) -> IO()
FAUX_DrawCylinder (Endx, i, j, k, Radius, dx, Control) = do Draw
where
Draw = if (Control <= Radius)
then do writefile([Spin("CCW"), X Endx, I i, J j, K k, F 120.0])
writefile([G "01", X (Endx+.dx), F 120.0])
FAUX_DrawCylinder(Endx+.dx, i, j, k, Radius, dx, Control+.dx)
else done
{-- La siguiente funcion es propiamente el cajeado circular --}
DrawCylinder :: (Float, Float, Float, Float, Float, Float) -> IO()
DrawCylinder (i, j, k, Height, Radius, dx) = do InitPOS
Perforate
Draw
Restore
where
InitPOS = writefile(GotoXYZ(i, j, k))
Perforate = do writefile(DrawZ(Height+.k, 40.0))
writefile([G "01", X (i+.dx), F 120.0])
Draw = FAUX_DrawCylinder (i+.dx, i, j, k, Radius, dx, dx)
Restore = writefile(GotoXYZ(i, j, k))
|