|
|
|
@ -15,7 +15,7 @@ namespace Metamesh |
|
|
|
public List<int> min = new List<int>(); |
|
|
|
public List<int> min = new List<int>(); |
|
|
|
public Dictionary<string, int> vecToidx = new Dictionary<string, int>(); |
|
|
|
public Dictionary<string, int> vecToidx = new Dictionary<string, int>(); |
|
|
|
public Dictionary<string, List<int>> vertByDist = new Dictionary<string, List<int>>(); |
|
|
|
public Dictionary<string, List<int>> vertByDist = new Dictionary<string, List<int>>(); |
|
|
|
public List<List<int>> closestTo = new List<List<int>>(); |
|
|
|
public Dictionary<int, List<int>> closestTo = new Dictionary<int, List<int>>(); |
|
|
|
|
|
|
|
|
|
|
|
public List<List<string>> innerFacets = new List<List<string>>(); |
|
|
|
public List<List<string>> innerFacets = new List<List<string>>(); |
|
|
|
public List<List<IsoVector>> isoVecsABOB = new List<List<IsoVector>>(); |
|
|
|
public List<List<IsoVector>> isoVecsABOB = new List<List<IsoVector>>(); |
|
|
|
@ -116,7 +116,7 @@ namespace Metamesh |
|
|
|
string isoId; |
|
|
|
string isoId; |
|
|
|
string isoIdR; |
|
|
|
string isoIdR; |
|
|
|
|
|
|
|
|
|
|
|
var closestTo = new List<List<int>>(); |
|
|
|
var closestTo = new Dictionary<int, List<int>>(); |
|
|
|
var vDist = this.vertByDist; |
|
|
|
var vDist = this.vertByDist; |
|
|
|
|
|
|
|
|
|
|
|
System.Action<int, int, string, string> matchIdx = (f, fr, isoId, isoIdR) => |
|
|
|
System.Action<int, int, string, string> matchIdx = (f, fr, isoId, isoIdR) => |
|
|
|
@ -429,7 +429,7 @@ namespace Metamesh |
|
|
|
var x = OA * this.coau + OB * this.cobu; |
|
|
|
var x = OA * this.coau + OB * this.cobu; |
|
|
|
var y = OA * this.coav + OB * this.cobv; |
|
|
|
var y = OA * this.coav + OB * this.cobv; |
|
|
|
|
|
|
|
|
|
|
|
var mapped = new List<List<float>>(); |
|
|
|
var mapped = new Dictionary<int, List<float>>(); |
|
|
|
|
|
|
|
|
|
|
|
string idx; |
|
|
|
string idx; |
|
|
|
for (var i = 0; i < this.cartesian.Count; i++) |
|
|
|
for (var i = 0; i < this.cartesian.Count; i++) |
|
|
|
@ -501,13 +501,8 @@ namespace Metamesh |
|
|
|
return a.y - b.y; |
|
|
|
return a.y - b.y; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var min = new List<int> { m + n + 1 }; |
|
|
|
var min = Enumerable.Repeat(int.MaxValue, m + n + 1).ToList(); |
|
|
|
var max = new List<int> { m + n + 1 }; |
|
|
|
var max = Enumerable.Repeat(int.MinValue, m + n + 1).ToList(); |
|
|
|
for (var i = 0; i < min.Count; i++) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
min[i] = int.MaxValue; |
|
|
|
|
|
|
|
max[i] = int.MinValue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var y = 0; |
|
|
|
var y = 0; |
|
|
|
var x = 0; |
|
|
|
var x = 0; |
|
|
|
@ -540,10 +535,10 @@ namespace Metamesh |
|
|
|
return v.x + v.y; |
|
|
|
return v.x + v.y; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
var cartesian = new List<Vector3>(); |
|
|
|
var cartesian = Enumerable.Repeat(Vector3.zero, len).ToList(); |
|
|
|
var distFromO = new List<int>(); |
|
|
|
var distFromO = Enumerable.Repeat(0, len).ToArray(); |
|
|
|
var distFromA = new List<int>(); |
|
|
|
var distFromA = Enumerable.Repeat(0, len).ToArray(); |
|
|
|
var distFromB = new List<int>(); |
|
|
|
var distFromB = Enumerable.Repeat(0, len).ToArray(); |
|
|
|
var vertByDist = new Dictionary<string, List<int>>(); |
|
|
|
var vertByDist = new Dictionary<string, List<int>>(); |
|
|
|
; |
|
|
|
; |
|
|
|
var vertData = new List<List<int>>(); |
|
|
|
var vertData = new List<List<int>>(); |
|
|
|
@ -897,7 +892,15 @@ namespace Metamesh |
|
|
|
this.adjacentFaces = new List<List<int>>(); |
|
|
|
this.adjacentFaces = new List<List<int>>(); |
|
|
|
for (var m = 0; m < map.Length; m++) |
|
|
|
for (var m = 0; m < map.Length; m++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
goldbergPolyhedronData.face[m] = this.SetOrder(m, new List<int>(map[m])); |
|
|
|
var tempFace = this.SetOrder(m, new List<int>(map[m])); |
|
|
|
|
|
|
|
if (goldbergPolyhedronData.face.Count <= m) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
goldbergPolyhedronData.face.Add(tempFace); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
goldbergPolyhedronData.face[m] = tempFace; |
|
|
|
|
|
|
|
} |
|
|
|
foreach (var el in map[m]) |
|
|
|
foreach (var el in map[m]) |
|
|
|
{ |
|
|
|
{ |
|
|
|
cx = 0; |
|
|
|
cx = 0; |
|
|
|
@ -911,7 +914,16 @@ namespace Metamesh |
|
|
|
cy += vertex[1]; |
|
|
|
cy += vertex[1]; |
|
|
|
cz += vertex[2]; |
|
|
|
cz += vertex[2]; |
|
|
|
} |
|
|
|
} |
|
|
|
goldbergPolyhedronData.vertex[el] = new Vector3(cx / 3, cy / 3, cz / 3); |
|
|
|
|
|
|
|
|
|
|
|
var tempVertex = new Vector3(cx / 3, cy / 3, cz / 3); |
|
|
|
|
|
|
|
if (goldbergPolyhedronData.vertex.Count <= el) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
goldbergPolyhedronData.vertex.Add(tempVertex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
goldbergPolyhedronData.vertex[el] = tempVertex; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
; |
|
|
|
; |
|
|
|
} |
|
|
|
} |