Skip to content

Commit 1c90c1e

Browse files
Daniel-KhodabakhshDaniel Khodabakhsh
andauthored
CAM: Fix case when CAM operation Safe height, Start depth, and Final depth are the same value. (FreeCAD#27258)
Co-authored-by: Daniel Khodabakhsh <d@niel.khodabakh.sh>
1 parent 30ea676 commit 1c90c1e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/Mod/CAM/PathScripts/PathUtils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,13 @@ def getEnvelope(partshape, subshape=None, depthparams=None):
383383
newPlace = FreeCAD.Placement(Vector(0, 0, zShift), sec.Placement.Rotation)
384384
sec.Placement = newPlace
385385

386-
# Extrude the section to top of Boundbox or desired height
387-
envelopeshape = sec.extrude(Vector(0, 0, eLength))
386+
if Path.Geom.isRoughly(eLength, 0):
387+
# For 2D operations (e.g. laser cutting) use the section directly without extrusion
388+
envelopeshape = sec
389+
else:
390+
# Extrude the section to top of Boundbox or desired height
391+
envelopeshape = sec.extrude(Vector(0, 0, eLength))
392+
388393
if Path.Log.getLevel(Path.Log.thisModule()) == Path.Log.Level.DEBUG:
389394
removalshape = FreeCAD.ActiveDocument.addObject("Part::Feature", "Envelope")
390395
removalshape.Shape = envelopeshape

0 commit comments

Comments
 (0)