Class BorderCurveExtractor
Extracts smooth border curves from bitmap province boundaries Uses AdjacencySystem to process only known neighbor pairs (efficient) Pre-computes all curves at map load for zero-cost runtime updates
Architecture: Static Geometry + Dynamic Appearance Pattern
- Geometry (curves) computed once and cached
- Appearance (colors, thickness) updated at runtime via flags
REFACTORED: Now uses specialized helper classes for single responsibility
- BorderPolylineSimplifier: RDP simplification, Chaikin smoothing, tessellation
- BorderGeometryUtils: Geometric utilities (intersection, angles, distances)
- BorderChainMerger: Chain merging with U-turn detection
- JunctionDetector: Junction detection and endpoint snapping
- MedianFilterProcessor: Median filtering and pixel chaining
public class BorderCurveExtractor
- Inheritance
-
objectBorderCurveExtractor
Constructors
BorderCurveExtractor(MapTextureManager, AdjacencySystem, ProvinceSystem, ProvinceMapping)
public BorderCurveExtractor(MapTextureManager textures, AdjacencySystem adjacency, ProvinceSystem provinces, ProvinceMapping mapping)
Parameters
texturesMapTextureManageradjacencyAdjacencySystemprovincesProvinceSystemmappingProvinceMapping
Methods
ExtractAllBorders()
Extract and smooth all province borders using Chaikin algorithm Returns dictionary of border polylines: (provinceA, provinceB) -> smooth polyline points
public Dictionary<(ushort, ushort), List<Vector2>> ExtractAllBorders()
Returns
- Dictionary<(ushort, ushort), List<Vector2>>