X-Git-Url: http://git.megacz.com/?p=anneal.git;a=blobdiff_plain;f=src%2Fedu%2Fberkeley%2Fqfat%2FMain.java;h=237266b343a7e3c37788cc0953027ae87e58e517;hp=3ce1d8895722da29e96d541c2e404752df21d964;hb=4d37197f8e2572a3c5510d77c0f09a19e9d9f748;hpb=0c83217e7d2c100185cca08f5fcd310f2a5347a1 diff --git a/src/edu/berkeley/qfat/Main.java b/src/edu/berkeley/qfat/Main.java index 3ce1d88..237266b 100644 --- a/src/edu/berkeley/qfat/Main.java +++ b/src/edu/berkeley/qfat/Main.java @@ -6,11 +6,38 @@ import javax.swing.*; import javax.media.opengl.*; import javax.media.opengl.glu.*; import java.util.*; +import edu.berkeley.qfat.bind.*; import edu.berkeley.qfat.geom.*; +import edu.berkeley.qfat.stl.*; import edu.berkeley.qfat.geom.Point; import edu.berkeley.qfat.geom.Polygon; // TO DO: +// +// - Implement "real" constraints (plane, line, point) +// +// - Constrained surface subdivision +// - Edge.flip() gets us the triforce subdivision +// - Edge.delete() gets us the catmull-clark subdivision +// - Catmull-Clark: just don't move points if we can't. Need to average the influence of the points on a binding group. +// +// - Ability to snap three views to orthgonal +// - SLIDE UI +// - left button -> crystal ball +// - translate +// - rightbutton/mousewheel zoom +// - v+click to select vertex +// - show: constraints, bindings, faces +// +// Editing: +// - fracture edge, face +// - change aspect ratio +// - ability to select a point, rotate the model, then move the point +// - when moving a vertex in one window, show that window's axes in all other windows +// + + +// TO DO: // - real anneal // - solve self-intersection problem // - get a better test model? @@ -53,6 +80,7 @@ import edu.berkeley.qfat.geom.Polygon; public class Main extends InteractiveMeshViewer { + public static int verts = 1; public static final Random random = new Random(); @@ -71,7 +99,7 @@ public class Main extends InteractiveMeshViewer { if (v.mag() < 0.0001) continue; v = v.times(-1); v = v.times(0.5f); - Point p = Point.ORIGIN.plus(v); + Point p = Point.ZERO.plus(v); v = v.times(-1); //System.out.println(v); @@ -80,7 +108,7 @@ public class Main extends InteractiveMeshViewer { polygons.add(new Polygon(hs)); } for(Polygon p : polygons) { - System.out.println(p.plane.norm + " " + p.plane.dvalue); + System.out.println(p.plane.norm() + " " + p.plane.d); for(HalfSpace hs : halfSpaces) { if (p.plane==hs) continue; p = p.intersect(hs); @@ -108,7 +136,7 @@ public class Main extends InteractiveMeshViewer { StlFile stlf = new StlFile(); InputStream res = this.getClass().getClassLoader().getResourceAsStream(file); stlf.readBinaryFile(file, res); - goal = new Mesh(false); + setGoal(new Mesh(false)); for(int i=0; i