Open twelch opened 4 days ago
If polyclip-ts doesn't make sense to use, then we can at least better make use of polygon-clipping methods to prevent infinite loop errors. Right now we naively do chunking of features in user space. This might be better controlled through available environment variables.
Global settings are set via environment variables. POLYGON_CLIPPING_MAX_QUEUE_SIZE and POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS: Aims to prevent infinite loops - usually caused by floating-point math round-off errors. Defaults are 1,000,000.
It is refactored to use Typescript, uses big integer to solve floating point accuracy causing errors. However it is likely quite a bit slower, unclear how much. Performance testing needed.
Suggest looking at use of setPrecision - https://github.com/luizbarboza/polyclip-ts/issues/5