Permalink
Browse files

first commit

  • Loading branch information...
1 parent fe97605 commit 94caafa800d48d53a1b0f35362e0c514671a63ff @bettyt committed Dec 29, 2011
Showing with 3,025 additions and 0 deletions.
  1. +130 −0 src/Dress.pde
  2. +11 −0 src/Grid.pde
  3. +22 −0 src/HomePrint.pde
  4. +44 −0 src/Konf.pde
  5. +180 −0 src/Overall.pde
  6. +76 −0 src/Pants.pde
  7. +1,526 −0 src/Pattern.java
  8. +149 −0 src/Pattern.pde
  9. +96 −0 src/ReadWithScanner.pde
  10. +44 −0 src/SRMath.pde
  11. +46 −0 src/WriteToFile.pde
  12. +160 −0 src/basic_dress.pde
  13. +107 −0 src/basic_pants.pde
  14. +118 −0 src/basic_sleeve.pde
  15. +297 −0 src/createAndShowGUI.pde
  16. +19 −0 src/params.pde
View
@@ -0,0 +1,130 @@
+ void Dress(HashMap dress, RawDXF dxf){
+
+ float[] Lh = (float[]) dress.get("Lh");
+ float[] Lv = (float[]) dress.get("Lv");
+ float[] L1 = (float[]) dress.get("L1");
+ float[] H1 = (float[]) dress.get("H1");
+ float[] T1 = (float[]) dress.get("T1");
+ float[] R1 = (float[]) dress.get("R1");
+ float[] W = (float[]) dress.get("W");
+ float[] Hp = (float[]) dress.get("Hp");
+ float[] Sch = (float[]) dress.get("Sch");
+ float[] S = (float[]) dress.get("S");
+ float[] VAE = (float[]) dress.get("VAE");
+ float[] Schv = (float[]) dress.get("Schv");
+ float[] Hsv = (float[]) dress.get("Hsv");
+ float[] A = (float[]) dress.get("A");
+ float[] B = (float[]) dress.get("B");
+ float[] T3 = (float[]) dress.get("T3");
+ float[] H2 = (float[]) dress.get("H2");
+ float[] Hh = (float[]) dress.get("Hh");
+ float[] Hv = (float[]) dress.get("Hv");
+ float[] HAE = (float[]) dress.get("HAE");
+ float[] TAbs1 = (float[]) dress.get("TAbs1");
+ float[] TAbs2 = (float[]) dress.get("TAbs2");
+ float[] TAbh1 = (float[]) dress.get("TAbh1");
+ float[] TAbh2 = (float[]) dress.get("TAbh2");
+ float[] TAbh3 = (float[]) dress.get("TAbh3");
+ float[] TAbh4 = (float[]) dress.get("TAbh4");
+ float[] BAb = (float[]) dress.get("BAb");
+ float[] TAbv1 = (float[]) dress.get("TAbv1");
+ float[] TAbv2 = (float[]) dress.get("TAbv2");
+ float[] TAbv3 = (float[]) dress.get("TAbv3");
+ float[] TAbv4 = (float[]) dress.get("TAbv4");
+ float[] Abh1 = (float[]) dress.get("Abh1");
+ float[] Abh2 = (float[]) dress.get("Abh2");
+ float[] Abh3 = (float[]) dress.get("Abh3");
+ float[] Abh4 = (float[]) dress.get("Abh4");
+
+ float[] Bp = (float[]) dress.get("Bp");
+ float[] Rp =(float[]) dress.get("Rp");
+
+
+ PVector VoMi = new PVector(A[0] - B[0], A[1] - B[1]);
+ PVector Help = new PVector(0 , 1);
+ println(VoMi); println(Help);
+ float rot = PVector.angleBetween(VoMi, Help) - 2*PI;
+ print("rot"); println(rot);
+
+ //Zeichnung
+ beginRaw(dxf);
+ dxf.setLayer(0);
+ int start_x = 10 - 2;
+ int start_y = (int) (L1[1] - nzS - 2);
+ HomePrint(start_x, start_y, a, b);
+ dxf.setLayer(1);
+ stroke(0,0,0);
+ strokeWeight(1);
+
+ printMatrix();
+
+ pushMatrix();
+ translate(100,0 );
+ //Vorderteil//die beiden Vorderteile werden hier nicht zusammengenaeht sondern als ein stueck ausgeschnitten//es muesste noch eine nachtzugabe vorgesehn werden
+ println(H2); println(Lv); println(L1);
+ line(H2[0], L1[1]-nzS, Lv[0]+nz, Lv[1]-nzS);
+ line(Lv[0]+nz, Lv[1]-nzS, Hv[0]+nz, Hv[1]);
+ line(TAbs1[0]+nz, TAbs1[1], BAb[0]+nz, BAb[1]);
+ //line(BAb[0]+nz, BAb[1], S[0]+nz, S[1]+nz);
+ //line(VAE[0]+1+nz, VAE[1], VAE[0]-1+nz, VAE[1]);
+ //line(VAE[0]+nz, VAE[1]+1, VAE[0]+nz, VAE[1]-1);
+ //line(Schv[0]+nz, Schv[1]+nz, Hsv[0], Hsv[1]+nz);
+ //line(A[0], A[1], B[0], B[1]);
+ line(T3[0], T3[1], B[0], B[1]);
+ line(T3[0], T3[1], H2[0], H2[1]);
+ line(H2[0], H2[1], H2[0], L1[1]-nzS);
+ line(B[0], B[1], BAb[0]+nz, BAb[1]);
+ line(TAbv1[0], TAbv1[1], TAbv3[0], TAbv3[1]);
+ line(TAbv2[0], TAbv2[1], TAbv3[0], TAbv3[1]);
+ line(TAbv1[0], TAbv1[1], TAbv4[0], TAbv4[1]);
+ line(TAbv2[0], TAbv2[1], TAbv4[0], TAbv4[1]);
+ popMatrix();
+ //Abnaeher verschieben
+ pushMatrix();
+ stroke(150,0,0);
+ translate(B[0]+100, B[1]);
+ rotate(rot);
+ translate(-B[0], -B[1]);
+ line(BAb[0]+nz, BAb[1], S[0]+nz, S[1]+nz);
+ line(VAE[0]+1+nz, VAE[1], VAE[0]-1+nz, VAE[1]);
+ line(VAE[0]+nz, VAE[1]+1, VAE[0]+nz, VAE[1]-1);
+ line(Schv[0]+nz, Schv[1]+nz, Hsv[0], Hsv[1]+nz);
+ line(A[0], A[1], B[0], B[1]);
+ line(B[0], B[1], BAb[0]+nz, BAb[1]);
+ //armhole_front
+// armhole_fr(S, VAE, Schv, nz);
+ //neckline_front
+// neckline_fr(A, Hsv, nz);
+ popMatrix();
+
+ stroke(0,0,0);
+ pushMatrix();
+ translate(110,0);
+ //Hinterteil//die beiden Hinterteile werden hier nicht zusammengenaeht sondern als ein stueck ausgeschnitten//es muesste noch eine nachtzugabe vorgesehn werden
+ line(Lh[0]-nz, Lh[1]-nzS, L1[0], L1[1]-nzS);
+ line(L1[0], L1[1]-nzS, H1[0], H1[1]);
+ line(H1[0], H1[1], T1[0], T1[1]);
+ line(T1[0], T1[1], R1[0], R1[1]);
+ line(R1[0], R1[1], W[0], W[1]);
+ line(Hp[0], Hp[1]+nz, Sch[0]-nz, Sch[1]+nz);
+ line(HAE[0]+1-nz, HAE[1], HAE[0]-1-nz, HAE[1]);
+ line(HAE[0]-nz, HAE[1]+1, HAE[0]-nz, HAE[1]-1);
+ line(S[0]-nz, S[1]+nz, TAbs2[0]-nz, TAbs2[1]);
+ line(Hh[0]-nz, Hh[1], Lh[0]-nz, Lh[1]);
+ line(TAbh1[0], TAbh1[1], TAbh3[0], TAbh3[1]);
+ line(TAbh2[0], TAbh2[1], TAbh3[0], TAbh3[1]);
+ line(TAbh1[0], TAbh1[1], TAbh4[0], TAbh4[1]);
+ line(TAbh2[0], TAbh2[1], TAbh4[0], TAbh4[1]);
+ //armhole_back
+// armhole_ba(S, HAE, Sch, nz);
+ //neckline_back
+// neckline_ba(W, Hp, nz);
+ popMatrix();
+
+ dxf.setLayer(2);
+ //sleeve
+ basic_sleeve(0, 70, nz, nzS, Alg, Asw, Schv, Bp, Sch, Rp, S, VAE, HAE);
+
+ endRaw();
+ log.append("DONE");
+}
View
@@ -0,0 +1,11 @@
+void Grid (int a, int b) {
+
+ strokeWeight(1);
+ stroke(200);
+ for (int i = 0; i < a; i = i+1) {
+ line(i, 0, i, b);
+ }
+ for (int x = 0; x < b; x = x+1) {
+ line(0, x, a, x);
+ }
+}
View
@@ -0,0 +1,22 @@
+void HomePrint(int start_x, int start_y, int a, int b){
+
+ stroke(255, 0, 0);
+ strokeWeight(0.8); //A4-Format - je 3cm fuer die Raender = 15*24;
+
+ //Testsquare 10x10cm
+ rect(start_x + 3, start_y + 5, 10, 10);
+
+ for (int y = start_y; y < b; y = y + 24) {
+ line(0, y, a, y);
+
+ for (int x = start_x; x < a; x = x + 15){
+ line(x, 0, x, b);
+
+ if (x > start_x && y > start_y) {
+ ellipse(x - 15/2.0, y, 2, 2);
+ ellipse (x, y - 24/2.0, 2, 2);
+ }
+ }
+ }
+}
+
View
@@ -0,0 +1,44 @@
+float[] Konf(int Gr, float Ow) {
+
+ if (Gr==32 || Gr==34){
+ float Hs = 1.0/12.0 * Ow;
+ float VAb = 1.0/20.0 *Ow -2.0;
+ float[] konf = {Hs, VAb};
+ return konf;
+ }
+ else if(Gr==36 || Gr==38){
+ float Hs = 1.0/12.0 *Ow -0.5; //Halsspiegelbreite
+ float VAb = 1.0/20.0 *Ow -1.0;
+ float[] konf = {Hs, VAb};
+ return konf;
+ } //Vorderteil Abnaeher
+ else if (Gr==40 || Gr==42){
+ float Hs = 1.0/12.0 *Ow -0.5;
+ float VAb = 1.0/20.0 *Ow;
+ float[] konf = {Hs, VAb};
+ return konf;
+ }
+ else if (Gr==44){
+ float Hs = 1.0/12.0 *Ow -0.5;
+ float VAb = 1.0/20.0 *Ow +1.0;
+ float[] konf = {Hs, VAb};
+ return konf;
+ }
+ else if (Gr==46){
+ float Hs = 1.0/12.0 *Ow -1.0;
+ float VAb = 1.0/20.0 *Ow +1.0;
+ float[] konf = {Hs, VAb};
+ return konf;
+ }
+ else if (Gr==48 || Gr==50){
+ float Hs = 1.0/12.0 *Ow -1.0;
+ float VAb = 1.0/20.0 *Ow +2.0;
+ float[] konf = {Hs, VAb};
+ return konf;
+ }
+ else{
+ log.append("invalid confection size (choose 32-50) \n");
+ float[] konf = {0,0};
+ return konf;
+ }
+}
View
@@ -0,0 +1,180 @@
+void Overall(HashMap front, HashMap dress, RawDXF dxf){
+
+ float[] Fa = (float[]) front.get("Fa");
+ float[] Fb = (float[]) front.get("Fb");
+ float[] Kb = (float[]) front.get("Kb");
+ float[] Schritt = (float[]) front.get("Sch");
+ float[] BH = (float[]) front.get("B");
+ float[] H = (float[]) front.get("H");
+ float[] Ka = (float[]) front.get("Ka");
+ float[] Fc = (float[]) front.get("Fc");
+ float[] Fd = (float[]) front.get("Fd");
+ float[] Kd = (float[]) front.get("Kd");
+ float[] Br = (float[]) front.get("Br");
+ float[] Ga = (float[]) front.get("Ga");
+ float[] Ba = (float[]) front.get("Ba");
+ float[] Ha = (float[]) front.get("Ha");
+ float[] Kc = (float[]) front.get("Kc");
+
+ float[] H1 = (float[]) dress.get("H1");
+ float[] T1 = (float[]) dress.get("T1");
+ float[] R1 = (float[]) dress.get("R1");
+ float[] W = (float[]) dress.get("W");
+ float[] Hp = (float[]) dress.get("Hp");
+ float[] Sch = (float[]) dress.get("Sch");
+ float[] S = (float[]) dress.get("S");
+ float[] VAE = (float[]) dress.get("VAE");
+ float[] Schv = (float[]) dress.get("Schv");
+ float[] Hsv = (float[]) dress.get("Hsv");
+ float[] A = (float[]) dress.get("A");
+ float[] B = (float[]) dress.get("B");
+ float[] T3 = (float[]) dress.get("T3");
+ float[] H2 = (float[]) dress.get("H2");
+ float[] Hh = (float[]) dress.get("Hh");
+ float[] Hv = (float[]) dress.get("Hv");
+ float[] HAE = (float[]) dress.get("HAE");
+ float[] TAbs1 = (float[]) dress.get("TAbs1");
+ float[] TAbs2 = (float[]) dress.get("TAbs2");
+ float[] TAbh1 = (float[]) dress.get("TAbh1");
+ float[] TAbh2 = (float[]) dress.get("TAbh2");
+ float[] TAbh3 = (float[]) dress.get("TAbh3");
+ float[] TAbh4 = (float[]) dress.get("TAbh4");
+ float[] BAb = (float[]) dress.get("BAb");
+ float[] TAbv1 = (float[]) dress.get("TAbv1");
+ float[] TAbv2 = (float[]) dress.get("TAbv2");
+ float[] TAbv3 = (float[]) dress.get("TAbv3");
+ float[] TAbv4 = (float[]) dress.get("TAbv4");
+ float[] Abh1 = (float[]) dress.get("Abh1");
+ float[] Abh2 = (float[]) dress.get("Abh2");
+ float[] Abh3 = (float[]) dress.get("Abh3");
+ float[] Abh4 = (float[]) dress.get("Abh4");
+ float[] Bp = (float[]) dress.get("Bp");
+ float[] Rp = (float[]) dress.get("Rp");
+
+ //Zeichnung
+ beginRaw(dxf);
+ dxf.setLayer(0);
+
+ int start_x = 10 - 2;
+ int start_y = (int) (Fc[1] - nzS - 2);
+ HomePrint(start_x, start_y, a, b);
+ dxf.setLayer(1);
+
+ stroke(0,0,0);
+ strokeWeight(1);
+
+ pushMatrix();
+ translate(10,0);
+ //Vorderhose //Nathzugabe am Saum: 3cm, sonst 1 cm
+ line(Fa[0]-nz, Fa[1] - nzS, Fb[0]+nz, Fb[1]-nzS);
+ line(Fb[0]+nz, Fb[1]-nzS, Kb[0]+nz, Kb[1]);
+ line(Kb[0]+nz, Kb[1], Schritt[0]+nz, Schritt[1]+nz);
+ line(BH[0]+nz, BH[1]+nz, H[0]-nz, H[1]+nz);
+ line(H[0]-nz, H[1]+nz, Ka[0]-nz, Ka[1]);
+ line(Ka[0]-nz, Ka[1], Fa[0]-nz, Fa[1]-nzS);
+ popMatrix();
+
+ //Hinterhose
+ pushMatrix();
+ translate(15 + 2*(Hv[0]-H2[0]) - Ha[0], 0);
+ line(Fc[0]-nz, Fc[1]-nzS, Fd[0]+nz, Fd[1]-nzS);
+ line(Fd[0]+nz, Fd[1]-nzS, Kd[0]+nz, Kd[1]);
+ line(Kd[0]+nz, Kd[1], Br[0]+nz, Br[1]);
+ line(Br[0]+nz, Br[1], Ga[0]+nz, Ga[1]+nz);
+ line(Schritt[0]+nz+1, Schritt[1]+nz, Schritt[0]+nz-1, Schritt[1]+nz);
+ line(Schritt[0]+nz, Schritt[1]+nz+1, Schritt[0]+nz, Schritt[1]+nz-1);
+ line(Ba[0]+nz, Ba[1], Ha[0]-nz, Ha[1]);
+ line(Ha[0]-nz, Ha[1], Kc[0]-nz, Kc[1]);
+ line(Kc[0]-nz, Kc[1], Fc[0]-nz, Fc[1]-nzS);
+ popMatrix();
+
+ //Vorderteil// //Nahtzigabe nur an einer Seiten und unten, das Vorderzteil wird aus einem Stueck ausgeschnitten
+ pushMatrix();
+ translate(10-H2[0]+Hv[0]-H2[0], H[1]-Fc[1]-H2[1]+Sauh+bfo+2*nz+2);
+ line(Hv[0]+nz, Hv[1]-nz-bfo-1, Hv[0]+nz, Hv[1]-bfo-nz+1);
+ line(Hv[0]+nz-1, Hv[1]-nz-bfo, Hv[0]+nz+1, Hv[1]-bfo-nz);
+ line(TAbs1[0]+nz, TAbs1[1], BAb[0]+nz, BAb[1]);
+ //line(T3[0], T3[1], B[0], B[1]);
+ //line(T3[0], T3[1], H2[0], H2[1]);
+ line(H2[0], H2[1]-nz-bfo, Hv[0]+nz, Hv[1]-nz-bfo);
+ line(B[0], B[1], BAb[0]+nz, BAb[1]);
+ line(TAbv1[0], TAbv1[1], TAbv3[0], TAbv3[1]);
+ line(TAbv2[0], TAbv2[1], TAbv3[0], TAbv3[1]);
+ line(TAbv1[0], TAbv1[1], TAbv4[0], TAbv4[1]);
+ line(TAbv2[0], TAbv2[1], TAbv4[0], TAbv4[1]);
+ popMatrix();
+
+ //Spiegelung
+ pushMatrix();
+ translate(10+H2[0]+Hv[0]-H2[0], H[1]-Fc[1]-H2[1]+Sauh+bfo+2*nz+2);
+ line(-(Hv[0]+nz), Hv[1]-nz-bfo-1, -(Hv[0]+nz), Hv[1]-nz-bfo+1);
+ line(-(Hv[0]+nz-1), Hv[1]-nz-bfo, -(Hv[0]+nz+1), Hv[1]-nz-bfo);
+ line(-(TAbs1[0]+nz), TAbs1[1], -(BAb[0]+nz), BAb[1]);
+ line(-B[0], B[1], -(BAb[0]+nz), BAb[1]);
+ line(-H2[0], H2[1]-nz-bfo, -(Hv[0]+nz), Hv[1]-nz-bfo);
+ line(-TAbv1[0], TAbv1[1], -TAbv3[0], TAbv3[1]);
+ line(-TAbv2[0], TAbv2[1], -TAbv3[0], TAbv3[1]);
+ line(-TAbv1[0], TAbv1[1], -TAbv4[0], TAbv4[1]);
+ line(-TAbv2[0], TAbv2[1], -TAbv4[0], TAbv4[1]);
+ popMatrix();
+
+ //Rotation
+ PVector VoMi = new PVector(A[0] - B[0], A[1] - B[1]);
+ PVector Help = new PVector(0 , 1);
+ float rot = PVector.angleBetween(VoMi, Help) - 2*PI;
+
+ pushMatrix();
+ stroke(150,0,0);
+ translate(B[0]+10-H2[0]+Hv[0]-H2[0], B[1]+H[1]-Fc[1]-H2[1]+Sauh+bfo+2*nz+2);
+ rotate(rot);
+ translate(-B[0], -B[1]);
+ line(BAb[0]+nz, BAb[1], S[0]+nz, S[1]+nz);
+ line(VAE[0]+nz+1, VAE[1], VAE[0]+nz-1, VAE[1]);
+ line(VAE[0]+nz, VAE[1]+1, VAE[0]+nz, VAE[1]-1);
+ line(Schv[0]+nz, Schv[1]+nz, Hsv[0]-nz, Hsv[1]+nz);
+ line(A[0], A[1]+nz, B[0], B[1]);
+ line(B[0], B[1], BAb[0]+nz, BAb[1]);
+ popMatrix();
+
+ //Spiegelung
+ pushMatrix();
+ translate(-B[0]+10+H2[0]+Hv[0]-H2[0],B[1]+H[1]-Fc[1]-H2[1]+Sauh+bfo+2*nz+2);
+ rotate(-rot);
+ translate(B[0], -B[1]);
+ line(-(BAb[0]+nz), BAb[1], -(S[0]+nz), S[1]+nz);
+ line(-(VAE[0]+nz+1), VAE[1], -(VAE[0]+nz-1), VAE[1]);
+ line(-(VAE[0]+nz), VAE[1]+1, -(VAE[0]+nz), VAE[1]-1);
+ line(-(Schv[0]+nz), Schv[1]+nz, -(Hsv[0]-nz), Hsv[1]+nz);
+ line(-B[0], B[1], -(BAb[0]+nz), BAb[1]);
+ popMatrix();
+
+ //Hinterteil// //aus zwei Steucken Stoff: Nahtzugabe auf beiden Seiten
+ stroke(0,0,0);
+ pushMatrix();
+ translate(15 + 2*(Hv[0]-H2[0])-Hh[0], H[1]-Fc[1]-H2[1]+Sauh+bfo);
+ line(Hh[0]-nz, Hh[1]-bfo-1, Hh[0]-nz, Hh[1]-bfo+1);
+ line(Hh[0]-nz-1, Hh[1]-bfo, Hh[0]-nz+1, Hh[1]-bfo);
+ line(H1[0]+nz+1, H1[1]-bfo, T1[0]+nz, T1[1]);
+ line(T1[0]+nz, T1[1], R1[0]+nz, R1[1]);
+ line(R1[0]+nz, R1[1], W[0]+nz, W[1]+nz);
+ line(Hp[0]-nz, Hp[1]+nz, Sch[0]-nz, Sch[1]+nz);
+ line(HAE[0]-nz+1, HAE[1], HAE[0]-nz-1, HAE[1]);
+ line(HAE[0]-nz, HAE[1]+1, HAE[0]-nz, HAE[1]-1);
+ line(S[0]-nz, S[1]+nz, TAbs2[0]-nz, TAbs2[1]);
+ line(TAbh1[0], TAbh1[1], TAbh3[0], TAbh3[1]);
+ line(TAbh2[0], TAbh2[1], TAbh3[0], TAbh3[1]);
+ line(TAbh1[0], TAbh1[1], TAbh4[0], TAbh4[1]);
+ line(TAbh2[0], TAbh2[1], TAbh4[0], TAbh4[1]);
+ line(Abh2[0], Abh2[1], Abh1[0], Abh1[1]+nz);
+ line(Abh2[0], Abh2[1], Abh3[0]-nz, Abh3[1]);
+ line(Abh2[0], Abh2[1], Abh4[0]-nz, Abh4[1]);
+ popMatrix();
+
+ dxf.setLayer(2);
+
+ //sleeve
+ basic_sleeve(110, 100, nz, nzS, Alg, Asw, Schv, Bp, Sch, Rp, S, VAE, HAE);
+
+ endRaw();
+ log.append("DONE \n");
+}
Oops, something went wrong.

0 comments on commit 94caafa

Please sign in to comment.