From bbf77969d77d8f4ab4b96c3b385967609c00f758 Mon Sep 17 00:00:00 2001 From: palain Date: Thu, 2 Mar 2023 11:27:23 -0400 Subject: [PATCH] removed limit curve from unsupported strategies --- scripts/addons/cam/curvecamcreate.py | 1 + scripts/addons/cam/joinery.py | 8 +++++++- scripts/addons/cam/slice.py | 1 + scripts/addons/cam/ui_panels/area.py | 4 +++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/addons/cam/curvecamcreate.py b/scripts/addons/cam/curvecamcreate.py index 267b12e..d65bca8 100644 --- a/scripts/addons/cam/curvecamcreate.py +++ b/scripts/addons/cam/curvecamcreate.py @@ -274,6 +274,7 @@ class CamCurveMortise(bpy.types.Operator): bl_label = "Mortise" bl_options = {'REGISTER', 'UNDO', 'PRESET'} + finger_size: bpy.props.BoolProperty(name="kurf bending only", default=False) finger_size: bpy.props.FloatProperty(name="Maximum Finger Size", default=0.015, min=0.005, max=3.0, precision=4, unit="LENGTH") min_finger_size: bpy.props.FloatProperty(name="Minimum Finger Size", default=0.0025, min=0.001, max=3.0, diff --git a/scripts/addons/cam/joinery.py b/scripts/addons/cam/joinery.py index 0ed9e29..5a50f49 100644 --- a/scripts/addons/cam/joinery.py +++ b/scripts/addons/cam/joinery.py @@ -239,7 +239,7 @@ def make_flex_pocket(length, height, finger_thick, finger_width, pocket_width): def make_variable_flex_pocket(height, finger_thick, pocket_width, locations): # creates pockets pocket using mortise function for kerf bending for dist in locations: - mortise(height - 2 * finger_thick, pocket_width, 0, dist, 0, math.pi / 2) + mortise(height + 2 * finger_thick, pocket_width, 0, dist, 0, math.pi / 2) simple.active_name("_flex_pocket") simple.join_multiple("_flex_pocket") @@ -263,6 +263,11 @@ def create_flex_side(length, height, finger_thick, top_bottom=False): fingers = bpy.context.active_object bpy.ops.transform.translate(value=(0.0, height / 2 - finger_thick / 2 + 0.0003, 0.0)) + bpy.ops.curve.simple(align='WORLD', location=(length / 2 + 0.00025, 0, 0), rotation=(0, 0, 0), + Simple_Type='Rectangle', Simple_width=length, Simple_length=height, shape='3D', + outputType='POLY', use_cyclic_u=True, handleType='AUTO', edit_mode=False) + simple.active_name("no_fingers") + bpy.ops.curve.simple(align='WORLD', location=(length / 2 + 0.00025, 0, 0), rotation=(0, 0, 0), Simple_Type='Rectangle', Simple_width=length, Simple_length=height, shape='3D', outputType='POLY', use_cyclic_u=True, handleType='AUTO', edit_mode=False) @@ -456,6 +461,7 @@ def variable_finger(loop, loop_length, min_finger, finger_size, finger_thick, fi # adaptive finger length start while finger_sz > min_finger and next_angle_difference > adaptive: +# while finger_sz > min_finger and next_angle_difference > adaptive: finger_sz *= 0.95 # reduce the size of finger by a percentage... the closer to 1.0, the slower distance = old_distance + 3 * oldfinger_sz / 2 + finger_sz / 2 mortise_point = loop.interpolate(distance) # get the next mortise point diff --git a/scripts/addons/cam/slice.py b/scripts/addons/cam/slice.py index 76933d1..9141926 100644 --- a/scripts/addons/cam/slice.py +++ b/scripts/addons/cam/slice.py @@ -82,6 +82,7 @@ def sliceObject(ob): # April 2020 Alain Pelletier bpy.context.scene.collection.children.link(tcollection) # show object information + print(ob) print(ob.dimensions) print(ob.location) diff --git a/scripts/addons/cam/ui_panels/area.py b/scripts/addons/cam/ui_panels/area.py index 42ee9b8..44b3d8c 100644 --- a/scripts/addons/cam/ui_panels/area.py +++ b/scripts/addons/cam/ui_panels/area.py @@ -21,7 +21,9 @@ class CAM_AREA_Panel(CAMButtonsPanel, bpy.types.Panel): return self.draw_z_limits() - self.draw_xy_limits() + + if self.ao.strategy in ['BLOCK', 'SPIRAL', 'CIRCLES', 'PARALLEL', 'CROSS']: + self.draw_xy_limits() # Draw layers option: use layers(y/n) and choose the stepdown def draw_z_limits(self):