public MeshGenerator(MeshingAlgorithm.State settings) { cutter = new Cutter <T>(); boundingBox = settings.BoundingBox; boundaryLines = BoundaryLine.ToLines(settings.Boundary); boundaryHandler = new PeriodicBoundaryHandler <T>(settings.PeriodicMap); }
void CreateSetupForMeshingAlgorithm() { mesherSettings = new MeshingAlgorithm.State { Boundary = settings.Boundary.Polygon, BoundingBox = settings.Boundary.BoundingBox, NumberOfLloydIterations = settings.NumberOfLloydIterations, }; mesherSettings.PeriodicMap = PeriodicMapGenerator.GeneratePeriodicMap( mesherSettings, settings.Boundary); }
public static PeriodicMap GeneratePeriodicMap(MeshingAlgorithm.State settings, VoronoiBoundary boundary) { PeriodicMap map = null; IDictionary <int, int> periodicBoundaryMap = ExtractPeriodicBoundaryMap(boundary.EdgeTags); if (periodicBoundaryMap.Count > 0) { IDictionary <int, Transformation> periodicBoundaryTransformationMap = CreatePeriodicTransformationsFrom( settings.Boundary, periodicBoundaryMap); map = new PeriodicMap { PeriodicBoundaryCorrelation = periodicBoundaryMap, PeriodicBoundaryTransformations = periodicBoundaryTransformationMap, }; AddPeriodicCorners(map, boundary); } return(map); }