Esempio n. 1
0
        /// <summary>
        /// Reset internal data
        /// </summary>
        public void Reset()
        {
            m_MergedFaceSet.Clear();
            m_FacesCollDict.Clear();
            m_MeshVertices.Clear();

            IList <XYZ> vertices = null;

            if (m_Geom != null)
            {
                vertices = m_Geom.GetVertices();
            }
            else if (m_MeshGeom != null)
            {
                vertices = m_MeshGeom.Vertices;
            }

            if (vertices != null)
            {
                for (int idx = 0; idx < vertices.Count; ++idx)
                {
                    m_MeshVertices.Add(idx, vertices[idx]);
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Constructor for the class, accepting the TriangulatedShellComponent from the result of body tessellation
        /// </summary>
        /// <param name="triangulatedBody"></param>
        public TriangleMergeUtil(TriangulatedShellComponent triangulatedBody)
        {
            m_Geom     = triangulatedBody;
            m_MeshGeom = null;
            m_MeshVertices.Clear();
            int idx = 0;

            try
            {
                foreach (XYZ vert in triangulatedBody.GetVertices())
                {
                    m_MeshVertices.Add(idx, vert);
                    idx++;
                }
            }
            catch
            {
                int vertCount = triangulatedBody.VertexCount;
                for (int currentVertexIndex = 0; currentVertexIndex < vertCount; currentVertexIndex++)
                {
                    m_MeshVertices.Add(idx, triangulatedBody.GetVertex(currentVertexIndex));
                    idx++;
                }
            }
        }