// 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 vy,abdm,yly, aly,ylk,alk,length,FWstDart1,FWstDart2,SWstDart,SAbdDart,BWstDart1,BWstDart2,FWidth,BWidth; double language; double ease, f_vy[3],f_yly[3],f_aly[3]; double metric, sv; double read; double test; double ang; double x[200], y[200]; 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."); } vy=66; aly=82; alk=17.5; length=45; abdm=aly; ylk=alk/2; //Start Options while (!done) { if (index==0) { Popup1(); } } //End Options if (is_function("unit_mode")==1) { metric = unit_mode(); if (!metric) { vy=vy/2.54; aly=aly/2.54; alk=alk/2.54; length=length/2.54; } } else { if (language == 0) { metric=2*pop_up("Units","Inches","Centimeters"); } if (metric<1) { vy=vy/2.54; aly=aly/2.54; alk=alk/2.54; length=length/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' SKIRT"); } if (language == 0) { add_picture_input("Waist circumference",vy, "w_meas_waistcirc"); } if (language == 0) { add_picture_input("Hip circumference",aly, "w_meas_hipcirc"); } if (language == 0) { add_picture_input("Waist - Hip",alk, "w_meas_waist-hip"); } if (language == 0) { add_picture_input("Length from waist",length, "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' SKIRT", "Waist circumference,",vy, "Hip circumference",aly, "Waist - Hip",alk, "Length from waist",length, "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",length, "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",length, "Seam Allowance", sv); } } } if (is_function("unit_mode")==1) { metric = unit_mode(); if (!metric) { vy=vy*2.54; aly=aly*2.54; alk=alk*2.54; length=length*2.54; } } else { if (metric<1) { vy=vy*2.54; aly=aly*2.54; alk=alk*2.54; length=length*2.54; } } if(metric==2) { sv=sv/2.54; } f_vy[0]=vy+2; f_yly[0]=yly+4; f_aly[0]=aly+4; f_vy[1]=vy+1; f_yly[1]=yly+2; f_aly[1]=aly+2; f_vy[2]=vy+3; f_yly[2]=yly+6; f_aly[2]=aly+6; vy=f_vy[ease]; yly=f_yly[ease]; aly=f_aly[ease]; SAbdDart=aly/2-abdm/2-1; test=aly-vy; if (test < 25) { FWstDart1=2; FWstDart2=0; BWstDart1=0; BWstDart2=2.5; SWstDart=(aly/2-vy/2-FWstDart1-FWstdart2-BWstDart1-BWstDart2); } else { FWstDart1=2; FWstDart2=2; BWstDart1=2; BWstDart2=2.5; SWstDart=(aly/2-vy/2-FWstDart1-FWstdart2-BWstDart1-BWstDart2); } FWidth=aly/4+1.5; BWidth=aly/4-1.5; x[0]=0; y[0]=0; coord(0,1,0,length-alk); coord(0,2,0,length-ylk); coord(0,3,0,length); coord(3,4,FWidth-SWstDart/2-4.5-FWstDart2-4.5-FWstDart1,0); coord(4,6,FWstDart1,0); ang=angle(x[4], y[4], x[6], y[6]) - 3.14159/2; polar((x[4]+x[6])/2, (y[4]+y[6])/2, ang, ylk); x[5] = getresultx(); y[5] = getresulty(); coord(6,7,4.5,0.5); coord(7,9,FWstDart2,0); if(FWstDart2==0) { x[8]=x[7]; y[8]=y[7]; } else { ang=angle(x[7], y[7], x[9], y[9]) - 3.14159/2; } polar((x[7]+x[9])/2, (y[7]+y[9])/2, ang, ylk); x[8] = getresultx(); y[8] = getresulty(); coord(9,10,4.5,.5); coord(1,12,FWidth,0); coord(12,11,0,alk/3*2); coord(0,13,FWidth-1,0); coord(0,14,FWidth+1,0); coord(1,15,FWidth,0); coord(15,16,0,alk/3*2); coord(3,17,FWidth+SWstDart/2,1); coord(17,18,(BWidth-SWstDart-vy/10-BWstDart2)/2,-1); coord(18,20,BWstDart1,0); coord(20,21,(BWidth-SWstDart/2-vy/10-BWstDart2)/2,-0.5); coord(21,23,BWstDart2,0); if(BWstDart1==0) { x[19]=x[18]; y[19]=y[18]; } else { ang=angle(x[18], y[18], x[20], y[20]) - 3.14159/2; polar((x[18]+x[20])/2, (y[18]+y[20])/2, ang, ylk); x[19] = getresultx(); y[19] = getresulty(); } ang=angle(x[21], y[21], x[23], y[23]) - 3.14159/2; polar((x[21]+x[23])/2, (y[21]+y[23])/2, ang, ylk+(alk-ylk)/2); x[22] = getresultx(); y[22] = getresulty(); coord(3,24,aly/2,-1); coord(3,25,aly/2+3,-1); coord(1,26,aly/2+3,alk-20); coord(1,27,aly/2,alk-20); coord(1,28,aly/2,0); coord(0,29,aly/2,18); coord(29,30,4,0); coord(0,31,aly/2+4,0); coord(0,32,aly/2,0); group_obj[0] = newobject("poly"); addpoint(x[32]/2.54, y[32]/2.54, "LINE"); addpoint(x[24]/2.54, y[24]/2.54, "LINE"); if (test < 25) { group_obj[1] = newobject("poly"); addpoint((x[0]-4)/2.54, y[0]/2.54, "LINE"); addpoint((x[1]-4)/2.54, y[1]/2.54, "LINE"); addpoint((x[2]-4)/2.54, y[2]/2.54, "LINE"); addpoint((x[3]-4)/2.54, y[3]/2.54, "LINE"); addpoint((x[4]-4)/2.54, y[4]/2.54, "LINE"); addpoint((x[5]-4)/2.54, y[5]/2.54, "LINE"); addpoint((x[6]-4)/2.54, y[6]/2.54, "LINE"); addpoint((x[7]-4)/2.54, y[7]/2.54, "LINE"); addpoint((x[10]-4)/2.54, y[10]/2.54, "xarc_start"); current_point =addpoint((x[11]-4)/2.54, y[11]/2.54, "xarc_corner"); notch_type(current_point,"NOTCH",0); current_point = addpoint((x[12]-4)/2.54, y[12]/2.54, "line"); notch_type(current_point,"NOTCH",0); addpoint((x[13]-4)/2.54, y[13]/2.54, "LINE"); } else { group_obj[2] = newobject("poly"); addpoint((x[0]-4)/2.54, y[0]/2.54, "LINE"); addpoint((x[1]-4)/2.54, y[1]/2.54, "LINE"); addpoint((x[2]-4)/2.54, y[2]/2.54, "LINE"); addpoint((x[3]-4)/2.54, y[3]/2.54, "LINE"); addpoint((x[4]-4)/2.54, y[4]/2.54, "LINE"); addpoint((x[5]-4)/2.54, y[5]/2.54, "LINE"); addpoint((x[6]-4)/2.54, y[6]/2.54, "LINE"); addpoint((x[7]-4)/2.54, y[7]/2.54, "LINE"); addpoint((x[8]-4)/2.54, y[8]/2.54, "LINE"); addpoint((x[9]-4)/2.54, y[9]/2.54, "LINE"); addpoint((x[10]-4)/2.54, y[10]/2.54, "xarc_start"); current_point =addpoint((x[11]-4)/2.54, y[11]/2.54, "xarc_corner"); notch_type(current_point,"NOTCH",0); current_point = addpoint((x[12]-4)/2.54, y[12]/2.54, "line"); notch_type(current_point,"NOTCH",0); addpoint((x[13]-4)/2.54, y[13]/2.54, "LINE"); } if (test < 25) { group_obj[3] = newobject("poly"); addpoint(x[14]/2.54, y[14]/2.54, "line"); current_point = addpoint(x[15]/2.54, y[15]/2.54, "xarc_start"); notch_type(current_point,"NOTCH",0); current_point = addpoint(x[16]/2.54, y[16]/2.54, "xarc_corner"); notch_type(current_point,"NOTCH",0); addpoint(x[17]/2.54, y[17]/2.54, "LINE"); addpoint(x[18]/2.54, y[18]/2.54, "LINE"); addpoint(x[21]/2.54, y[21]/2.54, "LINE"); addpoint(x[22]/2.54, y[22]/2.54, "LINE"); addpoint(x[23]/2.54, y[23]/2.54, "LINE"); addpoint(x[24]/2.54, y[24]/2.54, "LINE"); addpoint(x[25]/2.54, y[25]/2.54, "LINE"); addpoint(x[26]/2.54, y[26]/2.54, "LINE"); addpoint(x[27]/2.54, y[27]/2.54, "LINE"); addpoint(x[29]/2.54, y[29]/2.54, "LINE"); addpoint(x[30]/2.54, y[30]/2.54, "LINE"); addpoint(x[31]/2.54, y[31]/2.54, "LINE"); addpoint(x[32]/2.54, y[32]/2.54, "LINE"); } else { group_obj[4] = newobject("poly"); addpoint(x[14]/2.54, y[14]/2.54, "line"); current_point = addpoint(x[15]/2.54, y[15]/2.54, "xarc_start"); notch_type(current_point,"NOTCH",0); current_point = addpoint(x[16]/2.54, y[16]/2.54, "xarc_corner"); notch_type(current_point,"NOTCH",0); addpoint(x[17]/2.54, y[17]/2.54, "LINE"); addpoint(x[18]/2.54, y[18]/2.54, "LINE"); addpoint(x[19]/2.54, y[19]/2.54, "LINE"); addpoint(x[20]/2.54, y[20]/2.54, "LINE"); addpoint(x[21]/2.54, y[21]/2.54, "LINE"); addpoint(x[22]/2.54, y[22]/2.54, "LINE"); addpoint(x[23]/2.54, y[23]/2.54, "LINE"); addpoint(x[24]/2.54, y[24]/2.54, "LINE"); addpoint(x[25]/2.54, y[25]/2.54, "LINE"); addpoint(x[26]/2.54, y[26]/2.54, "LINE"); addpoint(x[27]/2.54, y[27]/2.54, "LINE"); addpoint(x[29]/2.54, y[29]/2.54, "LINE"); addpoint(x[30]/2.54, y[30]/2.54, "LINE"); addpoint(x[31]/2.54, y[31]/2.54, "LINE"); addpoint(x[32]/2.54, y[32]/2.54, "LINE"); } group_obj[10] = rect ((x[3]-8)/2.54,(y[3])/2.54,(x[3]-8-7)/2.54,(y[3]-(vy-2)/2)/2.54); coord(29,33,-4,0); coord(32,34,-4,0); if (test < 25) { group_obj[5] = newobject("poly"); addpoint((x[14]+aly/4+8)/2.54, y[14]/2.54, "line"); current_point = addpoint((x[15]+aly/4+8)/2.54, y[15]/2.54, "xarc_start"); notch_type(current_point,"NOTCH",0); current_point = addpoint((x[16]+aly/4+8)/2.54, y[16]/2.54, "xarc_corner"); notch_type(current_point,"NOTCH",0); addpoint((x[17]+aly/4+8)/2.54, y[17]/2.54, "LINE"); current_point = addpoint((x[18]+aly/4+8)/2.54, y[18]/2.54, "LINE"); current_point = addpoint((x[21]+aly/4+8)/2.54, y[21]/2.54, "LINE"); notch_type(current_point,"NOTCH",0); current_point = addpoint((x[23]+aly/4+8)/2.54, y[23]/2.54, "LINE"); notch_type(current_point,"NOTCH",0); addpoint((x[24]+aly/4+8)/2.54, y[24]/2.54, "LINE"); current_point = addpoint((x[28]+aly/4+8)/2.54, y[28]/2.54, "LINE"); notch_type(current_point,"NOTCH",0); addpoint((x[29]+aly/4+8)/2.54, y[29]/2.54, "xarc_start"); addpoint((x[33]+aly/4+8)/2.54, y[33]/2.54, "xarc_corner"); addpoint((x[34]+aly/4+8)/2.54, (y[34])/2.54, "LINE"); } else { group_obj[6] = newobject("poly"); addpoint((x[14]+aly/4+8)/2.54, y[14]/2.54, "line"); current_point = addpoint((x[15]+aly/4+8)/2.54, y[15]/2.54, "xarc_start"); notch_type(current_point,"NOTCH",0); current_point = addpoint((x[16]+aly/4+8)/2.54, y[16]/2.54, "xarc_corner"); notch_type(current_point,"NOTCH",0); addpoint((x[17]+aly/4+8)/2.54, y[17]/2.54, "LINE"); current_point = addpoint((x[18]+aly/4+8)/2.54, y[18]/2.54, "LINE"); notch_type(current_point,"NOTCH",0); current_point = addpoint((x[20]+aly/4+8)/2.54, y[20]/2.54, "LINE"); notch_type(current_point,"NOTCH",0); current_point = addpoint((x[21]+aly/4+8)/2.54, y[21]/2.54, "LINE"); notch_type(current_point,"NOTCH",0); current_point = addpoint((x[23]+aly/4+8)/2.54, y[23]/2.54, "LINE"); notch_type(current_point,"NOTCH",0); addpoint((x[24]+aly/4+8)/2.54, y[24]/2.54, "LINE"); current_point = addpoint((x[28]+aly/4+8)/2.54, y[28]/2.54, "LINE"); notch_type(current_point,"NOTCH",0); addpoint((x[29]+aly/4+8)/2.54, y[29]/2.54, "xarc_start"); addpoint((x[33]+aly/4+8)/2.54, y[33]/2.54, "xarc_corner"); addpoint((x[34]+aly/4+8)/2.54, (y[34])/2.54, "LINE"); } if (sv != 0) { offset_mark(10); group(current_selection); deselect(current_selection); if (test < 25) { //1,3,5 offset_mark(1); group(current_selection); deselect(current_selection); offset_mark(3); select(current_selection,group_obj[0]); group(current_selection); deselect(current_selection); offset_mark(5); group(current_selection); deselect(current_selection); } else { //2,4,6 offset_mark(2); group(current_selection); deselect(current_selection); offset_mark(4); select(current_selection,group_obj[0]); group(current_selection); deselect(current_selection); offset_mark(6); group(current_selection); deselect(current_selection); } } else { mark(10); if (test < 25) { //1,3,5 mark(1); mark(3); current_selection=newselection("OBJECT"); select(current_selection,current_object); select(current_selection,group_obj[0]); group(current_selection); deselect(current_selection); mark(5); } else { //2,4,6 mark(2); mark(4); current_selection=newselection("OBJECT"); select(current_selection,current_object); select(current_selection,group_obj[0]); group(current_selection); deselect(current_selection); mark(6); } } 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 cdistance) { double ang; ang=angle(x[cstart], y[cstart], x[cend], y[cend]); polar(x[cend], y[cend], ang, cdistance); 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) { done = 1; } } Backward() { index = index - 1; } Popup1() { if (language == 0) { start_pict_dialog("HIP EASE"); add_pict_item("Normal (+1.5in/+4cm)","blank.jpg"); add_pict_item("Minimum (+0.75in/+2 cm)","blank.jpg"); add_pict_item("Maximum (+2.5in/+6 cm)","blank.jpg"); run_pict("Next"); ease=get_pict_result(); Forward(); } } 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) { current_object = newobject("poly"); addpoint( x1,y1,"LINE"); addpoint( x2,y1,"LINE"); addpoint( x2,y2,"LINE"); addpoint( x1,y2,"LINE"); return current_object; } dot (double x, double y) { newobject("poly"); addpoint( x,y,"LINE"); } // End