Normand Briere
2019-06-26 89b25e7cc97f6fe221dfd41c4d463500f8a31bc1
BoundaryRep.java
....@@ -161,6 +161,7 @@
161161 || FaceCount() != other.FaceCount()
162162 || !(indices == null ^ other.indices != null)) // july 2014
163163 {
164
+ // The meshes have different structures.
164165 //new Exception().printStackTrace();
165166 trimmed = other.trimmed;
166167 stripified = other.stripified;
....@@ -239,9 +240,16 @@
239240 }
240241 }
241242
242
- Support[] InitConnections(BoundaryRep other)
243
+ transient Support[] cachesupports = null;
244
+
245
+ Support[] InitConnections()
243246 {
244
- int n = other.startvertices.length-1;
247
+ if (cachesupports != null)
248
+ {
249
+ return cachesupports;
250
+ }
251
+
252
+ int n = this.startvertices.length-1;
245253
246254 Support[] supports = new Support[n];
247255
....@@ -253,38 +261,60 @@
253261
254262 for (int object=1; object<=n; object++)
255263 {
256
- int start = other.startvertices[object-1];
257
- int end = other.startvertices[object];
264
+ int start = this.startvertices[object-1];
265
+ int end = this.startvertices[object];
258266
259267 if (start == end)
260268 continue; // ??
261269
270
+ /**
271
+ Vertex v2 = vertextemp;
272
+ v2.x = averagepoints[object*3];
273
+ v2.y = averagepoints[object*3+1];
274
+ v2.z = averagepoints[object*3+2];
275
+
276
+ //v2.set(GetVertex(this.startvertices[subsupport]));
277
+
278
+ // projected point
279
+ Vertex v3 = vertextemp2;
280
+ //GetVertex(this.startvertices[subsupport]);
281
+ v3.x = extremepoints[object*3];
282
+ v3.y = extremepoints[object*3+1];
283
+ v3.z = extremepoints[object*3+2];
284
+
285
+ vect3.set(v3); // "X" axis apex
286
+ vect3.sub(v2); // origin (center)
287
+ vect3.normalize();
288
+ /**/
289
+
262290 int linkcount = 0;
263291
264292 int objectinlist = -1;
293
+
294
+ Support subsupport = supports[object-1];
265295
266296 for (int object2=1; object2<=n; object2++)
267297 {
268298 for (int i = start; i < end; i++)
269299 {
270
- Vertex v = other.GetVertex(i);
300
+ Vertex v = this.GetVertex(i);
271301
272
- //
273
- if (other.Contains(v, object2))
302
+ // Check if v is close enough from any vertex of the given subobject.
303
+ if (this.Contains(v, object2))
274304 {
275
- if (linkcount == supports[object-1].links.length)
305
+ if (linkcount == subsupport.links.length)
276306 break;
277307
278308 if (object2 == object)
279309 objectinlist = linkcount;
280310
281
- supports[object-1].links[linkcount++] = object2;
311
+ subsupport.links[linkcount++] = object2;
282312 break;
283313 }
284314 }
285315 }
286316
287
- supports[object-1].links[linkcount] = -1;
317
+ subsupport.links[linkcount] = -1;
288318
289319 if (objectinlist == -1)
290320 assert(objectinlist != -1);
....@@ -293,9 +323,9 @@
293323 // assert(linkcount > 1);
294324
295325 // show main support as blue
296
- int first = supports[object-1].links[0];
297
- supports[object-1].links[0] = supports[object-1].links[objectinlist];
298
- supports[object-1].links[objectinlist] = first;
326
+ int first = subsupport.links[0];
327
+ subsupport.links[0] = subsupport.links[objectinlist];
328
+ subsupport.links[objectinlist] = first;
299329 }
300330
301331 for (int loop = 0; --loop>=0;)
....@@ -353,7 +383,7 @@
353383 supports = supports2;
354384 }
355385
356
- return supports;
386
+ return cachesupports = supports;
357387 }
358388
359389 double Distance2(Vertex v, Vertex v2, double dist2beat, double[][] toRoot, int k)
....@@ -598,7 +628,7 @@
598628 // ;
599629 //
600630
601
- supportsize = supportsizes[subsupport];
631
+ supportsize = supportminsize[subsupport];
602632
603633 double K = supportsize / distmax;
604634
....@@ -650,7 +680,8 @@
650680 // if (supportsize * fadefactor > 1)
651681 // return 1;
652682
653
- return supportsize * fadefactor;
683
+ return //supportsize *
684
+ supportsize * fadefactor;
654685 }
655686
656687 void RecomputeBasis(BoundaryRep other, double[][] toRoot, Vertex v)
....@@ -952,7 +983,7 @@
952983
953984 // sept 2017 SEUIL = 0.1; // aout 2013
954985
955
- supports = InitConnections(other);
986
+ supports = other.InitConnections();
956987
957988 other.supports = supports; // should be the other way around...
958989
....@@ -1895,7 +1926,7 @@
18951926 return;
18961927 }
18971928
1898
- // System.exit(0);
1929
+ // System.exit(0);
18991930
19001931 cVector vect = new cVector();
19011932 cVector normal = new cVector();
....@@ -1966,7 +1997,7 @@
19661997 if (v.vertexlinks == null)
19671998 continue;
19681999
1969
- if (v.weights != null && v.weights[j] == 0) // < 0.01 * v.totalweight) // == 0)
2000
+ if (v.weights != null && v.weights[j] < 0.001 * v.totalweight) // == 0)
19702001 {
19712002 //testweight += v.weights[j-1];
19722003 continue;
....@@ -2247,6 +2278,8 @@
22472278
22482279 transient int lastsoundtime;
22492280
2281
+ transient boolean once = false;
2282
+
22502283 void setMasterThis0(BoundaryRep other, double[][] toRoot, boolean smooth, boolean marked)
22512284 {
22522285 if (LA.isIdentity(toRoot))
....@@ -2302,7 +2335,11 @@
23022335
23032336 if (v.totalweight == 0)
23042337 {
2305
- System.err.println("v.totalweight == 0! --> " + this + " : " + other);
2338
+ if (!once)
2339
+ {
2340
+ System.err.println("v.totalweight == 0! --> " + this + " : " + other);
2341
+ once = true;
2342
+ }
23062343 continue;
23072344 }
23082345
....@@ -3098,6 +3135,7 @@
30983135 //
30993136 // transient VertexCompare[] vertexcompare = null;
31003137
3138
+ // Check if v0 is close enough from any vertex of the given subobject of this.
31013139 boolean Contains(Vertex v0, int object)
31023140 {
31033141 int start = startvertices[object-1];
....@@ -3696,6 +3734,111 @@
36963734 */
36973735 }
36983736
3737
+ void GenerateNormals2(boolean crease)
3738
+ {
3739
+ cVector tempVector = new cVector();
3740
+
3741
+// java.util.HashMap<cVector, cVector> tableBase = new java.util.HashMap<cVector, cVector>();
3742
+//
3743
+//
3744
+// for (int i=0; i<this.VertexCount(); i++)
3745
+// {
3746
+// Vertex v = this.GetVertex(i);
3747
+//
3748
+// tempVector.set(v);
3749
+//
3750
+// cVector n = tableBase.get(tempVector.ToFloat());
3751
+//
3752
+// if (n != null)
3753
+// {
3754
+// continue;
3755
+// }
3756
+//
3757
+// tableBase.put(new cVector(tempVector), new cVector(v.norm));
3758
+// }
3759
+
3760
+ BoundaryRep tempSupport = this.support;
3761
+
3762
+ this.support = null;
3763
+
3764
+ BoundaryRep tempRep = (BoundaryRep)Grafreed.clone(this);
3765
+
3766
+ this.support = tempSupport;
3767
+
3768
+ //tempRep.Unstripify();
3769
+
3770
+ tempRep.GenerateNormals2(crease);
3771
+
3772
+ boolean keepnormal = Vertex.normalmode;
3773
+ boolean epsequal = Grafreed.epsequal;
3774
+
3775
+ Vertex.normalmode = false;
3776
+ Grafreed.epsequal = false; // A bit strange
3777
+
3778
+ // No need to have a match for vertex counts.
3779
+
3780
+ java.util.HashMap<cVector, cVector> table = new java.util.HashMap<cVector, cVector>();
3781
+
3782
+ for (int i=0; i<tempRep.VertexCount(); i++)
3783
+ {
3784
+ Vertex v = tempRep.GetVertex(i);
3785
+
3786
+ cVector n = table.get(tempVector.ToFloat());
3787
+
3788
+ if (v.norm.x == 1 && v.norm.y == 0 && v.norm.z == 0)
3789
+ {
3790
+ //continue;
3791
+ }
3792
+
3793
+ tempVector.set(v);
3794
+
3795
+ //cVector nBase = tableBase.get(tempVector);
3796
+
3797
+ //if (v.norm.dot(nBase) < 0.9)
3798
+ //{
3799
+ // continue;
3800
+ //}
3801
+
3802
+ if (n != null && n.x == 1 && n.y == 0 && n.z == 0)
3803
+ {
3804
+ //continue;
3805
+ }
3806
+
3807
+ if (n != null)
3808
+ {
3809
+// if (n.dot(v.norm) < 0)
3810
+// n.sub(v.norm);
3811
+// else
3812
+// n.add(v.norm);
3813
+//
3814
+// n.normalize();
3815
+ continue;
3816
+ }
3817
+
3818
+ table.put(new cVector(tempVector), new cVector(v.norm));
3819
+ }
3820
+
3821
+ for (int i=0; i<this.VertexCount(); i++)
3822
+ {
3823
+ Vertex v = this.GetVertex(i);
3824
+
3825
+ tempVector.set(v);
3826
+
3827
+ cVector n = table.get(tempVector.ToFloat());
3828
+
3829
+ //if (n.dot(v.norm) < 0)
3830
+ if (n == null)
3831
+ continue;
3832
+
3833
+ LA.vecCopy(n, v.norm);
3834
+
3835
+ this.SetVertex(v, i);
3836
+ }
3837
+
3838
+ Grafreed.epsequal = epsequal;
3839
+ Vertex.normalmode = keepnormal;
3840
+ }
3841
+
36993842 void GenerateNormals(boolean crease)
37003843 {
37013844 boolean wastrim = trimmed;
....@@ -3712,6 +3855,28 @@
37123855 }
37133856
37143857 Trim(true/*wastrim*/,true,crease,wasstrip,false);
3858
+ }
3859
+
3860
+ void GenerateNormalsMesh()
3861
+ {
3862
+ if (stripified)
3863
+ {
3864
+ Unstripify();
3865
+ }
3866
+
3867
+ if (trimmed)
3868
+ {
3869
+ normals = null;
3870
+ }
3871
+ else
3872
+ {
3873
+ for (int i=VertexCount(); --i>=0;)
3874
+ {
3875
+ Vertex v = GetVertex(i);
3876
+
3877
+ v.norm = null;
3878
+ }
3879
+ }
37153880 }
37163881
37173882 void GenNormalsJME()
....@@ -3869,6 +4034,10 @@
38694034 {
38704035 triangles[i] = i;
38714036 }
4037
+
4038
+// Untrim();
4039
+ if (!trimmed)
4040
+ MergeNormals();
38724041 }
38734042 }
38744043
....@@ -3929,6 +4098,10 @@
39294098 triangles = new int[1];
39304099 triangles[0] = 3;
39314100 }
4101
+
4102
+ //Untrim();
4103
+ if (!trimmed)
4104
+ MergeNormals();
39324105 }
39334106
39344107 /*
....@@ -3978,6 +4151,42 @@
39784151 }
39794152
39804153 Vertex.normalmode = false;
4154
+ }
4155
+
4156
+ void MergeNormals()
4157
+ {
4158
+ assert(!trimmed);
4159
+
4160
+ boolean smooth = Grafreed.smoothmode;
4161
+ boolean link = Grafreed.linkUV;
4162
+ Grafreed.smoothmode = true;
4163
+ Grafreed.linkUV = true;
4164
+
4165
+ System.out.println("#Vertex = " + VertexCount());
4166
+ System.out.println("#Face = " + FaceCount());
4167
+
4168
+ java.util.HashSet<Vertex> table = new java.util.HashSet<Vertex>();
4169
+
4170
+ for (int i = 0; i < VertexCount(); i++)
4171
+ {
4172
+ Vertex v = GetVertex(i);
4173
+
4174
+ if (!table.contains(v))
4175
+ {
4176
+ table.add(v);
4177
+ }
4178
+ }
4179
+
4180
+ Grafreed.smoothmode = smooth;
4181
+ Grafreed.linkUV = link;
4182
+
4183
+// for (int i = 0; i < VertexCount(); i++)
4184
+// {
4185
+// Vertex v = GetVertex(i);
4186
+//
4187
+// table.add(v);
4188
+// }
4189
+
39814190 }
39824191
39834192 static cVector temp1 = new cVector();
....@@ -4752,16 +4961,25 @@
47524961 {
47534962 i3 = positions.length-3;
47544963 i2 = uvmap.length - 2;
4755
- new Exception().printStackTrace();
4964
+ //new Exception().printStackTrace();
47564965 }
47574966
47584967 v./*pos.*/x = positions[i3];
47594968 v./*pos.*/y = positions[i3 + 1];
47604969 v./*pos.*/z = positions[i3 + 2];
47614970
4762
- v.norm.x = normals[i3];
4763
- v.norm.y = normals[i3 + 1];
4764
- v.norm.z = normals[i3 + 2];
4971
+ if (normals == null)
4972
+ {
4973
+ v.norm.x = 0;
4974
+ v.norm.y = 0;
4975
+ v.norm.z = 0;
4976
+ }
4977
+ else
4978
+ {
4979
+ v.norm.x = normals[i3];
4980
+ v.norm.y = normals[i3 + 1];
4981
+ v.norm.z = normals[i3 + 2];
4982
+ }
47654983
47664984 v.s = uvmap[i2];
47674985 v.t = uvmap[i2 + 1];
....@@ -5476,17 +5694,27 @@
54765694
54775695 transient int nbbadfaces; // ?? = 1000000;
54785696
5479
- int ChooseTriangle()
5697
+ /*
5698
+ */
5699
+ int ChooseTriangle(boolean firstEquilateral)
54805700 {
54815701 int chosen = -1;
54825702
54835703 double minweight = 1E10;
54845704
5705
+ int step = 8; // ?
5706
+
5707
+ if (firstEquilateral)
5708
+ step = 1;
5709
+
54855710 nbbadfaces = 0;
5486
- for (int i=0; i<faces.size(); i+=8)
5711
+ for (int i=0; i<faces.size(); i+=step)
54875712 // for (int i=faces.size(); (i-=8)>=0;)
54885713 {
54895714 Face face = (Face) faces.get(i);
5715
+
5716
+ if (face.used)
5717
+ continue;
54905718
54915719 if (!Valid(face))
54925720 {
....@@ -5496,6 +5724,15 @@
54965724
54975725 if (Boundary(face))
54985726 continue;
5727
+
5728
+// if (Boundary(face.p))
5729
+// continue;
5730
+//
5731
+// if (Boundary(face.q))
5732
+// continue;
5733
+//
5734
+// if (Boundary(face.r))
5735
+// continue;
54995736
55005737 if (!ValidValence(face))
55015738 continue;
....@@ -5508,22 +5745,55 @@
55085745 //?? if (face.weight < 0)
55095746 // continue;
55105747
5511
- double K = 1; // 0.01; // .25;
5512
-
5513
- double factor = (1-K)*face.nbiterations + K; //*face.weight;
5514
-
5515
- double weight = FaceWeight(face); // *Math.pow(PerimeterMax(face),0.25)*factor;
5516
-
5517
- if (minweight > weight)
5748
+ if (firstEquilateral)
55185749 {
5519
- minweight = weight;
5750
+ if (OneFaceUsed(links.get(face.p)))
5751
+ continue;
5752
+
5753
+ if (OneFaceUsed(links.get(face.q)))
5754
+ continue;
5755
+
5756
+ if (OneFaceUsed(links.get(face.r)))
5757
+ continue;
5758
+
55205759 chosen = i;
5521
- if (minweight == 0)
5522
- break;
5760
+ break;
5761
+ }
5762
+ else
5763
+ {
5764
+ double K = 1; // 0.01; // .25;
5765
+
5766
+ double factor = (1-K)*face.nbiterations + K; //*face.weight;
5767
+
5768
+ double weight = FaceWeight(face); // *Math.pow(PerimeterMax(face),0.25)*factor;
5769
+
5770
+ if (minweight > weight)
5771
+ {
5772
+ minweight = weight;
5773
+ chosen = i;
5774
+ if (minweight == 0)
5775
+ break;
5776
+ }
55235777 }
55245778 }
55255779
55265780 return chosen;
5781
+ }
5782
+
5783
+ private boolean OneFaceUsed(Vector<Face> faces)
5784
+ {
5785
+ if (faces.size() != 6)
5786
+ return true;
5787
+
5788
+ for (int i=0; i<6; i+=1)
5789
+ {
5790
+ if (faces.get(i).used)
5791
+ {
5792
+ return true;
5793
+ }
5794
+ }
5795
+
5796
+ return false;
55275797 }
55285798
55295799 static boolean remove3valence = true;
....@@ -5559,7 +5829,7 @@
55595829 }
55605830 else
55615831 {
5562
- assert(links.size() == vertices.size());
5832
+ // TODO Grafreed.Assert(links.size() == vertices.size());
55635833
55645834 links.setSize(vertices.size());
55655835 for (int i=vertices.size(); --i>=0;)
....@@ -5567,6 +5837,7 @@
55675837 // linkstouched[i] = false;
55685838 if (links.get(i) == null) // ??
55695839 {
5840
+ new Exception().printStackTrace();
55705841 links.set(i, new Vector(8));
55715842 // linkstouched[i] = true;
55725843 }
....@@ -5577,6 +5848,8 @@
55775848 }
55785849 }
55795850
5851
+ boolean once = false;
5852
+
55805853 for (int i=faces.size(); --i>=0;)
55815854 {
55825855 Face face = (Face) faces.get(i);
....@@ -5588,6 +5861,9 @@
55885861 //if (linkstouched[face.r])
55895862 links.get(face.r).add(face);
55905863
5864
+ if (face.used)
5865
+ once = true;
5866
+
55915867 face.good = 1;
55925868 face.boundary = -1;
55935869 }
....@@ -6953,6 +7229,10 @@
69537229 return (face.boundary = 1) == 1;
69547230 }
69557231
7232
+ // June 2019
7233
+ if (true)
7234
+ return (face.boundary = 0) == 1;
7235
+
69567236 // reverse triangle test
69577237 q1.set(p);
69587238 q2.set(q);
....@@ -7402,7 +7682,7 @@
74027682 //InitWeights();
74037683 }
74047684
7405
- int chosen = ChooseTriangle(); // Best is slow and not really better
7685
+ int chosen = ChooseTriangle(true); // Best is slow and not really better
74067686
74077687 if (chosen == -1)
74087688 {
....@@ -7416,7 +7696,7 @@
74167696 //remove3valence = false;
74177697 // InitWeights();
74187698
7419
- chosen = ChooseTriangle();
7699
+ chosen = ChooseTriangle(true);
74207700 }
74217701 }
74227702
....@@ -7692,7 +7972,7 @@
76927972
76937973 // boolean lock;
76947974
7695
- void SplitInTwo(boolean reduction34, boolean onlyone)
7975
+ boolean SplitInTwo(boolean reduction34, boolean onlyone)
76967976 {
76977977 if (stripified)
76987978 {
....@@ -7729,12 +8009,12 @@
77298009 {
77308010 System.err.println("EXCEPTION CAUGHT");
77318011 e.printStackTrace();
7732
- return;
8012
+ return false;
77338013 } catch (Error e)
77348014 {
77358015 System.err.println("ERROR CAUGHT");
77368016 e.printStackTrace();
7737
- return;
8017
+ return false;
77388018 }
77398019
77408020 System.out.println("# faces = " + faces.size());
....@@ -7744,6 +8024,7 @@
77448024 {
77458025 Face face = (Face) faces.get(i);
77468026
8027
+ face.used = false;
77478028 face.nbiterations = 1;
77488029 face.weight = -1;
77498030 face.boundary = -1;
....@@ -7795,6 +8076,11 @@
77958076 nbbadfaces = faces.size();
77968077 //remove3valence = true;
77978078
8079
+ int count = 2;
8080
+
8081
+ if (onlyone)
8082
+ count = 1;
8083
+
77988084 firstpass = true;
77998085
78008086 int n = faces.size();
....@@ -7810,8 +8096,9 @@
78108096 System.out.print('.');
78118097 }
78128098 System.out.println();
8099
+ boolean atleastone = false;
78138100 int i = 0;
7814
- while (reduction34 || faces.size() > n/2)
8101
+ while (true) // reduction34 || faces.size() > n/2)
78158102 {
78168103 if (i++%100 == 0)
78178104 {
....@@ -7833,6 +8120,8 @@
78338120 {
78348121 if (!RemoveOneTriangle())
78358122 break;
8123
+
8124
+ atleastone = true;
78368125 }
78378126 // if (iterationcount == 0)
78388127 // break;
....@@ -7843,8 +8132,8 @@
78438132 break;
78448133 }
78458134 firstpass = false;
7846
- if (onlyone)
7847
- break; // one triangle only
8135
+// if (--count<0 && !reduction34)
8136
+// break; // one triangle only
78488137 }
78498138
78508139 InitLinks(false); // for further display
....@@ -7860,6 +8149,8 @@
78608149 Trim(true,false,false,false,false);
78618150
78628151 Globals.theRenderer.setCursor(java.awt.Cursor.getPredefinedCursor(java.awt.Cursor.DEFAULT_CURSOR));
8152
+
8153
+ return atleastone;
78638154 }
78648155
78658156 void UpdateIndices(Face face, Face minface)
....@@ -7872,18 +8163,21 @@
78728163 face.p = minface.p;
78738164 //if (leafweights)
78748165 face.good = 0; // false;
8166
+ face.used = true;
78758167 }
78768168 if (face.q == minface.p || face.q == minface.q || face.q == minface.r)
78778169 {
78788170 face.q = minface.p;
78798171 //if (leafweights)
78808172 face.good = 0; // false;
8173
+ face.used = true;
78818174 }
78828175 if (face.r == minface.p || face.r == minface.q || face.r == minface.r)
78838176 {
78848177 face.r = minface.p;
78858178 //if (leafweights)
78868179 face.good = 0; // false;
8180
+ face.used = true;
78878181 }
78888182
78898183 if (face.p >/*=*/ minface.q && face.p < minface.r)
....@@ -7943,50 +8237,50 @@
79438237 if (v == 2)
79448238 vert = minface.r;
79458239 // Face face = (Face) faces.get(i);
7946
- Vector<Face> vertfaces = links.get(vert);
7947
- for (int i=vertfaces.size(); --i>=0;)
7948
- {
7949
- Face face = (Face) vertfaces.get(i);
7950
-
7951
- // if (face.weight == 10000)
7952
- // continue;
7953
-
7954
- if (face.p == minface.p || face.q == minface.p || face.r == minface.p ||
7955
- face.p == minface.q || face.q == minface.q || face.r == minface.q ||
7956
- face.p == minface.r || face.q == minface.r || face.r == minface.r)
8240
+ Vector<Face> vertfaces = links.get(vert);
8241
+ for (int i=vertfaces.size(); --i>=0;)
79578242 {
7958
- if (!leafweights)
8243
+ Face face = (Face) vertfaces.get(i);
8244
+
8245
+ // if (face.weight == 10000)
8246
+ // continue;
8247
+
8248
+ if (face.p == minface.p || face.q == minface.p || face.r == minface.p ||
8249
+ face.p == minface.q || face.q == minface.q || face.r == minface.q ||
8250
+ face.p == minface.r || face.q == minface.r || face.r == minface.r)
79598251 {
7960
-// if(minfaceweight <= 0)
7961
-// assert(minfaceweight > 0);
7962
-//
7963
-// //FaceWeight(face);
7964
-// if(face.weight < 0)
7965
-// assert(face.weight >= 0);
7966
-
7967
- face.weight += minfaceweight;
7968
-
7969
-// if (face.weight >= 10000)
7970
-// assert(face.weight < 10000);
8252
+ if (!leafweights)
8253
+ {
8254
+ // if(minfaceweight <= 0)
8255
+ // assert(minfaceweight > 0);
8256
+ //
8257
+ // //FaceWeight(face);
8258
+ // if(face.weight < 0)
8259
+ // assert(face.weight >= 0);
8260
+
8261
+ face.weight += minfaceweight;
8262
+
8263
+ // if (face.weight >= 10000)
8264
+ // assert(face.weight < 10000);
8265
+ }
8266
+ else
8267
+ face.weight = -1;
8268
+
8269
+ face.nbiterations += 1;
8270
+ face.boundary = -1;
8271
+
8272
+ Vertex p = (Vertex)vertices.get(face.p);
8273
+ Vertex q = (Vertex)vertices.get(face.q);
8274
+ Vertex r = (Vertex)vertices.get(face.r);
8275
+
8276
+ p.boundary = -1;
8277
+ q.boundary = -1;
8278
+ r.boundary = -1;
79718279 }
79728280 else
7973
- face.weight = -1;
7974
-
7975
- face.nbiterations += 1;
7976
- face.boundary = -1;
7977
-
7978
- Vertex p = (Vertex)vertices.get(face.p);
7979
- Vertex q = (Vertex)vertices.get(face.q);
7980
- Vertex r = (Vertex)vertices.get(face.r);
7981
-
7982
- p.boundary = -1;
7983
- q.boundary = -1;
7984
- r.boundary = -1;
8281
+ assert(false);
79858282 }
7986
- else
7987
- assert(false);
79888283 }
7989
- }
79908284
79918285 // TouchVertex(minface.p);
79928286 // TouchVertex(minface.q);
....@@ -8187,6 +8481,7 @@
81878481 for (int i=vertfaces.size(); --i>=0;)
81888482 {
81898483 Face face = (Face) vertfaces.get(i);
8484
+ face.used = true;
81908485 face.good = 0; // false;
81918486 if (leafweights)
81928487 face.weight = -1;
....@@ -8465,7 +8760,8 @@
84658760 int[] startvertices;
84668761 float[] averagepoints;
84678762 float[] extremepoints;
8468
- float[] supportsizes; // distance of closest point
8763
+ float[] supportminsize; // distance of closest point
8764
+ float[] supportmaxsize; // distance of fartest point
84698765
84708766 transient Hashtable vertextable;
84718767 /*transient*/ private Vertex[] verticesCopy;