diff options
| author | Andreas <v.andreas.1@web.de> | 2021-10-30 21:28:40 +0200 |
|---|---|---|
| committer | Kaalleen <reni@allenka.de> | 2022-05-04 18:57:20 +0200 |
| commit | 1a1939b5daf421116791b5ae45434cb1aba2ea38 (patch) | |
| tree | ee91d51873bcb70d26adf0884d205c611c1ec7a6 /lib/stitches/StitchPattern.py | |
| parent | 125db3f83b3b330df757f7cc0faf6489b3cb348d (diff) | |
Bug fixing + refactoring
Diffstat (limited to 'lib/stitches/StitchPattern.py')
| -rw-r--r-- | lib/stitches/StitchPattern.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/stitches/StitchPattern.py b/lib/stitches/StitchPattern.py index ba3e3031..1fc5e389 100644 --- a/lib/stitches/StitchPattern.py +++ b/lib/stitches/StitchPattern.py @@ -152,7 +152,8 @@ def offset_poly( at this position """ ordered_poly = orient(poly, -1) - ordered_poly = ordered_poly.simplify(constants.simplification_threshold, False) + ordered_poly = ordered_poly.simplify( + constants.simplification_threshold, False) root = AnyNode( id="node", val=ordered_poly.exterior, @@ -168,7 +169,8 @@ def offset_poly( id="hole", val=holes, already_rastered=False, - transferred_point_priority_deque=DEPQ(iterable=None, maxlen=None), + transferred_point_priority_deque=DEPQ( + iterable=None, maxlen=None), ) ) @@ -182,7 +184,7 @@ def offset_poly( offset, "left", resolution=5, - joint_style=join_style, + join_style=join_style, mitre_limit=10, ) outer = outer.simplify(constants.simplification_threshold, False) @@ -194,7 +196,7 @@ def offset_poly( offset, "left", resolution=5, - joint_style=join_style, + join_style=join_style, mitre_limit=10, ) inner = inner.simplify(constants.simplification_threshold, False) @@ -209,9 +211,11 @@ def offset_poly( result = MultiPolygon(polygonize(outer)) else: if outer.geom_type == "LineString": - result = Polygon(outer).difference(MultiPolygon(poly_inners)) + result = Polygon(outer).difference( + MultiPolygon(poly_inners)) else: - result = MultiPolygon(outer).difference(MultiPolygon(poly_inners)) + result = MultiPolygon(outer).difference( + MultiPolygon(poly_inners)) if not result.is_empty and result.area > offset * offset / 10: result_list = [] |
