small fixes

This commit is contained in:
Mario Voigt 2020-09-12 22:25:05 +02:00
parent 98a6418676
commit dd8d0c57a7
3 changed files with 6 additions and 6 deletions

View File

@ -186,7 +186,7 @@ class ContourScanner(inkex.Effect):
'stroke': self.options.color_selfintersecting, 'stroke-linecap': 'butt', 'fill': 'none'}).to_str() 'stroke': self.options.color_selfintersecting, 'stroke-linecap': 'butt', 'fill': 'none'}).to_str()
try: 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) isect = poly_point_isect.isect_polygon(points)
if len(isect) > 0: 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 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.set('d', str(Path(isectSegsPath)))
# polySegsNode.attrib['style'] = closingLineStyle # polySegsNode.attrib['style'] = closingLineStyle
except Exception as e: # we skip AssertionError except AssertionError as e: # we skip AssertionError
inkex.utils.debug(str(e)) 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 the intersectionGroup was created but nothing attached we delete it again to prevent messing the SVG XML tree
if len(intersectionGroup.getchildren()) == 0: if len(intersectionGroup.getchildren()) == 0:
intersectionGroupParent = intersectionGroup.getparent() intersectionGroupParent = intersectionGroup.getparent()

View File

@ -8,7 +8,7 @@ Import any DWG or DXF file using ODA File Converter, sk1 UniConvertor, ezdxf and
Author: Mario Voigt / FabLab Chemnitz Author: Mario Voigt / FabLab Chemnitz
Mail: mario.voigt@stadtfabrikanten.org Mail: mario.voigt@stadtfabrikanten.org
Date: 23.08.2020 Date: 23.08.2020
Last patch: 28.08.2020 Last patch: 12.09.2020
License: GNU GPL v3 License: GNU GPL v3
Module licenses Module licenses
@ -17,6 +17,7 @@ Module licenses
- https://github.com/bjnortier/dxf - MIT License - https://github.com/bjnortier/dxf - MIT License
- ODA File Converter - not bundled (due to restrictions by vendor) - ODA File Converter - not bundled (due to restrictions by vendor)
- sk1 UniConvertor (https://github.com/sk1project/uniconvertor) - AGPL v3.0 - not bundled - sk1 UniConvertor (https://github.com/sk1project/uniconvertor) - AGPL v3.0 - not bundled
- kabeja (http://kabeja.sourceforge.net/) - Apache v2
ToDos: 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) - 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: for element in elements:
if count != 0: #skip the first if count != 0: #skip the first
try: try:
#bbox.add(element.bounding_box())
bbox += element.bounding_box() bbox += element.bounding_box()
except Exception as e: except Exception as e:
#inkex.utils.debug(str(e)) #inkex.utils.debug(str(e))

View File

@ -8,7 +8,7 @@ Features
Author: Mario Voigt / FabLab Chemnitz Author: Mario Voigt / FabLab Chemnitz
Mail: mario.voigt@stadtfabrikanten.org Mail: mario.voigt@stadtfabrikanten.org
Date: 19.08.2020 Date: 19.08.2020
Last patch: 29.08.2020 Last patch: 10.09.2020
License: GNU GPL v3 License: GNU GPL v3
""" """
import inkex import inkex