Normand Briere
2019-08-13 0cdf3fb57ddea3226f094ba45c836c7e9b123e3a
BoundaryRep.java
....@@ -1997,7 +1997,10 @@
19971997 if (v.vertexlinks == null)
19981998 continue;
19991999
2000
- if (v.weights != null && v.weights[j] < 0.001 * v.totalweight) // == 0)
2000
+ // Warning: faster but dangerous
2001
+ if (v.weights != null && v.weights[j]
2002
+ // == 0)
2003
+ < 0.001 * v.totalweight)
20012004 {
20022005 //testweight += v.weights[j-1];
20032006 continue;
....@@ -4001,7 +4004,7 @@
40014004 NormalGenerator ng;
40024005
40034006 if (crease)
4004
- ng = new NormalGenerator(Math.PI/6); // default is 44 degrees (or Math.PI/3); // /4);
4007
+ ng = new NormalGenerator(Math.PI/4); // default is 44 degrees (or Math.PI/3); // /4);
40054008 else
40064009 ng = new NormalGenerator(Math.PI); // (Math.PI / 3); // /4);
40074010
....@@ -4019,8 +4022,6 @@
40194022 //System.out.println("NEW = " + positions.length);
40204023 uvmap = new float[ta.getVertexCount() * 2];
40214024
4022
- colors = new float[ta.getVertexCount()]; // * 3];
4023
-
40244025 ta.getCoordinates(0, positions);
40254026 ta.getNormals(0, normals);
40264027 // ta.getColors(0, colors);
....@@ -4028,6 +4029,14 @@
40284029
40294030 System.out.println("UV = " + uvmap[2] + ", " + uvmap[3] + ";");
40304031
4032
+ colors = null;
4033
+// colors = new float[ta.getVertexCount()]; // * 3];
4034
+//
4035
+// for (int i=colors.length; --i>=0;)
4036
+// {
4037
+// colors[i] = 1;
4038
+// }
4039
+
40314040 triangles = new int[ta.getVertexCount()];
40324041
40334042 for (int i = 0; i < triangles.length; i++)
....@@ -4065,17 +4074,18 @@
40654074 positions = new float[3 * ga.getVertexCount()];
40664075 normals = new float[3 * ga.getVertexCount()];
40674076 uvmap = new float[2 * ga.getVertexCount()];
4068
- colors = new float[1 * ga.getVertexCount()];
40694077
40704078 tsa.getCoordinates(0, positions);
40714079 tsa.getNormals(0, normals);
40724080 tsa.getTextureCoordinates(0, 0, uvmap);
40734081 // tsa.getColors(0, colors);
4074
-
4075
- for (int i=colors.length; --i>=0;)
4076
- {
4077
- colors[i] = 1;
4078
- }
4082
+
4083
+ colors = null;
4084
+// colors = new float[1 * ga.getVertexCount()];
4085
+// for (int i=colors.length; --i>=0;)
4086
+// {
4087
+// colors[i] = 1;
4088
+// }
40794089
40804090 int stripcount = tsa.getNumStrips();
40814091 triangles = new int[stripcount];
....@@ -4084,6 +4094,7 @@
40844094 stripified = true;
40854095 } catch (ClassCastException e)
40864096 {
4097
+ // ??? aug 2019
40874098 TriangleArray ta = (TriangleArray) ga;
40884099
40894100 positions = new float[3 * ga.getVertexCount()];