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.
Since this repository is migrated from C++, type checkers cannot perform any checking with its public interfaces. Hence I would like to add a .pyi file to support static type checking. This file is written following the
module.cpp
file.Additionally, when writing the file I review some of the code as well, and I want to give some personal recommendations.
JoinType
andEndType
both have variablesRound
andSquare
, and name collisions occur when all variables are exposed to the main namespace.FillType
is named asFillRule
in Clipper2 library. I would recommend following their naming style, or users learning Clipper2 from C++ documentation will be confused when finding the corresponding python interface does not match.polyTreeToPaths64, orientation, polyTreeToPaths, simplifyPath, simplifyPaths
shall be exported. After trying with many strategies I still cannot figure out how I can properly passing in parameters. Moreover, from the cource code I findpolyTreeToPaths64
andpolyTreeToPaths
are bound to the same function. I guesspolyTreeToPaths
is intended to be bound toPolyTreeToPathsD
instead.Clipper.execute
andClipper.execute2
methods have various return types depending onreturnOpenPaths
,returnZ
flags. I feel that there are ways to handle these flags more appropriately. Sidenote, some lines of code given in the readme playing with these flags raise error about tuple mismatching.pc.scaleFactor
->po.scaleFactor
def_readwrite
, some usingdef_property
. Are there any differences?isHole
,addPath
,clipType
,returnOpenPath
, etc.execute2
returnsPolyTree
(it seems it always returnsPolyTreeD
)? I'm unsure if classesPolyPath
andPolyTree
should be exposed, because I cannot find how they can be obtained through clipping/offsetting operations.execute2
. A more natural, understandable naming would beexecute_tree
.All the above are my personal suggestions on the repository. Discussions are always welcome!