From d29bee2d23df4b493e4135ea40c06709eee428eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Sun, 29 Dec 2024 15:47:48 +0100 Subject: [PATCH 01/12] Fix missing references for A and B axis --- scripts/addons/cam/ui/panels/op_properties_panel.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/addons/cam/ui/panels/op_properties_panel.py b/scripts/addons/cam/ui/panels/op_properties_panel.py index 5fde18263..a189260da 100644 --- a/scripts/addons/cam/ui/panels/op_properties_panel.py +++ b/scripts/addons/cam/ui/panels/op_properties_panel.py @@ -216,20 +216,20 @@ def draw(self, context): header.label(text="A & B Axes") if panel: subheader, subpanel = panel.panel("a_axis", default_closed=True) - subheader.prop(self.op, "enable_A", text="A Axis") + subheader.prop(self.op, "enable_a_axis", text="A Axis") if subpanel: subpanel.enabled = self.op.enable_a_axis col = subpanel.column(align=True) row = col.row() row.use_property_split = True row.prop(self.op, "rotation_a") - col.prop(self.op, "A_along_x") + col.prop(self.op, "a_along_x") if self.op.a_along_x: col.label(text="Ⓐ || Ⓧ - Ⓑ || Ⓨ") else: col.label(text="Ⓐ || Ⓨ - Ⓑ || Ⓧ") subheader, subpanel = panel.panel("b_axis", default_closed=True) - subheader.prop(self.op, "enable_B", text="B Axis") + subheader.prop(self.op, "enable_b_axis", text="B Axis") if subpanel: subpanel.enabled = self.op.enable_b_axis col = subpanel.column(align=True) From 776661e1345e4bdb2391233c3afd83672f182fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Sun, 29 Dec 2024 18:58:46 +0100 Subject: [PATCH 02/12] Set step values for angle properties --- scripts/addons/cam/operators/curve_create_ops.py | 6 ++++++ scripts/addons/cam/operators/curve_tools_ops.py | 2 ++ scripts/addons/cam/operators/pack_op.py | 1 + scripts/addons/cam/properties/movement_props.py | 3 +++ scripts/addons/cam/properties/operation_props.py | 6 ++++++ 5 files changed, 18 insertions(+) diff --git a/scripts/addons/cam/operators/curve_create_ops.py b/scripts/addons/cam/operators/curve_create_ops.py index 128244b1e..fa78f5089 100644 --- a/scripts/addons/cam/operators/curve_create_ops.py +++ b/scripts/addons/cam/operators/curve_create_ops.py @@ -851,6 +851,7 @@ class CamCurveMortise(Operator): default=0.0, min=0.000, max=2, + step=100, subtype="ANGLE", unit="ROTATION", ) @@ -1029,6 +1030,7 @@ class CamCurveInterlock(Operator): default=0.0, min=0.000, max=2, + step=100, subtype="ANGLE", unit="ROTATION", ) @@ -1037,6 +1039,7 @@ class CamCurveInterlock(Operator): default=0.0, min=0.000, max=2, + step=100, subtype="ANGLE", unit="ROTATION", ) @@ -1444,6 +1447,7 @@ class CamCurvePuzzle(Operator): default=pi / 4, min=-10, max=10, + step=500, subtype="ANGLE", unit="ROTATION", ) @@ -1452,6 +1456,7 @@ class CamCurvePuzzle(Operator): default=pi / 4, min=-10, max=10, + step=500, subtype="ANGLE", unit="ROTATION", ) @@ -1986,6 +1991,7 @@ class CamCurveGear(Operator): min=0.001, max=pi / 2, precision=4, + step=100, subtype="ANGLE", unit="ROTATION", ) diff --git a/scripts/addons/cam/operators/curve_tools_ops.py b/scripts/addons/cam/operators/curve_tools_ops.py index 9dc351e2d..35d050778 100644 --- a/scripts/addons/cam/operators/curve_tools_ops.py +++ b/scripts/addons/cam/operators/curve_tools_ops.py @@ -236,6 +236,7 @@ class CamCurveSimpleOvercuts(Operator): min=-3.14, max=3.14, precision=4, + step=500, subtype="ANGLE", unit="ROTATION", ) @@ -361,6 +362,7 @@ class CamCurveBoneFilletOvercuts(Operator): max=3.14, description="The maximum angle to be considered as an inside corner", precision=4, + step=500, subtype="ANGLE", unit="ROTATION", ) diff --git a/scripts/addons/cam/operators/pack_op.py b/scripts/addons/cam/operators/pack_op.py index b4e619dd8..f338fdd14 100644 --- a/scripts/addons/cam/operators/pack_op.py +++ b/scripts/addons/cam/operators/pack_op.py @@ -96,6 +96,7 @@ class CamPackObjects(Operator): min=pi / 180, max=pi, precision=5, + step=500, subtype="ANGLE", unit="ROTATION", ) diff --git a/scripts/addons/cam/properties/movement_props.py b/scripts/addons/cam/properties/movement_props.py index cccaddb30..776d652dd 100644 --- a/scripts/addons/cam/properties/movement_props.py +++ b/scripts/addons/cam/properties/movement_props.py @@ -118,6 +118,7 @@ class CAM_MOVEMENT_Properties(PropertyGroup): min=0, max=pi * 0.4999, precision=1, + step=500, subtype="ANGLE", unit="ROTATION", update=update_operation, @@ -158,6 +159,7 @@ class CAM_MOVEMENT_Properties(PropertyGroup): min=0, max=pi * 0.4999, precision=1, + step=500, subtype="ANGLE", unit="ROTATION", update=update_operation, @@ -220,6 +222,7 @@ class CAM_MOVEMENT_Properties(PropertyGroup): min=0, max=pi * 0.5, precision=0, + step=100, subtype="ANGLE", unit="ROTATION", update=update_operation, diff --git a/scripts/addons/cam/properties/operation_props.py b/scripts/addons/cam/properties/operation_props.py index ba4c0759f..f864e45ee 100644 --- a/scripts/addons/cam/properties/operation_props.py +++ b/scripts/addons/cam/properties/operation_props.py @@ -507,10 +507,12 @@ class CAM_OPERATION_Properties(PropertyGroup): min=-360, max=360, precision=0, + step=500, subtype="ANGLE", unit="ROTATION", update=update_rest, ) + # OBSOLETE?, REMOVE ? old_rotation_a: FloatProperty( name="A Axis Angle", description="old value of Rotate A axis\nto specified angle", @@ -522,6 +524,7 @@ class CAM_OPERATION_Properties(PropertyGroup): unit="ROTATION", update=update_rest, ) + # OBSOLETE?, REMOVE ? old_rotation_b: FloatProperty( name="A Axis Angle", description="old value of Rotate A axis\nto specified angle", @@ -540,6 +543,7 @@ class CAM_OPERATION_Properties(PropertyGroup): min=-360, max=360, precision=0, + step=500, subtype="ANGLE", unit="ROTATION", update=update_rotation, @@ -563,6 +567,7 @@ class CAM_OPERATION_Properties(PropertyGroup): min=-360, max=360, precision=0, + step=500, subtype="ANGLE", unit="ROTATION", update=update_rotation, @@ -882,6 +887,7 @@ class CAM_OPERATION_Properties(PropertyGroup): min=0, max=pi * 0.5, precision=0, + step=500, subtype="ANGLE", unit="ROTATION", update=update_rest, From b3b344bf86685305d52135da542083cfac95e283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Sun, 29 Dec 2024 19:20:06 +0100 Subject: [PATCH 03/12] More angle step fixes --- scripts/addons/cam/operators/curve_equation_ops.py | 3 +++ scripts/addons/cam/properties/operation_props.py | 1 + 2 files changed, 4 insertions(+) diff --git a/scripts/addons/cam/operators/curve_equation_ops.py b/scripts/addons/cam/operators/curve_equation_ops.py index a3751043a..eef933107 100644 --- a/scripts/addons/cam/operators/curve_equation_ops.py +++ b/scripts/addons/cam/operators/curve_equation_ops.py @@ -79,6 +79,7 @@ class CamSineCurve(Operator): min=-360, max=360, precision=4, + step=100, unit="ROTATION", ) offset: FloatProperty( @@ -125,6 +126,7 @@ class CamSineCurve(Operator): min=-200 * pi, max=200 * pi, precision=4, + step=100, unit="ROTATION", ) wave_amount: IntProperty( @@ -266,6 +268,7 @@ class CamLissajousCurve(Operator): min=-360, max=360, precision=4, + step=100, unit="ROTATION", ) diff --git a/scripts/addons/cam/properties/operation_props.py b/scripts/addons/cam/properties/operation_props.py index fc43c5845..a10fe0101 100644 --- a/scripts/addons/cam/properties/operation_props.py +++ b/scripts/addons/cam/properties/operation_props.py @@ -413,6 +413,7 @@ class CAM_OPERATION_Properties(PropertyGroup): subtype="ANGLE", unit="ROTATION", precision=PRECISION, + step=500, update=update_offset_image, ) ball_radius: FloatProperty( From bf9eb949fe44035820d73162df969eeba3741ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Mon, 30 Dec 2024 11:17:12 +0100 Subject: [PATCH 04/12] Fix missing imports in puzzle_joinery --- scripts/addons/cam/puzzle_joinery.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/addons/cam/puzzle_joinery.py b/scripts/addons/cam/puzzle_joinery.py index d107d7cbd..dcf28e9e5 100644 --- a/scripts/addons/cam/puzzle_joinery.py +++ b/scripts/addons/cam/puzzle_joinery.py @@ -31,6 +31,10 @@ rotate, make_active, remove_multiple, + select_multiple, + join_multiple, + remove_doubles, + add_rectangle, ) From c654d3c83c7b39c9253690d0185f055e7efda3ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Mon, 30 Dec 2024 11:31:07 +0100 Subject: [PATCH 05/12] Fix missing imports in cam_chunk --- scripts/addons/cam/cam_chunk.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/addons/cam/cam_chunk.py b/scripts/addons/cam/cam_chunk.py index cad16e487..f6fd8223f 100644 --- a/scripts/addons/cam/cam_chunk.py +++ b/scripts/addons/cam/cam_chunk.py @@ -14,6 +14,7 @@ ) import sys import time +import random import numpy as np import shapely @@ -31,7 +32,7 @@ pass import bpy -from mathutils import Vector +from mathutils import Vector, Euler try: import bl_ext.blender_org.simplify_curves_plus as curve_simplify @@ -59,6 +60,8 @@ from .utilities.image_utils import ( get_sample_image, prepare_area, + render_sample_image, + get_circle_binary, ) from .utilities.numba_utils import jit from .utilities.ocl_utils import ( @@ -84,6 +87,7 @@ tuple_multiply, tuple_subtract, is_vertical_limit, + get_cache_path, ) From 44e2c19f48b47e5c199d5b6481e6b0f11d3c4072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Mon, 30 Dec 2024 11:39:57 +0100 Subject: [PATCH 06/12] Fix reference in pack --- scripts/addons/cam/pack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/addons/cam/pack.py b/scripts/addons/cam/pack.py index 4ecf5ca8d..704b91ef0 100644 --- a/scripts/addons/cam/pack.py +++ b/scripts/addons/cam/pack.py @@ -225,5 +225,5 @@ def pack_curves(): i += 1 t = time.time() - t - polygon_utils_cam.shapely_to_curve("test", sgeometry.MultiPolygon(placedpolys), 0) + shapely_to_curve("test", sgeometry.MultiPolygon(placedpolys), 0) print(t) From 9bccef0479b73acc98a51456c73c3a4a13596acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Mon, 30 Dec 2024 12:05:40 +0100 Subject: [PATCH 07/12] Fixing reference in testing.py --- scripts/addons/cam/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/addons/cam/testing.py b/scripts/addons/cam/testing.py index 8089a6bc3..33a2d156f 100644 --- a/scripts/addons/cam/testing.py +++ b/scripts/addons/cam/testing.py @@ -5,7 +5,7 @@ import bpy -from .gcodepath import getPath +from .gcode_path import getPath from .utilities.simple_utils import activate From 8e856d39e53fdba05edc9ad1665aacf21abe3186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Mon, 30 Dec 2024 13:40:51 +0100 Subject: [PATCH 08/12] Fix import and reference in optimisation_panel-py --- scripts/addons/cam/ui/panels/optimisation_panel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/addons/cam/ui/panels/optimisation_panel.py b/scripts/addons/cam/ui/panels/optimisation_panel.py index 3d9f81c20..e734a9bca 100644 --- a/scripts/addons/cam/ui/panels/optimisation_panel.py +++ b/scripts/addons/cam/ui/panels/optimisation_panel.py @@ -9,6 +9,7 @@ from .parent_panel import CAMParentPanel +from ...utilities.version_utils import opencamlib_version class CAM_OPTIMISATION_Panel(CAMParentPanel, Panel): """CAM Optimisation Panel""" @@ -86,7 +87,7 @@ def draw(self, context): if self.op.remove_redundant_points: row = col.row() row.use_property_split = True - row.prop(self.op, "simplify_tol") + row.prop(self.op, "simplify_tolerance") # Use Modifiers if self.op.geometry_source in ["OBJECT", "COLLECTION"]: From abd986b2ec508151f7c048e28bf0e2f10d6eafb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Mon, 30 Dec 2024 13:46:14 +0100 Subject: [PATCH 09/12] Fix missing import in bounds_utils.py --- scripts/addons/cam/utilities/bounds_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/addons/cam/utilities/bounds_utils.py b/scripts/addons/cam/utilities/bounds_utils.py index 394cb8442..06995233f 100644 --- a/scripts/addons/cam/utilities/bounds_utils.py +++ b/scripts/addons/cam/utilities/bounds_utils.py @@ -12,7 +12,7 @@ progress, unit_value_to_string, ) - +from ..exception import CamException def get_bounds_worldspace(obs, use_modifiers=False): """Get the bounding box of a list of objects in world space. From 300e7e819523c9bef6981aae734866ef3e09586c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Mon, 30 Dec 2024 14:28:59 +0100 Subject: [PATCH 10/12] Fix missing import in index_utils.py --- scripts/addons/cam/utilities/index_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/addons/cam/utilities/index_utils.py b/scripts/addons/cam/utilities/index_utils.py index 586844b90..d9dc928a6 100644 --- a/scripts/addons/cam/utilities/index_utils.py +++ b/scripts/addons/cam/utilities/index_utils.py @@ -8,7 +8,7 @@ import bpy from .simple_utils import activate - +from .orient_utils import rotation_to_2_axes def prepare_indexed(o): """Prepare and index objects in the given collection. From 26fb125a30d18946aef5603ef10525210275a08d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Station=C3=A4r=5CHenrik?= Date: Mon, 30 Dec 2024 14:36:53 +0100 Subject: [PATCH 11/12] Fix missing import in thread_utils.py --- scripts/addons/cam/utilities/thread_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/addons/cam/utilities/thread_utils.py b/scripts/addons/cam/utilities/thread_utils.py index 598ce5fa1..240a2fcba 100644 --- a/scripts/addons/cam/utilities/thread_utils.py +++ b/scripts/addons/cam/utilities/thread_utils.py @@ -2,6 +2,7 @@ They mostly call the functions from 'utils.py' """ +import threading import bpy From 506d29ef668aaac8bdf4dcc8dff1b4480eed3fa4 Mon Sep 17 00:00:00 2001 From: hmunktell <5789534+hmunktell@users.noreply.github.com> Date: Mon, 30 Dec 2024 13:38:27 +0000 Subject: [PATCH 12/12] :art: Format Python code with psf/black --- scripts/addons/cam/ui/panels/optimisation_panel.py | 1 + scripts/addons/cam/utilities/bounds_utils.py | 1 + scripts/addons/cam/utilities/index_utils.py | 1 + 3 files changed, 3 insertions(+) diff --git a/scripts/addons/cam/ui/panels/optimisation_panel.py b/scripts/addons/cam/ui/panels/optimisation_panel.py index e734a9bca..cd582b60d 100644 --- a/scripts/addons/cam/ui/panels/optimisation_panel.py +++ b/scripts/addons/cam/ui/panels/optimisation_panel.py @@ -11,6 +11,7 @@ from ...utilities.version_utils import opencamlib_version + class CAM_OPTIMISATION_Panel(CAMParentPanel, Panel): """CAM Optimisation Panel""" diff --git a/scripts/addons/cam/utilities/bounds_utils.py b/scripts/addons/cam/utilities/bounds_utils.py index 06995233f..2fc48baf3 100644 --- a/scripts/addons/cam/utilities/bounds_utils.py +++ b/scripts/addons/cam/utilities/bounds_utils.py @@ -14,6 +14,7 @@ ) from ..exception import CamException + def get_bounds_worldspace(obs, use_modifiers=False): """Get the bounding box of a list of objects in world space. diff --git a/scripts/addons/cam/utilities/index_utils.py b/scripts/addons/cam/utilities/index_utils.py index d9dc928a6..b96554121 100644 --- a/scripts/addons/cam/utilities/index_utils.py +++ b/scripts/addons/cam/utilities/index_utils.py @@ -10,6 +10,7 @@ from .simple_utils import activate from .orient_utils import rotation_to_2_axes + def prepare_indexed(o): """Prepare and index objects in the given collection.