From dd8d0c57a727d3ed58b11c493cecee96cdee4a6a Mon Sep 17 00:00:00 2001 From: Mario Voigt Date: Sat, 12 Sep 2020 22:25:05 +0200 Subject: [PATCH] small fixes --- extensions/fablabchemnitz/contourscanner/contour_scanner.py | 6 +++--- extensions/fablabchemnitz/dxfdwgimporter/dxfdwgimporter.py | 4 ++-- extensions/fablabchemnitz/styles_to_layers.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/fablabchemnitz/contourscanner/contour_scanner.py b/extensions/fablabchemnitz/contourscanner/contour_scanner.py index 89c04adb..0611221a 100644 --- a/extensions/fablabchemnitz/contourscanner/contour_scanner.py +++ b/extensions/fablabchemnitz/contourscanner/contour_scanner.py @@ -186,7 +186,7 @@ class ContourScanner(inkex.Effect): 'stroke': self.options.color_selfintersecting, 'stroke-linecap': 'butt', 'fill': 'none'}).to_str() try: - if len(points) > 0: #try to find self-intersecting /overlapping polygons + if len(points) > 2: #try to find self-intersecting /overlapping polygons. We need at least 3 points to detect for intersections (only possible if first points matched last point) isect = poly_point_isect.isect_polygon(points) if len(isect) > 0: if closed == False and self.options.addlines == True: #if contour is open and we found intersection points those points might be not relevant @@ -240,8 +240,8 @@ class ContourScanner(inkex.Effect): # polySegsNode.set('d', str(Path(isectSegsPath))) # polySegsNode.attrib['style'] = closingLineStyle - except Exception as e: # we skip AssertionError - inkex.utils.debug(str(e)) + except AssertionError as e: # we skip AssertionError + inkex.utils.debug("Error: " + str(e)) #if the intersectionGroup was created but nothing attached we delete it again to prevent messing the SVG XML tree if len(intersectionGroup.getchildren()) == 0: intersectionGroupParent = intersectionGroup.getparent() diff --git a/extensions/fablabchemnitz/dxfdwgimporter/dxfdwgimporter.py b/extensions/fablabchemnitz/dxfdwgimporter/dxfdwgimporter.py index 0954938f..9e51659a 100644 --- a/extensions/fablabchemnitz/dxfdwgimporter/dxfdwgimporter.py +++ b/extensions/fablabchemnitz/dxfdwgimporter/dxfdwgimporter.py @@ -8,7 +8,7 @@ Import any DWG or DXF file using ODA File Converter, sk1 UniConvertor, ezdxf and Author: Mario Voigt / FabLab Chemnitz Mail: mario.voigt@stadtfabrikanten.org Date: 23.08.2020 -Last patch: 28.08.2020 +Last patch: 12.09.2020 License: GNU GPL v3 Module licenses @@ -17,6 +17,7 @@ Module licenses - https://github.com/bjnortier/dxf - MIT License - ODA File Converter - not bundled (due to restrictions by vendor) - sk1 UniConvertor (https://github.com/sk1project/uniconvertor) - AGPL v3.0 - not bundled +- kabeja (http://kabeja.sourceforge.net/) - Apache v2 ToDos: - change copy commands to movefile commands (put into temp. sub directories where the input file is located). We need to copy files in this script because ODA File Converter will process whole dirs instead of single files only.DXF files can be really large, which slows the process) @@ -393,7 +394,6 @@ class DXFDWGImport(inkex.Effect): for element in elements: if count != 0: #skip the first try: - #bbox.add(element.bounding_box()) bbox += element.bounding_box() except Exception as e: #inkex.utils.debug(str(e)) diff --git a/extensions/fablabchemnitz/styles_to_layers.py b/extensions/fablabchemnitz/styles_to_layers.py index a7ebe9c5..1e1ca84d 100644 --- a/extensions/fablabchemnitz/styles_to_layers.py +++ b/extensions/fablabchemnitz/styles_to_layers.py @@ -8,7 +8,7 @@ Features Author: Mario Voigt / FabLab Chemnitz Mail: mario.voigt@stadtfabrikanten.org Date: 19.08.2020 -Last patch: 29.08.2020 +Last patch: 10.09.2020 License: GNU GPL v3 """ import inkex