drlukeparry / pyclipr Goto Github PK
View Code? Open in Web Editor NEWPython Polygon Clipping and Offsetting based on Clipper2 Library
License: Boost Software License 1.0
Python Polygon Clipping and Offsetting based on Clipper2 Library
License: Boost Software License 1.0
Hi,
I am having issue with polygons merging.
If a create a bunch of polygons as:
# Make a bunch of rectangles
tot = []
tot.append(np.array([[ -5., -100.],
[ 5., -100.],
[ 5., 100.],
[ -5., 100.]]))
tot.append(np.array([[ 45., -100.],
[ 55., -100.],
[ 55., 100.],
[ 45., 100.]]))
tot.append(np.array([[-100., -5.],
[ 100., -5.],
[ 100., 5.],
[-100., 5.]]))
tot.append(np.array([[-100., 45.],
[ 100., 45.],
[ 100., 55.],
[-100., 55.]]))
If I "merge" the polygons to have only one left as:
# Execute the merge
pc = pyclipr.Clipper()
pc.scaleFactor = int(1000)
pc.addPaths(tot, pyclipr.Subject)
tot = pc.execute(pyclipr.Union,
pyclipr.FillRule.EvenOdd)
You can remark the holes at the intersections of the polygons.
I was expected something like this:
Which is something I get by using Klayout and click on: edit -> selection -> merge
If you can help me to get the same result as with Klayout that would be really helpful.
For the prevention of name pollution of enums when importing pyclipr
and preventing collision of some enum values, , the enumerations for EndType
and JoinType
used in offsetting operations are to be not exported into the global-scope.
Hi,
I'm currently working on a python repository about graphics rendering, and I'd like to include Clipper2 as a third party dependency. I encountered an error when running pip install pyclipr
. It seemed that a distribution for python 3.12 is missing (which is the latest python version). So I manually compiled the source code following readme and it worked for me.
Whenever it's convenient, could you please make a release so that a distribution for python 3.12 is available via pypi? This will make it easier for other users using python 3.12 to install pyclipr as well. Thanks in advance!
Normals are incorrect when performing an offset using ClipperOffset
using the EndType.Polygon
for the added paths.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.