Ejemplo n.º 1
0
        bool BuildBoundary()
        {
            m_Mesh2D = new AM_Mesh2d();

            BoundingBox maxRect = new BoundingBox();

            if (!BuildMeshBoundary(ref maxRect))
            {
                return(false);
            }

            // Inserisce i contorni
            m_Mesh2D.Init(maxRect);

            int numBoundary = m_ArrayMeshBoundary.Count;

            for (int i = 0; i < numBoundary; i++)
            {
                m_ArrayMeshBoundary[i].InsertIntoMesh(m_Mesh2D);
            }

            //// Inserisce i vertici isolati
            for (int i = 0; i < m_ArrayInnerVertex.Count; i++)
            {
                var       vertex  = m_ArrayInnerVertex[i];
                AM_Vertex pvertex = null;

                Point2d pt = vertex.Location;

                if (m_Mesh2D.InsertPoint(new Point2d(pt), vertex.Space, out pvertex))
                {
                    pvertex.Flag      = 0x01;
                    vertex.MeshVertex = pvertex;
                }
            }

            return(true);
        }