.. | .. |
---|
112 | 112 | { |
---|
113 | 113 | //if (normalmode) // pos == null) |
---|
114 | 114 | // return 0; |
---|
115 | | - |
---|
116 | 115 | if (norm == null || !normalmode) |
---|
117 | 116 | { |
---|
118 | 117 | return /*pos.*/ super.hashCode(); |
---|
.. | .. |
---|
123 | 122 | |
---|
124 | 123 | public boolean equals(Object o) |
---|
125 | 124 | { |
---|
126 | | - assert(norm.normalized()); |
---|
| 125 | + // JUNE 2019. norm can be null (e.g. Box) Grafreed.Assert(norm.normalized()); |
---|
127 | 126 | //if (true) return false; |
---|
128 | 127 | |
---|
129 | 128 | Vertex vert = (Vertex) o; |
---|
130 | 129 | |
---|
131 | 130 | //System.out.println("pos = " + pos + "; vert.pos = " + vert/*.pos*/); |
---|
| 131 | + |
---|
| 132 | + double tolerance = 0.00001; |
---|
| 133 | + |
---|
| 134 | + if (!Grafreed.epsequal) |
---|
| 135 | + tolerance = 0; |
---|
132 | 136 | |
---|
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 && // GrafreeD.epsvertex2 && // WARNING: USE 0.0001 for serial issues |
---|
136 | | - (GrafreeD.linkUV || Math.abs(s - vert.s) + Math.abs(t - vert.t) < 0.00001) |
---|
137 | | - ; // GrafreeD.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; |
---|
138 | 151 | } |
---|
139 | 152 | /* |
---|
140 | 153 | public boolean isSame(Object o) |
---|