# MACRO zigzag_surf
# this is a macro to cut a path on a 3d surface.
# it checks the distance between the last point and the start point
# if this distance is less than the pick_dist it will generate a 
# retract move.
# 
#
ASSIGN: Surfstartpt
ASSIGN: Dist_3d= SQR((Xstart-Xlast)^2+(Ystart-Ylast)^2+(Zstart-Zlast)^2);
SELECT: (Dist_3d < Pick_dist)
CASE: 0
MACRO: end_surf         Repeats= (Path>1);
MACRO: rapid_start
CASE: 1
MACRO: rapid_start	Repeats= (Path<2);
MACRO: feed_start	Repeats= (Path>1);
END SELECT:
CUTSURF:
ASSIGN: Surfendpt
ASSIGN: Xlast= Xend; Ylast= Yend; Zlast= Zend;
ASSIGN: Path= Path+1;
MACRO: end_surf		Repeats= (Path>Cpath_count);
