diff --git a/scripts/addons/cam.zip b/scripts/addons/cam.zip new file mode 100644 index 000000000..2f700b280 Binary files /dev/null and b/scripts/addons/cam.zip differ diff --git a/scripts/addons/cam/__init__.py b/scripts/addons/cam/__init__.py index 031ced31b..2d03b0b35 100644 --- a/scripts/addons/cam/__init__.py +++ b/scripts/addons/cam/__init__.py @@ -172,8 +172,6 @@ PathsChain, PathExport, PathExportChain, - # .pack - # PackObjectsSettings, # .preferences CamAddonPreferences, # .preset_managers @@ -183,8 +181,6 @@ AddPresetCamCutter, AddPresetCamOperation, AddPresetCamMachine, - # .slice - # SliceObjectsSettings, ] @@ -225,12 +221,6 @@ def register() -> None: scene.cam_operations = CollectionProperty( type=camOperation, ) - # scene.cam_pack = PointerProperty( - # type=PackObjectsSettings, - # ) - # scene.cam_slice = PointerProperty( - # type=SliceObjectsSettings, - # ) scene.cam_text = StringProperty() scene.interface = PointerProperty( type=CAM_INTERFACE_Properties, diff --git a/scripts/addons/cam/engine.py b/scripts/addons/cam/engine.py index 75da28253..849af715e 100644 --- a/scripts/addons/cam/engine.py +++ b/scripts/addons/cam/engine.py @@ -16,10 +16,6 @@ from .ui.panels.cutter import CAM_CUTTER_Panel from .ui.panels.feedrate import CAM_FEEDRATE_Panel from .ui.panels.gcode import CAM_GCODE_Panel - -# from .ui.panels.info import CAM_INFO_Panel - -# from .ui.panels.interface import CAM_INTERFACE_Panel from .ui.panels.machine import CAM_MACHINE_Panel from .ui.panels.material import CAM_MATERIAL_Panel from .ui.panels.movement import CAM_MOVEMENT_Panel @@ -35,20 +31,6 @@ class FABEX_ENGINE(RenderEngine): bl_label = "Fabex CNC/CAM" bl_use_eevee_viewport = True - # view3d = [a.spaces[0] for a in context.screen.areas if a.type == "VIEW_3D"][0] - - # shading = view3d.shading - # shading.color_type = "OBJECT" - # shading.show_shadows = True - # shading.show_cavity = True - # shading.cavity_type = "BOTH" - # shading.cavity_ridge_factor = 2.5 - # shading.cavity_valley_factor = 2.5 - # shading.curvature_ridge_factor = 2 - # shading.curvature_valley_factor = 2 - # shading.use_dof = True - # shading.show_object_outline = True - def get_panels(): """Retrieve a list of panels for the Blender UI. @@ -83,10 +65,8 @@ def get_panels(): EEVEE_MATERIAL_PT_context_material, EEVEE_MATERIAL_PT_surface, EEVEE_MATERIAL_PT_settings, - # CAM_INTERFACE_Panel, CAM_CHAINS_Panel, CAM_OPERATIONS_Panel, - # CAM_INFO_Panel, CAM_MATERIAL_Panel, CAM_OPERATION_PROPERTIES_Panel, CAM_OPTIMISATION_Panel, diff --git a/scripts/addons/cam/gcodepath.py b/scripts/addons/cam/gcodepath.py index 14d0297e7..0b1089ec0 100644 --- a/scripts/addons/cam/gcodepath.py +++ b/scripts/addons/cam/gcodepath.py @@ -182,8 +182,6 @@ def exportGcodePath(filename, vertslist, operations): unitcorr = 1 rotcorr = 180.0 / pi - use_experimental = bpy.context.preferences.addons[__package__].preferences.experimental - def startNewFile(): """Start a new file for G-code generation. @@ -208,7 +206,7 @@ def startNewFile(): # process user overrides for post processor settings - if use_experimental and isinstance(c, iso.Creator): + if isinstance(c, iso.Creator): c.output_block_numbers = m.output_block_numbers c.start_block_number = m.start_block_number c.block_number_increment = m.block_number_increment @@ -248,7 +246,7 @@ def startNewFile(): cut_distance = 0 for i, o in enumerate(operations): - if use_experimental and o.output_header: + if o.output_header: lines = o.gcode_header.split(";") for aline in lines: c.write(aline + "\n") diff --git a/scripts/addons/cam/pack.py b/scripts/addons/cam/pack.py index d98644763..c76199f35 100644 --- a/scripts/addons/cam/pack.py +++ b/scripts/addons/cam/pack.py @@ -227,68 +227,3 @@ def packCurves(): polygon_utils_cam.shapelyToCurve("test", sgeometry.MultiPolygon(placedpolys), 0) print(t) - - -# class PackObjectsSettings(PropertyGroup): -# """stores all data for machines""" - -# sheet_fill_direction: EnumProperty( -# name="Fill Direction", -# items=( -# ("X", "X", "Fills sheet in X axis direction"), -# ("Y", "Y", "Fills sheet in Y axis direction"), -# ), -# description="Fill direction of the packer algorithm", -# default="Y", -# ) -# sheet_x: FloatProperty( -# name="X Size", -# description="Sheet size", -# min=0.001, -# max=10, -# default=0.5, -# precision=constants.PRECISION, -# unit="LENGTH", -# ) -# sheet_y: FloatProperty( -# name="Y Size", -# description="Sheet size", -# min=0.001, -# max=10, -# default=0.5, -# precision=constants.PRECISION, -# unit="LENGTH", -# ) -# distance: FloatProperty( -# name="Minimum Distance", -# description="Minimum distance between objects(should be " "at least cutter diameter!)", -# min=0.001, -# max=10, -# default=0.01, -# precision=constants.PRECISION, -# unit="LENGTH", -# ) -# tolerance: FloatProperty( -# name="Placement Tolerance", -# description="Tolerance for placement: smaller value slower placemant", -# min=0.001, -# max=0.02, -# default=0.005, -# precision=constants.PRECISION, -# unit="LENGTH", -# ) -# rotate: BoolProperty( -# name="Enable Rotation", -# description="Enable rotation of elements", -# default=True, -# ) -# rotate_angle: FloatProperty( -# name="Placement Angle Rotation Step", -# description="Bigger rotation angle, faster placemant", -# default=0.19635 * 4, -# min=pi / 180, -# max=pi, -# precision=5, -# subtype="ANGLE", -# unit="ROTATION", -# ) diff --git a/scripts/addons/cam/preferences.py b/scripts/addons/cam/preferences.py index 89bf66e1c..6f1af2c61 100644 --- a/scripts/addons/cam/preferences.py +++ b/scripts/addons/cam/preferences.py @@ -27,12 +27,6 @@ class CamAddonPreferences(AddonPreferences): default=False, ) - experimental: BoolProperty( - name="Show Experimental Features", - description="Use these features when you want to help development of Fabex", - default=False, - ) - default_interface_level: EnumProperty( name="Interface Level in New File", description="Choose visible options", @@ -271,8 +265,3 @@ def draw(self, context): col.label(text="Shapely is not Installed") else: col.label(text=f"Shapely v{shape_version}") - - box = layout.box() - col = box.column(align=True) - col.label(text="Experimental", icon="EXPERIMENTAL") - col.prop(self, "experimental") diff --git a/scripts/addons/cam/slice.py b/scripts/addons/cam/slice.py index ff51ae536..77a88745b 100644 --- a/scripts/addons/cam/slice.py +++ b/scripts/addons/cam/slice.py @@ -110,108 +110,3 @@ def slicing3d(ob, start, end): bpy.ops.object.select_all(action="DESELECT") # deselect everything return True - - -# def sliceObject(ob): -# """Slice a 3D object into layers based on a specified thickness. - -# This function takes a 3D object and slices it into multiple layers -# according to the specified thickness. It creates a new collection for -# the slices and optionally creates text labels for each slice if the -# indexes parameter is set. The slicing can be done in either 2D or 3D -# based on the user's selection. The function also handles the positioning -# of the slices based on the object's bounding box. - -# Args: -# ob (bpy.types.Object): The 3D object to be sliced. -# """ -# # April 2020 Alain Pelletier -# # get variables from menu -# thickness = bpy.context.scene.cam_slice.slice_distance -# slice3d = bpy.context.scene.cam_slice.slice_3d -# indexes = bpy.context.scene.cam_slice.indexes -# above0 = bpy.context.scene.cam_slice.slice_above0 -# # setup the collections -# scollection = bpy.data.collections.new("Slices") -# bpy.context.scene.collection.children.link(scollection) -# if indexes: -# tcollection = bpy.data.collections.new("Text") -# bpy.context.scene.collection.children.link(tcollection) - -# bpy.ops.object.mode_set(mode="OBJECT") # force object mode -# minx, miny, minz, maxx, maxy, maxz = utils.getBoundsWorldspace([ob]) - -# start_height = minz -# if above0 and minz < 0: -# start_height = 0 - -# # calculate amount of layers needed -# layeramt = 1 + int((maxz - start_height) // thickness) - -# for layer in range(layeramt): -# height = round(layer * thickness, 6) # height of current layer -# t = str(layer) + "-" + str(height * 1000) -# slicename = "slice_" + t # name for the current slice -# tslicename = "t_" + t # name for the current slice text -# height += start_height -# print(slicename) - -# ob.select_set(True) # select object to be sliced -# bpy.context.view_layer.objects.active = ob # make object to be sliced active -# bpy.ops.object.duplicate() # make a copy of object to be sliced -# bpy.context.view_layer.objects.active.name = slicename # change the name of object - -# # attribute active object to obslice -# obslice = bpy.context.view_layer.objects.active -# scollection.objects.link(obslice) # link obslice to scollecton -# if slice3d: -# # slice 3d at desired height and stop at desired height -# slicesuccess = slicing3d(obslice, height, height + thickness) -# else: -# # slice object at desired height -# slicesuccess = slicing2d(obslice, height) - -# if indexes and slicesuccess: -# # text objects -# bpy.ops.object.text_add() # new text object -# textob = bpy.context.active_object -# textob.data.size = 0.006 # change size of object -# textob.data.body = t # text content -# textob.location = (0, 0, 0) # text location -# textob.name = tslicename # change the name of object -# bpy.ops.object.select_all(action="DESELECT") # deselect everything -# tcollection.objects.link(textob) # add to text collection -# textob.parent = obslice # make textob child of obslice - -# # select all slices -# for obj in bpy.data.collections["Slices"].all_objects: -# obj.select_set(True) - - -# class SliceObjectsSettings(PropertyGroup): -# """Stores All Data for Machines""" - -# slice_distance: FloatProperty( -# name="Slicing Distance", -# description="Slices distance in z, should be most often " "thickness of plywood sheet.", -# min=0.001, -# max=10, -# default=0.005, -# precision=constants.PRECISION, -# unit="LENGTH", -# ) -# slice_above0: BoolProperty( -# name="Slice Above 0", -# description="only slice model above 0", -# default=False, -# ) -# slice_3d: BoolProperty( -# name="3D Slice", -# description="For 3D carving", -# default=False, -# ) -# indexes: BoolProperty( -# name="Add Indexes", -# description="Adds index text of layer + index", -# default=True, -# ) diff --git a/scripts/addons/cam/ui/panels/__init__.py b/scripts/addons/cam/ui/panels/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/scripts/addons/cam/ui/panels/buttons_panel.py b/scripts/addons/cam/ui/panels/buttons_panel.py index 6a3c55228..d01e7761a 100644 --- a/scripts/addons/cam/ui/panels/buttons_panel.py +++ b/scripts/addons/cam/ui/panels/buttons_panel.py @@ -41,9 +41,6 @@ def __init__(self): self.level = int(context.scene.interface.level) self.machine = context.scene.cam_machine - addon_prefs = context.preferences.addons["bl_ext.user_default.fabex"].preferences - self.use_experimental = addon_prefs.experimental - operations = context.scene.cam_operations operations_count = len(operations) operation_index = context.scene.cam_active_operation diff --git a/scripts/addons/cam/ui/panels/interface.py b/scripts/addons/cam/ui/panels/interface.py index bc8a5cd42..1cd7265ff 100644 --- a/scripts/addons/cam/ui/panels/interface.py +++ b/scripts/addons/cam/ui/panels/interface.py @@ -131,9 +131,6 @@ def update_layout(self, context): bpy.types.WORLD_PT_CAM_OPERATION, bpy.types.WORLD_PT_CAM_OPERATIONS, bpy.types.WORLD_PT_CAM_OPTIMISATION, - # bpy.types.WORLD_PT_CAM_PACK, - # bpy.types.WORLD_PT_CAM_SLICE, - # bpy.types.WORLD_PT_BASRELIEF, bpy.types.VIEW3D_PT_tools_curvetools, bpy.types.VIEW3D_PT_tools_create, ] @@ -149,9 +146,6 @@ def update_layout(self, context): CAM_OPERATIONS_Panel, CAM_MATERIAL_Panel, CAM_MACHINE_Panel, - # CAM_PACK_Panel, - # CAM_SLICE_Panel, - # BASRELIEF_Panel, ] operation_classes = [ CAM_OPERATION_PROPERTIES_Panel, @@ -279,9 +273,6 @@ def update_user_layout(self, context): bpy.ops.wm.save_userpref() -# update_layout(self, context) - - class CAM_INTERFACE_Properties(PropertyGroup): level: EnumProperty( name="Interface", diff --git a/scripts/addons/cam/ui/panels/op_properties.py b/scripts/addons/cam/ui/panels/op_properties.py index 33d521756..d67f6cb24 100644 --- a/scripts/addons/cam/ui/panels/op_properties.py +++ b/scripts/addons/cam/ui/panels/op_properties.py @@ -20,24 +20,6 @@ class CAM_OPERATION_PROPERTIES_Panel(CAMButtonsPanel, Panel): bl_idname = "WORLD_PT_CAM_OPERATION" panel_interface_level = 0 - # def draw_cutter_engagement(self, col): - # if self.op is not None: - # # layout = self.layout - # box = col.box() - # sub = box.column(align=True) - # # Cutter Engagement - # # Warns if cutter engagement is greater than 50% - # if self.op.cutter_type in ["BALLCONE"]: - # engagement = round(100 * self.op.dist_between_paths / self.op.ball_radius, 1) - # else: - # engagement = round(100 * self.op.dist_between_paths / self.op.cutter_diameter, 1) - - # if engagement > 50: - # sub.alert = True - # sub.label(text="Warning: High Cutter Engagement", icon="ERROR") - - # sub.label(text=f"Cutter Engagement: {engagement}%", icon="MOD_SHRINKWRAP") - def draw_overshoot(self, col): # layout = self.layout # Overshoot @@ -201,8 +183,6 @@ def draw(self, context): sub = box.column(align=True) sub.label(text="Toolpath Distance") sub.prop(self.op, "dist_between_paths", text="Between") - # self.draw_cutter_engagement(col=col) - # self.draw_enable_A_B_axis(col=col) # Default Options if self.op.strategy not in [ @@ -227,11 +207,6 @@ def draw(self, context): col.label(text="Toolpath Distance") col.prop(self.op, "dist_between_paths", text="Between") col.prop(self.op, "dist_along_paths", text="Along") - # self.draw_cutter_engagement(col=col) - - # # Skin - # if self.op.strategy not in ["POCKET", "DRILL", "CURVE", "MEDIAL_AXIS"]: - # col.prop(self.op, "skin") # A & B, Array, Bridges Options if self.level >= 1: @@ -257,8 +232,6 @@ def draw(self, context): row = col.row() row.use_property_split = True row.prop(self.op, "rotation_A") - # row = col.row() - # row.use_property_split = False col.prop(self.op, "A_along_x") if self.op.A_along_x: col.label(text="Ⓐ || Ⓧ - Ⓑ || Ⓨ") @@ -306,19 +279,3 @@ def draw(self, context): ) col.prop(self.op, "use_bridge_modifiers", text="Use Modifiers") col.operator("scene.cam_bridges_add", text="Autogenerate") - - # # Cutter Engagement - # if self.op is not None and not self.op.strategy == "CUTOUT": - # box = layout.box() - # col = box.column(align=True) - # # Warns if cutter engagement is greater than 50% - # if self.op.cutter_type in ["BALLCONE"]: - # engagement = round(100 * self.op.dist_between_paths / self.op.ball_radius, 1) - # else: - # engagement = round(100 * self.op.dist_between_paths / self.op.cutter_diameter, 1) - - # if engagement > 50: - # col.alert = True - # col.label(text="Warning: High Cutter Engagement", icon="ERROR") - - # col.label(text=f"Cutter Engagement: {engagement}%", icon="MOD_SHRINKWRAP") diff --git a/scripts/addons/cam/utils.py b/scripts/addons/cam/utils.py index 8e93e80dc..5439c8e97 100644 --- a/scripts/addons/cam/utils.py +++ b/scripts/addons/cam/utils.py @@ -3023,7 +3023,6 @@ def getStrategyList(scene, context): name, and description. """ - use_experimental = bpy.context.preferences.addons[__package__].preferences.experimental items = [ ( "CUTOUT", @@ -3117,7 +3116,6 @@ def getStrategyList(scene, context): 12, ), ] - # if use_experimental: # items.extend([('MEDIAL_AXIS', 'Medial axis - EXPERIMENTAL', # 'Medial axis, must be used with V or ball cutter, for engraving various width shapes with a single stroke ')]); # ('PENCIL', 'Pencil - EXPERIMENTAL','Pencil operation - detects negative corners in the model and mills only those.'),