From eb5244ed2af93ea358389e00e866411640c4cc8f Mon Sep 17 00:00:00 2001 From: Fredrik Hansson Date: Thu, 9 Jan 2025 19:25:32 +0100 Subject: [PATCH] add skin to ui for project curve to surface add limit curve the ui for waterline as it works there aswell also fix waterline skin thickness in the z direction by moving the slice line down by the skin thickness. --- scripts/addons/cam/gcode_path.py | 9 +++++---- scripts/addons/cam/ui/panels/area_panel.py | 2 +- scripts/addons/cam/ui/panels/op_properties_panel.py | 2 ++ scripts/addons/cam/ui/panels/operations_panel.py | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/addons/cam/gcode_path.py b/scripts/addons/cam/gcode_path.py index 209649402..e4a00d886 100644 --- a/scripts/addons/cam/gcode_path.py +++ b/scripts/addons/cam/gcode_path.py @@ -901,7 +901,8 @@ async def get_path_3_axis(context, operation): for h in range(0, nslices): layerstepinc += 1 slicechunks = [] - z = o.min_z + h * o.slice_detail + # lower the layer by the skin value so the slice gets done at the tip of the tool + z = o.min_z + h * o.slice_detail - o.skin if h == 0: z += 0.0000001 # if people do mill flat areas, this helps to reach those... @@ -915,7 +916,7 @@ async def get_path_3_axis(context, operation): for p in slicepolys.geoms: poly = poly.union(p) # polygversion TODO: why is this added? - nchunks = shapely_to_chunks(p, z) + nchunks = shapely_to_chunks(p, z + o.skin) nchunks = limit_chunks(nchunks, o, force=True) lastchunks.extend(nchunks) slicechunks.extend(nchunks) @@ -951,7 +952,7 @@ async def get_path_3_axis(context, operation): fillz = z i = 0 while not restpoly.is_empty: - nchunks = shapely_to_chunks(restpoly, fillz) + nchunks = shapely_to_chunks(restpoly, fillz + o.skin) # project paths TODO: path projection during waterline is not working if o.waterline_project: nchunks = chunks_refine(nchunks, o) @@ -993,7 +994,7 @@ async def get_path_3_axis(context, operation): # 'GeometryCollection':#len(restpoly.boundary.coords)>0: while not restpoly.is_empty: # print(i) - nchunks = shapely_to_chunks(restpoly, fillz) + nchunks = shapely_to_chunks(restpoly, fillz + o.skin) ######################### nchunks = limit_chunks(nchunks, o, force=True) slicechunks.extend(nchunks) diff --git a/scripts/addons/cam/ui/panels/area_panel.py b/scripts/addons/cam/ui/panels/area_panel.py index b2e291603..e4facafce 100644 --- a/scripts/addons/cam/ui/panels/area_panel.py +++ b/scripts/addons/cam/ui/panels/area_panel.py @@ -100,7 +100,7 @@ def draw(self, context): # Draw Limit Curve if self.level >= 1: - if self.op.strategy in ["BLOCK", "SPIRAL", "CIRCLES", "PARALLEL", "CROSS"]: + if self.op.strategy in ["BLOCK", "SPIRAL", "CIRCLES", "PARALLEL", "CROSS", "WATERLINE"]: main.use_property_split = False col = main.column(align=False) header, panel = col.panel("limit", default_closed=True) diff --git a/scripts/addons/cam/ui/panels/op_properties_panel.py b/scripts/addons/cam/ui/panels/op_properties_panel.py index a189260da..ba8aec8f2 100644 --- a/scripts/addons/cam/ui/panels/op_properties_panel.py +++ b/scripts/addons/cam/ui/panels/op_properties_panel.py @@ -125,6 +125,7 @@ def draw(self, context): if self.op.strategy in ["CARVE"]: col = box.column(align=True) col.prop(self.op, "carve_depth", text="Depth") + col.prop(self.op, "skin") box = col.box() sub = box.column(align=True) sub.label(text="Toolpath Distance") @@ -192,6 +193,7 @@ def draw(self, context): row.use_property_split = False row.prop(self.op, "inverse") if self.op.strategy in ["PARALLEL", "CROSS"]: + col.prop(self.op, "skin") col.prop(self.op, "parallel_angle") box = col.box() col = box.column(align=True) diff --git a/scripts/addons/cam/ui/panels/operations_panel.py b/scripts/addons/cam/ui/panels/operations_panel.py index bb62c1cdf..37e306539 100644 --- a/scripts/addons/cam/ui/panels/operations_panel.py +++ b/scripts/addons/cam/ui/panels/operations_panel.py @@ -120,6 +120,6 @@ def draw(self, context): col.prop_search(self.op, "source_image_name", bpy.data, "images") if self.op.strategy in ["CARVE", "PROJECTED_CURVE"]: - col.prop_search(self.op, "curve_object", bpy.data, "objects") + col.prop_search(self.op, "curve_source", bpy.data, "objects") if self.op.strategy == "PROJECTED_CURVE": - col.prop_search(self.op, "curve_object1", bpy.data, "objects") + col.prop_search(self.op, "curve_target", bpy.data, "objects")