From 25960b42f3060815004a38f9794ced0afc1f0f32 Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Tue, 12 Sep 2023 19:10:42 +0200 Subject: [PATCH] Draft: importSVG.py: check and fix path faces Fixes #10659. --- src/Mod/Draft/importSVG.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Mod/Draft/importSVG.py b/src/Mod/Draft/importSVG.py index f2f64d2662..382cf87d5d 100644 --- a/src/Mod/Draft/importSVG.py +++ b/src/Mod/Draft/importSVG.py @@ -955,6 +955,8 @@ class svgHandler(xml.sax.ContentHandler): sh = makewire(path) if self.fill and sh.isClosed(): sh = Part.Face(sh) + if sh.isValid() is False: + sh.fix(1e-6, 0, 1) sh = self.applyTrans(sh) obj = self.doc.addObject("Part::Feature", pathname) obj.Shape = sh @@ -1227,6 +1229,8 @@ class svgHandler(xml.sax.ContentHandler): and len(sh.Wires) == 1 \ and sh.Wires[0].isClosed(): sh = Part.Face(sh) + if sh.isValid() is False: + sh.fix(1e-6, 0, 1) sh = self.applyTrans(sh) obj = self.doc.addObject("Part::Feature", pathname) obj.Shape = sh @@ -1244,6 +1248,8 @@ class svgHandler(xml.sax.ContentHandler): # sh = Part.Wire(path) if self.fill and sh.isClosed(): sh = Part.Face(sh) + if sh.isValid() is False: + sh.fix(1e-6, 0, 1) sh = self.applyTrans(sh) obj = self.doc.addObject("Part::Feature", pathname) obj.Shape = sh