- in SVG parser: made sure that the minimum number of steps to approximate an arc/circle/bezier is 10

This commit is contained in:
Marius Stanciu
2020-09-21 03:27:52 +03:00
parent d3ebb08d1f
commit 1d46b43c4f
6 changed files with 67 additions and 42 deletions

View File

@@ -1090,7 +1090,7 @@ class Geometry(object):
else:
yield item
def import_svg(self, filename, object_type=None, flip=True, units='MM'):
def import_svg(self, filename, object_type=None, flip=True, units=None):
"""
Imports shapes from an SVG file into the object's geometry.
@@ -1114,7 +1114,9 @@ class Geometry(object):
# w = float(svg_root.get('width'))
h = svgparselength(svg_root.get('height'))[0] # TODO: No units support yet
geos = getsvggeo(svg_root, object_type)
units = self.app.defaults['units'] if units is None else units
res = self.app.defaults['geometry_circle_steps']
geos = getsvggeo(svg_root, object_type, units=units, res=res)
if flip:
geos = [translate(scale(g, 1.0, -1.0, origin=(0, 0)), yoff=h) for g in geos]