// Copyright (C) 2001 Leena L�hteenm�ki, Finland // Copyright (C) 2015 PatternMaker Software // 2015-09-02 // 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; object marker_array[20]; double marker_count, loop; double metric, sv; double read; double ang; double x[400], y[400]; double ang,vang,vdistance,rangle; 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,pit; double ease; double 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_sp[5],f_ktk[5],f_kay[5],f_ray[5],f_hp[5]; double ptke, ptkt; double language; 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."); } //Start Options while (!done) { if (index==0) { Popup1(); } } //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; pit=alk+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' PULLOVER"); } 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' PULLOVER, 1 of 2", "Neck circumference.",ky, "Bust circumference", ry, "Waist circumference", vy, "Abdomen Circ.",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' PULLOVER, 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; } ry=ry+8; ky=ky+0; vy=vy+6; sl=sl+1.6; aly=aly+4; rkkv=rkkv+0; op=op+0; vk=vk+0; rk=rk+0; sp=sp+0; ktk=ktk+0; rl=rl+0; kay=kay+2; ray=ray+2; f_ry[0]=ry-2; f_ky[0]=ky; f_vy[0]=vy-2; f_yly[0]=yly-2; f_aly[0]=aly-2; f_rkkv[0]=rkkv; f_sl[0]=sl-.5; f_op[0]=op-2; f_vk[0]=vk; f_rk[0]=rk; f_sp[0]=sp; f_ktk[0]=ktk-1; f_kay[0]=kay; f_ray[0]=ray; f_hp[0]=hp; f_ry[1]=ry+0; f_ky[1]=ky; f_vy[1]=vy+2; f_yly[1]=yly+2; f_aly[1]=aly+2; f_rkkv[1]=rkkv; f_sl[1]=sl; f_op[1]=op-1; f_vk[1]=vk; f_rk[1]=rk; f_sp[1]=sp; f_ktk[1]=ktk; f_kay[1]=kay+3; f_ray[1]=ray+3; f_hp[1]=hp; f_ry[2]=ry+8; f_ky[2]=ky; f_vy[2]=vy+6; f_yly[2]=yly+4+2; f_aly[2]=aly+4; f_rkkv[2]=rkkv; f_sl[2]=sl+1.6; f_op[2]=op; f_vk[2]=vk; f_rk[2]=rk; f_sp[2]=sp; f_ktk[2]=ktk+1; f_kay[2]=kay+6; f_ray[2]=ray+6; f_hp[2]=hp; 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]; sp=f_sp[ease]; ktk=f_ktk[ease]; kay=f_kay[ease]; ray=f_ray[ease]; hp=f_hp[ease]; 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; pts=pts+6; ptl=ptl+1; eml=0; tml=0; sml=(ry/2-vy/2); smlaly=(ry/2-aly/2); if(aly 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