Skip to content

deoverlap 4.0: Rust engine - #1

Merged
piLeoni merged 8 commits into
mainfrom
rust-port
Sep 28, 2026
Merged

piLeoni merged 8 commits into
mainfrom
rust-port

Conversation

@piLeoni

@piLeoni piLeoni commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Rust core (geo) with PyO3 bindings, built with maturin as abi3 wheels.

  • The engine is written in Rust; the Python package is a thin Shapely wrapper.
  • Options are the same for Python and the vpype command: --prefer, --angle, --self-overlap, -m/--min-length, --drop, -k, -p/--progress-bar, -l.
  • CI builds and tests one wheel per platform (Linux glibc/musl x86_64/aarch64, macOS x86_64/arm64, Windows x64) plus the sdist.

Made with Cursor

piLeoni and others added 8 commits September 27, 2026 18:05
Same algorithm as the Python 3.2.2 engine (corridor mask, local bearing,
segments mode with fold-back, min_length, drop mode, carried mask), with
the behaviour tests ported and a comparison harness on the Maze map.

Co-authored-by: Cursor <[email protected]>
The package now builds with maturin; deoverlap._core wraps the Rust crate
through PyO3 (abi3, Python >= 3.10). deoverlap() picks the Rust engine
when the extension is present and falls back to the Python engine
otherwise; engine= or DEOVERLAP_ENGINE forces one. The test suite runs
against both engines.

Co-authored-by: Cursor <[email protected]>
The Python package is now a thin Shapely wrapper around deoverlap._core.
Removed the engine switch and the options that only tuned the Python
engine (progress_bar, tree_rebuild_every, mask_union_every, track_origins),
the vpype --progress flag and the tqdm dependency. The core reports the
order geometries were kept in. Figures regenerated with the Rust engine.

Co-authored-by: Cursor <[email protected]>
… Rust core

deoverlap_with_progress() reports (done, total); the Python binding
forwards it to an optional callback about a hundred times per run, and
deoverlap(progress_bar=True) shows it as a tqdm bar again.

Co-authored-by: Cursor <[email protected]>
- --prefer longest|first|shortest replaces --keep
- --angle replaces --parallel-only/--parallel-angle; 90 cuts crossings
- --drop FRACTION replaces --mode/--drop-fraction
- --self-overlap replaces --segments; --segment-adjacency is gone and the
  hairpin threshold no longer depends on the angle
- -m/--min-length and -p/--progress-bar, as in vpype filter and deduplicate
- Python defaults now match the CLI (prefer longest, angle 30); group,
  preserve_types, the tuple unpacking and the KeepPolicy/ClipMode enums
  are gone
- Invalid prefer/angle/drop values raise ValueError
- README and figures updated

Co-authored-by: Cursor <[email protected]>
@piLeoni
piLeoni merged commit 7b315e3 into main Sep 28, 2026
9 checks passed
@piLeoni
piLeoni deleted the rust-port branch September 30, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant