Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference repair and Step Size increase #229

Merged
merged 16 commits into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scripts/addons/cam/cam_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
)
import sys
import time
import random

import numpy as np
import shapely
Expand All @@ -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
Expand Down Expand Up @@ -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 (
Expand All @@ -84,6 +87,7 @@
tuple_multiply,
tuple_subtract,
is_vertical_limit,
get_cache_path,
)


Expand Down
6 changes: 6 additions & 0 deletions scripts/addons/cam/operators/curve_create_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,7 @@ class CamCurveMortise(Operator):
default=0.0,
min=0.000,
max=2,
step=100,
subtype="ANGLE",
unit="ROTATION",
)
Expand Down Expand Up @@ -1029,6 +1030,7 @@ class CamCurveInterlock(Operator):
default=0.0,
min=0.000,
max=2,
step=100,
subtype="ANGLE",
unit="ROTATION",
)
Expand All @@ -1037,6 +1039,7 @@ class CamCurveInterlock(Operator):
default=0.0,
min=0.000,
max=2,
step=100,
subtype="ANGLE",
unit="ROTATION",
)
Expand Down Expand Up @@ -1444,6 +1447,7 @@ class CamCurvePuzzle(Operator):
default=pi / 4,
min=-10,
max=10,
step=500,
subtype="ANGLE",
unit="ROTATION",
)
Expand All @@ -1452,6 +1456,7 @@ class CamCurvePuzzle(Operator):
default=pi / 4,
min=-10,
max=10,
step=500,
subtype="ANGLE",
unit="ROTATION",
)
Expand Down Expand Up @@ -1986,6 +1991,7 @@ class CamCurveGear(Operator):
min=0.001,
max=pi / 2,
precision=4,
step=100,
subtype="ANGLE",
unit="ROTATION",
)
Expand Down
3 changes: 3 additions & 0 deletions scripts/addons/cam/operators/curve_equation_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class CamSineCurve(Operator):
min=-360,
max=360,
precision=4,
step=100,
unit="ROTATION",
)
offset: FloatProperty(
Expand Down Expand Up @@ -125,6 +126,7 @@ class CamSineCurve(Operator):
min=-200 * pi,
max=200 * pi,
precision=4,
step=100,
unit="ROTATION",
)
wave_amount: IntProperty(
Expand Down Expand Up @@ -266,6 +268,7 @@ class CamLissajousCurve(Operator):
min=-360,
max=360,
precision=4,
step=100,
unit="ROTATION",
)

Expand Down
2 changes: 2 additions & 0 deletions scripts/addons/cam/operators/curve_tools_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ class CamCurveSimpleOvercuts(Operator):
min=-3.14,
max=3.14,
precision=4,
step=500,
subtype="ANGLE",
unit="ROTATION",
)
Expand Down Expand Up @@ -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",
)
Expand Down
1 change: 1 addition & 0 deletions scripts/addons/cam/operators/pack_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class CamPackObjects(Operator):
min=pi / 180,
max=pi,
precision=5,
step=500,
subtype="ANGLE",
unit="ROTATION",
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/addons/cam/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
3 changes: 3 additions & 0 deletions scripts/addons/cam/properties/movement_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions scripts/addons/cam/properties/operation_props.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ class CAM_OPERATION_Properties(PropertyGroup):
subtype="ANGLE",
unit="ROTATION",
precision=PRECISION,
step=500,
update=update_offset_image,
)
ball_radius: FloatProperty(
Expand Down Expand Up @@ -509,10 +510,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",
Expand All @@ -524,6 +527,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",
Expand All @@ -542,6 +546,7 @@ class CAM_OPERATION_Properties(PropertyGroup):
min=-360,
max=360,
precision=0,
step=500,
subtype="ANGLE",
unit="ROTATION",
update=update_rotation,
Expand All @@ -565,6 +570,7 @@ class CAM_OPERATION_Properties(PropertyGroup):
min=-360,
max=360,
precision=0,
step=500,
subtype="ANGLE",
unit="ROTATION",
update=update_rotation,
Expand Down Expand Up @@ -884,6 +890,7 @@ class CAM_OPERATION_Properties(PropertyGroup):
min=0,
max=pi * 0.5,
precision=0,
step=500,
subtype="ANGLE",
unit="ROTATION",
update=update_rest,
Expand Down
4 changes: 4 additions & 0 deletions scripts/addons/cam/puzzle_joinery.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
rotate,
make_active,
remove_multiple,
select_multiple,
join_multiple,
remove_doubles,
add_rectangle,
)


Expand Down
2 changes: 1 addition & 1 deletion scripts/addons/cam/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import bpy

from .gcodepath import getPath
from .gcode_path import getPath

from .utilities.simple_utils import activate

Expand Down
4 changes: 3 additions & 1 deletion scripts/addons/cam/ui/panels/optimisation_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

from .parent_panel import CAMParentPanel

from ...utilities.version_utils import opencamlib_version


class CAM_OPTIMISATION_Panel(CAMParentPanel, Panel):
"""CAM Optimisation Panel"""
Expand Down Expand Up @@ -86,7 +88,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"]:
Expand Down
1 change: 1 addition & 0 deletions scripts/addons/cam/utilities/bounds_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
progress,
unit_value_to_string,
)
from ..exception import CamException


def get_bounds_worldspace(obs, use_modifiers=False):
Expand Down
1 change: 1 addition & 0 deletions scripts/addons/cam/utilities/index_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import bpy

from .simple_utils import activate
from .orient_utils import rotation_to_2_axes


def prepare_indexed(o):
Expand Down
1 change: 1 addition & 0 deletions scripts/addons/cam/utilities/thread_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

They mostly call the functions from 'utils.py'
"""
import threading

import bpy

Expand Down
Loading