- modified the bounding box utility feature in the Gerber Object UI to work with negative margin values
This commit is contained in:
@@ -11,10 +11,11 @@ CHANGELOG for FlatCAM beta
|
|||||||
|
|
||||||
- fixed the Cutout plugin not working with Geometry objects that are made out of a LineString or LinearRing geometric elements
|
- fixed the Cutout plugin not working with Geometry objects that are made out of a LineString or LinearRing geometric elements
|
||||||
- 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 margin 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
|
- 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
|
||||||
- minor changes
|
- minor changes
|
||||||
|
- modified the bounding box utility feature in the Gerber Object UI to work with negative margin values
|
||||||
|
|
||||||
25.01.2022
|
25.01.2022
|
||||||
|
|
||||||
|
|||||||
@@ -482,16 +482,31 @@ class GerberObject(FlatCAMObj, Gerber):
|
|||||||
except Exception:
|
except Exception:
|
||||||
self.solid_geometry = unary_union(self.solid_geometry)
|
self.solid_geometry = unary_union(self.solid_geometry)
|
||||||
|
|
||||||
|
distance = float(self.options["bboxmargin"])
|
||||||
|
|
||||||
# Bounding box with rounded corners
|
# Bounding box with rounded corners
|
||||||
if isinstance(self.solid_geometry, Polygon):
|
if distance >= 0:
|
||||||
bounding_box = self.solid_geometry.buffer(float(self.options["bboxmargin"])).exterior
|
if isinstance(self.solid_geometry, Polygon):
|
||||||
elif isinstance(self.solid_geometry, MultiPolygon):
|
bounding_box = self.solid_geometry.buffer(distance).exterior
|
||||||
try:
|
elif isinstance(self.solid_geometry, MultiPolygon):
|
||||||
bounding_box = self.solid_geometry.buffer(float(self.options["bboxmargin"])).exterior
|
try:
|
||||||
except Exception:
|
bounding_box = self.solid_geometry.buffer(distance).exterior
|
||||||
bounding_box = self.solid_geometry.envelope.buffer(float(self.options["bboxmargin"]))
|
except Exception:
|
||||||
|
bounding_box = self.solid_geometry.envelope.buffer(distance)
|
||||||
|
else:
|
||||||
|
bounding_box = self.solid_geometry.envelope.buffer(distance)
|
||||||
else:
|
else:
|
||||||
bounding_box = self.solid_geometry.envelope.buffer(float(self.options["bboxmargin"]))
|
if isinstance(self.solid_geometry, Polygon):
|
||||||
|
bounding_box = self.solid_geometry.buffer(abs(distance*2)).interiors
|
||||||
|
elif isinstance(self.solid_geometry, MultiPolygon):
|
||||||
|
try:
|
||||||
|
bounding_box = self.solid_geometry.buffer(abs(distance*2)).interiors
|
||||||
|
except Exception:
|
||||||
|
bounding_box = self.solid_geometry.envelope.buffer(abs(distance*2)).interiors
|
||||||
|
else:
|
||||||
|
bounding_box = self.solid_geometry.envelope.buffer(abs(distance*2)).interiors
|
||||||
|
bounding_box = unary_union(bounding_box).buffer(-distance).exterior
|
||||||
|
|
||||||
if not self.options["bboxrounded"]: # Remove rounded corners
|
if not self.options["bboxrounded"]: # Remove rounded corners
|
||||||
bounding_box = bounding_box.envelope
|
bounding_box = bounding_box.envelope
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user