From 1c90c1ec443cf3181020fe1fb97608df58ef7b87 Mon Sep 17 00:00:00 2001 From: Daniel-Khodabakhsh Date: Mon, 2 Feb 2026 09:03:59 -0800 Subject: [PATCH] CAM: Fix case when CAM operation `Safe height`, `Start depth`, and `Final depth` are the same value. (#27258) Co-authored-by: Daniel Khodabakhsh --- src/Mod/CAM/PathScripts/PathUtils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/CAM/PathScripts/PathUtils.py b/src/Mod/CAM/PathScripts/PathUtils.py index cb248e7cc9..edbcfd0dfb 100644 --- a/src/Mod/CAM/PathScripts/PathUtils.py +++ b/src/Mod/CAM/PathScripts/PathUtils.py @@ -383,8 +383,13 @@ def getEnvelope(partshape, subshape=None, depthparams=None): newPlace = FreeCAD.Placement(Vector(0, 0, zShift), sec.Placement.Rotation) sec.Placement = newPlace - # Extrude the section to top of Boundbox or desired height - envelopeshape = sec.extrude(Vector(0, 0, eLength)) + if Path.Geom.isRoughly(eLength, 0): + # For 2D operations (e.g. laser cutting) use the section directly without extrusion + envelopeshape = sec + else: + # Extrude the section to top of Boundbox or desired height + envelopeshape = sec.extrude(Vector(0, 0, eLength)) + if Path.Log.getLevel(Path.Log.thisModule()) == Path.Log.Level.DEBUG: removalshape = FreeCAD.ActiveDocument.addObject("Part::Feature", "Envelope") removalshape.Shape = envelopeshape