- fixed Tool Cutout so when the target Gerber is a single Polygon then the created manual geometry will follow the shape if shape is freeform
This commit is contained in:
parent
10115dfd4c
commit
299ccb2eca
|
@ -16,6 +16,7 @@ CAD program, and create G-Code for Isolation routing.
|
||||||
- added possibility to turn application portable from the Edit -> Preferences -> General -> App. Preferences -> Portable checkbox
|
- added possibility to turn application portable from the Edit -> Preferences -> General -> App. Preferences -> Portable checkbox
|
||||||
- moved the canvas setup into it's own function and called it in the init() function
|
- moved the canvas setup into it's own function and called it in the init() function
|
||||||
- fixed the Buffer Tool in Geometry Editor; made the Buffer entry field a QDoubleSpinner and set the lower limit to zero.
|
- fixed the Buffer Tool in Geometry Editor; made the Buffer entry field a QDoubleSpinner and set the lower limit to zero.
|
||||||
|
- fixed Tool Cutout so when the target Gerber is a single Polygon then the created manual geometry will follow the shape if shape is freeform
|
||||||
|
|
||||||
21.08.2019
|
21.08.2019
|
||||||
|
|
||||||
|
|
|
@ -864,9 +864,17 @@ class CutOut(FlatCAMTool):
|
||||||
geo = geo_union.convex_hull
|
geo = geo_union.convex_hull
|
||||||
geo_obj.solid_geometry = geo.buffer(margin + abs(dia / 2))
|
geo_obj.solid_geometry = geo.buffer(margin + abs(dia / 2))
|
||||||
elif kind == 'single':
|
elif kind == 'single':
|
||||||
x0, y0, x1, y1 = geo_union.bounds
|
if isinstance(geo_union, Polygon) or \
|
||||||
geo = box(x0, y0, x1, y1)
|
(isinstance(geo_union, list) and len(geo_union) == 1) or \
|
||||||
geo_obj.solid_geometry = geo.buffer(margin + abs(dia / 2))
|
(isinstance(geo_union, MultiPolygon) and len(geo_union) == 1):
|
||||||
|
geo_obj.solid_geometry = geo_union.buffer(margin + abs(dia / 2)).exterior
|
||||||
|
elif isinstance(geo_union, MultiPolygon):
|
||||||
|
x0, y0, x1, y1 = geo_union.bounds
|
||||||
|
geo = box(x0, y0, x1, y1)
|
||||||
|
geo_obj.solid_geometry = geo.buffer(margin + abs(dia / 2))
|
||||||
|
else:
|
||||||
|
self.app.inform.emit(_("[ERROR_NOTCL] Geometry not supported for cutout: %s") % type(geo_union))
|
||||||
|
return 'fail'
|
||||||
else:
|
else:
|
||||||
geo = geo_union
|
geo = geo_union
|
||||||
geo = geo.buffer(margin + abs(dia / 2))
|
geo = geo.buffer(margin + abs(dia / 2))
|
||||||
|
|
Loading…
Reference in New Issue