From 76cb3a15daeae7de9be1b4c0a2f9217a6019426b Mon Sep 17 00:00:00 2001 From: abosafia Date: Thu, 3 Oct 2024 23:06:08 +0300 Subject: [PATCH] clean lefted material in pocket if primeter --- scripts/addons/cam/strategy.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/scripts/addons/cam/strategy.py b/scripts/addons/cam/strategy.py index 00be4486..f0689c51 100644 --- a/scripts/addons/cam/strategy.py +++ b/scripts/addons/cam/strategy.py @@ -485,37 +485,27 @@ async def pocket(o): i = 0 chunks = [] lastchunks = [] - centers = None - firstoutline = p # for testing in the end. - prest = p.buffer(-c_offset, o.optimisation.circle_detail) - while not p.is_empty: if o.pocketToCurve: # make a curve starting with _3dpocket shapelyToCurve('3dpocket', p, 0.0) - nchunks = shapelyToChunks(p, o.min.z) # print("nchunks") pnew = p.buffer(-o.dist_between_paths, o.optimisation.circle_detail,join_style=join, mitre_limit=2) - if pnew.is_empty: - + if pnew.is_empty or pnew.area < 0.00001: # test if the last curve will leave material pt = p.buffer(-c_offset, o.optimisation.circle_detail,join_style=join, mitre_limit=2) - if not pt.is_empty: + if not pt.is_empty and pt.area > 0.00001: pnew = pt - # print("pnew") - nchunks = limitChunks(nchunks, o) chunksFromCurve.extend(nchunks) parentChildDist(lastchunks, nchunks, o) lastchunks = nchunks - percent = int(i / approxn * 100) progress('Outlining Polygons ', percent) p = pnew - i += 1 - + # if (o.poc)#TODO inside outside! if (o.movement.type == 'CLIMB' and o.movement.spindle_rotation == 'CW') or ( o.movement.type == 'CONVENTIONAL' and o.movement.spindle_rotation == 'CCW'):