X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMain.java;h=4ae3a8e519f57df01a7d131f7554ef8e6de9ad0e;hp=b7df3d4a848e231fa1ac7f04f7ffa9543faecfdb;hb=e4d317da98c8126fa7cfb4d0097419d8f0d383a5;hpb=8cb2aceb7c2b140b70b9955f1a0a6f2524f2314e diff --git a/src/edu/berkeley/qfat/Main.java b/src/edu/berkeley/qfat/Main.java index b7df3d4..4ae3a8e 100644 --- a/src/edu/berkeley/qfat/Main.java +++ b/src/edu/berkeley/qfat/Main.java @@ -12,6 +12,56 @@ import edu.berkeley.qfat.stl.*; import edu.berkeley.qfat.geom.Point; import edu.berkeley.qfat.geom.Polygon; +/* + + +Todo +- review catmull-clark; move vertex points? +- re-anneal fish + +- show constraints (?) +- show in red if user tries to move a point to an illegal location + +- eliminate use of bindinggroupschanged() + +- post qfat on my software page + + +With Sequin +- constraints admit intersections (lattice) +- constraints may be transformed linearly + + + + +Log console + - blend-shaded overlay? slick. + +face/vertex count +rendering FPS +ability to not draw edges between faces + + +three circumcircles showing crystal ball -- these don't get scaled +axes? + +drawing modes: + - bounding box + - vertices + - edges + - visible-edges + - flat with or without edges + - shaded with or without edges + * contrasting-faces + + +quadric decimation? + +show normals +show bounding box +show axes (big+fat) + */ + // TO DO: // // - Ability to snap three views to orthgonal @@ -170,48 +220,51 @@ public class Main extends InteractiveMeshViewer { Point t1v1 = m.times(t1.v1().p); Point t1v2 = m.times(t1.v2().p); Point t1v3 = m.times(t1.v3().p); + if (t1v1.distance(t2.v1().p) < MATCHING_EPSILON && t1v2.distance(t2.v3().p) < MATCHING_EPSILON && t1v3.distance(t2.v2().p) < MATCHING_EPSILON) { - t2.e3().bindEdge(t1.e1(), m); - t2.e2().bindEdge(t1.e2(), m); - t2.e1().bindEdge(t1.e3(), m); + t2.e3().bindEdge(t1.e1().pair, m); + t2.e2().bindEdge(t1.e2().pair, m); + t2.e1().bindEdge(t1.e3().pair, m); } if (t1v2.distance(t2.v1().p) < MATCHING_EPSILON && t1v3.distance(t2.v3().p) < MATCHING_EPSILON && t1v1.distance(t2.v2().p) < MATCHING_EPSILON) { - t2.e3().bindEdge(t1.e2(), m); - t2.e2().bindEdge(t1.e3(), m); - t2.e1().bindEdge(t1.e1(), m); + t2.e3().bindEdge(t1.e2().pair, m); + t2.e2().bindEdge(t1.e3().pair, m); + t2.e1().bindEdge(t1.e1().pair, m); } if (t1v3.distance(t2.v1().p) < MATCHING_EPSILON && t1v1.distance(t2.v3().p) < MATCHING_EPSILON && t1v2.distance(t2.v2().p) < MATCHING_EPSILON) { - t2.e3().bindEdge(t1.e3(), m); - t2.e2().bindEdge(t1.e1(), m); - t2.e1().bindEdge(t1.e2(), m); + t2.e3().bindEdge(t1.e3().pair, m); + t2.e2().bindEdge(t1.e1().pair, m); + t2.e1().bindEdge(t1.e2().pair, m); } + if (t1v1.distance(t2.v1().p) < MATCHING_EPSILON && t1v2.distance(t2.v2().p) < MATCHING_EPSILON && t1v3.distance(t2.v3().p) < MATCHING_EPSILON) { - t2.e1().bindEdge(t1.e1().pair, m); - t2.e2().bindEdge(t1.e2().pair, m); - t2.e3().bindEdge(t1.e3().pair, m); + t2.e1().bindEdge(t1.e1(), m); + t2.e2().bindEdge(t1.e2(), m); + t2.e3().bindEdge(t1.e3(), m); } if (t1v2.distance(t2.v1().p) < MATCHING_EPSILON && t1v3.distance(t2.v2().p) < MATCHING_EPSILON && t1v1.distance(t2.v3().p) < MATCHING_EPSILON) { - t2.e2().bindEdge(t1.e1().pair, m); - t2.e3().bindEdge(t1.e2().pair, m); - t2.e1().bindEdge(t1.e3().pair, m); + t2.e2().bindEdge(t1.e1(), m); + t2.e3().bindEdge(t1.e2(), m); + t2.e1().bindEdge(t1.e3(), m); } if (t1v3.distance(t2.v1().p) < MATCHING_EPSILON && t1v1.distance(t2.v2().p) < MATCHING_EPSILON && t1v2.distance(t2.v3().p) < MATCHING_EPSILON) { - t2.e3().bindEdge(t1.e1().pair, m); - t2.e1().bindEdge(t1.e2().pair, m); - t2.e2().bindEdge(t1.e3().pair, m); + t2.e3().bindEdge(t1.e1(), m); + t2.e1().bindEdge(t1.e2(), m); + t2.e2().bindEdge(t1.e3(), m); } + } } } @@ -574,6 +627,7 @@ public class Main extends InteractiveMeshViewer { generateTile(transforms, tile); fixupTile(); } }); + tileMenu.add(new MyMenuItem("Slim Dense Packing (Cubic)") { public void hit() { setTile(new Mesh(false)); float unit = 0.4f; @@ -585,6 +639,9 @@ public class Main extends InteractiveMeshViewer { float height = 2*r*(float)Math.sqrt(2f/3f); transforms = new Matrix[] { + + //Matrix.reflect(new Vec( 0, height, -z).norm()), + Matrix.translate(new Vec(-unit, 0, 0)), Matrix.translate(new Vec( unit, 0, 0)), Matrix.translate(new Vec(-cos, 0, sin)), @@ -592,6 +649,13 @@ public class Main extends InteractiveMeshViewer { Matrix.translate(new Vec(-cos, 0, -sin)), Matrix.translate(new Vec( cos, 0, -sin)), + Matrix.translate(new Vec( 0, height, -z)), + Matrix.translate(new Vec(-r, height, x)), + Matrix.translate(new Vec( r, height, x)), + Matrix.translate(new Vec( 0, -height, z)), + Matrix.translate(new Vec(-r, -height, -x)), + Matrix.translate(new Vec( r, -height, -x)), + /* Matrix.translate(new Vec( 0, height, -z)).times(Matrix.rotate(new Vec(0,1,0), (float)Math.PI)), Matrix.translate(new Vec(-r, height, x)).times(Matrix.rotate(new Vec(0,1,0), (float)Math.PI)), @@ -601,14 +665,6 @@ public class Main extends InteractiveMeshViewer { Matrix.translate(new Vec( r, -height, x)).times(Matrix.rotate(new Vec(0,1,0), (float)Math.PI)), */ - Matrix.translate(new Vec( 0, height, -z)), - Matrix.translate(new Vec(-r, height, x)), - Matrix.translate(new Vec( r, height, x)), - Matrix.translate(new Vec( 0, -height, z)), - Matrix.translate(new Vec(-r, -height, -x)), - Matrix.translate(new Vec( r, -height, -x)), - //Matrix.rotate(new Vec(0,0,1), (float)Math.PI), - /* Matrix.translate(new Vec( 0, height, -z)).times(Matrix.scale(-1,1,-1)), Matrix.translate(new Vec(-r, height, x)).times(Matrix.scale(-1,1,-1)), @@ -620,12 +676,39 @@ public class Main extends InteractiveMeshViewer { Matrix.ONE }; generateTile(transforms, tile); + + + transforms = new Matrix[] { + Matrix.reflect(new Vec( 0, height, -z).norm()), + //Matrix.reflect(new Vec( 0, -height, z)), + Matrix.ONE, + Matrix.translate(new Vec(-unit, 0, 0)), + Matrix.translate(new Vec( unit, 0, 0)), + /* + Matrix.translate(new Vec(-cos, 0, sin)), + Matrix.translate(new Vec( cos, 0, sin)), + Matrix.translate(new Vec(-cos, 0, -sin)), + Matrix.translate(new Vec( cos, 0, -sin)), + + Matrix.translate(new Vec( 0, height, -z)), + Matrix.translate(new Vec(-r, height, x)), + Matrix.translate(new Vec( r, height, x)), + Matrix.translate(new Vec( 0, -height, z)), + Matrix.translate(new Vec(-r, -height, -x)), + Matrix.translate(new Vec( r, -height, -x)), + */ + }; + + //for(int i=0; i