+
+
+ Geom.P ltf = geom.newP(-0.2, 0.1, 0.1);
+ Geom.P mtf = geom.newP( 0.0, 0.1, 0.1);
+ Geom.P rtf = geom.newP( 0.2, 0.1, 0.1);
+ Geom.P ltn = geom.newP(-0.2, 0.1, -0.1);
+ Geom.P mtn = geom.newP( 0.0, 0.1, -0.1);
+ Geom.P rtn = geom.newP( 0.2, 0.1, -0.1);
+ Geom.P lbf = geom.newP(-0.2, -0.1, 0.1);
+ Geom.P mbf = geom.newP( 0.0, -0.1, 0.1);
+ Geom.P rbf = geom.newP( 0.2, -0.1, 0.1);
+ Geom.P lbn = geom.newP(-0.2, -0.1, -0.1);
+ Geom.P mbn = geom.newP( 0.0, -0.1, -0.1);
+ Geom.P rbn = geom.newP( 0.2, -0.1, -0.1);
+
+ points = new Geom.P[] {
+ ltf,
+ mtf,
+ rtf,
+ ltn,
+ mtn,
+ rtn,
+ lbf,
+ mbf,
+ rbf,
+ lbn,
+ mbn,
+ rbn
+ };
+
+ translations = new Geom.V[] {
+ geom.new V(-0.2, 0.2, 0),
+ geom.new V( 0.2, 0.2, 0),
+ geom.new V(-0.2, -0.2, 0),
+ geom.new V( 0.2, -0.2, 0),
+ geom.new V( 0.4, 0, 0),
+ geom.new V(-0.4, 0, 0),
+ geom.new V( 0, 0, 0.2),
+ geom.new V( 0, 0, -0.2),
+ };
+
+ // top
+ geom.newT(ltf, mtf, mtn);
+ geom.newT(mtn, ltn, ltf);
+ geom.newT(mtf, rtf, rtn);
+ geom.newT(rtn, mtn, mtf);
+
+ // bottom (swap normals)
+ geom.newT(mbf, lbf, mbn);
+ geom.newT(lbn, mbn, lbf);
+ geom.newT(rbf, mbf, rbn);
+ geom.newT(mbn, rbn, mbf);
+
+ // left
+ geom.newT(ltf, ltn, lbn);
+ geom.newT(lbn, lbf, ltf);
+
+ // right (swap normals)
+ geom.newT(rtn, rtf, rbn);
+ geom.newT(rbf, rbn, rtf);
+
+ // front
+ geom.newT(ltn, mtn, mbn);
+ geom.newT(ltn, mbn, lbn);
+ geom.newT(mtn, rtn, rbn);
+ geom.newT(mtn, rbn, mbn);
+
+ // back
+ geom.newT(mtf, ltf, mbf);
+ geom.newT(mbf, ltf, lbf);
+ geom.newT(rtf, mtf, rbf);
+ geom.newT(rbf, mtf, mbf);
+
+ for(Geom.V v : translations) {
+ for(Geom.T t1 : geom) {
+ for(Geom.T t2 : geom) {
+ if (t1==t2) continue;
+
+ if ((t1.p1().plus(v).minus(t2.p1()).mag() < Geom.EPSILON) &&
+ (t1.p2().plus(v).minus(t2.p3()).mag() < Geom.EPSILON) &&
+ (t1.p3().plus(v).minus(t2.p2()).mag() < Geom.EPSILON))
+ t1.bind(t2, 0);
+ if ((t1.p2().plus(v).minus(t2.p1()).mag() < Geom.EPSILON) &&
+ (t1.p3().plus(v).minus(t2.p3()).mag() < Geom.EPSILON) &&
+ (t1.p1().plus(v).minus(t2.p2()).mag() < Geom.EPSILON))
+ t1.bind(t2, 1);
+ if ((t1.p3().plus(v).minus(t2.p1()).mag() < Geom.EPSILON) &&
+ (t1.p1().plus(v).minus(t2.p3()).mag() < Geom.EPSILON) &&
+ (t1.p2().plus(v).minus(t2.p2()).mag() < Geom.EPSILON))
+ t1.bind(t2, 2);
+ }
+ }
+ }
+
+ //Geom.P mid = geom.newE(ltf, lbn).shatter();
+
+ //tx.e2.shatter();
+ //tx.e3.shatter();
+
+ //mid.move(geom.new V((float)-0.05,0,0));
+
+ //mtf.move(geom.new V(0, (float)-0.05, (float)0.05));
+ mtf.move(geom.new V(0, (float)-0.05, (float)0.00));
+
+ /*
+