- added ability to see the verbose log when importing SVG's (if set in preferences)

- added some more logs to the SVG import
This commit is contained in:
Marius Stanciu
2021-01-22 12:33:14 +02:00
committed by Marius
parent 5bb3c18693
commit bd64a34ab8
5 changed files with 56 additions and 12 deletions

View File

@@ -486,6 +486,8 @@ class QRCode(AppTool):
:return: None
"""
self.app.log.debug("QRCode.import_svg()")
# Parse into list of shapely objects
svg_tree = ET.parse(filename)
svg_root = svg_tree.getroot()
@@ -497,16 +499,21 @@ class QRCode(AppTool):
units = self.app.defaults['units'] if units is None else units
res = self.app.defaults['geometry_circle_steps']
factor = svgparse_viewbox(svg_root)
geos = getsvggeo(svg_root, object_type, units=units, res=res, factor=factor)
geos = getsvggeo(svg_root, object_type, units=units, res=res, factor=factor, app=self.app)
self.app.log.debug("QRCode.import_svg(). Finished parsing the SVG geometry.")
if flip:
geos = [translate(scale(g, 1.0, -1.0, origin=(0, 0)), yoff=h) for g in geos]
self.app.log.debug("QRCode.import_svg(). SVG geometry was flipped.")
# flatten the svg geometry for the case when the QRCode SVG is added into a Gerber object
solid_geometry = list(self.flatten_list(geos))
geos_text = getsvgtext(svg_root, object_type, app=self.app, units=units)
if geos_text is not None:
self.app.log.debug("QRCode.import_svg(). Processing SVG text.")
geos_text_f = []
if flip:
# Change origin to bottom left