Repository navigation
Preserve translated minimum-length FlexPath segments - #337
CAOShurong wants to merge 1 commit into
Conversation
|
I'm not convinced by this change. Having segments below the spine tolerance can impact the creation of the polygonal contour in other ways, is my feeling, because we would be breaking an assumption that the remaining of the code might be using. If you need to preserve segments below 1 nm (honestly I don't know why… this is way below any real fabrication error I've ever seen), why not just decrease the flex path tolerance? |
|
Lowering the tolerance works: I rechecked the supplied file with Your concern is valid: at a synthetic |
Fixes #277. Extends #278 to translated coordinates, where
3.28 - 3.279rounds below0.001and a minimum-length segment is still discarded during polygon conversion or GDS/OASIS writing.Account for endpoint roundoff before removing a point. Exact duplicates and clearly sub-tolerance segments are still removed; segments within the roundoff bound are preserved. The change stays in
remove_overlapping_points, without changing path tolerance or adding output-grid parameters.Add regressions for translated segments in both directions, two grids, polygon conversion, GDS/OASIS round-trips and repeated OASIS writes, plus duplicate and sub-tolerance controls.
Validated on Windows with MSVC and Python 3.13: all 402 tests pass, including the original 294; 42 added cases fail on current main. The issue's attachment round-trips without altering path spines, and independent KLayout geometry comparisons pass. Linux/macOS were not tested locally. A filtered overlap-removal microbenchmark was about 14% slower; full polygon conversion measured within 2% of baseline for the 256/4096-point cases tested.