コード例 #1
0
        static IntersectionMesh <T> CreateMesh <T>(IList <MICHVertex <T> > startNodes, int startCell_NodeIndice)
            where T : IMesherNode, new()
        {
            SimpleIdMesh <T> mesh = MICMesher <T> .Create(startNodes);

            IntersectionMesh <T> intersectionMesh = new IntersectionMesh <T>(mesh, startCell_NodeIndice);

            return(intersectionMesh);
        }
コード例 #2
0
        public static SimpleIdMesh <T> Create(IList <MICHVertex <T> > startNodes)
        {
            var mICHMesh      = CreateVoronoiMeshFromDLL(startNodes);
            var delaunayCells = mICHMesh.Vertices;
            var delaunayEdges = mICHMesh.Edges;

            SimpleIdMesh <T> mesh = MeshFromCellsAndEdges(delaunayCells, delaunayEdges, startNodes.Count);

            return(mesh);
        }
コード例 #3
0
        static SimpleIdMesh <T> MeshFromCellsAndEdges(
            IEnumerable <MICHDelaunayCell <T> > delaCells,
            IEnumerable <MIConvexHull.VoronoiEdge <MICHVertex <T>, MICHDelaunayCell <T> > > delaEdges,
            int numberOfVoronois)
        {
            (VariableCell <T>[] vCells, Vertex[] arrVertices) =
                CreateMeshLists(delaCells, delaEdges, numberOfVoronois);

            for (int i = 0; i < vCells.Length; ++i)
            {
                vCells[i].Init();
            }
            List <MeshCell <T> > cells    = new List <MeshCell <T> >(vCells);
            List <Vertex>        vertices = new List <Vertex>(arrVertices);
            SimpleIdMesh <T>     mesh     = new SimpleIdMesh <T>(cells, vertices);

            return(mesh);
        }