Normand Briere
2019-05-02 a76491b66a2e304d9ae27a162f407b98c70fbafa
BoundaryRep.java
....@@ -3247,12 +3247,21 @@
32473247 max = ay;
32483248 }
32493249
3250
+ if (max == 0)
3251
+ {
3252
+ uvmap[i2] = 0.5f;
3253
+ uvmap[i2+1] = 0.5f;
3254
+ continue;
3255
+ }
3256
+
32503257 x /= max;
32513258 y /= max;
32523259
32533260 double angle = Math.acos(Math.abs(z*2));
32543261
32553262 double k = angle / Math.PI * 2;
3263
+
3264
+ assert(k >= 0);
32563265
32573266 // k == 0 => uv = 0 (center)
32583267 // k == 1 => uv = -1,1 (border)
....@@ -3268,7 +3277,8 @@
32683277 t = Math.pow(t, 3);
32693278
32703279 // Interpolate between k/length2 (center) and k (border)
3271
- k = k / length2 * (1 - t) + k * t;
3280
+ if (length2 > 0)
3281
+ k *= (1 - t) / length2 + t;
32723282
32733283 double u = k*x;
32743284 double v = k*y;
....@@ -6344,6 +6354,7 @@
63446354
63456355 void InitWeights()
63466356 {
6357
+ new Exception().printStackTrace();
63476358 System.exit(0);
63486359 int n = 0;
63496360 int b = 0;