# MACRO cut_contour
# this is a macro to cut a path.
# Insert diameter comp in a move to the path start point
# Cuts the path
# Turns off comp in a move away from the contour
#
CUTPATH: Codes= "G44";
ASSIGN: X1= X; Y1= Y;
ASSIGN: Pathendpt
ASSIGN: Cut_compx= Xnormal*Lead_out;
ASSIGN: Cut_compy= Ynormal*Lead_out;
ASSIGN: Pre_posx= Xend+ Cut_compx;
ASSIGN: Pre_posy= Yend+ Cut_compy;
ASSIGN: Length_rem= Length_cut; Time_rem= Machine_time;
ASSIGN: X= Xend+ Xtangent; Y= Yend+ Ytangent;Plot_on= 0;
FEED: 	
ASSIGN: Length_cut= Length_rem; Machine_time= Time_rem;
#ASSIGN: X= Xend; Y= Yend;
ASSIGN: X= X1; Y= Y1;
ASSIGN: Setcoordinates
ASSIGN: X= Pre_posx; Y= Pre_posy; Plot_on= 1;
FEED: 	Codes= "G40M21";
OUTPUT: G45M21
