diff --git a/src/Mod/Path/PathScripts/PathUtils.py b/src/Mod/Path/PathScripts/PathUtils.py index 10f4d05d9c..7bd3ad0b3c 100644 --- a/src/Mod/Path/PathScripts/PathUtils.py +++ b/src/Mod/Path/PathScripts/PathUtils.py @@ -211,6 +211,23 @@ def getEnvelope(partshape, stockheight=None): else: return sec.extrude(FreeCAD.Vector(0, 0, partshape.BoundBox.ZMax)) +def getEnvelopeTD(partshape, stockheight=None): + ''' + getEnvelopTD(partshape, stockheight=None) + Uses the TechDraw findShapeOutline to return a shape corresponding to the + partshape silhouette extruded to height. if stockheight is given, the + returned shape is extruded to that height otherwise the returned shape + is the height of the original shape boundbox + partshape = solid object + stockheight = float + ''' + import TechDraw + sec = Part.Face(TechDraw.findShapeOutline(partshape, 1 , FreeCAD.Vector(0,0,1))) + if stockheight is not None: + return sec.extrude(FreeCAD.Vector(0, 0, stockheight)) + else: + return sec.extrude(FreeCAD.Vector(0, 0, partshape.BoundBox.ZMax)) + def reverseEdge(e): if geomType(e) == "Circle": arcstpt = e.valueAt(e.FirstParameter)