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); }
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); }
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; }
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); }
public void CutOut(IDMesh <T> mesh, Boundary <T> boundary) { this.boundaryLines = BoundaryLineEnumerator.GetEnumerator(BoundaryLine.Copy(boundary.BoundaryLines)); Initialize(mesh, boundary); CutOut(); }
public MeshEdgeDivider(IDMesh <T> mesh) { this.mesh = mesh; }
public MeshIntersecter(IDMesh <T> idMesh) { mesh = idMesh; }