// Copyright (C) 2001 Leena L�hteenm�ki, Finland // Copyright (C) 2015 PatternMaker Software // 2011/11/04 // 2017-07-17 Added 4 blank lines at end of file selection current_selection; object current_object, group_obj[100]; point current_point; double result; double index, done, metric, sv; object marker_array[30]; double marker_count, loop; double ky,ry,vy,yly,aly,rkkv,rk,vk,sp,sl,op; double ylk,alk,kay,ray,hp; double eml, tml, sml, smlyly,smlaly; double ktk,ktl,ptl,ptp,ptl,pts,rl,pk; double okt,oke; double ktpe,ktpt,ktp; double nv,pit,nv,t_nv[5]; double ease, f_ry[5],f_ky[5],f_vy[5],f_yly[5],f_aly[5],f_rkkv[5],f_sl[5]; double f_op[5],f_vk[5],f_rk[5],f_rl[5],f_sp[5],f_ktk[5]; double f_kay[5],f_ray[5],f_hp[5]; double nvp, nv, f_nv[2]; double ptke, ptkt; double x[300], y[300]; double ang,vang,vdistance,rangle; double lapel; double sleeve,t_sleeve[2]; double language; double read; double ang; main() { language=get_language(); if ( language != 0 ) { language = 0; } if ( language == 0 ) { check_reg(0, "Leena","G1macros", "This macro needs to be properly installed before running it."); } pit=30; nvp=0; //Start Options while (!done) { if (index==0) { Popup1(); } if (index==1) { Popup2(); } if (index==2) { Popup3(); } if (index==3) { Popup4(); } if (index==4) { Popup5(); } } //End Options ry=85; ky=35.75; vy=72; yly=85; aly=91; sp=41.5; op=13.2; sl=36; kay=30; ray=16; hp=59.5; if (is_function("unit_mode")==1) { metric = unit_mode(); if (!metric) { ky=ky/2.54; ry=ry/2.54; vy=vy/2.54; yly=yly/2.54; aly=aly/2.54; rkkv=rkkv/2.54; vk=vk/2.54; sp=sp/2.54; sl=sl/2.54; op=op/2.54; ylk=ylk/2.54; alk=alk/2.54; rk=rk/2.54; kay=kay/2.54; ray=ray/2.54; hp=hp/2.54; pit=pit/2.54; } } else { if (language == 0) { metric=2*pop_up("UNITS","Inches","Centimeters"); } if (metric<1) { ky=ky/2.54; ry=ry/2.54; vy=vy/2.54; yly=yly/2.54; aly=aly/2.54; rkkv=rkkv/2.54; vk=vk/2.54; sp=sp/2.54; sl=sl/2.54; op=op/2.54; ylk=ylk/2.54; alk=alk/2.54; rk=rk/2.54; kay=kay/2.54; ray=ray/2.54; hp=hp/2.54; pit=pit/2.54; } } if(metric==0) { sv=0.39; } read = 0; if (is_function("measure_table")==1) { if (measure_table("Leena_default_juniors")==1) { read = 1; } } if (read==0) { if (is_function("start_picture_input")) { if (language == 0) { start_picture_input("JUNIORS' JACKET"); } if (language == 0) { add_picture_input("Neck circumference",ky, "w_meas_neckcirc"); } if (language == 0) { add_picture_input("Bust circumference", ry, "w_meas_bustcirc"); } if (language == 0) { add_picture_input("Waist circumference", vy, "w_meas_waistcirc"); } if (language == 0) { add_picture_input("Abdomen circumference",yly, "w_meas_abdmcirc"); } if (language == 0) { add_picture_input("Hip circumference",aly, "w_meas_hipcirc"); } if (language == 0) { add_picture_input("Back length",sp, "w_meas_bklength"); } if (language == 0) { add_picture_input("Back width",sl, "w_meas_bkwidth"); } if (language == 0) { add_picture_input("Shoulder length",op, "w_meas_shldr"); } if (language == 0) { add_picture_input("Biceps circumference",kay, "w_meas_biceps"); } if (language == 0) { add_picture_input("Wrist circumference",ray, "w_meas_wrist"); } if (language == 0) { add_picture_input("Overarm length",hp, "w_meas_overarm"); } if (language == 0) { add_picture_input("Length from waist",pit, "w_meas_jacket_length"); } if (language == 0) { add_picture_input("Seam Allowance", sv, "meas_seamallow"); } run_picture_input(); } else { if (language == 0) { dialog_box( "JUNIORS' JACKET, 1 of 2", "Neck circumference.",ky, "Bust circumference", ry, "Waist circumference", vy, "Abdomen circumference",yly, "Hip circumference",aly, "Back length",sp, "Back width",sl, "Shoulder length",op, "Biceps circumference",kay, "Wrist circumference",ray); } if (language == 0) { dialog_box( "JUNIORS' JACKET, 2 of 2", "Overarm length",hp, "Length from waist",pit, "Seam Allowance", sv); } } } else { if (is_function("start_picture_input")) { if (language == 0) { start_picture_input("CUSTOM MEASUREMENTS"); } if (language == 0) { add_picture_input("Length from waist",pit, "w_meas_jacket_length"); } if (language == 0) { add_picture_input("Seam Allowance", sv, "meas_seamallow"); } run_picture_input(); } else { if (language == 0) { dialog_box( "CUSTOM MEASUREMENTS", "Length from waist",pit, "Seam Allowance", sv); } } } if (is_function("unit_mode")==1) { metric = unit_mode(); if (!metric) { ky=ky*2.54; ry=ry*2.54; vy=vy*2.54; yly=yly*2.54; aly=aly*2.54; rkkv=rkkv*2.54; vk=vk*2.54; sp=sp*2.54; sl=sl*2.54; op=op*2.54; ylk=ylk*2.54; alk=alk*2.54; rk=rk*2.54; kay=kay*2.54; ray=ray*2.54; hp=hp*2.54; pit=pit*2.54; } } else { if (metric<1) { ky=ky*2.54; ry=ry*2.54; vy=vy*2.54; yly=yly*2.54; aly=aly*2.54; rkkv=rkkv*2.54; vk=vk*2.54; sp=sp*2.54; sl=sl*2.54; op=op*2.54; ylk=ylk*2.54; alk=alk*2.54; rk=rk*2.54; kay=kay*2.54; ray=ray*2.54; hp=hp*2.54; pit=pit*2.54; } } if(metric==2) { sv=sv/2.54; } oke=2; okt=1.5; if (ry < 73) { rl=1.5; } else { if (ry < 76) { rl=1.75; } else { if (ry < 79) { rl=2; } else { if (ry < 82) { rl=2.25; } else { if (ry < 85) { rl=2.5; } else { if (ry < 85) { rl=2.75; } else { if (ry < 88) { rl=3; } } } } } } } if (ry < 73) { ray=14; } else { if (ry < 76) { ray=14.5; } else { if (ry < 79) { ray=15; } else { if (ry < 82) { ray=15.5; } else { if (ry < 85) { ray=16; } else { if (ry < 85) { ray=16.5; } else { if (ry < 88) { ray=17; } } } } } } } if (ry < 82) { ptke=2.75; } else { ptke=3; } f_ry[0]=ry+12; f_ky[0]=ky; f_vy[0]=vy+10; f_yly[0]=yly+8+2; f_aly[0]=aly+8; f_rkkv[0]=rkkv+3; f_sl[0]=sl+2.8; f_op[0]=op+1; f_vk[0]=vk; f_rk[0]=rk; f_rl[0]=rl+0.2; f_sp[0]=sp; f_ktk[0]=ktk+3; f_kay[0]=kay+9; f_ray[0]=ray+9; f_hp[0]=hp+1; f_ry[1]=ry+14; f_ky[1]=ky; f_vy[1]=vy+12; f_yly[1]=yly+10+2; f_aly[1]=aly+10; f_rkkv[1]=rkkv+4; f_sl[1]=sl+3.4; f_op[1]=op+1; f_vk[1]=vk+0.5; f_rk[1]=rk+0.5; f_rl[1]=rl+0.3; f_sp[1]=sp+0.5; f_ktk[1]=ktk+3; f_kay[1]=kay+10; f_ray[1]=ray+10; f_hp[1]=hp+1; f_ry[2]=ry+16; f_ky[2]=ky; f_vy[2]=vy+14; f_yly[2]=yly+12+2; f_aly[2]=aly+12; f_rkkv[2]=rkkv+5; f_sl[2]=sl+4; f_op[2]=op+1+0.2; f_vk[2]=vk+0.5; f_rk[2]=rk+0.5; f_rl[2]=rl+0.4; f_sp[2]=sp+0.5; f_ktk[2]=ktk+4; f_kay[2]=kay+12; f_ray[2]=ray+12; f_hp[2]=hp+1; ry=f_ry[ease]; ky=f_ky[ease]; vy=f_vy[ease]; yly=f_yly[ease]; aly=f_aly[ease]; rkkv=f_rkkv[ease]; sl=f_sl[ease]; op=f_op[ease]; vk=f_vk[ease]; rk=f_rk[ease]; rl=f_rl[ease]; sp=f_sp[ease]; ktk=f_ktk[ease]; kay=f_kay[ease]; ray=f_ray[ease]; hp=f_hp[ease]; f_nv[0]=2; f_nv[1]=8; nv=f_nv[nvp]; vy=vy+3; aly=aly+2; pts=ky/5; ptl=ky/5-0.5; eml=(ry/2-vy/2)/4; sml=(ry/2-vy/2)/2; smlyly=ry/2-yly/2; smlaly=ry/2-aly/2; tml=(ry/2-vy/2)/4; rkkv=ry/5; ktl=ry/8-0.5; ktk=ry/4-2; alk=ktk-2; ylk=alk/2; rk=ktk+ptke+pts+1; vk=sp+ptke+pts+1; oke=oke-0.5; okt=okt-1; op=op+1; x[0]=0; y[0]=0; coord(0,1,0,0); coord(1,2,-ry/2,0); coord(2,3,0,-ktk); coord(2,4,0,-sp); coord(4,5,0,-ylk); coord(4,6,0,-alk); coord(1,7,-sl/2,0); coord(7,8,-ktl,0); coord(7,9,0,-ktk); coord(9,10,-ktl,0); coord(9,11,-ktl/2,0); coord(9,12,sl/2,0); coord(1,13,0,-sp); coord(13,14,0,-ylk); coord(13,15,0,-alk); coord(13,16,-sl/2-ktl/2,0); coord(14,17,-sl/2-ktl/2,0); coord(15,18,-sl/2-ktl/2,0); coord(3,19,rkkv/2,0); coord(4,20,rkkv/2,0); coord(1,21,0,.5); coord(1,22,-ptl,2.5); coord(22,122,0,-2.5); coord(2,23,ptl,0); coord(1,24,0,-okt); coord(24,124,-100,0); coord(1,25,0,-oke); coord(25,125,-100,0); coord(22,26,-sqrt((op+2)*(op+2)-(okt+2.5)*(okt+2.5)),-(okt+2.5)); coord(23,123,0,100); cont(26,22,27,-4); coord(1,28,-rkkv/2,-7); cont(28,27,127,.6); cont(26,22,29,-6); coord(127,129,0,0); ang=angle(x[28],y[28],x[27],y[27])-angle(x[28],y[28],x[29],y[29]); rotate(129,28,-ang); coord(20,30,0,vk-rk); init_xarc_array(); ptp=arclength(21,122,22); coord(30,31,-rkkv/2+ptl,sqrt((rk-ptp)*(rk-ptp)-(rkkv/2-ptl)*(rkkv/2-ptl))); coord(31,32,0,0); ang=angle(x[30],y[30],x[31],y[31])-angle(x[30],y[30],x[31]+rl,y[31]); rotate(32,30,-ang); x[223]=x[32]; y[223]=y[25]; oke=dist(32,223); coord(32,33,sqrt(op*op-oke*oke),-oke); cont(33,31,131,-4); cont(33,32,132,-4); coord(10,34,0,ktk/4); coord(9,35,0,ktk/4); coord(10,36,0,ktk/2); coord(9,37,0,2*ktk/4); coord(31,102,-ptl,-pts); coord(6,38,rkkv/2,0); coord(38,39,0,(alk-ylk)/2); coord(20,40,-eml/2,0); coord(20,41,eml/2,0); coord(15,42,-rkkv/2,0); coord(42,43,0,(alk-ylk)/2); coord(13,44,-rkkv/2-tml/2,0); coord(12,45,-rkkv/2,-2); coord(44,46,tml,0); coord(18,47,smlaly/2,0); coord(17,48,smlyly/2,0); coord(16,49,sml/2,0); coord(16,50,-sml/2,0); coord(17,51,-smlyly/2,0); coord(18,52,-smlaly/2,0); x[23]=x[23]-1; y[23]=y[102]-3; if (nvp==0) { x[102]=x[102]-nv-2; } else { x[102]=x[102]-nv+2; } y[102]=y[102]-5; if(lapel==0) { coord(4,104,-nv,0); } if(lapel==1) { coord(4,104,-nv,dist(3,4)/2); } if(lapel==2) { coord(3,104,-nv,0); } cont(23,102,202,-4); if(lapel==2) { coord(104,204,-3,10); } else { coord(104,204,-5,10); } cont(33,31,131,-5); cont(33,32,132,-5); cont(131,30,131,-dist(30,132)); y[21]=y[21]-1; coord(122,122,-1,-1); x[22]=x[22]-1; cont(26,22,27,-5); cont(28,27,127,.6); cont(26,22,29,-7); coord(127,129,0,0); ang=angle(x[28],y[28],x[27],y[27])-angle(x[28],y[28],x[29],y[29]); rotate(129,28,-ang); x[36]=x[36]+1; x[37]=x[37]-1; group_obj[0] = newobject("poly"); addpoint((x[104])/2.54, (y[104])/2.54, "line"); coord(31,231,-2,0); cont(104,231,232,-20); addpoint((x[232])/2.54, (y[232])/2.54, "line"); coord(21,121,0,-5); coord(122,222,0,-5); cont(26,22,227,-5); x[222]=x[227]; group_obj[1] = newobj_dot(); addpoint((x[21]+17)/2.54, (y[21])/2.54, "line"); addpoint((x[121]+17)/2.54, (y[121])/2.54, "xarc_start"); addpoint((x[222]+17)/2.54, (y[222])/2.54, "xarc_corner"); addpoint((x[127]+17)/2.54, (y[127])/2.54, "line"); addpoint((x[22]+17)/2.54, (y[22])/2.54, "xarc_start"); addpoint((x[122]+17)/2.54, (y[122])/2.54, "xarc_corner"); coord(3,93,6,0); cont(93,131,193,-5); coord(4,94,6,0); cont(13,193,194,-5); coord(5,95,6,0); coord(6,96,6,0); group_obj[2] = newobj_dot(); addpoint((x[131])/2.54, (y[131])/2.54, "xarc_start"); addpoint((x[193])/2.54, (y[193])/2.54, "xarc_corner"); cont(93,193,194,-5); addpoint((x[194])/2.54, (y[194])/2.54, "xarc_start"); addpoint((x[93])/2.54, (y[93])/2.54, "xarc_corner"); addpoint((x[94])/2.54, (y[94])/2.54, "line"); addpoint((x[95])/2.54, (y[95])/2.54, "line"); addpoint((x[96])/2.54, (y[96])/2.54, "line"); addpoint((x[96])/2.54, (y[96]-(pit-alk))/2.54, "line"); addpoint((x[6]-nv)/2.54, (y[6]-(pit-alk))/2.54, "line"); addpoint((x[6]-nv)/2.54, (y[6])/2.54, "line"); addpoint((x[5]-nv)/2.54, (y[5])/2.54, "line"); addpoint((x[4]-nv)/2.54, (y[4])/2.54, "line"); addpoint((x[104])/2.54, (y[104])/2.54, "xarc_start"); addpoint((x[204])/2.54, (y[204])/2.54, "xarc_corner"); addpoint((x[102])/2.54, (y[102])/2.54, "line"); addpoint((x[202])/2.54, (y[202])/2.54, "xarc_start"); addpoint((x[23])/2.54, (y[23])/2.54, "xarc_corner"); addpoint((x[31])/2.54, (y[31])/2.54, "line"); group_obj[3] = newobject("poly"); addpoint((x[6])/2.54, (y[104])/2.54, "line"); addpoint((x[6])/2.54, (y[6]-(pit-alk))/2.54, "open"); if (nv==2) { if(lapel==0) { group_obj[4] = newobj_dot(); current_point=addpoint((x[2])/2.54, (y[104])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2])/2.54, (y[5])/2.54, "line"); notch_type(current_point,"BTN",0); } if(lapel==1) { group_obj[5] = newobj_dot(); current_point=addpoint((x[2])/2.54, (y[104])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2])/2.54, (y[4])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2])/2.54, (y[4]-dist(104,4))/2.54, "line"); notch_type(current_point,"BTN",0); } if(lapel==2) { group_obj[6] = newobj_dot(); current_point=addpoint((x[2])/2.54, (y[104])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2])/2.54, (y[104]-dist(104,5)/3)/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2])/2.54, (y[104]-2*dist(104,5)/3)/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2])/2.54, (y[104]-3*dist(104,5)/3)/2.54, "line"); notch_type(current_point,"BTN",0); } } else { if(lapel==0) { group_obj[7] = newobj_dot(); current_point=addpoint((x[2]-nv/2)/2.54, (y[104])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]-nv/2)/2.54, (y[5])/2.54, "line"); notch_type(current_point,"BTN",0); group_obj[8] = newobj_dot(); current_point=addpoint((x[2]+nv/2)/2.54, (y[104])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]+nv/2)/2.54, (y[5])/2.54, "line"); notch_type(current_point,"BTN",0); } if(lapel==1) { group_obj[9] = newobj_dot(); current_point=addpoint((x[2]-nv/2)/2.54, (y[104])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]-nv/2)/2.54, (y[4])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]-nv/2)/2.54, (y[4]-dist(104,4))/2.54, "line"); notch_type(current_point,"BTN",0); group_obj[10] = newobj_dot(); current_point=addpoint((x[2]+nv/2)/2.54, (y[104])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]+nv/2)/2.54, (y[4])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]+nv/2)/2.54, (y[4]-dist(104,4))/2.54, "line"); notch_type(current_point,"BTN",0); } if(lapel==2) { group_obj[11] = newobj_dot(); current_point=addpoint((x[2]-nv/2)/2.54, (y[104])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]-nv/2)/2.54, (y[104]-dist(104,5)/3)/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]-nv/2)/2.54, (y[104]-2*dist(104,5)/3)/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]-nv/2)/2.54, (y[104]-3*dist(104,5)/3)/2.54, "line"); notch_type(current_point,"BTN",0); group_obj[12] = newobj_dot(); current_point=addpoint((x[2]+nv/2)/2.54, (y[104])/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]+nv/2)/2.54, (y[104]-dist(104,5)/3)/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]+nv/2)/2.54, (y[104]-2*dist(104,5)/3)/2.54, "line"); notch_type(current_point,"BTN",0); current_point=addpoint((x[2]+nv/2)/2.54, (y[104]-3*dist(104,5)/3)/2.54, "line"); notch_type(current_point,"BTN",0); } } group_obj[13] = newobject("poly"); addpoint((x[131])/2.54, (y[131])/2.54, "line"); addpoint((x[31])/2.54, (y[31])/2.54, "xarc_start"); addpoint((x[23])/2.54, (y[23])/2.54, "xarc_corner"); current_point= addpoint((x[202])/2.54, (y[202])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[102])/2.54, (y[102])/2.54, "xarc_start"); addpoint((x[204])/2.54, (y[204])/2.54, "xarc_corner"); addpoint((x[104])/2.54, (y[104])/2.54, "line"); current_point= addpoint((x[4]-nv)/2.54, (y[4])/2.54, "line"); notch_type(current_point,"NOTCH",1); current_point= addpoint((x[5]-nv)/2.54, (y[5])/2.54, "line"); notch_type(current_point,"NOTCH",1); current_point= addpoint((x[6]-nv)/2.54, (y[6])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[6]-nv)/2.54, (y[6]-pit+alk)/2.54, "line"); addpoint((x[38])/2.54, (y[38]-pit+alk)/2.54, "line"); current_point= addpoint((x[38])/2.54, (y[38])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[39])/2.54, (y[39])/2.54, "line"); current_point= addpoint((x[40])/2.54, (y[40])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[30])/2.54, (y[30])/2.54, "line"); group_obj[14] = newobject("poly"); addpoint((x[52]+4)/2.54, (y[52]-pit+alk)/2.54, "xarc_start"); cont(51,52,152,-3); current_point= addpoint((x[52]+4)/2.54, (y[52])/2.54, "xarc_corner"); notch_type(current_point,"NOTCH",1); addpoint((x[152]+4)/2.54, (y[152])/2.54, "xarc_start"); addpoint((x[51]+4)/2.54, (y[51])/2.54, "xarc_corner"); cont(51,50,151,-3); current_point= addpoint((x[151]+4)/2.54, (y[151])/2.54, "xarc_start"); notch_type(current_point,"NOTCH",1); addpoint((x[50]+4)/2.54, (y[50])/2.54, "xarc_corner"); cont(11,50,111,-3); current_point= addpoint((x[111]+4)/2.54, (y[111])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[11]+4)/2.54, (y[11])/2.54, "xarc_start"); addpoint((x[10]+4)/2.54, (y[10])/2.54, "xarc_corner"); addpoint((x[34]+4)/2.54, (y[34])/2.54, "xarc_start"); addpoint((x[36]+4)/2.54, (y[36])/2.54, "xarc_corner"); addpoint((x[33]+4)/2.54, (y[33])/2.54, "line"); addpoint((x[132]+4)/2.54, (y[132])/2.54, "line"); cont(132,30,130,-3); addpoint((x[130]+4)/2.54, (y[130])/2.54, "xarc_start"); cont(41,30,230,-3); addpoint((x[30]+4)/2.54, (y[30])/2.54, "xarc_corner"); addpoint((x[230]+4)/2.54, (y[230])/2.54, "line"); current_point= addpoint((x[41]+4)/2.54, (y[41])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[39]+4)/2.54, (y[39])/2.54, "line"); current_point= addpoint((x[38]+4)/2.54, (y[38])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[38]+4)/2.54, (y[38]-pit+alk)/2.54, "line"); group_obj[15] = newobject("poly"); addpoint((x[21]+17)/2.54, (y[21])/2.54, "xarc_start"); addpoint((x[122]+17)/2.54, (y[122])/2.54, "xarc_corner"); addpoint((x[22]+17)/2.54, (y[22])/2.54, "line"); addpoint((x[127]+17)/2.54, (y[127])/2.54, "xarc_start"); addpoint((x[28]+17)/2.54, (y[28])/2.54, "xarc_corner"); addpoint((x[45]+17)/2.54, (y[45])/2.54, "line"); current_point= addpoint((x[46]+17)/2.54, (y[46])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[43]+17)/2.54, (y[43])/2.54, "line"); current_point= addpoint((x[42]+17)/2.54, (y[42])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[42]+17)/2.54, (y[42]-pit+alk)/2.54, "line"); current_point= addpoint((x[15]-1+17)/2.54, (y[15]-pit+alk)/2.54, "line"); notch_type(current_point,"NOTCH",1); current_point= addpoint((x[15]-1+17)/2.54, (y[15])/2.54, "line"); notch_type(current_point,"NOTCH",1); current_point= addpoint((x[14]-1+17)/2.54, (y[14])/2.54, "line"); notch_type(current_point,"NOTCH",1); current_point= addpoint((x[13]-1.5+17)/2.54, (y[13])/2.54, "line"); notch_type(current_point,"NOTCH",1); addpoint((x[12]+17)/2.54, (y[12]+dist(21,12)/2)/2.54, "line"); group_obj[16] = newobject("poly"); addpoint((x[42]+13)/2.54, (y[42]-pit+alk)/2.54, "line"); addpoint((x[47]+13)/2.54, (y[47]-pit+alk)/2.54, "xarc_start"); current_point= addpoint((x[47]+13)/2.54, (y[47])/2.54, "xarc_corner"); notch_type(current_point,"NOTCH",0); cont(48,47,147,-3); addpoint((x[147]+13)/2.54, (y[147])/2.54, "xarc_start"); addpoint((x[48]+13)/2.54, (y[48])/2.54, "xarc_corner"); cont(48,49,148,-3); current_point= addpoint((x[148]+13)/2.54, (y[148])/2.54, "xarc_start"); notch_type(current_point,"NOTCH",0); addpoint((x[49]+13)/2.54, (y[49])/2.54, "xarc_corner"); cont(11,49,149,-3); current_point= addpoint((x[149]+13)/2.54, (y[149])/2.54, "line"); notch_type(current_point,"NOTCH",0); addpoint((x[11]+13)/2.54, (y[11])/2.54, "xarc_start"); addpoint((x[9]+13)/2.54, (y[9])/2.54, "xarc_corner"); addpoint((x[35]+13)/2.54, (y[35])/2.54, "xarc_start"); addpoint((x[37]+13)/2.54, (y[37])/2.54, "xarc_corner"); addpoint((x[26]+13)/2.54, (y[26])/2.54, "line"); addpoint((x[129]+13)/2.54, (y[129])/2.54, "xarc_start"); addpoint((x[28]+13)/2.54, (y[28])/2.54, "xarc_corner"); addpoint((x[45]+13)/2.54, (y[45])/2.54, "line"); current_point= addpoint((x[44]+13)/2.54, (y[44])/2.54, "line"); notch_type(current_point,"NOTCH",0); addpoint((x[43]+13)/2.54, (y[43])/2.54, "line"); current_point= addpoint((x[42]+13)/2.54, (y[42])/2.54, "line"); notch_type(current_point,"NOTCH",0); group_obj[17] = newobj_dot(); addpoint((x[40])/2.54, (y[5])/2.54, "LINE"); addpoint((x[40]-2)/2.54, (y[5])/2.54, "LINE"); addpoint((x[40]-2)/2.54, (y[5]-13)/2.54, "XARC_START"); addpoint((x[40]-2)/2.54, (y[5]-18)/2.54, "XARC_CORNER"); addpoint((x[38])/2.54, (y[5]-18)/2.54, "XARC_START"); addpoint((x[40]-2)/2.54, (y[5]-18)/2.54, "XARC_CORNER"); addpoint((x[40]-2)/2.54, (y[5]-13)/2.54, "LINE"); addpoint((x[40]-2)/2.54, (y[5])/2.54, "LINE"); group_obj[18] = newobject("poly"); current_point=addpoint((x[13]+8)/2.54, (y[13])/2.54, "LINE"); notch_type(current_point,"NOTCH",1); addpoint((x[13]+8)/2.54, (y[13]-13)/2.54, "XARC_START"); addpoint((x[13]+8)/2.54, (y[13]-18)/2.54, "XARC_CORNER"); addpoint((x[13]+8+5)/2.54, (y[13]-18)/2.54, "LINE"); addpoint((x[13]+8+12)/2.54, (y[13]-18)/2.54, "XARC_START"); addpoint((x[13]+8+17)/2.54, (y[13]-18)/2.54, "XARC_CORNER"); addpoint((x[13]+8+17)/2.54, (y[13]-13)/2.54, "LINE"); current_point=addpoint((x[13]+8+17)/2.54, (y[13])/2.54, "LINE"); notch_type(current_point,"NOTCH",1); group_obj[19] = newobj_dot(); addpoint((x[30])/2.54, (y[30]+9)/2.54, "LINE"); addpoint((x[30]-2)/2.54, (y[30]+9)/2.54, "LINE"); addpoint((x[30]-2)/2.54, (y[30]+9-8)/2.54, "XARC_START"); addpoint((x[30]-2)/2.54, (y[30]+9-11)/2.54, "XARC_CORNER"); addpoint((x[30])/2.54, (y[30]+9-11)/2.54, "open"); group_obj[20] = newobject("poly"); current_point=addpoint((x[13]+8)/2.54, (y[13]+15)/2.54, "LINE"); notch_type(current_point,"NOTCH",1); addpoint((x[13]+8)/2.54, (y[13]+15-8)/2.54, "XARC_START"); addpoint((x[13]+8)/2.54, (y[13]+15-11)/2.54, "XARC_CORNER"); addpoint((x[13]+8+3)/2.54, (y[13]+15-11)/2.54, "LINE"); addpoint((x[13]+8+7)/2.54, (y[13]+15-11)/2.54, "XARC_START"); addpoint((x[13]+8+10)/2.54, (y[13]+15-11)/2.54, "XARC_CORNER"); addpoint((x[13]+8+10)/2.54, (y[13]+15-8)/2.54, "LINE"); current_point=addpoint((x[13]+8+10)/2.54, (y[13]+15)/2.54, "LINE"); notch_type(current_point,"NOTCH",1); ktpe=arclength(33,36,34)+arclength(34,10,11); ktpt=arclength(26,37,35)+arclength(35,9,11); ktp=ktpe+ktpt; pk=ktp/3; coord(23,1,0,0); coord(31,2,0,0); cont(131,31,114,2); cont(104,114,214,30); linecirc(31,104,214,ptp,1,3); ang=6*360/2/3.14159/ptp*3.14159/180; rotate(3,2,-ang); cont(2,3,4,-7); rotate (4,3,-angle (x[3],y[4],x[3],y[4]+90*3.14159/180)); cont(3,4,5,5); rotate (5,4,-angle (x[3],y[4],x[3],y[4]-90*3.14159/180)); cont(204,102,7,3); cont(4,5,104,50); cont(204,102,105,50); line_intersect(204,105,4,104,6); group_obj[21] = newobject("POLY"); cont(1,2,101,-4); addpoint((x[101]-2)/2.54, (y[101]+2)/2.54, "xarc_start"); addpoint((x[2]-2)/2.54, (y[2]+2)/2.54, "xarc_corner"); addpoint((x[3]-2)/2.54, (y[3]+2)/2.54, "LINE"); addpoint((x[4]-2)/2.54, (y[4]+2)/2.54, "line"); addpoint((x[5]-2)/2.54, (y[5]+2)/2.54, "xarc_start"); addpoint((x[6]-2)/2.54, (y[6]+2)/2.54, "xarc_corner"); addpoint((x[7]-2)/2.54, (y[7]+2)/2.54, "LINE"); current_point= addpoint((x[202]-2)/2.54, (y[202]+2)/2.54, "xarc_start"); notch_type(current_point,"NOTCH",1); addpoint((x[1]-2)/2.54, (y[1]+2)/2.54, "xarc_corner"); if (sleeve==0) { coord(0,1,kay,0); coord(1,2,0,-pk/3); coord(2,3,0,-pk/3); coord(3,4,0,-pk/3); coord(1,5,0,-hp); center(5,1,6); y[6]=y[6]-4; coord(5,7,0,-3); coord(4,8,-kay/2,0); coord(4,9,kay/2,0); coord(5,10,-(kay/2)+2,0); coord(5,11,+(kay/2)-2,0); center(8,10,12); y[12]=y[6]; center(9,11,13); y[13]=y[6]; coord(8,19,ktl/2,0); coord(1,20,-5,0); cont(19,20,21,-dist(19,20)/3); cont(20,19,22,-dist(19,20)/3); coord(9,23,-ktl/4,0); coord(1,24,5,0); cont(23,24,25,-dist(23,24)/3); cont(24,23,26,-dist(23,24)/3); coord(5,27,-2,0); coord(6,28,0,0); rotate (28,27,-angle(x[6],y[6],x[27]+90*3.14159/180,y[27])); cont(28,27,28,-(ray/2-1)); cont(28,27,29,+(ray/2+1)); coord(12,30,2.5,0); coord(13,31,.5,0); cont(30,28,28,.5); cont(13,29,29,.5); coord(6,32,dist(12,13)/4+1,0); coord(31,33,0,-2); cont(33,32,33,-dist(31,32)); group_obj[22] = newobject("poly"); addpoint((x[1]+10)/2.54, (y[1])/2.54, "xarc_start"); addpoint((x[20]+10)/2.54, (y[20])/2.54, "xarc_corner"); addpoint((x[21]+10)/2.54, (y[21])/2.54, "line"); addpoint((x[22]+10)/2.54, (y[22])/2.54, "xarc_start"); addpoint((x[19]+10)/2.54, (y[19])/2.54, "xarc_corner"); addpoint((x[8]+10)/2.54, (y[8])/2.54, "xarc_start"); addpoint((x[30]+10)/2.54, (y[30])/2.54, "xarc_corner"); addpoint((x[28]+10)/2.54, (y[28])/2.54, "line"); addpoint((x[27]+10)/2.54, (y[27])/2.54, "line"); addpoint((x[29]+10)/2.54, (y[29])/2.54, "line"); addpoint((x[33]+10)/2.54, (y[33])/2.54, "line"); addpoint((x[32]+10)/2.54, (y[32])/2.54, "line"); addpoint((x[31]+10)/2.54, (y[31])/2.54, "line"); addpoint((x[9]+10)/2.54, (y[9])/2.54, "xarc_start"); addpoint((x[23]+10)/2.54, (y[23])/2.54, "xarc_corner"); addpoint((x[26]+10)/2.54, (y[26])/2.54, "line"); addpoint((x[25]+10)/2.54, (y[25])/2.54, "xarc_start"); addpoint((x[24]+10)/2.54, (y[24])/2.54, "xarc_corner"); group_obj[23] = newobject("poly"); addpoint((x[1]+10)/2.54, (y[1])/2.54, "line"); addpoint((x[1]+10)/2.54, (y[6])/2.54, "open"); } else { coord(1,1,2*kay,0); coord(1,2,-kay/2,0); coord(1,3,1,-hp); coord(3,4,-kay/2,0); coord(1,5,0,-pk); coord(5,6,-kay/2,0); center(1,3,7); y[7]=y[7]-4; coord(7,8,-kay/2,0); coord(1,9,0,-pk/3); coord(9,10,-kay/2,0); coord(10,11,(kay/4+1)/3,0); coord(2,12,kay/4+2,0); coord(12,13,1,-pk/3); coord(12,14,0,-pk); coord(12,15,0,-dist(1,2)/2-4); coord(12,16,-5,0); coord(12,17,5,0); coord(9,18,1.5,-1); center(17,18,19); coord(5,20,1,0); coord(6,21,-2,0); coord(21,22,0,1); coord(6,23,0,3); coord(7,25,.5,0); coord(8,26,-.5+2,0); coord(4,27,0,1.5); coord(27,28,-2,0); coord(3,29,0,-1.5); coord(29,129,-50,0); coord(27,30,sqrt(ray/2*ray/2-3*3),-3); coord(6,31,2-.5,1); coord(6,131,ktl/2-2,0); coord(6,32,ktl/2,0); coord(14,33,0,3); coord(9,34,-dist(9,13)/2,-1); center(33,34,35); coord(5,36,-3,0); cont(34,33,132,50); line_intersect(5,6,34,132,132); x[132]=x[132]-1; coord(7,37,-2,0); coord(8,39,1.5+2,0); coord(36,136,2,-dist(36,137)/2); coord(27,38,2,0); coord(8,39,4,0); coord(39,139,2,dist(39,31)/2); cont(11,23,124,50); coord(22,224,4,0); line_intersect(22,224,11,124,24); group_obj[24] = newobject("poly"); addpoint((x[12]+20)/2.54, (y[1])/2.54, "line"); addpoint((x[12]+20)/2.54, (y[7])/2.54, "open"); group_obj[25] = newobject("poly"); addpoint((x[22]+20)/2.54, (y[22])/2.54, "xarc_start"); addpoint((x[26]+20)/2.54, (y[26])/2.54, "xarc_corner"); addpoint((x[28]+20)/2.54, (y[28])/2.54, "line"); addpoint((x[27]+20)/2.54, (y[27])/2.54, "line"); addpoint((x[30]+20)/2.54, (y[30])/2.54, "xarc_start"); addpoint((x[25]+20)/2.54, (y[25])/2.54, "xarc_corner"); addpoint((x[20]+20)/2.54, (y[20])/2.54, "line"); addpoint((x[18]+20)/2.54, (y[18])/2.54, "line"); addpoint((x[19]+20)/2.54, (y[19])/2.54, "xarc_start"); addpoint((x[17]+20)/2.54, (y[17])/2.54, "xarc_corner"); addpoint((x[12]+20)/2.54, (y[12])/2.54, "xarc_start"); addpoint((x[16]+20)/2.54, (y[16])/2.54, "xarc_corner"); addpoint((x[11]+20)/2.54, (y[11])/2.54, "line"); addpoint((x[23]+20)/2.54, (y[23])/2.54, "xarc_start"); addpoint((x[24]+20)/2.54, (y[24])/2.54, "xarc_corner"); group_obj[26] = newobject("poly"); addpoint((x[31]+20)/2.54, (y[31])/2.54, "xarc_start"); addpoint((x[39]+20)/2.54, (y[39])/2.54, "xarc_corner"); addpoint((x[38]+20)/2.54, (y[38])/2.54, "line"); addpoint((x[30]+20)/2.54, (y[30])/2.54, "xarc_start"); addpoint((x[37]+20)/2.54, (y[37])/2.54, "xarc_corner"); addpoint((x[36]+20)/2.54, (y[36])/2.54, "line"); addpoint((x[34]+20)/2.54, (y[34])/2.54, "line"); addpoint((x[35]+20)/2.54, (y[35])/2.54, "line"); addpoint((x[33]+20)/2.54, (y[33])/2.54, "xarc_start"); addpoint((x[132]+20)/2.54, (y[132])/2.54, "xarc_corner"); current_point= addpoint((x[32]+20)/2.54, (y[32])/2.54, "xarc_start"); notch_type(current_point,"NOTCH",1); addpoint((x[131]+20)/2.54, (y[131])/2.54, "xarc_corner"); } //Add pockets offset_mark(15); group(current_selection); deselect(current_selection); offset_mark(21); group(current_selection); deselect(current_selection); offset_mark(18); group(current_selection); deselect(current_selection); offset_mark(20); group(current_selection); deselect(current_selection); offset_mark(16); group(current_selection); deselect(current_selection); offset_mark(14); group(current_selection); deselect(current_selection); offset_mark(1); group(current_selection); deselect(current_selection); offset_mark(13); select(current_selection,group_obj[0]); select(current_selection,group_obj[2]); select(current_selection,group_obj[3]); select(current_selection,group_obj[17]); select(current_selection,group_obj[19]); if(lapel==0) { select(current_selection,group_obj[4]); } if(lapel==1) { select(current_selection,group_obj[5]); } if(lapel==2) { select(current_selection,group_obj[6]); } group(current_selection); deselect(current_selection); if (sleeve==0) { offset_mark(22); select(current_selection,group_obj[23]); group(current_selection); deselect(current_selection); } else { offset_mark(25); select(current_selection,group_obj[24]); group(current_selection); deselect(current_selection); offset_mark(26); group(current_selection); deselect(current_selection); } current_selection=newselection("OBJECT"); for (loop = 0; loop < 20; loop = loop + 1) { if (marker_array[loop] != 0) { select(current_selection, marker_array[loop]); } } check_overlap(current_selection); if (is_function("origin_arrange")==1) { origin_arrange(current_selection); } deselect(current_selection); if (is_function("set_marker")==1) { for (loop = 0; loop < 20; loop = loop + 1) { if (marker_array[loop] != 0) { set_marker(marker_array[loop], 0); } } } run_command("zoomall"); } newobj_dot() { line("CENTER_LINE"); current_object = newobject("poly"); line("SOLID_LINE"); return current_object; } coord(double orig, double dest, double xxx, double yyy) { x[dest]=x[orig]+xxx; y[dest]=y[orig]+yyy; } center(double one, double two, double result) { x[result]=(x[one]+x[two])/2; y[result]=(y[one]+y[two])/2; } dist(double p1, double p2) { return distance(x[p1],y[p1],x[p2],y[p2]); } line_intersect(double start1, double end1, double start2, double end2, double dest) { double tempx; double tempy; intersect(x[start1],y[start1],x[end1],y[end1],x[start2],y[start2],x[end2],y[end2],0); x[dest]=getresultx(); y[dest]=getresulty(); } cont(double cstart, double cend, double cdest, double cvdistanceance) { double ang; ang=angle(x[cstart], y[cstart], x[cend], y[cend]); polar(x[cend], y[cend], ang, cvdistanceance); x[cdest]=getresultx(); y[cdest]=getresulty(); } right_ang(double start, double end, double to_point, double dest) { double m,b; if (x[start]==x[end]) { x[dest]=x[end]; y[dest]=y[to_point]; } else { if (y[start]==y[end]) { x[dest]=x[to_point]; y[dest]=y[end]; } else { m=(y[start]-y[end])/(x[start]-x[end]); m=-1/m; b=y[to_point]-m*x[to_point]; intersect(x[start],y[start],x[end],y[end],x[to_point],y[to_point],0,b,0); x[dest]=getresultx(); y[dest]=getresulty(); } } } mark(double pass_index) { group_obj[pass_index]=marker_piece(group_obj[pass_index],1); marker_array[marker_count] = group_obj[pass_index]; marker_count = marker_count + 1; } offset_mark(double pass_index) { point pnt, test; double save_x, save_y; current_selection=newselection("OBJECT"); select(current_selection,group_obj[pass_index]); sel_push(current_selection); var_push(sv); run_command("OFFSET"); deselect(current_selection); current_object=last_obj(); marker_array[marker_count] = marker_piece(current_object,1); current_selection=newselection("OBJECT"); select(current_selection, marker_array[marker_count]); select(current_selection, group_obj[pass_index]); marker_count = marker_count + 1; } Forward() { index = index + 1; if ((index == 2) && (nvp == 1)) { index = index + 1; } if ((index == 3) && (nvp != 1)) { index = index + 1; } if (index == 5) { done = 1; } } Backward() { index = index - 1; if ((index == 3) && (nvp != 1)) { index = index - 1; } if ((index == 2) && (nvp == 1)) { index = index - 1; } } Popup1() { if (language == 0) { start_pict_dialog("BUST EASE"); add_pict_item("Minimum (+4.75 in/+12 cm)","blank.jpg"); add_pict_item("Medium (+5.5 in/+14 cm)","blank.jpg"); add_pict_item("Maximum (6.25 in/+16 cm)","blank.jpg"); run_pict("Next"); ease=get_pict_result(); Forward(); } } Popup2() { if (language == 0) { start_pict_dialog("JACKET STYLE"); add_pict_item("Single-breasted","J_jkt_br-single.jpg"); add_pict_item("Double-breasted","J_jkt_br-dbl.jpg"); if (run_pict("Back","Next")) { nvp=get_pict_result(); Forward(); } else { nvp=0; Backward(); } } } Popup3() { if (language == 0) { start_pict_dialog("LAPEL HEIGHT"); add_pict_item("Low","J_jkt_lapel-low.jpg"); add_pict_item("Medium","J_jkt_lapel-med.jpg"); add_pict_item("High","J_jkt_lapel-high.jpg"); if (run_pict("Back","Next")) { lapel=get_pict_result(); Forward(); } else { lapel=0; Backward(); } } } Popup4() { if (language == 0) { start_pict_dialog("LAPEL HEIGHT"); add_pict_item("Low","J_jkt_lapel-low.jpg"); add_pict_item("Medium","J_jkt_lapel-med.jpg"); if (run_pict("Back","Next")) { lapel=get_pict_result(); Forward(); } else { lapel=0; Backward(); } } } Popup5() { if (language == 0) { start_pict_dialog("SLEEVE STYLE"); add_pict_item("One-piece sleeve","J_jkt_slv-1-pc.jpg"); add_pict_item("Two-piece sleeve","J_jkt_slv-2pc.jpg"); if (run_pict("Back","Next")) { sleeve=get_pict_result(); Forward(); } else { sleeve=0; Backward(); } } } shift(double orig, double xxx, double yyy) { x[orig]=x[orig]+xxx; y[orig]=y[orig]+yyy; } rect (double x1, double y1, double x2, double y2) { newobject("poly"); addpoint( x1/2.54,y1/2.54,"LINE"); addpoint( x2/2.54,y1/2.54,"LINE"); addpoint( x2/2.54,y2/2.54,"LINE"); addpoint( x1/2.54,y2/2.54,"LINE"); } dot (double x, double y) { newobject("poly"); addpoint( x/2.54,y/2.54,"LINE"); } line (double x3, double y3, double x4, double y4) { newobject("poly"); addpoint( x3/2.54,y3/2.54,"LINE"); addpoint( x4/2.54,y4/2.54,"LINE"); } rotate(double rpoint,double rcenter, double rangle) { double vdistance, vang; vdistance=dist(rpoint, rcenter); vang=angle(x[rcenter],y[rcenter],x[rpoint],y[rpoint]); polar(x[rcenter],y[rcenter],vang+rangle,vdistance); x[rpoint]=getresultx(); y[rpoint]=getresulty(); } linecirc(double PA,double PB,double PC,double dradius,double which, double PD) { double mslope, dist0, dist1, dist2, xtemp; double tx, ty; xtemp = (x[PB]-x[PC])*(x[PB]-x[PC]); if (xtemp > 0) { xtemp = (y[PB]-y[PC])*(y[PB]-y[PC]); if ( xtemp > 0) { mslope = (y[PC] - y[PB])/(x[PC] - x[PB]); tx = x[PA] + 1; ty = y[PA] - 1/mslope; intersect(x[PA], y[PA], tx, ty, x[PB], y[PB], x[PC], y[PC], 0); tx = getresultx(); ty = getresulty(); dist1 = distance(x[PA], y[PA], tx, ty); dist2 = interceptline(0, dist1, dradius); dist0 = sqrt(1+mslope*mslope); xtemp = dist2/dist0; if (which) { x[PD] = tx+xtemp; y[PD] = ty+ xtemp*mslope; } else { x[PD] = tx-xtemp; y[PD] = ty- xtemp*mslope; } } else { x[PD] = x[PB]; if (which) { y[PD] = y[PA] + interceptline(x[PA], x[PB], dradius); } else { y[PD] = y[PA] - interceptline(x[PA], x[PB], dradius); } } } else { y[PD] = y[PB]; if (which) { x[PD] = x[PA] + interceptline(y[PA], y[PB], dradius); } else { x[PD] = x[PA] - interceptline(y[PA], y[PB], dradius); } } } double xar[13], yar[13]; double save_rx, save_ry; arclength(double start, double corner, double end) { double ct, last_x, last_y; double a_dist; last_x = x[start]; last_y = y[start]; a_dist=0; for (ct=1; ct < 12; ct = ct + 1) { fts(start, corner, end, ct); a_dist = a_dist + distance(save_rx, save_ry, last_x, last_y); last_x=save_rx; last_y=save_ry; } return a_dist; } double A1, A2, B1, B2; double sx, sy, cx, cy, ex, ey; double t0[2], t1[2]; double ftc[2]; fts(double start, double corner, double end, double pos) { if (pos<1) { save_rx=x[start]; save_ry=y[start]; } else { if (pos<2) { sx = x[start]; sy = y[start]; cx = x[corner]; cy = y[corner]; ex = x[end]; ey = y[end]; A1=cx - sx; A2=cy - sy; B1=cx - ex; B2=cy - ey; A1=-A1; B1=-B1; A2=-A2; B2=-B2; t0[0]=A1; t0[1]=B1; t1[0]=A2; t1[1]=B2; ftc[0]= cx + (t0[0] + t0[1]); ftc[1]= cy + (t1[0] + t1[1]); save_rx = t0[0]*(xar[pos])+t0[1]*(yar[pos])+ ftc[0]; save_ry = t1[0]*(xar[pos])+t1[1]*(yar[pos])+ ftc[1]; } else { if (pos>10) { save_rx=x[end]; save_ry=y[end]; } else { save_rx = t0[0]*(xar[pos])+t0[1]*(yar[pos])+ ftc[0]; save_ry = t1[0]*(xar[pos])+t1[1]*(yar[pos])+ ftc[1]; } } } } init_xarc_array() { double ang_start, ang_end, step, theta, ct; double XARC_PIECES; XARC_PIECES = 12; ang_start = -3.14159/2; ang_end= -3.14159; ct=0; step= (ang_end - ang_start)/(XARC_PIECES-1); for (theta=ang_start; ct < XARC_PIECES; theta = theta + step) { xar[ct] = cos(theta); yar[ct] = sin(theta); ct=ct+1; } } max(double aa, double bb) { if (aa > bb) { return aa; } else { return bb; } } min(double aa, double bb) { if (aa < bb) { return aa; } else { return bb; } } // End