From 271bc7450e1609e21c4864a3f97114e90e8de289 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Sat, 4 Mar 2017 16:08:52 -0300 Subject: [PATCH] Draft: Fixed Shape2DView's Cut Face mode bug when cutting through multi solids --- src/Mod/Draft/Draft.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py index b9c98b738..9933baaaf 100644 --- a/src/Mod/Draft/Draft.py +++ b/src/Mod/Draft/Draft.py @@ -5316,17 +5316,16 @@ class _Shape2DView(_DraftObject): if sh.Volume < 0: sh.reverse() c = sh.section(cutp) + faces = [] if (obj.ProjectionMode == "Cutfaces") and (sh.ShapeType == "Solid"): - try: - c = Part.Wire(Part.__sortEdges__(c.Edges)) - except Part.OCCError: - pass - else: - try: - c = Part.Face(c) - except Part.OCCError: - pass - cuts.append(c) + wires = DraftGeomUtils.findWires(c.Edges) + for w in wires: + if w.isClosed(): + faces.append(Part.Face(w)) + if faces: + cuts.extend(faces) + else: + cuts.append(c) comp = Part.makeCompound(cuts) opl = FreeCAD.Placement(obj.Base.Placement) comp.Placement = opl.inverse()