Exemple #1
0
        public static Dictionary <Vertex, List <TriangleMesh> > GetVertexTriangleMap(TriangleMesh[] triangles)
        {
            var map = new Dictionary <Vertex, List <TriangleMesh> >();

            for (var i = 0; i < triangles.Length; i++)
            {
                TriangleMesh currentTriangle           = triangles[i];
                ReadOnlyCollection <Vertex> vertexData = currentTriangle.Vertices;
                for (var j = 0; j < vertexData.Count; i++)
                {
                    Vertex datum = vertexData[j];
                    if (!map.ContainsKey(datum))
                    {
                        map[datum] = new List <TriangleMesh>();
                    }

                    map[datum].Add(currentTriangle);
                }
            }

            return(map);
        }
Exemple #2
0
 public bool HasSharedEdge(TriangleMesh otherTriangle)
 {
     return(NumSharedVertices(otherTriangle) > 1);
 }
Exemple #3
0
 public Mesh ToUnityMesh()
 {
     return(TriangleMesh.ToUnityMesh(Meshes.SelectMany(mesh => mesh.TriangleMeshes)));
 }
 public Mesh ToUnityMesh()
 {
     return(TriangleMesh.ToUnityMesh(_triangles));
 }