Example #1
0
        public static IDMesh <T> CreateMesh <T>(IList <T> nodes)
            where T : ILocatable, new()
        {
            ResetDataIDCounters <T>();
            MICHVertex <T>[] startNodes = Wrap(nodes);
            IDMesh <T>       mesh       = MICMesher <T> .Create(startNodes);

            return(mesh);
        }
Example #2
0
        public static IDMesh <T> Create(IList <MICHVertex <T> > startNodes)
        {
            MIConvexHull.VoronoiMesh <MICHVertex <T>, MICHDelaunayCell <T>, MIConvexHull.VoronoiEdge <MICHVertex <T>, MICHDelaunayCell <T> > > mICHMesh = CreateDealaunayTriangulation(startNodes);
            IEnumerable <MICHDelaunayCell <T> > delaunayVertices = mICHMesh.Vertices;
            IEnumerable <MIConvexHull.VoronoiEdge <MICHVertex <T>, MICHDelaunayCell <T> > > delaunayEdges = mICHMesh.Edges;

            IDMesh <T> mesh = MeshFromCellsAndEdges(delaunayVertices, delaunayEdges, startNodes.Count);

            return(mesh);
        }
Example #3
0
        void Initialize(
            IDMesh <T> mesh,
            Boundary <T> boundary)
        {
            this.meshIntersecter = new MeshIntersecter <T>(mesh);
            this.greatDivider    = new Divider <T>(mesh, boundary);

            state      = new CutterState <Edge <T> >();
            edgeCutter = new OnEdgeCutter <T>(this.meshIntersecter, this.boundaryLines);
            firstCell  = null;
        }
Example #4
0
        static IDMesh <T> MeshFromCellsAndEdges(
            IEnumerable <MICHDelaunayCell <T> > delaunayCells,
            IEnumerable <MIConvexHull.VoronoiEdge <MICHVertex <T>, MICHDelaunayCell <T> > > delaunayEdges,
            int numberOfVoronois)
        {
            (VariableCell <T>[] vCells, Vertex[] arrVertices) =
                CreateMeshLists(delaunayCells, delaunayEdges, numberOfVoronois);

            for (int i = 0; i < vCells.Length; ++i)
            {
                vCells[i].Init();
            }
            Debug.Assert(VerticesMatch(vCells));

            List <MeshCell <T> > cells    = new List <MeshCell <T> >(vCells);
            List <Vertex>        vertices = new List <Vertex>(arrVertices);
            IDMesh <T>           mesh     = new IDMesh <T>
            {
                Cells    = cells,
                Vertices = vertices
            };

            return(mesh);
        }
Example #5
0
 public void CutOut(IDMesh <T> mesh, Boundary <T> boundary)
 {
     this.boundaryLines = BoundaryLineEnumerator.GetEnumerator(BoundaryLine.Copy(boundary.BoundaryLines));
     Initialize(mesh, boundary);
     CutOut();
 }
Example #6
0
 public MeshEdgeDivider(IDMesh <T> mesh)
 {
     this.mesh = mesh;
 }
Example #7
0
 public MeshIntersecter(IDMesh <T> idMesh)
 {
     mesh = idMesh;
 }