示例#1
0
        private static List <ModelData.EdgeIndex> GenerateEndgeList(List <ModelData.FaceIndex> faceList, ref ProgressHelper progressHelper)
        {
            var hashCollection = new Dictionary <ModelData.EdgeIndex, ModelData.EdgeIndex>();

            for (var index = 0; index < faceList.Count; ++index)
            {
                ModelData.FaceIndex face = faceList[index];
                ModelData.AppendEdgeToHash_Helper(ref hashCollection, index, face.P1, face.P2);
                ModelData.AppendEdgeToHash_Helper(ref hashCollection, index, face.P2, face.P3);
                ModelData.AppendEdgeToHash_Helper(ref hashCollection, index, face.P1, face.P3);
                progressHelper.Process(index);
            }
            return(hashCollection.Values.ToList <ModelData.EdgeIndex>());
        }
示例#2
0
        private static List <ModelData.VertexIndex> GenerateFaceLink_Helper(List <M3D.Model.Utils.Vector3> newVerticesList, List <ModelData.FaceIndex> newFaceList, ProgressHelper progressHelper = null)
        {
            var vertexIndexList = new List <ModelData.VertexIndex>(newFaceList.Count);

            foreach (M3D.Model.Utils.Vector3 newVertices in newVerticesList)
            {
                vertexIndexList.Add(new ModelData.VertexIndex(new List <int>()));
            }

            for (var index = 0; index < newFaceList.Count; ++index)
            {
                ModelData.FaceIndex newFace = newFaceList[index];
                vertexIndexList[newFace.P1].Faces.Add(index);
                vertexIndexList[newFace.P2].Faces.Add(index);
                vertexIndexList[newFace.P3].Faces.Add(index);
                progressHelper?.Process(index);
            }
            return(vertexIndexList);
        }