Normand Briere
2019-06-09 c5b599b48b333b34e554b464aefbca0b9bc66275
Vertex.java
....@@ -112,7 +112,6 @@
112112 {
113113 //if (normalmode) // pos == null)
114114 // return 0;
115
-
116115 if (norm == null || !normalmode)
117116 {
118117 return /*pos.*/ super.hashCode();
....@@ -129,12 +128,26 @@
129128 Vertex vert = (Vertex) o;
130129
131130 //System.out.println("pos = " + pos + "; vert.pos = " + vert/*.pos*/);
131
+
132
+ double tolerance = 0.00001;
133
+
134
+ if (!Grafreed.epsequal)
135
+ tolerance = 0;
132136
133
- return Math.abs(/*pos.*/x - vert./*pos.*/x) +
134
- Math.abs(/*pos.*/y - vert./*pos.*/y) +
135
- Math.abs(/*pos.*/z - vert./*pos.*/z) < 0.00001 && // GraphreeD.epsvertex2 && // WARNING: USE 0.0001 for serial issues
136
- (GraphreeD.linkUV || Math.abs(s - vert.s) + Math.abs(t - vert.t) < 0.00001)
137
- ; // GraphreeD.epsvertex2;
137
+ boolean samepos = Math.abs(/*pos.*/x - vert./*pos.*/x) +
138
+ Math.abs(/*pos.*/y - vert./*pos.*/y) +
139
+ Math.abs(/*pos.*/z - vert./*pos.*/z) <= tolerance && // GrafreeD.epsvertex2 && // WARNING: USE 0.0001 for serial issues
140
+ (Grafreed.linkUV || Math.abs(s - vert.s) + Math.abs(t - vert.t) <= tolerance)
141
+ ; // GrafreeD.epsvertex2;
142
+
143
+ if (samepos && Grafreed.smoothmode)
144
+ {
145
+ norm.add(vert.norm);
146
+ norm.normalize();
147
+ vert.norm.set(norm);
148
+ }
149
+
150
+ return samepos;
138151 }
139152 /*
140153 public boolean isSame(Object o)