Fix hatch pattern calculator line refinement logic to use more robust way.
More better idea has came. Not use even-odd parity, but use whether each edges are in paths. This method doesn't have to detect singularity that I've mentioned, and more reliable.
For each adjacent intersection pair, if that edge is inside of the polygon, then just included it. Otherwise do not include. This is more computational intensive but it'll be optimized using R-tree later, by not scanning every edges of the path(s).
@vagran 's suggested paper was pretty brilliant, but I'm not sure how should I modify that so that it works with multiple polygons (=this.boundaryPaths), not just a single one. And time complexity is same so I just stick to current implementation.
Related comment: https://github.com/vagran/dxf-viewer/issues/36#issuecomment-1500921337
Fix hatch pattern calculator line refinement logic to use more robust way.
More better idea has came. Not use even-odd parity, but use whether each edges are in paths. This method doesn't have to detect singularity that I've mentioned, and more reliable.
For each adjacent intersection pair, if that edge is inside of the polygon, then just included it. Otherwise do not include. This is more computational intensive but it'll be optimized using R-tree later, by not scanning every edges of the path(s).
@vagran 's suggested paper was pretty brilliant, but I'm not sure how should I modify that so that it works with multiple polygons (=
this.boundaryPaths
), not just a single one. And time complexity is same so I just stick to current implementation.