From 2fb786f498aad8d8a4d667f685c3a8466d1b2b47 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 30 Jun 2020 00:03:06 +0300 Subject: [PATCH] - fixed the SVG parser so the SVG files with no information regarding the 'height' can be opened in FlatCAM; fixed issue #433 --- CHANGELOG.md | 4 ++++ appParsers/ParseSVG.py | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3004a4b..5e0e06c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta ================================================= +30.06.2020 + +- fixed the SVG parser so the SVG files with no information regarding the 'height' can be opened in FlatCAM; fixed issue #433 + 29.06.2020 - fixed the DXF parser to work with the latest version of ezdxf module (issues for the ellipse entity and modified attribute name for the knots_values to knots) diff --git a/appParsers/ParseSVG.py b/appParsers/ParseSVG.py index e5369dbf..1321b973 100644 --- a/appParsers/ParseSVG.py +++ b/appParsers/ParseSVG.py @@ -48,9 +48,12 @@ def svgparselength(lengthstr): r'(?:' + integer_re_str + r'(?:[Ee]' + integer_re_str + r')?)' length_re_str = r'(' + number_re_str + r')(em|ex|px|in|cm|mm|pt|pc|%)?' - match = re.search(length_re_str, lengthstr) - if match: - return float(match.group(1)), match.group(2) + if lengthstr: + match = re.search(length_re_str, lengthstr) + if match: + return float(match.group(1)), match.group(2) + else: + return 0, 0 return