- fix the Transform plugin, buffer functionality for Geometry objects such that the buffer with negative values will work by crating a buffer toward the interior of that geometry
This commit is contained in:
@@ -13,6 +13,7 @@ CHANGELOG for FlatCAM beta
|
|||||||
- fixed the Cutout plugin for the rectangular cutout: the name of the resulting object is now correct if there is no extension in the source file
|
- fixed the Cutout plugin for the rectangular cutout: the name of the resulting object is now correct if there is no extension in the source file
|
||||||
- modified the bounding box utility feature in the Gerber Object UI to work with buffer value of 0.0 and rounded corners
|
- modified the bounding box utility feature in the Gerber Object UI to work with buffer value of 0.0 and rounded corners
|
||||||
- in Cutout plugin added the ability to create Manual Geometries with negative tool diameters
|
- in Cutout plugin added the ability to create Manual Geometries with negative tool diameters
|
||||||
|
- fix the Transform plugin, buffer functionality for Geometry objects such that the buffer with negative values will work by crating a buffer toward the interior of that geometry
|
||||||
|
|
||||||
25.01.2022
|
25.01.2022
|
||||||
|
|
||||||
|
|||||||
@@ -2630,7 +2630,13 @@ class Geometry(object):
|
|||||||
except TypeError:
|
except TypeError:
|
||||||
try:
|
try:
|
||||||
if factor is None or factor is False or factor == 0:
|
if factor is None or factor is False or factor == 0:
|
||||||
|
if distance >= 0:
|
||||||
new_obj = obj.buffer(distance, resolution=self.geo_steps_per_circle, join_style=join)
|
new_obj = obj.buffer(distance, resolution=self.geo_steps_per_circle, join_style=join)
|
||||||
|
else:
|
||||||
|
new_obj = obj.buffer(abs(distance*2), resolution=self.geo_steps_per_circle, join_style=join)
|
||||||
|
new_obj = unary_union(new_obj.interiors)
|
||||||
|
new_obj = new_obj.buffer(-distance, resolution=self.geo_steps_per_circle, join_style=join)
|
||||||
|
new_obj = new_obj.exterior
|
||||||
if isinstance(obj, (LinearRing, LineString)) and only_exterior is True:
|
if isinstance(obj, (LinearRing, LineString)) and only_exterior is True:
|
||||||
new_obj = new_obj.exterior
|
new_obj = new_obj.exterior
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user