recipe: pyclipper 1.4.0#107
Merged
Merged
Conversation
Cython C++ extension over the vendored Angus Johnson Clipper library — self-contained sdist, zero patches; android gets the usual flet-libcpp-shared host dep for the C++ runtime. ~130KB wheels, full 6-slice matrix green first try. This is a groundwork recipe for OCR: rapidocr's only missing native dep besides onnxruntime (text-box intersection/unclip postprocessing); also used by easyocr forks and doctr. Tests cover Pyclipper clipping, PyclipperOffset dilation (the rapidocr unclip step), and the scale_to/from_clipper fixed-point helpers.
…_pythons=none footgun, pypi verify with - -> _ filename [skip ci]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
pyclipperrecipe (android & iOS) — polygon clipping/offsetting (Cython bindings over the vendored Angus Johnson Clipper library).Closes flet-dev/flet#6685
Shape
Minimal Cython recipe, PyPI sdist, zero patches. The extension is C++ (
language="c++"over the bundled Clipper sources), so on Android it needslibc++_shared.soat runtime — one Jinja-gated host dep onflet-libcpp-shared. iOS links the system libc++, so no host dep there.Consumer notes (usage & recommendations)
pyclipperis a small, self-contained geometry library — polygon clipping (intersection/union/difference) and offsetting (dilate/erode). It's the polygon-math dependency RapidOCR uses for text-box postprocessing (the "unclip" step), but it's equally usable on its own.Add it to your app's dependencies:
Example:
Good to know:
pyclipper.scale_to_clipper(...)before adding paths and back withscale_from_clipper(...)after — the standard fixed-point dance every real caller does.page.run_thread(...)if it ever blocks the UI.