public Main(StlFile stlf) {
for(int i=0; i<stlf.coordArray.length; i+=3) {
- Mesh.Vert p0 = goal.register(new Point(stlf.coordArray[i+0].x * MAG, stlf.coordArray[i+0].y * MAG, stlf.coordArray[i+0].z * MAG));
- Mesh.Vert p1 = goal.register(new Point(stlf.coordArray[i+1].x * MAG, stlf.coordArray[i+1].y * MAG, stlf.coordArray[i+1].z * MAG));
- Mesh.Vert p2 = goal.register(new Point(stlf.coordArray[i+2].x * MAG, stlf.coordArray[i+2].y * MAG, stlf.coordArray[i+2].z * MAG));
+ Point p0 = new Point(stlf.coordArray[i+0].x * MAG, stlf.coordArray[i+0].y * MAG, stlf.coordArray[i+0].z * MAG);
+ Point p1 = new Point(stlf.coordArray[i+1].x * MAG, stlf.coordArray[i+1].y * MAG, stlf.coordArray[i+1].z * MAG);
+ Point p2 = new Point(stlf.coordArray[i+2].x * MAG, stlf.coordArray[i+2].y * MAG, stlf.coordArray[i+2].z * MAG);
Vec n = new Vec(stlf.normArray[i/3].x * MAG, stlf.normArray[i/3].y * MAG, stlf.normArray[i/3].z * MAG);
Mesh.T t = goal.newT(p0, p1, p2, n);
}
};
- Mesh.Vert ltf = tile.register(new Point(-(width/2), (height/2), (depth/2)));
- Mesh.Vert mtf = tile.register(new Point( 0.0, (height/2), (depth/2)));
- Mesh.Vert rtf = tile.register(new Point( (width/2), (height/2), (depth/2)));
- Mesh.Vert ltn = tile.register(new Point(-(width/2), (height/2), -(depth/2)));
- Mesh.Vert mtn = tile.register(new Point( 0.0, (height/2), -(depth/2)));
- Mesh.Vert rtn = tile.register(new Point( (width/2), (height/2), -(depth/2)));
- Mesh.Vert lbf = tile.register(new Point(-(width/2), -(height/2), (depth/2)));
- Mesh.Vert mbf = tile.register(new Point( 0.0, -(height/2), (depth/2)));
- Mesh.Vert rbf = tile.register(new Point( (width/2), -(height/2), (depth/2)));
- Mesh.Vert lbn = tile.register(new Point(-(width/2), -(height/2), -(depth/2)));
- Mesh.Vert mbn = tile.register(new Point( 0.0, -(height/2), -(depth/2)));
- Mesh.Vert rbn = tile.register(new Point( (width/2), -(height/2), -(depth/2)));
+ Point ltf = new Point(-(width/2), (height/2), (depth/2));
+ Point mtf = new Point( 0.0, (height/2), (depth/2));
+ Point rtf = new Point( (width/2), (height/2), (depth/2));
+ Point ltn = new Point(-(width/2), (height/2), -(depth/2));
+ Point mtn = new Point( 0.0, (height/2), -(depth/2));
+ Point rtn = new Point( (width/2), (height/2), -(depth/2));
+ Point lbf = new Point(-(width/2), -(height/2), (depth/2));
+ Point mbf = new Point( 0.0, -(height/2), (depth/2));
+ Point rbf = new Point( (width/2), -(height/2), (depth/2));
+ Point lbn = new Point(-(width/2), -(height/2), -(depth/2));
+ Point mbn = new Point( 0.0, -(height/2), -(depth/2));
+ Point rbn = new Point( (width/2), -(height/2), -(depth/2));
- points = new Mesh.Vert[] {
+ Point[] points = new Point[] {
ltf,
mtf,
rtf,
}
}
+ for(Mesh.Vert vert : goal.vertices()) {
+ System.out.println("error: " + vert.quadric().preAndPostMultiply(vert.p));
+ }
+
+
//xMesh.Vert mid = lbf.getE(mbn).shatter();
// rescale to match volume
//double min = (tile.avgedge/tile.numedges)*(1+(4/(double)verts));
//if (verts>0 && tile.es.peek().length() < min) return;
PriorityQueue<Mesh.E> es = new PriorityQueue<Mesh.E>();
- for(Mesh.E e : tile.es) es.add(e);
+ for(Mesh.E e : tile.edges()) es.add(e);
for(int i=0; i<10; i++) {
Mesh.E e = es.poll();
verts++;
r1 = r1 - (float)Math.floor(r1);
r1 = r1 * (float)0.01;
r1 = r1 - (float)0.005;
- Vec v = p.watchback().p.minus(p.p).norm().times(r1);
+ Vec v = p.watchback().minus(p.p).norm().times(r1);
//v = p.norm().times(v.dot(p.norm()));