double lang, index, done; double Flow[1]; double x[73],y[73]; double metric; object Obj[15]; selection current_selection; point current_point; object Off[15]; double temp, Var0, Var1, Var2, Var3, Var4, Var5, Var6, Var7, Var8, Var9; double Var[48]; //__Inches main() { double read; init_xarc_array(); lang = get_language(); if ( (lang != 0) && ( (lang != 0) && ( (lang != 0) && ( (lang != 0))))) { lang=0; } if (is_function("unit_mode")==1) { metric = unit_mode(); } else { metric=pop_up("Units","Inches","Centimeters"); } while (!done) { if (index == 0) { Popup0(); } } if (measure_table("Wrenaissance")==1) { read = 1; } if (read==0) { if (is_function("start_picture_input")) { Var[0]=CheckToMetric(20.5); Var[4]=CheckToMetric(18); Var[5]=CheckToMetric(14.5); Var[7]=CheckToMetric(18); Var[9]=CheckToMetric(15.5); Var[11]=CheckToMetric(18); Var[13]=CheckToMetric(16.5); Var[14]=CheckToMetric(14.25); Var[20]=CheckToMetric(8.5); Var[24]=CheckToMetric(23); if (lang == 0) { start_picture_input("Chemise"); add_picture_input("f1 full bust width",Var[0],"measureF1"); add_picture_input("f5 side neck to waist",Var[4],"measureF5"); add_picture_input("f6 cf neck to waist",Var[5],"measureF6"); add_picture_input("f8 shoulder slope",Var[7],"measureF8"); add_picture_input("f10 full side length",Var[9],"measureF10"); add_picture_input("b1 full back width",Var[11],"measureB1"); add_picture_input("b3 cb neck to waist",Var[13],"measureB3"); add_picture_input("b4 across back",Var[14],"measureB4"); add_picture_input("fb2 side seam",Var[20],"measureFB2"); add_picture_input("s1 shoulder to wrist",Var[24],"measureS1"); run_picture_input(); } Var[0]=CheckFromMetric(Var[0]); Var[4]=CheckFromMetric(Var[4]); Var[5]=CheckFromMetric(Var[5]); Var[7]=CheckFromMetric(Var[7]); Var[9]=CheckFromMetric(Var[9]); Var[11]=CheckFromMetric(Var[11]); Var[13]=CheckFromMetric(Var[13]); Var[14]=CheckFromMetric(Var[14]); Var[20]=CheckFromMetric(Var[20]); Var[24]=CheckFromMetric(Var[24]); } else { Var0=CheckToMetric(20.5); Var1=CheckToMetric(18); Var2=CheckToMetric(14.5); Var3=CheckToMetric(18); Var4=CheckToMetric(15.5); Var5=CheckToMetric(18); Var6=CheckToMetric(16.5); Var7=CheckToMetric(14.25); Var8=CheckToMetric(8.5); Var9=CheckToMetric(23); if (lang == 0) { dialog_box("Chemise","f1 full bust width",Var0,"f5 side neck to waist",Var1,"f6 cf neck to waist",Var2,"f8 shoulder slope",Var3,"f10 full side length",Var4,"b1 full back width",Var5,"b3 cb neck to waist",Var6,"b4 across back",Var7,"fb2 side seam",Var8,"s1 shoulder to wrist",Var9); } Var[0]=CheckFromMetric(Var0); Var[4]=CheckFromMetric(Var1); Var[5]=CheckFromMetric(Var2); Var[7]=CheckFromMetric(Var3); Var[9]=CheckFromMetric(Var4); Var[11]=CheckFromMetric(Var5); Var[13]=CheckFromMetric(Var6); Var[14]=CheckFromMetric(Var7); Var[20]=CheckFromMetric(Var8); Var[24]=CheckFromMetric(Var9); } } else { if (is_function("start_picture_input")) { Var[24]=CheckToMetric(23); if (lang == 0) { start_picture_input("Chemise"); add_picture_input("s1 shoulder to wrist",Var[24],"measureS1"); run_picture_input(); } Var[24]=CheckFromMetric(Var[24]); } else { Var0=CheckToMetric(23); if (lang == 0) { dialog_box("Chemise","s1 shoulder to wrist",Var0); } Var[24]=CheckFromMetric(Var0); } } if (Flow[0] == 0) { if (is_function("start_picture_input")) { Var[25]=CheckToMetric(3); Var[26]=CheckToMetric(0); Var[32]=CheckToMetric(0.62); Var[42]=CheckToMetric(0); if (lang == 0) { start_picture_input("Chemise"); add_picture_input("Neckline Depth",Var[25],"NecklineDepth"); add_picture_input("Extra body width",Var[26],"XBodyWidth"); add_picture_input("seam allowance",Var[32],"meas_seamallow"); add_picture_input("Extra sleeve width",Var[42],"SleeveWidth"); run_picture_input(); } Var[25]=CheckFromMetric(Var[25]); Var[26]=CheckFromMetric(Var[26]); Var[32]=CheckFromMetric(Var[32]); Var[42]=CheckFromMetric(Var[42]); } else { Var0=CheckToMetric(3); Var1=CheckToMetric(0); Var2=CheckToMetric(0.62); Var3=CheckToMetric(0); if (lang == 0) { dialog_box("Chemise","Neckline Depth",Var0,"Extra body width",Var1,"seam allowance",Var2,"Extra sleeve width",Var3); } Var[25]=CheckFromMetric(Var0); Var[26]=CheckFromMetric(Var1); Var[32]=CheckFromMetric(Var2); Var[42]=CheckFromMetric(Var3); } } if (Flow[0] == 1) { if (is_function("start_picture_input")) { Var[25]=CheckToMetric(3); Var[26]=CheckToMetric(0); Var[30]=CheckToMetric(32); Var[32]=CheckToMetric(0.62); Var[42]=CheckToMetric(0); if (lang == 0) { start_picture_input("Chemise"); add_picture_input("Neckline Depth",Var[25],"NecklineDepth"); add_picture_input("Extra body width",Var[26],"XBodyWidth"); add_picture_input("Length from waist",Var[30],"Length"); add_picture_input("seam allowance",Var[32],"meas_seamallow"); add_picture_input("Extra sleeve width",Var[42],"SleeveWidth"); run_picture_input(); } Var[25]=CheckFromMetric(Var[25]); Var[26]=CheckFromMetric(Var[26]); Var[30]=CheckFromMetric(Var[30]); Var[32]=CheckFromMetric(Var[32]); Var[42]=CheckFromMetric(Var[42]); } else { Var0=CheckToMetric(3); Var1=CheckToMetric(0); Var2=CheckToMetric(32); Var3=CheckToMetric(0.62); Var4=CheckToMetric(0); if (lang == 0) { dialog_box("Chemise","Neckline Depth",Var0,"Extra body width",Var1,"Length from waist",Var2,"seam allowance",Var3,"Extra sleeve width",Var4); } Var[25]=CheckFromMetric(Var0); Var[26]=CheckFromMetric(Var1); Var[30]=CheckFromMetric(Var2); Var[32]=CheckFromMetric(Var3); Var[42]=CheckFromMetric(Var4); } } Var[27]=Var[26]/4+Var[0]/6+0; Var[28]=Var[20]/-1+Var[9]/1+0; Var[33]=Var[32]/1+Var[31]/1+0; Var[34]=Var[33]/1+Var[33]/1+0; Var[35]=Var[0]/6+Var[34]/1+0; Var[34]=Var[33]/1+Var[33]/1+0; Var[35]=Var[0]/6+Var[34]/1+0; Var[35]=Var[0]/6+Var[34]/1+0; Var[36]=Var[11]/6+Var[26]/2+0; Var[38]=Var[36]/1+Var[14]/2+1; Var[38]=Var[36]/1+Var[14]/2+1; Var[43]=Var[42]/2+Var[41]/1+0; Var[44]=Var[43]/1+Var[43]/1+6; Var[44]=Var[43]/1+Var[43]/1+6; Var[46]=Var[24]/1+3; if (Flow[0] == 0) { Flow0View1(); } if (Flow[0] == 1) { Flow0View2(); } for (temp=0; temp < 15; temp=temp+1) { if (Off[temp] != 0) { current_selection=newselection("OBJECT"); select(current_selection,Obj[temp]); select(current_selection,Off[temp]); group(current_selection); deselect(current_selection); } } current_selection=newselection("OBJECT"); for (temp=0; temp < 15; temp=temp+1) { if (Obj[temp] != 0) { select(current_selection,Obj[temp]); } } check_overlap(current_selection); deselect(current_selection); run_command("ZOOMALL"); } Popup0() { if (lang == 0) { start_pict_dialog("Chemise"); add_pict_item("Waist Length","shortpattern.jpg"); add_pict_item("Desired Length","longpattern.jpg"); run_pict("Next"); Flow[0] = get_pict_result(); Forward(); } } Forward() { if (index == 0) { if (Flow[0] == 1) { done = 1; } if (Flow[0] == 0) { done = 1; } } } Backward() { } Flow0View1() { if (is_function("macgen_write")) { macgen_write("Flow0View1"); } //Point Start x[0]=0; y[0]=0; //Point c1 coord(0,1,0,0 + Var[4]/-1); //Point c2 coord(0,2,0 + Var[27]/1,0); //Point c3 coord(2,3,0 + Var[0]/2,0); //Point c4 x[4]=x[2]; y[4]=y[1]; //Point c5 x[5]=x[3]; y[5]=y[1]; //Point c6 coord(1,6,0,0 + Var[5]/1); //Point c7 coord(2,7,1 + Var[0]/3,0); //Point c8 coord(7,8,0,-1 + Var[28]/-1); //Point c9 LinePointDist(9,7,8,4,0 + Var[7]/1,1); //Point c10 coord(9,10,0,-1 + Var[28]/-1); //Point c11 Cont(5, 9, 11, 0 + Var[9]/-1); //Point c12 coord(11,12,0 + Var[0]/12,0); //Point c13 x[13]=x[5]; y[13]=y[10]; Var[29]=distance(x[10],y[10],x[13], y[13]); //Point c15 coord(6,14,0,0 + Var[25]/-1); //Point c16 coord(10,15,0,0 + Var[29]/1); //Point c17 x[16]=x[2]; y[16]=y[14]; //Point c18 line_intersect(14,16,13,15,17); Var[41]=distance(x[17],y[17],x[9], y[9]); Var[43]=Var[42]/2+Var[41]/1+0; Var[44]=Var[43]/1+Var[43]/1+6; //Point c19 Center(18,10,13); //Point c20 Center(19,18,10); //Point c21 Center(20,15,10); //Point c22 coord(1,21,0,0 + Var[30]/-1); //Point c23 x[22]=x[5]; y[22]=y[21]; //Point c24 Cont(13, 12, 23, 0 + Var[30]/1); Var[31]=distance(x[23],y[23],x[22], y[22]); Var[33]=Var[32]/1+Var[31]/1+0; Var[34]=Var[33]/1+Var[33]/1+0; Var[35]=Var[0]/6+Var[34]/1+0; //Point t1 coord(1,24,0.5,3); //Point t4 coord(14,25,2,-3); //Point n1 Cont(12, 13, 26, -4); //Point cr1 coord(25,27,0,-2); //Point b1 coord(5,28,0 + Var[35]/1,0); //Point b2 coord(28,29,0 + Var[11]/2,0); //Point b3 coord(29,30,0 + Var[36]/1,0); //Point b4 x[31]=x[30]; y[31]=y[14]; //Point b5 coord(31,32,0,2); //Point b6 x[33]=x[28]; y[33]=y[32]; //Point b7 coord(29,34,-1 + Var[11]/-3,0); //Point b8 x[35]=x[34]; y[35]=y[32]; //Point b9 x[36]=x[28]; y[36]=y[13]; //Point b10 x[37]=x[28]; y[37]=y[11]; //Point b11 coord(37,38,0 + Var[0]/-12,0); //Point b12 x[39]=x[34]; y[39]=y[36]; Var[37]=distance(x[39],y[39],x[36], y[36]); //Point b13 coord(39,40,0,1 + Var[37]/1); //Point b14 line_intersect(36,40,32,35,41); //Point b15 Center(42,39,40); //Point b16 Center(43,36,39); //Point n2 Cont(38, 36, 44, -4); //Point t2 coord(30,45,-0.5,2); //Point s11 x[46]=x[41]; y[46]=y[36]; Var[45]=distance(x[36],y[36],x[46], y[46]); //Point cr2 coord(46,47,0,-2); //Point b18 coord(30,48,0,0 + Var[30]/-1); //Point b19 x[49]=x[28]; y[49]=y[48]; //Point b20 Cont(36, 38, 50, 0 + Var[30]/1); //Point s1 coord(39,51,0 + Var[38]/1,0); //Point s2 coord(51,52,0 + Var[29]/1,0); //Point s3 x[53]=x[52]; y[53]=y[8]; //Point s4 x[54]=x[17]; y[54]=y[10]; Var[39]=distance(x[54],y[54],x[10], y[10]); Var[40]=distance(x[54],y[54],x[17], y[17]); //Point s5 coord(52,55,0 + Var[39]/1,0); //Point s6 coord(55,56,0,0 + Var[40]/1); //Point s7 Center(57,51,52); //Point s8 Center(58,57,52); //Point s9 coord(56,59,0 + Var[44]/1,0); //Point s10 x[60]=x[59]; y[60]=y[32]; //Point s12 x[61]=x[60]; y[61]=y[46]; //Point s13 coord(61,62,0 + Var[45]/1,0); //Point s14 coord(62,63,0 + Var[37]/-1,0); //Point s16 x[64]=x[63]; y[64]=y[42]; //Point s17 Center(65,62,63); //Point s18 Center(66,56,60); //Point s19 coord(66,67,0,0 + Var[46]/-1); //Point s20 x[68]=x[62]; y[68]=y[67]; //Point s21 x[69]=x[51]; y[69]=y[67]; //Point t6 coord(55,70,2,0); //Point t7 coord(70,71,0,-2); //Point s22 coord(67,72,0.5,3); if (lang == 0) { Obj[0]=newobject("Text","Copyright Jennifer Smith 2005",0,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[71],y[71],"LINE"); name_point(current_point,"t7"); if (lang == 0) { name_object(Obj[0],"Sleeve Copyright"); } if (lang == 0) { Obj[1]=newobject("Text","Chemise Sleeve",0,1,1,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[70],y[70],"LINE"); name_point(current_point,"t6"); if (lang == 0) { name_object(Obj[1],"Sleeve text"); } Obj[2]=newobject("poly"); current_point=addpoint(x[66],y[66],"LINE"); name_point(current_point,"s18"); current_point=addpoint(x[67],y[67],"OPEN"); name_point(current_point,"s19"); if (lang == 0) { name_object(Obj[2],"sleeve grain"); } Obj[3]=newobject("poly"); current_point=addpoint(x[69],y[69],"LINE"); name_point(current_point,"s21"); current_point=addpoint(x[51],y[51],"XARC_START"); name_point(current_point,"s1"); current_point=addpoint(x[58],y[58],"XARC_CORNER"); name_point(current_point,"s8"); current_point=addpoint(x[53],y[53],"LINE"); name_point(current_point,"s3"); current_point=addpoint(x[56],y[56],"LINE"); name_point(current_point,"s6"); current_point=addpoint(x[60],y[60],"LINE"); name_point(current_point,"s10"); current_point=addpoint(x[64],y[64],"XARC_START"); notch_type(current_point,"NOTCH",0); name_point(current_point,"s16"); current_point=addpoint(x[65],y[65],"XARC_CORNER"); notch_type(current_point,"NOTCH",0); name_point(current_point,"s17"); current_point=addpoint(x[62],y[62],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"s13"); current_point=addpoint(x[68],y[68],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"s20"); offset(3,0 + Var[32]/1); if (lang == 0) { name_object(Obj[3],"sleeve"); } if (lang == 0) { Obj[4]=newobject("Text","Place on fold cut off seam allowance",1.5707963267949,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[45],y[45],"LINE"); name_point(current_point,"t2"); if (lang == 0) { name_object(Obj[4],"back place on fold"); } if (lang == 0) { Obj[5]=newobject("Text","Copyright Jennifer Smith 2005",0,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[47],y[47],"LINE"); name_point(current_point,"cr2"); if (lang == 0) { name_object(Obj[5],"Copyright back"); } if (lang == 0) { Obj[6]=newobject("Text","Chemise Back",0,1,1,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[46],y[46],"LINE"); name_point(current_point,"s11"); if (lang == 0) { name_object(Obj[6],"chemise back text"); } Obj[7]=newobject("poly"); current_point=addpoint(x[38],y[38],"LINE"); name_point(current_point,"b11"); current_point=addpoint(x[44],y[44],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"n2"); current_point=addpoint(x[36],y[36],"XARC_START"); name_point(current_point,"b9"); current_point=addpoint(x[43],y[43],"XARC_CORNER"); name_point(current_point,"b16"); current_point=addpoint(x[42],y[42],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"b15"); current_point=addpoint(x[41],y[41],"LINE"); name_point(current_point,"b14"); current_point=addpoint(x[32],y[32],"LINE"); name_point(current_point,"b5"); current_point=addpoint(x[30],y[30],"XARC_START"); name_point(current_point,"b3"); current_point=addpoint(x[28],y[28],"XARC_CORNER"); name_point(current_point,"b1"); offset(7,0 + Var[32]/1); if (lang == 0) { name_object(Obj[7],"back"); } if (lang == 0) { Obj[8]=newobject("Text","Place on fold cut off seam allowance",1.5707963267949,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[24],y[24],"LINE"); name_point(current_point,"t1"); if (lang == 0) { name_object(Obj[8],"f place on fold"); } if (lang == 0) { Obj[9]=newobject("Text","Copyright Jennifer Smith 2005",0,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[27],y[27],"LINE"); name_point(current_point,"cr1"); if (lang == 0) { name_object(Obj[9],"Copyright"); } if (lang == 0) { Obj[10]=newobject("Text","Chemise Front",0,1,1,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[25],y[25],"LINE"); name_point(current_point,"t4"); if (lang == 0) { name_object(Obj[10],"Chemise Front"); } Obj[11]=newobject("poly"); current_point=addpoint(x[14],y[14],"LINE"); name_point(current_point,"c15"); current_point=addpoint(x[17],y[17],"LINE"); name_point(current_point,"c18"); current_point=addpoint(x[20],y[20],"XARC_START"); name_point(current_point,"c21"); current_point=addpoint(x[18],y[18],"XARC_CORNER"); name_point(current_point,"c19"); current_point=addpoint(x[13],y[13],"LINE"); name_point(current_point,"c13"); current_point=addpoint(x[26],y[26],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"n1"); current_point=addpoint(x[12],y[12],"XARC_START"); name_point(current_point,"c12"); current_point=addpoint(x[5],y[5],"XARC_CORNER"); name_point(current_point,"c5"); current_point=addpoint(x[1],y[1],"LINE"); name_point(current_point,"c1"); offset(11,0 + Var[32]/1); if (lang == 0) { name_object(Obj[11],"front"); } if (lang == 0) { Obj[12]=newobject("Text","grain line",1.5707963267949,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[72],y[72],"LINE"); name_point(current_point,"s22"); if (lang == 0) { name_object(Obj[12],"sleeve grain text"); } current_selection=newselection("OBJECT"); select(current_selection,Obj[4]); select(current_selection,Obj[5]); select(current_selection,Obj[6]); select(current_selection,Obj[7]); group(current_selection); deselect(current_selection); if (lang == 0) { name_group(Obj[7],"back"); } current_selection=newselection("OBJECT"); select(current_selection,Obj[8]); select(current_selection,Obj[9]); select(current_selection,Obj[10]); select(current_selection,Obj[11]); group(current_selection); deselect(current_selection); if (lang == 0) { name_group(Obj[11],"front"); } current_selection=newselection("OBJECT"); select(current_selection,Obj[0]); select(current_selection,Obj[1]); select(current_selection,Obj[2]); select(current_selection,Obj[3]); select(current_selection,Obj[12]); group(current_selection); deselect(current_selection); if (lang == 0) { name_group(Obj[12],"sleeve"); } } Flow0View2() { if (is_function("macgen_write")) { macgen_write("Flow0View2"); } //Point Start x[0]=0; y[0]=0; //Point c1 coord(0,1,0,0 + Var[4]/-1); //Point c2 coord(0,2,0 + Var[27]/1,0); //Point c3 coord(2,3,0 + Var[0]/2,0); //Point c4 x[4]=x[2]; y[4]=y[1]; //Point c5 x[5]=x[3]; y[5]=y[1]; //Point c6 coord(1,6,0,0 + Var[5]/1); //Point c7 coord(2,7,1 + Var[0]/3,0); //Point c8 coord(7,8,0,-1 + Var[28]/-1); //Point c9 LinePointDist(9,7,8,4,0 + Var[7]/1,1); //Point c10 coord(9,10,0,-1 + Var[28]/-1); //Point c11 Cont(5, 9, 11, 0 + Var[9]/-1); //Point c12 coord(11,12,0 + Var[0]/12,0); //Point c13 x[13]=x[5]; y[13]=y[10]; Var[29]=distance(x[10],y[10],x[13], y[13]); //Point c15 coord(6,14,0,0 + Var[25]/-1); //Point c16 coord(10,15,0,0 + Var[29]/1); //Point c17 x[16]=x[2]; y[16]=y[14]; //Point c18 line_intersect(14,16,13,15,17); Var[41]=distance(x[17],y[17],x[9], y[9]); Var[43]=Var[42]/2+Var[41]/1+0; Var[44]=Var[43]/1+Var[43]/1+6; //Point c19 Center(18,10,13); //Point c20 Center(19,18,10); //Point c21 Center(20,15,10); //Point c22 coord(1,21,0,0 + Var[30]/-1); //Point c23 x[22]=x[5]; y[22]=y[21]; //Point c24 Cont(13, 12, 23, 0 + Var[30]/1); Var[31]=distance(x[23],y[23],x[22], y[22]); Var[33]=Var[32]/1+Var[31]/1+0; Var[34]=Var[33]/1+Var[33]/1+0; Var[35]=Var[0]/6+Var[34]/1+0; //Point t1 coord(1,24,0.5,3); //Point t4 coord(14,25,2,-3); //Point n1 Cont(12, 13, 26, -4); //Point cr1 coord(25,27,0,-2); //Point b1 coord(5,28,0 + Var[35]/1,0); //Point b2 coord(28,29,0 + Var[11]/2,0); //Point b3 coord(29,30,0 + Var[36]/1,0); //Point b4 x[31]=x[30]; y[31]=y[14]; //Point b5 coord(31,32,0,2); //Point b6 x[33]=x[28]; y[33]=y[32]; //Point b7 coord(29,34,-1 + Var[11]/-3,0); //Point b8 x[35]=x[34]; y[35]=y[32]; //Point b9 x[36]=x[28]; y[36]=y[13]; //Point b10 x[37]=x[28]; y[37]=y[11]; //Point b11 coord(37,38,0 + Var[0]/-12,0); //Point b12 x[39]=x[34]; y[39]=y[36]; Var[37]=distance(x[39],y[39],x[36], y[36]); //Point b13 coord(39,40,0,1 + Var[37]/1); //Point b14 line_intersect(36,40,32,35,41); //Point b15 Center(42,39,40); //Point b16 Center(43,36,39); //Point n2 Cont(38, 36, 44, -4); //Point t2 coord(30,45,-0.5,2); //Point s11 x[46]=x[41]; y[46]=y[36]; Var[45]=distance(x[36],y[36],x[46], y[46]); //Point cr2 coord(46,47,0,-2); //Point b18 coord(30,48,0,0 + Var[30]/-1); //Point b19 x[49]=x[28]; y[49]=y[48]; //Point b20 Cont(36, 38, 50, 0 + Var[30]/1); //Point s1 coord(39,51,0 + Var[38]/1,0); //Point s2 coord(51,52,0 + Var[29]/1,0); //Point s3 x[53]=x[52]; y[53]=y[8]; //Point s4 x[54]=x[17]; y[54]=y[10]; Var[39]=distance(x[54],y[54],x[10], y[10]); Var[40]=distance(x[54],y[54],x[17], y[17]); //Point s5 coord(52,55,0 + Var[39]/1,0); //Point s6 coord(55,56,0,0 + Var[40]/1); //Point s7 Center(57,51,52); //Point s8 Center(58,57,52); //Point s9 coord(56,59,0 + Var[44]/1,0); //Point s10 x[60]=x[59]; y[60]=y[32]; //Point s12 x[61]=x[60]; y[61]=y[46]; //Point s13 coord(61,62,0 + Var[45]/1,0); //Point s14 coord(62,63,0 + Var[37]/-1,0); //Point s16 x[64]=x[63]; y[64]=y[42]; //Point s17 Center(65,62,63); //Point s18 Center(66,56,60); //Point s19 coord(66,67,0,0 + Var[46]/-1); //Point s20 x[68]=x[62]; y[68]=y[67]; //Point s21 x[69]=x[51]; y[69]=y[67]; //Point t6 coord(55,70,2,0); //Point t7 coord(70,71,0,-2); //Point s22 coord(67,72,0.5,3); Obj[0]=newobject("poly"); current_point=addpoint(x[38],y[38],"XARC_START"); name_point(current_point,"b11"); current_point=addpoint(x[28],y[28],"XARC_CORNER"); name_point(current_point,"b1"); current_point=addpoint(x[29],y[29],"LINE"); name_point(current_point,"b2"); current_point=addpoint(x[30],y[30],"OPEN"); name_point(current_point,"b3"); if (lang == 0) { name_object(Obj[0],"back waist"); } Obj[1]=newobject("poly"); current_point=addpoint(x[1],y[1],"LINE"); name_point(current_point,"c1"); current_point=addpoint(x[4],y[4],"XARC_START"); name_point(current_point,"c4"); current_point=addpoint(x[5],y[5],"XARC_CORNER"); name_point(current_point,"c5"); current_point=addpoint(x[12],y[12],"OPEN"); name_point(current_point,"c12"); if (lang == 0) { name_object(Obj[1],"front waist"); } if (lang == 0) { Obj[2]=newobject("Text","Copyright Jennifer Smith 2005",0,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[71],y[71],"LINE"); name_point(current_point,"t7"); if (lang == 0) { name_object(Obj[2],"Sleeve Copyright"); } if (lang == 0) { Obj[3]=newobject("Text","Chemise Sleeve",0,1,1,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[70],y[70],"LINE"); name_point(current_point,"t6"); if (lang == 0) { name_object(Obj[3],"Sleeve text"); } Obj[4]=newobject("poly"); current_point=addpoint(x[66],y[66],"LINE"); name_point(current_point,"s18"); current_point=addpoint(x[67],y[67],"OPEN"); name_point(current_point,"s19"); if (lang == 0) { name_object(Obj[4],"sleeve grain"); } Obj[5]=newobject("poly"); current_point=addpoint(x[69],y[69],"LINE"); name_point(current_point,"s21"); current_point=addpoint(x[51],y[51],"XARC_START"); name_point(current_point,"s1"); current_point=addpoint(x[58],y[58],"XARC_CORNER"); name_point(current_point,"s8"); current_point=addpoint(x[53],y[53],"LINE"); name_point(current_point,"s3"); current_point=addpoint(x[56],y[56],"LINE"); name_point(current_point,"s6"); current_point=addpoint(x[60],y[60],"LINE"); name_point(current_point,"s10"); current_point=addpoint(x[64],y[64],"XARC_START"); notch_type(current_point,"NOTCH",0); name_point(current_point,"s16"); current_point=addpoint(x[65],y[65],"XARC_CORNER"); notch_type(current_point,"NOTCH",0); name_point(current_point,"s17"); current_point=addpoint(x[62],y[62],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"s13"); current_point=addpoint(x[68],y[68],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"s20"); offset(5,0 + Var[32]/1); if (lang == 0) { name_object(Obj[5],"sleeve"); } if (lang == 0) { Obj[6]=newobject("Text","Place on fold cut off seam allowance",1.5707963267949,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[45],y[45],"LINE"); name_point(current_point,"t2"); if (lang == 0) { name_object(Obj[6],"back place on fold"); } if (lang == 0) { Obj[7]=newobject("Text","Copyright Jennifer Smith 2005",0,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[47],y[47],"LINE"); name_point(current_point,"cr2"); if (lang == 0) { name_object(Obj[7],"Copyright back"); } if (lang == 0) { Obj[8]=newobject("Text","Chemise Back",0,1,1,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[46],y[46],"LINE"); name_point(current_point,"s11"); if (lang == 0) { name_object(Obj[8],"chemise back text"); } Obj[9]=newobject("poly"); current_point=addpoint(x[38],y[38],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"b11"); current_point=addpoint(x[44],y[44],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"n2"); current_point=addpoint(x[36],y[36],"XARC_START"); name_point(current_point,"b9"); current_point=addpoint(x[43],y[43],"XARC_CORNER"); name_point(current_point,"b16"); current_point=addpoint(x[42],y[42],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"b15"); current_point=addpoint(x[41],y[41],"LINE"); name_point(current_point,"b14"); current_point=addpoint(x[32],y[32],"LINE"); name_point(current_point,"b5"); current_point=addpoint(x[30],y[30],"LINE"); name_point(current_point,"b3"); current_point=addpoint(x[48],y[48],"XARC_START"); name_point(current_point,"b18"); current_point=addpoint(x[49],y[49],"XARC_CORNER"); name_point(current_point,"b19"); current_point=addpoint(x[50],y[50],"LINE"); name_point(current_point,"b20"); offset(9,0 + Var[32]/1); if (lang == 0) { name_object(Obj[9],"back"); } if (lang == 0) { Obj[10]=newobject("Text","Place on fold cut off seam allowance",1.5707963267949,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[24],y[24],"LINE"); name_point(current_point,"t1"); if (lang == 0) { name_object(Obj[10],"f place on fold"); } if (lang == 0) { Obj[11]=newobject("Text","Copyright Jennifer Smith 2005",0,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[27],y[27],"LINE"); name_point(current_point,"cr1"); if (lang == 0) { name_object(Obj[11],"Copyright"); } if (lang == 0) { Obj[12]=newobject("Text","Chemise Front",0,1,1,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[25],y[25],"LINE"); name_point(current_point,"t4"); if (lang == 0) { name_object(Obj[12],"Chemise Front"); } Obj[13]=newobject("poly"); current_point=addpoint(x[14],y[14],"LINE"); name_point(current_point,"c15"); current_point=addpoint(x[17],y[17],"LINE"); name_point(current_point,"c18"); current_point=addpoint(x[20],y[20],"XARC_START"); name_point(current_point,"c21"); current_point=addpoint(x[18],y[18],"XARC_CORNER"); name_point(current_point,"c19"); current_point=addpoint(x[13],y[13],"LINE"); name_point(current_point,"c13"); current_point=addpoint(x[26],y[26],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"n1"); current_point=addpoint(x[12],y[12],"LINE"); notch_type(current_point,"NOTCH",0); name_point(current_point,"c12"); current_point=addpoint(x[23],y[23],"XARC_START"); name_point(current_point,"c24"); current_point=addpoint(x[22],y[22],"XARC_CORNER"); name_point(current_point,"c23"); current_point=addpoint(x[21],y[21],"LINE"); name_point(current_point,"c22"); current_point=addpoint(x[1],y[1],"LINE"); name_point(current_point,"c1"); offset(13,0 + Var[32]/1); if (lang == 0) { name_object(Obj[13],"front"); } if (lang == 0) { Obj[14]=newobject("Text","grain line",1.5707963267949,0.5,0.5,"SIMP.CHR","USELAYERCOLOR","NONE","CENTER_LINE",0); } current_point=addpoint(x[72],y[72],"LINE"); name_point(current_point,"s22"); if (lang == 0) { name_object(Obj[14],"sleeve grain text"); } current_selection=newselection("OBJECT"); select(current_selection,Obj[0]); select(current_selection,Obj[6]); select(current_selection,Obj[7]); select(current_selection,Obj[8]); select(current_selection,Obj[9]); group(current_selection); deselect(current_selection); if (lang == 0) { name_group(Obj[9],"back"); } current_selection=newselection("OBJECT"); select(current_selection,Obj[1]); select(current_selection,Obj[10]); select(current_selection,Obj[11]); select(current_selection,Obj[12]); select(current_selection,Obj[13]); group(current_selection); deselect(current_selection); if (lang == 0) { name_group(Obj[13],"front"); } current_selection=newselection("OBJECT"); select(current_selection,Obj[2]); select(current_selection,Obj[3]); select(current_selection,Obj[4]); select(current_selection,Obj[5]); select(current_selection,Obj[14]); group(current_selection); deselect(current_selection); if (lang == 0) { name_group(Obj[14],"sleeve"); } } Mirror(double obj_numb, double from, double line_start, double line_end) { double res_x, res_y; double dx, dy, end_x, end_y, slope, b; if (y[line_start] == y[line_end]) { res_x = x[from]; res_y = y[line_start]; } else { if (x[line_start] == x[line_end]) { res_x = x[line_start]; res_y = y[from]; } else { slope = (y[line_start]-y[line_end])/(x[line_start]-x[line_end]); end_x = x[from]+1; b = y[from] + x[from]/slope; end_y = - end_x/slope + b; intersect(x[line_start], y[line_start], x[line_end], y[line_end],x[from], y[from], end_x, end_y,0); res_x=getresultx(); res_y=getresulty(); } } dx = res_x - x[from]; dy = res_y - y[from]; x[obj_numb] = res_x + dx; y[obj_numb] = res_y + dy; } RotDist(double obj_numb, double start, double end, double to_rot, double rdist) { double dist, ang, ang2; dist=distance(x[start], y[start], x[end], y[end]); if (dist > 0.01) { ang2 = 2*asin(rdist/(2*dist)); ang=angle(x[start], y[start], x[to_rot], y[to_rot]); dist=distance(x[start], y[start], x[to_rot], y[to_rot]); x[obj_numb]=x[start] + dist*cos(ang+ang2); y[obj_numb]=y[start] + dist*sin(ang+ang2); } else { x[obj_numb]=x[to_rot]; y[obj_numb]=y[to_rot]; } } Rotate(double obj_numb, double start, double end, double pass_angle) { double dist, ang; dist=distance(x[start], y[start], x[end], y[end]); if (dist > 0.01) { ang=(pass_angle*3.1417)/180 + angle(x[start], y[start], x[end], y[end]); } else { ang=0; } x[obj_numb]=x[start] + dist*cos(ang); y[obj_numb]=y[start] + dist*sin(ang); } offset(double obj_numb, double value) { Off[obj_numb]=0; if (is_function("unit_mode")==1) { metric = unit_mode(); if (metric) { value=value*2.54; } } if (value!=0) { point pnt, test_pnt; current_selection=newselection("OBJECT"); select(current_selection,Obj[obj_numb]); sel_push(current_selection); var_push(value); run_command("OFFSET"); deselect(current_selection); current_selection=newselection("OBJECT"); get_result_selection(current_selection); while (loop_sel(current_selection)) { pnt=first_point(Obj[obj_numb]); test_pnt=first_point(get_sel_obj()); if ( (pointx(test_pnt) != pointx(pnt)) || (pointy(test_pnt) != pointy(pnt)) ) { Off[obj_numb]=get_sel_obj(); } } deselect(current_selection); } } ArcArcIntersect(double start, double corner, double end, double a2start, double a2corner, double a2end, double dest) { x[dest]=0; y[dest]=0; if (arc_arc_intersect(x[start], y[start], x[corner], y[corner], x[end], y[end], x[a2start], y[a2start], x[a2corner], y[a2corner], x[a2end], y[a2end],1)) { x[dest]=getresultx(); y[dest]=getresulty(); } } LineArcIntersect(double start, double end, double corner, double lstart, double lend, double dest) { x[dest]=0; y[dest]=0; if (arc_line_intersect(x[start], y[start], x[corner], y[corner], x[end], y[end], x[lstart], y[lstart], x[lend], y[lend], 1)) { x[dest]=getresultx(); y[dest]=getresulty(); } } double t0[2], t1[2]; double ftc[2]; double xar[13], yar[13]; double rx, 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; fts(start, corner, end, 0); for (ct=1; ct < 12; ct = ct + 1) { fts(start, corner, end, ct); a_dist = a_dist + distance(rx, ry, last_x, last_y); last_x=rx; last_y=ry; } return a_dist; } // These global variables are used by fts for repeated calls. double A1, A2, B1, B2; //transformation vectors double sx, sy, cx, cy, ex, ey; fts(double start, double corner, double end, double pos) { if (pos<1) { rx=x[start]; 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]); rx = t0[0]*(xar[pos])+t0[1]*(yar[pos])+ ftc[0]; ry = t1[0]*(xar[pos])+t1[1]*(yar[pos])+ ftc[1]; } else {if (pos>10) { rx=x[end]; ry=y[end]; } else { rx = t0[0]*(xar[pos])+t0[1]*(yar[pos])+ ftc[0]; ry = t1[0]*(xar[pos])+t1[1]*(yar[pos])+ ftc[1]; }}} } init_xarc_array() { // Must be called before calling fts(). This routine // sets the values in an array of sines and cosines. // You only need to call this routine once. 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; } //end init_xarc_array } PlaceCorner(double start, double corner, double end, double new_start, double new_end, double dest) { place_corner(x[start], y[start], x[corner], y[corner], x[end], y[end], x[new_start], y[new_start], x[new_end], y[new_end]); x[dest]=getresultx(); y[dest]=getresulty(); } coord(double orig, double dest, double x_offset, double y_offset) { x[dest]=x[orig]+x_offset; y[dest]=y[orig]+y_offset; } 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 cdist) { double ang; ang=angle(x[cstart],y[cstart], x[cend], y[cend]); polar(x[cend],y[cend],ang,cdist); x[cdest]=getresultx(); y[cdest]=getresulty(); } resize(double dest, double first, double second, double pass_scale) { double dx, dy; dx=x[first]-x[second]; dy=y[first]-y[second]; x[dest]=x[first] - dx*pass_scale; y[dest]=y[first] - dy*pass_scale; } move(double dest, double orig, double start, double end) { x[dest]=x[orig]+x[end]-x[start]; y[dest]=y[orig]+y[end]-y[start]; } Center(double dest, double first, double second) { x[dest]=(x[first]+x[second])/2; y[dest]=(y[first]+y[second])/2; } right_ang(double dest, double start, double end, double dist, double clockwise) { double ang; ang=angle(x[start], y[start], x[end], y[end]); if (clockwise) { ang=ang + 3.1417/2; } else { ang=ang - 3.1417/2; } x[dest]=x[start]+dist*cos(ang); y[dest]=y[start]+dist*sin(ang); } Dart(double dest, double start, double end, double dist2, double dir) { double dist, ang, dx, dy, h; dx=x[start]-x[end]; dy=y[start]-y[end]; dist=sqrt(dx*dx+dy*dy); h=sqrt((dist*dist)+(dist2/2)*(dist2/2)); ang=atan(h,(dist2/2)); if (dir==0) { ang=ang+angle(x[start], y[start], x[end], y[end]); } else { ang=angle(x[start], y[start], x[end], y[end])-ang; } x[dest]=x[start]+dist2*cos(ang); y[dest]=y[start]+dist2*sin(ang); } LinePointDist(double dest, double line_start, double line_end, double from, double dist, double clockwise) { double calc_dist, ang; LinePnt(dest, line_start, line_end, from); calc_dist=distance(x[from],y[from],x[dest],y[dest]); if (dist<=calc_dist) { ; } else { calc_dist=sqrt(dist*dist-calc_dist*calc_dist); ang=angle(x[from],y[from],x[dest],y[dest]); if (clockwise==1) { ang=ang+3.1417/2; } else { ang=ang-3.1417/2; } x[dest] = x[dest] + calc_dist*cos(ang); y[dest] = y[dest] + calc_dist*sin(ang); } } CheckToMetric(double pass) { if (metric==1) { pass=pass*2.540000; } return pass; } CheckFromMetric(double pass) { if (metric==1) { pass=pass/2.540000; } return pass; } LinePnt(double dest, double from, double to, double end) { double m1,m2, b1, b2; if (x[from]==x[to]) { x[dest]=x[from]; y[dest]=y[end]; } else { m1=(y[from]-y[to])/(x[from]-x[to]); b1=y[to]-m1*x[to]; if (m1!=0) { m2=-1/m1; b2=y[end]-m2*x[end]; x[dest]=(b1-b2)/(m2-m1); y[dest]=m1*x[dest]+b1; } else { x[dest]=x[end]; y[dest]=y[from]; } } }