// Copyright (C) 2001 Leena L�hteenm�ki, Finland // Copyright (C) 2012 PatternMaker Softwar // 2011/11/04 selection current_selection; object current_object, group_obj[100]; point current_point; double index, done, sv; object marker_array[20]; double marker_count, loop; double metric, sv; double result; double ry, vy, ly, ky, ktk, sp, lk, pp, sl, ktl, op, ptkt, ptke, ptl, ptse, okt, oke, rke; double hp, pk, hl, ray, sip, jsp, ik, lx, ls, polvi, lp; double kp, kpe, kpt; double size; double t_ry[8]; double t_vy[8]; double t_ly[8]; double t_ky[8]; double t_sp[8]; double t_op[8]; double t_sl[8]; double t_ptke[8]; double t_ptkt[8]; double t_hp[8]; double t_ray[8]; double t_sip[8]; double t_jsp[8]; double t_oke[8]; double t_ik[8]; double t_ls[8]; double t_lp[8]; double hupunkorkeus; double t_hupunkorkeus[8]; double language; double sizes; double ease, f_ry[2],f_vy[2],f_ly[2],f_sl[2]; double x[500],y[500]; main() { language=get_language(); if ( language != 0 ) { language = 0; } if (language == 0) { check_reg(0, "Leena","Children", "This macro needs to be properly installed before running it."); } okt=1.5; Forward(); //Start Options while (!done) { if (index==0) { Popup1(); } if (index==1) { Popup2(); } if (index == 2) { Popup3(); } if (index==3) { Popup4(); } } //End Options t_vy[0]=55; t_vy[1]=56; t_vy[2]=57; t_vy[3]=58; t_vy[4]=59; t_vy[5]=60; t_vy[6]=62; t_vy[7]=64; t_ry[0]=58; t_ry[1]=60; t_ry[2]=62; t_ry[3]=64; t_ry[4]=66; t_ry[5]=68; t_ry[6]=70; t_ry[7]=73; t_ly[0]=62; t_ly[1]=64; t_ly[2]=66; t_ly[3]=68; t_ly[4]=70; t_ly[5]=73; t_ly[6]=76; t_ly[7]=79; t_ky[0]=28.5; t_ky[1]=29.25; t_ky[2]=30; t_ky[3]=30.75; t_ky[4]=31.5; t_ky[5]=32.25; t_ky[6]=33; t_ky[7]=33.75; t_op[0]=8.8; t_op[1]=9.2; t_op[2]=9.6; t_op[3]=10; t_op[4]=10.4; t_op[5]=10.8; t_op[6]=11.2; t_op[7]=11.6; t_sl[0]=2*13.4; t_sl[1]=2*13.7; t_sl[2]=2*14; t_sl[3]=2*14.3; t_sl[4]=2*14.6; t_sl[5]=2*15; t_sl[6]=2*15.4; t_sl[7]=2*16; t_hp[0]=36; t_hp[1]=38; t_hp[2]=40; t_hp[3]=42; t_hp[4]=44; t_hp[5]=46; t_hp[6]=48; t_hp[7]=50; t_ray[0]=12.5; t_ray[1]=12.5; t_ray[2]=13; t_ray[3]=13; t_ray[4]=13.5; t_ray[5]=13.5; t_ray[6]=14; t_ray[7]=14.5; t_sp[0]=25; t_sp[1]=26.5; t_sp[2]=28; t_sp[3]=29.5; t_sp[4]=31; t_sp[5]=32.5; t_sp[6]=34; t_sp[7]=35.5; t_sip[0]=62; t_sip[1]=66; t_sip[2]=70; t_sip[3]=74; t_sip[4]=78; t_sip[5]=82; t_sip[6]=86; t_sip[7]=90; t_jsp[0]=44; t_jsp[1]=47.5; t_jsp[2]=51; t_jsp[3]=54.5; t_jsp[4]=58; t_jsp[5]=61.5; t_jsp[6]=65; t_jsp[7]=68.5; t_lp[0]=35; t_lp[1]=35.5; t_lp[2]=36; t_lp[3]=36.5; t_lp[4]=37; t_lp[5]=37.5; t_lp[6]=38; t_lp[7]=39; t_ls[0]=29; t_ls[1]=29.5; t_ls[2]=30; t_ls[3]=30.5; t_ls[4]=31; t_ls[5]=31.5; t_ls[6]=32; t_ls[7]=33; t_ptke[0]=2.25; t_ptke[1]=2.25; t_ptke[2]=2.25; t_ptke[3]=2.25; t_ptke[4]=2.25; t_ptke[5]=2.25; t_ptke[6]=2.75; t_ptke[7]=2.75; t_ptkt[0]=1.5; t_ptkt[1]=1.5; t_ptkt[2]=1.5; t_ptkt[3]=1.5; t_ptkt[4]=1.5; t_ptkt[5]=1.5; t_ptkt[6]=1.5; t_ptkt[7]=1.5; t_oke[0]=1; t_oke[1]=1; t_oke[2]=1; t_oke[3]=1; t_oke[4]=1; t_oke[5]=1; t_oke[6]=2; t_oke[7]=2; t_hupunkorkeus[0]=23+7; t_hupunkorkeus[1]=23.5+7; t_hupunkorkeus[2]=24+7; t_hupunkorkeus[3]=24.5+7; t_hupunkorkeus[4]=25+7; t_hupunkorkeus[5]=25.5+7; t_hupunkorkeus[6]=26+7; t_hupunkorkeus[7]=26+7; ry= t_ry[size]; vy= t_vy[size]; ly= t_ly[size]; ky= t_ky[size]; op= t_op[size]; sp= t_sp[size]; hp= t_hp[size]; ray= t_ray[size]; op= t_op[size]; sl= t_sl[size]; sip= t_sip[size]; jsp= t_jsp[size]; ptke=t_ptke[size]; ptkt=t_ptkt[size]; lp=t_lp[size]; ls=t_ls[size]; hupunkorkeus=t_hupunkorkeus[size]; if (is_function("unit_mode")==1) { metric = unit_mode(); if (!metric) { ry=ry/2.54; vy=vy/2.54; ly=ly/2.54; ky=ky/2.54; op=op/2.54; sl=sl/2.54; sp=sp/2.54; hp=hp/2.54; ray=ray/2.54; sip=sip/2.54; jsp=jsp/2.54; } } else { if (language == 0) { metric=2*pop_up("Units","Inches","Centimeters"); } if (metric<1) { ry=ry/2.54; vy=vy/2.54; ly=ly/2.54; ky=ky/2.54; op=op/2.54; sl=sl/2.54; sp=sp/2.54; hp=hp/2.54; ray=ray/2.54; sip=sip/2.54; jsp=jsp/2.54; } } if(metric==0) { sv=0.39; } else { sv = 0.25; } double read; read = 0; if (is_function("measure_table")==1) { if (measure_table("default_children")==1) { read = 1; } } if (read==0) { if (is_function("start_picture_input")) { if (language == 0) { start_picture_input("CHILD'S BIB OVERALLS"); } if (language == 0) { add_picture_input("Chest circumference", ry, "bc_meas_chestcirc"); } if (language == 0) { add_picture_input("Waist circumference", vy,"bc_meas_waistcirc"); } if (language == 0) { add_picture_input("Hip circumference",ly, "bc_meas_hipcirc"); } if (language == 0) { add_picture_input("Neck circumference", ky, "bc_meas_neckcirc"); } if (language == 0) { add_picture_input("Shoulder length",op, "bc_meas_shldr"); } if (language == 0) { add_picture_input("Back width",sl, "bc_meas_bkwidth"); } if (language == 0) { add_picture_input("Overarm length",hp, "bc_meas_overarm"); } if (language == 0) { add_picture_input("Back length", sp, "bc_meas_bklength"); } if (language == 0) { add_picture_input("Wrist circumference", ray, "bc_meas_wrist"); } if (language == 0) { add_picture_input("Outside length", sip, "bc_meas_outside"); } if (language == 0) { add_picture_input("Inside length", jsp, "bc_meas_inside"); } if (language == 0) { add_picture_input("Seam Allowance", sv, "meas_seamallow"); } run_picture_input(); } else { if (language == 0) { dialog_box("CHILD'S BIB OVERALLS - 1 of 2", "Chest circumference", ry, "Waist circumference", vy, "Hip circumference",ly, "Neck circumference", ky, "Shoulder length",op, "Back width",sl, "Overarm length",hp, "Back length", sp); } if (language == 0) { dialog_box("CHILD'S BIB OVERALLS - 2 of 2", "Wrist circumference", ray, "Outside length", sip, "Inside length", jsp, "Seam Allowance", sv); } } } else { if (is_function("start_picture_input")) { if (language == 0) { start_picture_input("CUSTOM MEASUREMENTS"); } if (language == 0) { add_picture_input("Seam Allowance", sv, "meas_seamallow"); } run_picture_input(); } else { if (language == 0) { dialog_box("CUSTOM MEASUREMENTS", "Seam Allowance", sv); } } } if (is_function("unit_mode")==1) { metric = unit_mode(); if (!metric) { ry=ry*2.54; vy=vy*2.54; ly=ly*2.54; ky=ky*2.54; op=op*2.54; sl=sl*2.54; sp=sp*2.54; hp=hp*2.54; ray=ray*2.54; sip=sip*2.54; jsp=jsp*2.54; } } else { if (metric<1) { ry=ry*2.54; vy=vy*2.54; ly=ly*2.54; ky=ky*2.54; op=op*2.54; sl=sl*2.54; sp=sp*2.54; hp=hp*2.54; ray=ray*2.54; sip=sip*2.54; jsp=jsp*2.54; } } if(metric==2) { sv=sv/2.54; } ry= ry+20; sl=sl+4; vy= vy+16; ly= ly+16; ray=ray+10; op=op+2; lp=lp+6; ls=ls+4; if(ease==1) { ry=ry+4; sl=sl+2-1; vy=vy+4; ly=ly+4; op=op+1; ray=ray+4; lp=lp+8; ls=ls+4; } ktk=ry/4-2; lk=ktk-2; pp=sp; ktl=ry/8; ptl=ky/5-.5; ptse=ky/5; rke=ry/10; pk=ry/6-2; hl=sl+1.5; polvi=jsp/2+jsp/10; ptse=ptse+1; ptl=ptl+1; ptkt=1; okt=1; oke=1; jsp=jsp-2; ik=sip-jsp; lx=ly/20; coord(0,1,0,0); coord(1,2,0,-ktk); coord(1,3,0,-sp); coord(3,4,0,-lk); coord(1,5,0,-pp); coord(2,6,-sl/2,0); coord(6,7,-ktl,0); coord(2,8,-ry/2,0); x[9]=x[8]; y[9]=y[3]; coord(9,10,-.5,0); coord(1,101,-100,0); cont(10,8,111,100); line_intersect (8,111,1,101,11); coord(4,104,-100,0); cont(8,10,113,100); line_intersect(8,113,4,104,12); coord(5,105,-100,0); line_intersect(8,113,5,105,13); coord(1,14,-sl/2,0); coord(14,15,-ktl,0); center(6,7,16); coord(1,17,-ptl,0); coord(17,18,0,ptkt); coord(14,19,0,-1); coord(19,119,-50,0); coord(18,20,-sqrt((op+1)*(op+1)-(ptkt+okt)*(ptkt+okt)),-ptkt-okt); coord(17,220,-2,-5); cont(20,18,118,-2.5); cont(220,118,118,+.3); cont(20,18,218,-3.5); cont(218,220,218,-dist(220,118)); cont(8,11,21,ptke); coord(21,22,ptl,0); cont(10,21,23,-ptse); x[123]=x[22]; y[123]=y[23]; coord(15,24,0,-oke); coord(22,25,sqrt(op*op-(ptke+oke)*(ptke+oke)),-ptke-oke); coord(7,26,0,ktk/4); coord(7,125,0,ktk/2); coord(6,27,0,ktk/3); coord(6,120,0,ktk/3*2); coord(16,28,0,-pp+ktk); double sivu; sivu=dist(16,28); double mlvy, mlly; mlvy=dist(10,3)-vy/2; mlly=dist(12,4)-ly/2; coord(16,41,+mlvy/4,-dist(2,3)); coord(3,42,-ry/10,+10); coord(3,43,-ry/10,-10); coord(3,44,-ry/10-mlvy/4,0); coord(3,45,-ry/10+mlvy/4,0); init_xarc_array(); kpt=arclength(1,17,18); kpe=arclength(22,123,23); coord(10,201,vy/8-0.5,0); coord(201,202,0,-sip); coord(201,203,0,-ik); coord(203,204,0,ik/3); coord(202,205,0,2); coord(204,206,-(ly/8-1.5),0); coord(204,207,(ly/8+1.5+1.5),0); x[208]=x[206]; y[208]=y[203]; coord(201,209,-(vy/8-0.5),0); coord(201,210,(vy/8+0.5+1),1); coord(208,211,-lx,0); coord(205,212,-(ls/4-0.75),0); coord(205,312,(ls/4-0.75),0); coord(204,213,0,(lx-0.5)); coord(213,214,-(lx+1),0); coord(214,215,sqrt((ly/4)*(ly/4)-(lx+1)*(lx+1)),-(lx+1)); coord(211,218,-(lx+1),0); coord(218,219,0,-1); coord(211,319,0,-1); coord(208,308,1,-1); coord(206,306,1,0); coord(212,220,-1.5,0); coord(312,320,1.5,0); cont(308,214,316,50); cont(320,215,317,(dist(207,210)/2)); cont(215,317,417,(dist(207,210)/2)); x[217]=x[417]; y[217]=y[201]+1; cont(316,214,216,-dist(215,417)); center(216,217,221); cont(217,221,224,-((dist(216,217)-(vy/4-1))/2)); cont(217,221,223,+((dist(216,217)-(vy/4-1))/2)); cont(214,216,314,-8); cont(317,314,222,-dist(216,221)); coord(205,225,-(lp/4-0.75),polvi); coord(205,226,(lp/4-0.75),polvi); coord(225,227,-1.5,0); coord(226,228,1.5,0); center(207,210,310); x[310]=x[207]; double ang; ang=angle(x[8],y[8],x[9],y[9])-angle(x[8],y[8],x[10],y[10]); coord(28,40,-mlvy/4,0); rotate(22,8,ang); rotate(123,8,ang); rotate(23,8,ang); rotate(10,8,ang); rotate(12,8,ang); rotate(16,8,ang); rotate(7,8,ang); rotate(26,8,ang); rotate(125,8,ang); rotate(25,8,ang); rotate(28,8,ang); rotate(40,8,ang); shift(10,0,-2); shift(15,0,-2); shift(40,0,-2); double siirtox1, siirtoy1; siirtox1=-(x[10]-x[209]); siirtoy1=-(y[10]-y[209]); shift(22,siirtox1,siirtoy1); shift(123,siirtox1,siirtoy1); shift(23,siirtox1,siirtoy1); shift(8,siirtox1,siirtoy1); shift(10,siirtox1,siirtoy1); shift(15,siirtox1,siirtoy1); shift(40,siirtox1,siirtoy1); shift(16,siirtox1,siirtoy1); shift(7,siirtox1,siirtoy1); shift(26,siirtox1,siirtoy1); shift(125,siirtox1,siirtoy1); shift(25,siirtox1,siirtoy1); x[125]=x[25]-1; x[26]=x[25]-1; x[7]=x[25]-1; kpe=arclength(22,123,23); group_obj[0]=newobject("poly"); addpoint((x[22]-ry/2)/2.54, (y[22])/2.54, "xarc_start"); addpoint((x[123]-ry/2)/2.54, (y[123])/2.54, "xarc_corner"); addpoint((x[23]-ry/2)/2.54, (y[23])/2.54, "line"); addpoint((x[23]-1-ry/2)/2.54, (y[23])/2.54, "LINE"); addpoint((x[23]-2-ry/2)/2.54, (y[23])/2.54, "LINE"); addpoint((x[23]-3-ry/2)/2.54, (y[23]+.25)/2.54, "LINE"); addpoint((x[10]-3-ry/2)/2.54, (y[206])/2.54, "LINE"); x[206]=x[10]; addpoint((x[206]-ry/2)/2.54, (y[206])/2.54, "xarc_start"); addpoint((x[208]-ry/2)/2.54, (y[208])/2.54, "xarc_corner"); addpoint((x[211]-ry/2)/2.54, (y[211])/2.54, "line"); addpoint((x[212]-ry/2)/2.54, (y[212])/2.54, "line"); addpoint((x[312]-ry/2)/2.54, (y[312])/2.54, "line"); addpoint((x[207]-ry/2)/2.54, (y[207])/2.54, "line"); addpoint((x[16]-ry/2)/2.54, (y[16])/2.54, "xarc_start"); addpoint((x[7]-ry/2)/2.54, (y[7])/2.54, "xarc_corner"); addpoint((x[26]-ry/2)/2.54, (y[26])/2.54, "xarc_start"); addpoint((x[125]-ry/2)/2.54, (y[125])/2.54, "xarc_corner"); addpoint((x[25]-ry/2)/2.54, (y[25])/2.54, "line"); group_obj[1]=newobject("poly"); addpoint((x[23]-ry/2)/2.54, (y[23])/2.54, "LINE"); addpoint((x[23]-1-ry/2)/2.54, (y[23])/2.54, "LINE"); addpoint((x[23]-2-ry/2)/2.54, (y[23])/2.54, "LINE"); addpoint((x[23]-3-ry/2)/2.54, (y[23]+.25)/2.54, "LINE"); addpoint((x[206]-3-ry/2)/2.54, (y[206])/2.54, "LINE"); addpoint((x[206]-ry/2)/2.54, (y[206])/2.54, "LINE"); group_obj[2]=newobject("poly"); addpoint((x[23]-1-ry/2)/2.54, (y[23])/2.54, "LINE"); addpoint((x[206]-1-ry/2)/2.54, (y[206])/2.54, "LINE"); cont(207,16,101,-sivu); cont(207,101,102,-2); group_obj[3]=newobject("poly"); addpoint((x[15]-ry/2)/2.54, (y[10])/2.54, "LINE"); addpoint((x[102]-ry/2)/2.54, (y[102])/2.54, "line"); addpoint((x[101]-ry/2)/2.54, (y[101])/2.54, "line"); addpoint((x[15]-ry/2)/2.54, (y[10]+2)/2.54, "LINE"); double siirto, siirtox; siirto=dist(23,211); siirtox=ry-ptl; if(ease==0) { group_obj[4]=newobject("poly"); addpoint((x[10]-ry/2)/2.54, (y[10])/2.54, "LINE"); addpoint((x[8]-ry/2)/2.54, (y[8]+2)/2.54, "LINE"); addpoint((x[22]+3-ry/2)/2.54, (y[8]+2)/2.54, "LINE"); addpoint((x[15]-ry/2)/2.54, (y[10]+2+2)/2.54, "LINE"); addpoint((x[15]-ry/2)/2.54, (y[10])/2.54, "LINE"); group_obj[5]=newobject("poly"); addpoint((x[10]-siirtox)/2.54, (y[10]-siirto)/2.54, "LINE"); addpoint((x[8]-siirtox)/2.54, (y[8]+2-siirto)/2.54, "LINE"); addpoint((x[22]+3-siirtox)/2.54, (y[8]+2-siirto)/2.54, "LINE"); addpoint((x[15]-siirtox)/2.54, (y[10]+2+2-siirto)/2.54, "LINE"); addpoint((x[15]-siirtox)/2.54, (y[10]-siirto)/2.54, "LINE"); } else { group_obj[6]=newobject("poly"); addpoint((x[10]-ry/2)/2.54, (y[10])/2.54, "LINE"); addpoint((x[8]-ry/2)/2.54, (y[8]+5)/2.54, "LINE"); addpoint((x[22]+3-ry/2)/2.54, (y[8]+5)/2.54, "LINE"); addpoint((x[15]-ry/2)/2.54, (y[10]+2+2)/2.54, "LINE"); addpoint((x[15]-ry/2)/2.54, (y[10])/2.54, "LINE"); group_obj[7]=newobject("poly"); addpoint((x[10]-siirtox)/2.54, (y[10]-siirto)/2.54, "LINE"); addpoint((x[8]-siirtox)/2.54, (y[8]+5-siirto)/2.54, "LINE"); addpoint((x[22]+3-siirtox)/2.54, (y[8]+5-siirto)/2.54, "LINE"); addpoint((x[15]-siirtox)/2.54, (y[10]+2+2-siirto)/2.54, "LINE"); addpoint((x[15]-siirtox)/2.54, (y[10]-siirto)/2.54, "LINE"); } x[100]=x[15]; y[100]=y[10]; linecirc(100,207,40,13,1,101); cont(312,207,102,-3); group_obj[8]=newobject("poly"); addpoint((x[22] -ry/2)/2.54, (y[10])/2.54, "LINE"); addpoint((x[22]-ry/2)/2.54, (y[102])/2.54, "LINE"); addpoint((x[102]-ry/2)/2.54, (y[102])/2.54, "LINE"); addpoint((x[207]-ry/2)/2.54, (y[207])/2.54, "LINE"); addpoint((x[101]-ry/2)/2.54, (y[101])/2.54, "LINE"); addpoint((x[100]-ry/2)/2.54, (y[100])/2.54, "LINE"); group_obj[9]=newobject("poly"); addpoint((x[22]-siirtox)/2.54, (y[10]-siirto-4)/2.54, "LINE"); addpoint((x[22]-siirtox)/2.54, (y[102]-siirto-4)/2.54, "LINE"); addpoint((x[102]-siirtox)/2.54, (y[102]-siirto-4)/2.54, "LINE"); addpoint((x[207]-siirtox)/2.54, (y[207]-siirto-4)/2.54, "LINE"); addpoint((x[101]-siirtox)/2.54, (y[101]-siirto-4)/2.54, "LINE"); addpoint((x[100]-siirtox)/2.54, (y[100]-siirto-4)/2.54, "LINE"); cont(25,22,301,-4); cont(8,23,303,-4); x[302]=x[301]; y[302]=y[303]; group_obj[10]=newobject("poly"); addpoint((x[22]-ry/2)/2.54, (y[22])/2.54, "LINE"); addpoint((x[301]-ry/2)/2.54, (y[301])/2.54, "xarc_start"); addpoint((x[302]-ry/2)/2.54, (y[302])/2.54, "xarc_corner"); addpoint((x[303]-ry/2)/2.54, (y[303])/2.54, "LINE"); addpoint((x[23]-ry/2)/2.54, (y[23])/2.54, "xarc_start"); addpoint((x[123]-ry/2)/2.54, (y[123])/2.54, "xarc_corner"); center(212,312,100); group_obj[11]=newobject("poly"); addpoint((x[100]-ry/2)/2.54, (y[100])/2.54, "LINE"); addpoint((x[100]-ry/2)/2.54, (y[211])/2.54, "line"); addpoint((x[100]-ry/2-.5)/2.54, (y[211]-2)/2.54, "line"); addpoint((x[100]-ry/2)/2.54, (y[211])/2.54, "line"); addpoint((x[100]-ry/2+.5)/2.54, (y[211]-2)/2.54, "open"); shift(16,-siirtox1,-siirtoy1); rotate(16,8,-ang); x[120]=x[20]+1; x[27]=x[20]+1; x[6]=x[20]+1; init_xarc_array(); kpt=arclength(1,17,18); y[41]=y[41]-2; y[44]=y[44]-2; y[42]=y[42]-2; y[3]=y[3]-2; shift(17,2*(x[1]-x[17]),0); shift(18,2*(x[1]-x[18]),0); shift(20,2*(x[1]-x[20]),0); shift(120,2*(x[1]-x[120]),0); shift(27,2*(x[1]-x[27]),0); shift(6,2*(x[1]-x[6]),0); shift(16,2*(x[1]-x[16]),0); shift(41,2*(x[1]-x[41]),0); shift(42,2*(x[1]-x[42]),0); shift(44,2*(x[1]-x[44]),0); shift(45,2*(x[1]-x[45]),0); double ang; ang=angle(x[3],y[3],x[41],y[41])-angle(x[216],y[216],x[217],y[217]); rotate (1,3,-ang); rotate (17,3,-ang); rotate (18,3,-ang); rotate (20,3,-ang); rotate (120,3,-ang); rotate (27,3,-ang); rotate (6,3,-ang); rotate (16,3,-ang); rotate (41,3,-ang); rotate (44,3,-ang); rotate (42,3,-ang); rotate (45,3,-ang); rotate (2,3,-ang); double siirtox, siirtoy; siirtox=x[3]-x[216]; siirtoy=y[3]-y[216]; shift(1,-siirtox,-siirtoy); shift(17,-siirtox,-siirtoy); shift(18,-siirtox,-siirtoy); shift(20,-siirtox,-siirtoy); shift(120,-siirtox,-siirtoy); shift(27,-siirtox,-siirtoy); shift(6,-siirtox,-siirtoy); shift(16,-siirtox,-siirtoy); shift(41,-siirtox,-siirtoy); shift(44,-siirtox,-siirtoy); shift(42,-siirtox,-siirtoy); shift(45,-siirtox,-siirtoy); shift(3,-siirtox,-siirtoy); shift(2,-siirtox,-siirtoy); group_obj[12]=newobject("poly"); addpoint((x[1])/2.54, (y[1]-1)/2.54, "xarc_start"); addpoint((x[17])/2.54, (y[17]-1)/2.54, "xarc_corner"); addpoint((x[18])/2.54, (y[18])/2.54, "LINE"); cont(20,18,20,-op); addpoint((x[20])/2.54, (y[20])/2.54, "xarc_start"); addpoint((x[120])/2.54, (y[120])/2.54, "xarc_corner"); addpoint((x[27])/2.54, (y[27])/2.54, "xarc_start"); addpoint((x[6])/2.54, (y[6])/2.54, "xarc_corner"); addpoint((x[16])/2.54, (y[16])/2.54, "line"); addpoint((x[41])/2.54, (y[41])/2.54, "line"); addpoint((x[320])/2.54, (y[320])/2.54, "line"); addpoint((x[205])/2.54, (y[205])/2.54, "line"); addpoint((x[220])/2.54, (y[220])/2.54, "line"); addpoint((x[219])/2.54, (y[219])/2.54, "line"); addpoint((x[319])/2.54, (y[319])/2.54, "xarc_start"); addpoint((x[308])/2.54, (y[308])/2.54, "xarc_corner"); addpoint((x[214])/2.54, (y[214])/2.54, "line"); addpoint((x[216])/2.54, (y[216])/2.54, "line"); addpoint((x[3])/2.54, (y[3])/2.54, "LINE"); addpoint((x[2])/2.54, (y[2])/2.54, "LINE"); cont(20,18,304,-4); cont(2,1,306,-4); x[305]=x[304]-3; y[305]=y[306]-2; group_obj[13]=newobject("poly"); addpoint((x[1])/2.54, (y[1]-1)/2.54, "xarc_start"); addpoint((x[17])/2.54, (y[17]-1)/2.54, "xarc_corner"); addpoint((x[18])/2.54, (y[18])/2.54, "LINE"); addpoint((x[304])/2.54, (y[304])/2.54, "xarc_start"); addpoint((x[305])/2.54, (y[305])/2.54, "xarc_corner"); addpoint((x[306])/2.54, (y[306])/2.54, "LINE"); cont(228,41,100,2); cont(1,2,101,+dist(2,3)); cont(1,101,102,-2); group_obj[14]=newobject("poly"); addpoint((x[41])/2.54, (y[41])/2.54, "LINE"); addpoint((x[100])/2.54, (y[100])/2.54, "LINE"); addpoint((x[102])/2.54, (y[102])/2.54, "LINE"); addpoint((x[101])/2.54, (y[101])/2.54, "LINE"); center(220,320,101); group_obj[15]=newobject("poly"); addpoint((x[101])/2.54, (y[101])/2.54, "LINE"); addpoint((x[101])/2.54, (y[217])/2.54, "line"); addpoint((x[101]-.5)/2.54, (y[217]-2)/2.54, "line"); addpoint((x[101])/2.54, (y[217])/2.54, "line"); addpoint((x[101]+.5)/2.54, (y[217]-2)/2.54, "open"); pk=pk-3; coord(22,1,-hl-ry/2,pk); coord(1,2,0,-pk); coord(1,3,0,-hp); coord(1,4,0,-hp/2+1); coord(1,5,ktl/2,0); coord(2,6,hl/2,0); coord(3,7,ray/2,0); coord(1,9,-ktl/2,0); coord(2,10,-hl/2,0); coord(3,11,-ray/2,0); coord(10,13,ktl/2,0); coord(6,16,-ktl/4,0); center(5,16,15); center(9,13,14); center(7,3,18); y[18]=y[18]-.5; center(11,3,17); y[17]=y[17]+.5; group_obj[16]=newobject("poly"); addpoint((x[6])/2.54, (y[6])/2.54, "xarc_start"); addpoint((x[16])/2.54, (y[16])/2.54, "xarc_corner"); addpoint((x[15])/2.54, (y[15])/2.54, "xarc_start"); addpoint((x[5])/2.54, (y[5])/2.54, "xarc_corner"); addpoint((x[1])/2.54, (y[1])/2.54, "xarc_start"); addpoint((x[9])/2.54, (y[9])/2.54, "xarc_corner"); addpoint((x[14])/2.54, (y[14])/2.54, "xarc_start"); addpoint((x[13])/2.54, (y[13])/2.54, "xarc_corner"); addpoint((x[10])/2.54, (y[10])/2.54, "line"); addpoint((x[11])/2.54, (y[11])/2.54, "xarc_start"); addpoint((x[17])/2.54, (y[17])/2.54, "xarc_corner"); addpoint((x[3])/2.54, (y[3])/2.54, "xarc_start"); addpoint((x[18])/2.54, (y[18])/2.54, "xarc_corner"); addpoint((x[7])/2.54, (y[7])/2.54, "line"); group_obj[17]=newobject("poly"); addpoint((x[1])/2.54, (y[1])/2.54, "line"); addpoint((x[4])/2.54, (y[4]-2)/2.54, "line"); addpoint((x[4]-.5)/2.54, (y[4])/2.54, "line"); addpoint((x[4])/2.54, (y[4]-2)/2.54, "line"); addpoint((x[4]+.5)/2.54, (y[4])/2.54, "open"); kp=kpe+kpt; coord(120,71,-ry/2,+5); coord(71,72,-kp,.5); coord(72,73,0,5); coord(71,74,0,7); coord(71,75,-kp/6,0); coord(71,76,-kp/6*2,0); coord(71,77,-kp/6*3,0); coord(71,78,-kp/6*4,0); coord(71,79,-kp/6*5,0); cont(74,73,80,+1); cont(72,80,81,-1); group_obj[18]=newobject("poly"); addpoint((x[71])/2.54, (y[71]+5+2)/2.54, "line"); addpoint((x[75])/2.54, (y[75]+5+2)/2.54, "xarc_start"); addpoint((x[76])/2.54, (y[76]+5+2)/2.54, "xarc_corner"); addpoint((x[77])/2.54, (y[77]+5+1)/2.54, "xarc_start"); addpoint((x[78])/2.54, (y[78]+5)/2.54, "xarc_corner"); addpoint((x[79])/2.54, (y[79]+5)/2.54, "line"); addpoint((x[72])/2.54, (y[72]+5)/2.54, "LINE"); addpoint((x[72])/2.54, (y[71]+5+hupunkorkeus)/2.54, "LINE"); addpoint((x[71]+4-5)/2.54,(y[71]+5+hupunkorkeus)/2.54, "xarc_start"); addpoint((x[71]+4)/2.54, (y[71]+5+hupunkorkeus)/2.54, "xarc_corner"); addpoint((x[71]+4)/2.54, (y[71]+5+hupunkorkeus-5)/2.54, "xarc_start"); addpoint((x[71]+4)/2.54, (y[71]+5+hupunkorkeus/2)/2.54, "xarc_corner"); //Front if (sv!=0) { offset_mark(0); select(current_selection,group_obj[1]); select(current_selection,group_obj[2]); select(current_selection,group_obj[3]); if(ease==0) { select(current_selection,group_obj[4]); } else { select(current_selection,group_obj[7]); } select(current_selection,group_obj[8]); select(current_selection,group_obj[11]); group(current_selection); deselect(current_selection); if(ease==0) { //pocket offset_mark(5); group(current_selection); deselect(current_selection); } else { //pocket offset_mark(7); group(current_selection); deselect(current_selection); } //pocket offset_mark(9); group(current_selection); deselect(current_selection); //front neck offset_mark(10); group(current_selection); deselect(current_selection); //back offset_mark(12); select(current_selection,group_obj[14]); select(current_selection,group_obj[15]); group(current_selection); deselect(current_selection); //back neck offset_mark(13); group(current_selection); deselect(current_selection); //sleeve offset_mark(16); select(current_selection,group_obj[17]); group(current_selection); deselect(current_selection); //hood offset_mark(18); group(current_selection); deselect(current_selection); } else { mark(0); current_selection=newselection("OBJECT"); select(current_selection,group_obj[0]); select(current_selection,group_obj[1]); select(current_selection,group_obj[2]); select(current_selection,group_obj[3]); if(ease==0) { select(current_selection,group_obj[4]); } else { select(current_selection,group_obj[7]); } select(current_selection,group_obj[8]); select(current_selection,group_obj[11]); group(current_selection); deselect(current_selection); if(ease==0) { //pocket mark(5); } else { //pocket mark(7); } //pocket mark(9); //front neck mark(10); //back mark(12); current_selection=newselection("OBJECT"); select(current_selection,group_obj[12]); select(current_selection,group_obj[14]); select(current_selection,group_obj[15]); group(current_selection); deselect(current_selection); //back neck mark(13); //sleeve mark(16); current_selection=newselection("OBJECT"); select(current_selection,group_obj[16]); select(current_selection,group_obj[17]); group(current_selection); deselect(current_selection); //hood mark(18); } 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"); } 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 == 1) && (unit_mode() == 1) ) { index = index + 1; } if ( (index == 2) && (unit_mode() == 0) ) { index = index + 1; } if (index == 4) { done = 1; } //debug(index); } Backward() { index = index - 1; if ( (index == 2) && (unit_mode() == 0) ) { index = index - 1; } if ( (index == 1) && (unit_mode() == 1) ) { index = index - 1; } } Popup1() { if (language == 0) { start_pict_dialog("CHOOSE MEASUREMENT UNITS"); add_pict_item("Child's height in inches","blank.jpg"); add_pict_item("Child's height in centimeters","blank.jpg"); run_pict("Next"); sizes=get_pict_result(); Forward(); } } Popup2() { if (language == 0) { start_pict_dialog("SELECT CLOSEST HEIGHT"); add_pict_item("41","blank.jpg"); add_pict_item("43","blank.jpg"); add_pict_item("45.5","blank.jpg"); add_pict_item("48","blank.jpg"); add_pict_item("50.5","blank.jpg"); add_pict_item("53","blank.jpg"); add_pict_item("55","blank.jpg"); add_pict_item("57.5","blank.jpg"); run_pict("Next"); size=get_pict_result(); Forward(); } } Popup3() { if (language == 0) { start_pict_dialog("SELECT CLOSEST HEIGHT"); add_pict_item("104","blank.jpg"); add_pict_item("110","blank.jpg"); add_pict_item("116","blank.jpg"); add_pict_item("122","blank.jpg"); add_pict_item("128","blank.jpg"); add_pict_item("134","blank.jpg"); add_pict_item("140","blank.jpg"); add_pict_item("146","blank.jpg"); run_pict("Next"); size=get_pict_result(); Forward(); } } Popup4() { if (language == 0) { start_pict_dialog("CHOICE OF EASE"); add_pict_item("Normal","blank.jpg"); add_pict_item("Wide","blank.jpg"); if (run_pict("Back","Next")) { ease=get_pict_result(); Forward(); } else { ease=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 xarc_x_array[13], xarc_y_array[13]; double return_x, return_y; arclength(double start, double corner, double end) { double count, last_x, last_y; double a_dist; last_x = x[start]; last_y = y[start]; a_dist=0; for (count=1; count < 12; count = count + 1) { from_tspace(start, corner, end, count); a_dist = a_dist + distance(return_x, return_y, last_x, last_y); last_x=return_x; last_y=return_y; } return a_dist; } double A1, A2, B1, B2; double sx, sy, cx, cy, ex, ey; double tspace_0[2], tspace_1[2]; double ft_center[2]; from_tspace(double start, double corner, double end, double pos) { if (pos<1) { return_x=x[start]; return_y=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; tspace_0[0]=A1; tspace_0[1]=B1; tspace_1[0]=A2; tspace_1[1]=B2; ft_center[0]= cx + (tspace_0[0] + tspace_0[1]); ft_center[1]= cy + (tspace_1[0] + tspace_1[1]); return_x = tspace_0[0]*(xarc_x_array[pos])+tspace_0[1] *(xarc_y_array[pos])+ ft_center[0]; return_y = tspace_1[0]*(xarc_x_array[pos])+tspace_1[1] *(xarc_y_array[pos])+ ft_center[1]; } else { if (pos>10) { return_x=x[end]; return_y=y[end]; } else { return_x = tspace_0[0]*(xarc_x_array[pos])+tspace_0[1] *(xarc_y_array[pos])+ ft_center[0]; return_y = tspace_1[0]*(xarc_x_array[pos])+tspace_1[1] *(xarc_y_array[pos])+ ft_center[1]; } } } } init_xarc_array() { double ang_start, ang_end, step, theta, count; double XARC_PIECES; XARC_PIECES = 12; ang_start = -3.14159/2; ang_end= -3.14159; count=0; step= (ang_end - ang_start)/(XARC_PIECES-1); for (theta=ang_start; count < XARC_PIECES; theta = theta + step) { xarc_x_array[count] = cos(theta); xarc_y_array[count] = sin(theta); count=count+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; } } newobj_dot() { line("CENTER_LINE"); NEWOBJECT ("POLY"); line("SOLID_LINE"); }