- 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);
+ for(int i=0; i<stlf.coordArray.length; i+=3) {
+ Geom.P p0 = goal.newP(stlf.coordArray[i+0].x * MAG, stlf.coordArray[i+0].y * MAG, stlf.coordArray[i+0].z * MAG);
+ Geom.P p1 = goal.newP(stlf.coordArray[i+1].x * MAG, stlf.coordArray[i+1].y * MAG, stlf.coordArray[i+1].z * MAG);
+ Geom.P p2 = goal.newP(stlf.coordArray[i+2].x * MAG, stlf.coordArray[i+2].y * MAG, stlf.coordArray[i+2].z * MAG);
+ Geom.V n = goal.new V(stlf.normArray[i/3].x * MAG, stlf.normArray[i/3].y * MAG, stlf.normArray[i/3].z * MAG);
+ Geom.T t = goal.newT(p0, p1, p2, n);
+ }
+
+ // rotate to align major axis -- this probably needs to be done by a human.
+ goal.transform(goal.new M(goal.new V(0, 0, 1), (float)(Math.PI/2)));
+
+
+ float goal_width = goal.diagonal().dot(goal.new V(1, 0, 0));
+ float goal_height = goal.diagonal().dot(goal.new V(0, 1, 0));
+ float goal_depth = goal.diagonal().dot(goal.new V(0, 0, 1));
+
+ float width = (float)0.6;
+ float height = (float)0.08;
+ float depth = (float)0.3;
+ translations = new Geom.M[] {
+
+ tile.new M(tile.new V(-(width/2), height, 0)),
+ tile.new M(tile.new V( (width/2), height, 0)),
+ tile.new M(tile.new V(-(width/2), -height, 0)),
+ tile.new M(tile.new V( (width/2), -height, 0)),
+ tile.new M(tile.new V(-(width/2), 0, depth)),
+ tile.new M(tile.new V( (width/2), 0, depth)),
+ tile.new M(tile.new V(-(width/2), 0, -depth)),
+ tile.new M(tile.new V( (width/2), 0, -depth)),
+
+ tile.new M(tile.new V( width, 0, 0)),
+ tile.new M(tile.new V(-width, 0, 0)),
+ /*
+ tile.new M(tile.new V( 0, 0, depth)),
+ tile.new M(tile.new V( 0, 0, -depth)),
+ */
+ };
+
+
+ Geom.P ltf = tile.newP(-(width/2), (height/2), (depth/2));
+ Geom.P mtf = tile.newP( 0.0, (height/2), (depth/2));
+ Geom.P rtf = tile.newP( (width/2), (height/2), (depth/2));
+ Geom.P ltn = tile.newP(-(width/2), (height/2), -(depth/2));
+ Geom.P mtn = tile.newP( 0.0, (height/2), -(depth/2));
+ Geom.P rtn = tile.newP( (width/2), (height/2), -(depth/2));
+ Geom.P lbf = tile.newP(-(width/2), -(height/2), (depth/2));
+ Geom.P mbf = tile.newP( 0.0, -(height/2), (depth/2));
+ Geom.P rbf = tile.newP( (width/2), -(height/2), (depth/2));
+ Geom.P lbn = tile.newP(-(width/2), -(height/2), -(depth/2));
+ Geom.P mbn = tile.newP( 0.0, -(height/2), -(depth/2));
+ Geom.P rbn = tile.newP( (width/2), -(height/2), -(depth/2));