internal bool CreateSphereNodes() { for (int i = 0; i < this._mesh.TriangleCount; i++) { List <int> triIndexes = vertexIndexByTri[i]; SphereNode sp = SphereNode.ByThreePoints(this.vertices[triIndexes[0]], this.vertices[triIndexes[1]], this.vertices[triIndexes[2]]); SaveTriangleToNode(sp, i); this.nodes.Add(sp); } return(true); }
public static IList <SphereNode> SphereNodesByMesh(MeshToolkit mesh) { List <Point> vertices = mesh.Vertices(); List <int> vertexIndex = mesh.VertexIndicesByTri(); var setOfIndexes = Core.List.Chop <int>(vertexIndex, 3); List <SphereNode> sphereNodes = new List <SphereNode>(); foreach (var ind in setOfIndexes) { sphereNodes.Add(SphereNode.ByThreePoints(vertices[ind[0]], vertices[ind[1]], vertices[ind[2]])); } return(sphereNodes); }