cam.operators

Contents

cam.operators#

Fabex ‘operators.__init__.py’ © 2012 Vilem Novak

Import Properties, Register and Unregister Classes

Submodules#

Attributes#

Classes#

DoBasRelief

Calculate Bas Relief

ProblemAreas

Find Bas Relief Problem Areas

CamBridgesAdd

Add Bridge Objects to Curve

CamChainAdd

Add New CAM Chain

CamChainOperationAdd

Add Operation to Chain

CamChainOperationDown

Add Operation to Chain

CamChainOperationRemove

Remove Operation from Chain

CamChainOperationUp

Add Operation to Chain

CamChainRemove

Remove CAM Chain

CamCurveDrawer

Generates Drawers

CamCurveFlatCone

Generates cone from flat stock

CamCurveGear

Generates Involute Gears // version 1.1 by Leemon Baird, 2011, Leemon@Leemon.com

CamCurveHatch

Perform Hatch Operation on Single or Multiple Curves

CamCurveInterlock

Generates Interlock Along a Curve

CamCurveMortise

Generates Mortise Along a Curve

CamCurvePlate

Perform Generates Rounded Plate with Mounting Holes

CamCurvePuzzle

Generates Puzzle Joints and Interlocks

CamCustomCurve

Object Custom Curve

CamHypotrochoidCurve

Hypotrochoid

CamLissajousCurve

Lissajous

CamSineCurve

Object Sine

CamCurveBoolean

Perform Boolean Operation on Two or More Curves

CamCurveConvexHull

Perform Hull Operation on Single or Multiple Curves

CamCurveIntarsion

Makes Curve Cuttable Both Inside and Outside, for Intarsion and Joints

CamCurveSimpleOvercuts

Adds Overcuts for Slots

CamCurveBoneFilletOvercuts

Adds Overcuts for Slots

CamCurveRemoveDoubles

Curve Remove Doubles

CamMeshGetPockets

Detect Pockets in a Mesh and Extract Them as Curves

CamObjectSilhouette

Object Silhouette

CamOffsetSilhouete

Curve Offset Operation

WM_OT_gcode_import

Import G-code, Travel Lines Don't Get Drawn

CamOperationAdd

Add New CAM Operation

CamOperationCopy

Copy CAM Operation

CamOperationMove

Move CAM Operation

CamOperationRemove

Remove CAM Operation

CamOrientationAdd

Add Orientation to CAM Operation, for Multiaxis Operations

CamPackObjects

Calculate All CAM Paths

PathExport

Export G-code. Can Be Used only when the Path Object Is Present

PathExportChain

Calculate a Chain and Export the G-code Together.

PathsAll

Calculate All CAM Paths

PathsBackground

Calculate CAM Paths in Background. File Has to Be Saved Before.

PathsChain

Calculate a Chain and Export the G-code Alltogether.

KillPathsBackground

Remove CAM Path Processes in Background.

CalculatePath

Calculate CAM Paths

CAM_MATERIAL_PositionObject

AddPresetCamCutter

Add a Cutter Preset

AddPresetCamMachine

Add a Cam Machine Preset

AddPresetCamOperation

Add an Operation Preset

CAMSimulate

Simulate CAM Operation

CAMSimulateChain

Simulate CAM Chain, Compared to Single Op Simulation Just Writes Into One Image and Thus Enables

CamSliceObjects

Slice a Mesh Object Horizontally

Functions#

Package Contents#

class DoBasRelief[source]#

Bases: bpy.types.Operator

Calculate Bas Relief

bl_idname = 'scene.calculate_bas_relief'#
bl_label = 'Calculate Bas Relief'#
bl_options#
processes = []#
use_image_source: BoolProperty(name='Use Image Source', description='', default=False)#
source_image_name: StringProperty(name='Image Source', description='image source')#
view_layer_name: StringProperty(name='View Layer Source', description='Make a bas-relief from whatever is on this view layer')#
bit_diameter: FloatProperty(name='Diameter of Ball End in mm', description='Diameter of bit which will be used for carving', min=0.01, max=50.0, default=3.175, precision=PRECISION)#
pass_per_radius: IntProperty(name='Passes per Radius', description='Amount of passes per radius\n(more passes, more mesh precision)', default=2, min=1, max=10)#
width_mm: IntProperty(name='Desired Width in mm', default=200, min=5, max=4000)#
height_mm: IntProperty(name='Desired Height in mm', default=150, min=5, max=4000)#
thickness_mm: IntProperty(name='Thickness in mm', default=15, min=5, max=100)#
justify_x: EnumProperty(name='X', items=['1', 'Left', '', 0, '-0.5', 'Centered', '', 1, '-1', 'Right', '', 2], default='-1')#
justify_y: EnumProperty(name='Y', items=['1', 'Bottom', '', 0, '-0.5', 'Centered', '', 2, '-1', 'Top', '', 1], default='-1')#
justify_z: EnumProperty(name='Z', items=['-1', 'Below 0', '', 0, '-0.5', 'Centered', '', 2, '1', 'Above 0', '', 1], default='-1')#
depth_exponent: FloatProperty(name='Depth Exponent', description='Initial depth map is taken to this power. Higher = sharper relief', min=0.5, max=10.0, default=1.0, precision=PRECISION)#
silhouette_threshold: FloatProperty(name='Silhouette Threshold', description='Silhouette threshold', min=1e-06, max=1.0, default=0.003, precision=PRECISION)#
recover_silhouettes: BoolProperty(name='Recover Silhouettes', description='', default=True)#
silhouette_scale: FloatProperty(name='Silhouette Scale', description='Silhouette scale', min=1e-06, max=5.0, default=0.3, precision=PRECISION)#
silhouette_exponent: IntProperty(name='Silhouette Square Exponent', description='If lower, true depth distances between objects will be more visibe in the relief', default=3, min=0, max=5)#
attenuation: FloatProperty(name='Gradient Attenuation', description='Gradient attenuation', min=1e-06, max=100.0, default=1.0, precision=PRECISION)#
min_gridsize: IntProperty(name='Minimum Grid Size', default=16, min=2, max=512)#
smooth_iterations: IntProperty(name='Smooth Iterations', default=1, min=1, max=64)#
vcycle_iterations: IntProperty(name='V-Cycle Iterations', description='Set higher for planar constraint', default=2, min=1, max=128)#
linbcg_iterations: IntProperty(name='LINBCG Iterations', description='Set lower for flatter relief, and when using planar constraint', default=5, min=1, max=64)#
use_planar: BoolProperty(name='Use Planar Constraint', description='', default=False)#
gradient_scaling_mask_use: BoolProperty(name='Scale Gradients with Mask', description='', default=False)#
decimate_ratio: FloatProperty(name='Decimate Ratio', description='Simplify the mesh using the Decimate modifier. The lower the value the more simplyfied', min=0.01, max=1.0, default=0.1, precision=PRECISION)#
gradient_scaling_mask_name: StringProperty(name='Scaling Mask Name', description='Mask name')#
scale_down_before_use: BoolProperty(name='Scale Down Image Before Processing', description='', default=False)#
scale_down_before: FloatProperty(name='Image Scale', description='Image scale', min=0.025, max=1.0, default=0.5, precision=PRECISION)#
detail_enhancement_use: BoolProperty(name='Enhance Details', description='Enhance details by frequency analysis', default=False)#
detail_enhancement_amount: FloatProperty(name='Amount', description='Image scale', min=0.025, max=1.0, default=0.5, precision=PRECISION)#
advanced: BoolProperty(name='Advanced Options', description='Show advanced options', default=True)#
invoke(context, event)[source]#
execute(context)[source]#

Execute the relief rendering process based on the provided context.

This function retrieves the scene and its associated bas relief settings. It checks if an image source is being used and sets the view layer name accordingly. The function then attempts to render the scene and generate the relief. If any errors occur during these processes, they are reported, and the operation is canceled.

Parameters:

context – The context in which the function is executed.

Returns:

A dictionary indicating the result of the operation, either

Return type:

dict

draw(context)[source]#

Draw the user interface for the bas relief settings.

This method constructs the layout for the bas relief settings in the Blender user interface. It includes various properties and options that allow users to configure the bas relief calculations, such as selecting images, adjusting parameters, and setting justification options. The layout is dynamically updated based on user selections, providing a comprehensive interface for manipulating bas relief settings.

Parameters:

context (bpy.context) – The context in which the UI is being drawn.

Returns:

This method does not return any value; it modifies the layout directly.

Return type:

None

class ProblemAreas[source]#

Bases: bpy.types.Operator

Find Bas Relief Problem Areas

bl_idname = 'scene.problemareas_bas_relief'#
bl_label = 'Problem Areas Bas Relief'#
bl_options#
processes = []#
execute(context)[source]#

Execute the operation related to the bas relief settings in the current scene.

This method retrieves the current scene from the Blender context and accesses the bas relief settings. It then calls the problemAreas function to perform operations related to those settings. The method concludes by returning a status indicating that the operation has finished successfully.

Parameters:

context (bpy.context) – The current Blender context, which provides access

Returns:

A dictionary with a status key indicating the operation result, specifically {‘FINISHED’}.

Return type:

dict

class CamBridgesAdd[source]#

Bases: bpy.types.Operator

Add Bridge Objects to Curve

bl_idname = 'scene.cam_bridges_add'#
bl_label = 'Add Bridges / Tabs'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the camera operation in the given context.

This function retrieves the active camera operation from the current scene and adds automatic bridges to it. It is typically called within the context of a Blender operator to perform specific actions related to camera operations.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the result of the operation, typically containing the key ‘FINISHED’ to signify successful completion.

Return type:

dict

class CamChainAdd[source]#

Bases: bpy.types.Operator

Add New CAM Chain

bl_idname = 'scene.cam_chain_add'#
bl_label = 'Add New CAM Chain'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the camera chain creation in the given context.

This function adds a new camera chain to the current scene in Blender. It updates the active camera chain index and assigns a name and filename to the newly created chain. The function is intended to be called within a Blender operator context.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the operation’s completion status,

specifically returning {‘FINISHED’} upon successful execution.

Return type:

dict

class CamChainOperationAdd[source]#

Bases: bpy.types.Operator

Add Operation to Chain

bl_idname = 'scene.cam_chain_operation_add'#
bl_label = 'Add Operation to Chain'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute an operation in the active camera chain.

This function retrieves the active camera chain from the current scene and adds a new operation to it. It increments the active operation index and assigns the name of the currently selected camera operation to the newly added operation. This is typically used in the context of managing camera operations in a 3D environment.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the execution status, typically {‘FINISHED’}.

Return type:

dict

class CamChainOperationDown[source]#

Bases: bpy.types.Operator

Add Operation to Chain

bl_idname = 'scene.cam_chain_operation_down'#
bl_label = 'Add Operation to Chain'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the operation to move the active camera operation in the chain.

This function retrieves the current scene and the active camera chain. It checks if the active operation can be moved down in the list of operations. If so, it moves the active operation one position down and updates the active operation index accordingly.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the result of the operation,

specifically {‘FINISHED’} when the operation completes successfully.

Return type:

dict

class CamChainOperationRemove[source]#

Bases: bpy.types.Operator

Remove Operation from Chain

bl_idname = 'scene.cam_chain_operation_remove'#
bl_label = 'Remove Operation from Chain'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the operation to remove the active operation from the camera chain.

This method accesses the current scene and retrieves the active camera chain. It then removes the currently active operation from that chain and adjusts the index of the active operation accordingly. If the active operation index becomes negative, it resets it to zero to ensure it remains within valid bounds.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the execution status, typically

containing {‘FINISHED’} upon successful completion.

Return type:

dict

class CamChainOperationUp[source]#

Bases: bpy.types.Operator

Add Operation to Chain

bl_idname = 'scene.cam_chain_operation_up'#
bl_label = 'Add Operation to Chain'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the operation to move the active camera operation in the chain.

This function retrieves the current scene and the active camera chain. If there is an active operation (i.e., its index is greater than 0), it moves the operation one step up in the chain by adjusting the indices accordingly. After moving the operation, it updates the active operation index to reflect the change.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the result of the operation,

specifically returning {‘FINISHED’} upon successful execution.

Return type:

dict

class CamChainRemove[source]#

Bases: bpy.types.Operator

Remove CAM Chain

bl_idname = 'scene.cam_chain_remove'#
bl_label = 'Remove CAM Chain'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the camera chain removal process.

This function removes the currently active camera chain from the scene and decrements the active camera chain index if it is greater than zero. It modifies the Blender context to reflect these changes.

Parameters:

context – The context in which the function is executed.

Returns:

A dictionary indicating the status of the operation,

specifically {‘FINISHED’} upon successful execution.

Return type:

dict

class CamCurveDrawer[source]#

Bases: bpy.types.Operator

Generates Drawers

bl_idname = 'object.curve_drawer'#
bl_label = 'Drawer'#
bl_options#
depth: FloatProperty(name='Drawer Depth', default=0.2, min=0, max=1.0, precision=4, unit='LENGTH')#
width: FloatProperty(name='Drawer Width', default=0.125, min=0, max=3.0, precision=4, unit='LENGTH')#
height: FloatProperty(name='Drawer Height', default=0.07, min=0, max=3.0, precision=4, unit='LENGTH')#
finger_size: FloatProperty(name='Maximum Finger Size', default=0.015, min=0.005, max=3.0, precision=4, unit='LENGTH')#
finger_tolerance: FloatProperty(name='Finger Play Room', default=4.5e-05, min=0, max=0.003, precision=4, unit='LENGTH')#
finger_inset: FloatProperty(name='Finger Inset', default=0.0, min=0.0, max=0.01, precision=4, unit='LENGTH')#
drawer_plate_thickness: FloatProperty(name='Drawer Plate Thickness', default=0.00477, min=0.001, max=3.0, precision=4, unit='LENGTH')#
drawer_hole_diameter: FloatProperty(name='Drawer Hole Diameter', default=0.02, min=1e-05, max=0.5, precision=4, unit='LENGTH')#
drawer_hole_offset: FloatProperty(name='Drawer Hole Offset', default=0.0, min=-0.5, max=0.5, precision=4, unit='LENGTH')#
overcut: BoolProperty(name='Add Overcut', default=False)#
overcut_diameter: FloatProperty(name='Overcut Tool Diameter', default=0.003175, min=-0.001, max=0.5, precision=4, unit='LENGTH')#
draw(context)[source]#

Draw the user interface properties for the object.

This method is responsible for rendering the layout of various properties related to the object’s dimensions and specifications. It adds properties such as depth, width, height, finger size, finger tolerance, finger inset, drawer plate thickness, drawer hole diameter, drawer hole offset, and overcut diameter to the layout. The overcut diameter property is only added if the overcut option is enabled.

Parameters:

context – The context in which the drawing occurs, typically containing information about the current state and environment.

execute(context)[source]#

Execute the drawer creation process in Blender.

This method orchestrates the creation of a drawer by calculating the necessary dimensions for the finger joints, creating the base plate, and generating the drawer components such as the back, front, sides, and bottom. It utilizes various helper functions to perform operations like boolean differences and transformations to achieve the desired geometry. The method also handles the placement of the drawer components in the 3D space.

Parameters:

context (bpy.context) – The Blender context that provides access to the current scene and objects.

Returns:

A dictionary indicating the completion status of the operation,

typically {‘FINISHED’}.

Return type:

dict

class CamCurveFlatCone[source]#

Bases: bpy.types.Operator

Generates cone from flat stock

bl_idname = 'object.curve_flat_cone'#
bl_label = 'Cone Flat Calculator'#
bl_options#
small_d: FloatProperty(name='Small Diameter', default=0.025, min=0, max=0.1, precision=4, unit='LENGTH')#
large_d: FloatProperty(name='Large Diameter', default=0.3048, min=0, max=3.0, precision=4, unit='LENGTH')#
height: FloatProperty(name='Height of Cone', default=0.457, min=0, max=3.0, precision=4, unit='LENGTH')#
tab: FloatProperty(name='Tab Witdh', default=0.01, min=0, max=0.1, precision=4, unit='LENGTH')#
intake: FloatProperty(name='Intake Diameter', default=0, min=0, max=0.2, precision=4, unit='LENGTH')#
intake_skew: FloatProperty(name='Intake Skew', default=1, min=0.1, max=4)#
resolution: IntProperty(name='Resolution', default=12, min=5, max=200)#
execute(context)[source]#

Execute the construction of a geometric shape in Blender.

This method performs a series of operations to create a geometric shape based on specified dimensions and parameters. It calculates various dimensions needed for the shape, including height and angles, and then uses Blender’s operations to create segments, rectangles, and ellipses. The function also handles the positioning and rotation of these shapes within the 3D space of Blender.

Parameters:

context – The context in which the operation is executed, typically containing information about the current scene and active objects in Blender.

Returns:

A dictionary indicating the completion status of the operation,

typically {‘FINISHED’}.

Return type:

dict

class CamCurveGear[source]#

Bases: bpy.types.Operator

Generates Involute Gears // version 1.1 by Leemon Baird, 2011, Leemon@Leemon.com http://www.thingiverse.com/thing:5505

bl_idname = 'object.curve_gear'#
bl_label = 'Gears'#
bl_options#
tooth_spacing: FloatProperty(name='Distance per Tooth', default=0.01, min=0.001, max=1.0, precision=4, unit='LENGTH')#
tooth_amount: IntProperty(name='Amount of Teeth', default=7, min=4)#
spoke_amount: IntProperty(name='Amount of Spokes', default=4, min=0)#
hole_diameter: FloatProperty(name='Hole Diameter', default=0.003175, min=0, max=3.0, precision=4, unit='LENGTH')#
rim_size: FloatProperty(name='Rim Size', default=0.003175, min=0, max=3.0, precision=4, unit='LENGTH')#
hub_diameter: FloatProperty(name='Hub Diameter', default=0.005, min=0, max=3.0, precision=4, unit='LENGTH')#
pressure_angle: FloatProperty(name='Pressure Angle', default=radians(20), min=0.001, max=pi / 2, precision=4, step=100, subtype='ANGLE', unit='ROTATION')#
clearance: FloatProperty(name='Clearance', default=0.0, min=0, max=0.1, precision=4, unit='LENGTH')#
backlash: FloatProperty(name='Backlash', default=0.0, min=0.0, max=0.1, precision=4, unit='LENGTH')#
rack_height: FloatProperty(name='Rack Height', default=0.012, min=0.001, max=1, precision=4, unit='LENGTH')#
rack_tooth_per_hole: IntProperty(name='Teeth per Mounting Hole', default=7, min=2)#
gear_type: EnumProperty(name='Type of Gear', items='PINION', 'Pinion', 'Circular Gear', 'RACK', 'Rack', 'Straight Rack', description='Type of gear', default='PINION')#
draw(context)[source]#

Draw the user interface properties for gear settings.

This method sets up the layout for various gear parameters based on the selected gear type. It dynamically adds properties to the layout for different gear types, allowing users to input specific values for gear design. The properties include gear type, tooth spacing, tooth amount, hole diameter, pressure angle, and backlash. Additional properties are displayed if the gear type is ‘PINION’ or ‘RACK’.

Parameters:

context – The context in which the layout is being drawn.

execute(context)[source]#

Execute the gear generation process based on the specified gear type.

This method checks the type of gear to be generated (either ‘PINION’ or ‘RACK’) and calls the appropriate function from the involute_gear module to create the gear or rack with the specified parameters. The parameters include tooth spacing, number of teeth, hole diameter, pressure angle, clearance, backlash, rim size, hub diameter, and spoke amount for pinion gears, and additional parameters for rack gears.

Parameters:

context – The context in which the execution is taking place.

Returns:

A dictionary indicating that the operation has finished with a key

’FINISHED’.

Return type:

dict

class CamCurveHatch[source]#

Bases: bpy.types.Operator

Perform Hatch Operation on Single or Multiple Curves

bl_idname = 'object.curve_hatch'#
bl_label = 'CrossHatch Curve'#
bl_options#
angle: FloatProperty(default=0, min=-pi / 2, max=pi / 2, precision=4, subtype='ANGLE')#
distance: FloatProperty(default=0.003, min=0, max=3.0, precision=4, unit='LENGTH')#
offset: FloatProperty(default=0, min=-1.0, max=3.0, precision=4, unit='LENGTH')#
pocket_shape: EnumProperty(name='Pocket Shape', items='BOUNDS', 'Bounds Rectangle', 'Uses a bounding rectangle', 'HULL', 'Convex Hull', 'Uses a convex hull', 'POCKET', 'Pocket', 'Uses the pocket shape', description='Type of pocket shape', default='POCKET')#
contour: BoolProperty(name='Contour Curve', default=False)#
xhatch: BoolProperty(name='Crosshatch #', default=False)#
contour_separate: BoolProperty(name='Contour Separate', default=False)#
straight: BoolProperty(name='Overshoot Style', description='Use overshoot cutout instead of conventional rounded', default=True)#
classmethod poll(context)[source]#
draw(context)[source]#

Draw the layout properties for the given context.

execute(context)[source]#
class CamCurveInterlock[source]#

Bases: bpy.types.Operator

Generates Interlock Along a Curve

bl_idname = 'object.curve_interlock'#
bl_label = 'Interlock'#
bl_options#
finger_size: FloatProperty(name='Finger Size', default=0.015, min=0.005, max=3.0, precision=4, unit='LENGTH')#
finger_tolerance: FloatProperty(name='Finger Play Room', default=4.5e-05, min=0, max=0.003, precision=4, unit='LENGTH')#
plate_thickness: FloatProperty(name='Plate Thickness', default=0.00477, min=0.001, max=3.0, unit='LENGTH')#
opencurve: BoolProperty(name='OpenCurve', default=False)#
interlock_type: EnumProperty(name='Type of Interlock', items='TWIST', 'Twist', 'Interlock requires 1/4 turn twist', 'GROOVE', 'Groove', 'Simple sliding groove', 'PUZZLE', 'Puzzle Interlock', 'Puzzle good for flat joints', description='Type of interlock', default='GROOVE')#
finger_amount: IntProperty(name='Finger Amount', default=2, min=1, max=100)#
tangent_angle: FloatProperty(name='Tangent Deviation', default=0.0, min=0.0, max=2, step=100, subtype='ANGLE', unit='ROTATION')#
fixed_angle: FloatProperty(name='Fixed Angle', default=0.0, min=0.0, max=2, step=100, subtype='ANGLE', unit='ROTATION')#
execute(context)[source]#

Execute the joinery operation based on the selected objects in the context.

This function checks the selected objects in the provided context and performs different operations depending on the type of the active object. If the active object is a curve or font and there are selected objects, it duplicates the object, converts it to a mesh, and processes its vertices to create a LineString representation. The function then calculates lengths and applies distributed interlock joinery based on the specified parameters. If no valid objects are selected, it defaults to a single interlock operation at the cursor’s location.

Parameters:

context (bpy.context) – The context containing selected objects and active object.

Returns:

A dictionary indicating the operation’s completion status.

Return type:

dict

class CamCurveMortise[source]#

Bases: bpy.types.Operator

Generates Mortise Along a Curve

bl_idname = 'object.curve_mortise'#
bl_label = 'Mortise'#
bl_options#
finger_size: BoolProperty(name='Kurf Bending only', default=False)#
min_finger_size: FloatProperty(name='Minimum Finger Size', default=0.0025, min=0.001, max=3.0, precision=4, unit='LENGTH')#
finger_tolerance: FloatProperty(name='Finger Play Room', default=4.5e-05, min=0, max=0.003, precision=4, unit='LENGTH')#
plate_thickness: FloatProperty(name='Drawer Plate Thickness', default=0.00477, min=0.001, max=3.0, unit='LENGTH')#
side_height: FloatProperty(name='Side Height', default=0.05, min=0.001, max=3.0, unit='LENGTH')#
flex_pocket: FloatProperty(name='Flex Pocket', default=0.004, min=0.0, max=1.0, unit='LENGTH')#
top_bottom: BoolProperty(name='Side Top & Bottom Fingers', default=True)#
opencurve: BoolProperty(name='OpenCurve', default=False)#
adaptive: FloatProperty(name='Adaptive Angle Threshold', default=0.0, min=0.0, max=2, step=100, subtype='ANGLE', unit='ROTATION')#
double_adaptive: BoolProperty(name='Double Adaptive Pockets', default=False)#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the joinery process based on the provided context.

This function performs a series of operations to duplicate the active object, convert it to a mesh, and then process its geometry to create joinery features. It extracts vertex coordinates, converts them into a LineString data structure, and applies either variable or fixed finger joinery based on the specified parameters. The function also handles the creation of flexible sides and pockets if required.

Parameters:

context (bpy.context) – The context in which the operation is executed.

Returns:

A dictionary indicating the completion status of the operation.

Return type:

dict

class CamCurvePlate[source]#

Bases: bpy.types.Operator

Perform Generates Rounded Plate with Mounting Holes

bl_idname = 'object.curve_plate'#
bl_label = 'Sign Plate'#
bl_options#
radius: FloatProperty(name='Corner Radius', default=0.025, min=0, max=0.1, precision=4, unit='LENGTH')#
width: FloatProperty(name='Width of Plate', default=0.3048, min=0, max=3.0, precision=4, unit='LENGTH')#
height: FloatProperty(name='Height of Plate', default=0.457, min=0, max=3.0, precision=4, unit='LENGTH')#
hole_diameter: FloatProperty(name='Hole Diameter', default=0.01, min=0, max=3.0, precision=4, unit='LENGTH')#
hole_tolerance: FloatProperty(name='Hole V Tolerance', default=0.005, min=0, max=3.0, precision=4, unit='LENGTH')#
hole_vdist: FloatProperty(name='Hole Vert Distance', default=0.4, min=0, max=3.0, precision=4, unit='LENGTH')#
hole_hdist: FloatProperty(name='Hole Horiz Distance', default=0, min=0, max=3.0, precision=4, unit='LENGTH')#
hole_hamount: IntProperty(name='Hole Horiz Amount', default=1, min=0, max=50)#
resolution: IntProperty(name='Spline Resolution', default=50, min=3, max=150)#
plate_type: EnumProperty(name='Type Plate', items='ROUNDED', 'Rounded corner', 'Makes a rounded corner plate', 'COVE', 'Cove corner', 'Makes a plate with circles cut in each corner ', 'BEVEL', 'Bevel corner', 'Makes a plate with beveled corners ', 'OVAL', 'Elipse', 'Makes an oval plate', description='Type of Plate', default='ROUNDED')#
draw(context)[source]#

Draw the UI layout for plate properties.

This method creates a user interface layout for configuring various properties of a plate, including its type, dimensions, hole specifications, and resolution. It dynamically adds properties to the layout based on the selected plate type, allowing users to input relevant parameters.

Parameters:

context – The context in which the UI is being drawn.

execute(context)[source]#

Execute the creation of a plate based on specified parameters.

This function generates a plate shape in Blender based on the defined attributes such as width, height, radius, and plate type. It supports different plate types including rounded, oval, cove, and bevel. The function also handles the creation of holes in the plate if specified. It utilizes Blender’s curve operations to create the geometry and applies various transformations to achieve the desired shape.

Parameters:

context (bpy.context) – The Blender context in which the operation is performed.

Returns:

A dictionary indicating the result of the operation, typically

{‘FINISHED’} if successful.

Return type:

dict

class CamCurvePuzzle[source]#

Bases: bpy.types.Operator

Generates Puzzle Joints and Interlocks

bl_idname = 'object.curve_puzzle'#
bl_label = 'Puzzle Joints'#
bl_options#
diameter: FloatProperty(name='Tool Diameter', default=0.003175, min=0.001, max=3.0, precision=4, unit='LENGTH')#
finger_tolerance: FloatProperty(name='Finger Play Room', default=5e-05, min=0, max=0.003, precision=4, unit='LENGTH')#
finger_amount: IntProperty(name='Finger Amount', default=1, min=0, max=100)#
stem_size: IntProperty(name='Size of the Stem', default=2, min=1, max=200)#
width: FloatProperty(name='Width', default=0.1, min=0.005, max=3.0, precision=4, unit='LENGTH')#
height: FloatProperty(name='Height or Thickness', default=0.025, min=0.005, max=3.0, precision=4, unit='LENGTH')#
angle: FloatProperty(name='Angle A', default=pi / 4, min=-10, max=10, step=500, subtype='ANGLE', unit='ROTATION')#
angleb: FloatProperty(name='Angle B', default=pi / 4, min=-10, max=10, step=500, subtype='ANGLE', unit='ROTATION')#
radius: FloatProperty(name='Arc Radius', default=0.025, min=0.005, max=5, precision=4, unit='LENGTH')#
interlock_type: EnumProperty(name='Type of Shape', items='JOINT', 'Joint', 'Puzzle Joint interlock', 'BAR', 'Bar', 'Bar interlock', 'ARC', 'Arc', 'Arc interlock', 'MULTIANGLE', 'Multi angle', 'Multi angle joint', 'CURVEBAR', 'Arc Bar', 'Arc Bar interlock', 'CURVEBARCURVE', 'Arc Bar Arc', 'Arc Bar Arc interlock', 'CURVET', 'T curve', 'T curve interlock', 'T', 'T Bar', 'T Bar interlock', 'CORNER', 'Corner Bar', 'Corner Bar interlock', 'TILE', 'Tile', 'Tile interlock', 'OPENCURVE', 'Open Curve', 'Corner Bar interlock', description='Type of interlock', default='CURVET')#
gender: EnumProperty(name='Type Gender', items='MF', 'Male-Receptacle', 'Male and receptacle', 'F', 'Receptacle only', 'Receptacle', 'M', 'Male only', 'Male', description='Type of interlock', default='MF')#
base_gender: EnumProperty(name='Base Gender', items='MF', 'Male - Receptacle', 'Male - Receptacle', 'F', 'Receptacle', 'Receptacle', 'M', 'Male', 'Male', description='Type of interlock', default='M')#
multiangle_gender: EnumProperty(name='Multiangle Gender', items='MMF', 'Male Male Receptacle', 'M M F', 'MFF', 'Male Receptacle Receptacle', 'M F F', description='Type of interlock', default='MFF')#
mitre: BoolProperty(name='Add Mitres', default=False)#
twist_lock: BoolProperty(name='Add TwistLock', default=False)#
twist_thick: FloatProperty(name='Twist Thickness', default=0.0047, min=0.001, max=3.0, precision=4, unit='LENGTH')#
twist_percent: FloatProperty(name='Twist Neck', default=0.3, min=0.1, max=0.9, precision=4)#
twist_keep: BoolProperty(name='Keep Twist Holes', default=False)#
twist_line: BoolProperty(name='Add Twist to Bar', default=False)#
twist_line_amount: IntProperty(name='Amount of Separators', default=2, min=1, max=600)#
twist_separator: BoolProperty(name='Add Twist Separator', default=False)#
twist_separator_amount: IntProperty(name='Amount of Separators', default=2, min=2, max=600)#
twist_separator_spacing: FloatProperty(name='Separator Spacing', default=0.025, min=-0.004, max=1.0, precision=4, unit='LENGTH')#
twist_separator_edge_distance: FloatProperty(name='Separator Edge Distance', default=0.01, min=0.0005, max=0.1, precision=4, unit='LENGTH')#
tile_x_amount: IntProperty(name='Amount of X Fingers', default=2, min=1, max=600)#
tile_y_amount: IntProperty(name='Amount of Y Fingers', default=2, min=1, max=600)#
interlock_amount: IntProperty(name='Interlock Amount on Curve', default=2, min=0, max=200)#
overcut: BoolProperty(name='Add Overcut', default=False)#
overcut_diameter: FloatProperty(name='Overcut Tool Diameter', default=0.003175, min=-0.001, max=0.5, precision=4, unit='LENGTH')#
draw(context)[source]#

Draws the user interface layout for interlock type properties.

This method is responsible for creating and displaying the layout of various properties related to different interlock types in the user interface. It dynamically adjusts the layout based on the selected interlock type, allowing users to input relevant parameters such as dimensions, tolerances, and other characteristics specific to the chosen interlock type.

Parameters:

context – The context in which the layout is being drawn, typically provided by the user interface framework.

Returns:

This method does not return any value; it modifies the layout

directly.

Return type:

None

execute(context)[source]#

Execute the puzzle joinery process based on the provided context.

This method processes the selected objects in the given context to perform various types of puzzle joinery operations. It first checks if there are any selected objects and if the active object is a curve. If so, it duplicates the object, applies transformations, and converts it to a mesh. The method then extracts vertex coordinates and performs different joinery operations based on the specified interlock type. Supported interlock types include ‘FINGER’, ‘JOINT’, ‘BAR’, ‘ARC’, ‘CURVEBARCURVE’, ‘CURVEBAR’, ‘MULTIANGLE’, ‘T’, ‘CURVET’, ‘CORNER’, ‘TILE’, and ‘OPENCURVE’.

Parameters:

context (Context) – The context containing selected objects and the active object.

Returns:

A dictionary indicating the completion status of the operation.

Return type:

dict

class CamCustomCurve[source]#

Bases: bpy.types.Operator

Object Custom Curve

bl_idname = 'object.customcurve'#
bl_label = 'Custom Curve'#
bl_options#
x_string: StringProperty(name='X Equation', description='Equation x=F(t)', default='t')#
y_string: StringProperty(name='Y Equation', description='Equation y=F(t)', default='0')#
z_string: StringProperty(name='Z Equation', description='Equation z=F(t)', default='0.05*sin(2*pi*4*t)')#
iteration: IntProperty(name='Iteration', default=100, min=50, max=2000)#
max_t: FloatProperty(name='Wave Ends at X', default=0.5, min=-3.0, max=10, precision=4, unit='LENGTH')#
min_t: FloatProperty(name='Wave Starts at X', default=0, min=-3.0, max=3, precision=4, unit='LENGTH')#
execute(context)[source]#
class CamHypotrochoidCurve[source]#

Bases: bpy.types.Operator

Hypotrochoid

bl_idname = 'object.hypotrochoid'#
bl_label = 'Spirograph Type Figure'#
bl_options#
typecurve: EnumProperty(name='Type of Curve', items='hypo', 'Hypotrochoid', 'Inside ring', 'epi', 'Epicycloid', 'Outside inner ring')#
R: FloatProperty(name='Big Circle Radius', default=0.25, min=0.001, max=100, precision=4, unit='LENGTH')#
r: FloatProperty(name='Small Circle Radius', default=0.18, min=0.0001, max=100, precision=4, unit='LENGTH')#
d: FloatProperty(name='Distance from Center of Interior Circle', default=0.05, min=0, max=100, precision=4, unit='LENGTH')#
dip: FloatProperty(name='Variable Depth from Center', default=0.0, min=-100, max=100, precision=4)#
execute(context)[source]#
class CamLissajousCurve[source]#

Bases: bpy.types.Operator

Lissajous

bl_idname = 'object.lissajous'#
bl_label = 'Lissajous Figure'#
bl_options#
amplitude_a: FloatProperty(name='Amplitude A', default=0.1, min=0, max=100, precision=4, unit='LENGTH')#
wave_a: EnumProperty(name='Wave X', items='sine', 'Sine Wave', 'Sine Wave', 'triangle', 'Triangle Wave', 'triangle wave', default='sine')#
amplitude_b: FloatProperty(name='Amplitude B', default=0.1, min=0, max=100, precision=4, unit='LENGTH')#
wave_b: EnumProperty(name='Wave Y', items='sine', 'Sine Wave', 'Sine Wave', 'triangle', 'Triangle Wave', 'triangle wave', default='sine')#
period_a: FloatProperty(name='Period A', default=1.1, min=0.001, max=100, precision=4, unit='LENGTH')#
period_b: FloatProperty(name='Period B', default=1.0, min=0.001, max=100, precision=4, unit='LENGTH')#
period_z: FloatProperty(name='Period Z', default=1.0, min=0.001, max=100, precision=4, unit='LENGTH')#
amplitude_z: FloatProperty(name='Amplitude Z', default=0.0, min=0, max=100, precision=4, unit='LENGTH')#
shift: FloatProperty(name='Phase Shift', default=0, min=-360, max=360, precision=4, step=100, unit='ROTATION')#
iteration: IntProperty(name='Iteration', default=500, min=50, max=10000)#
max_t: FloatProperty(name='Wave Ends at X', default=11, min=-3.0, max=1000000, precision=4, unit='LENGTH')#
min_t: FloatProperty(name='Wave Starts at X', default=0, min=-10.0, max=3, precision=4, unit='LENGTH')#
execute(context)[source]#
class CamSineCurve[source]#

Bases: bpy.types.Operator

Object Sine

bl_idname = 'object.sine'#
bl_label = 'Periodic Wave'#
bl_options#
axis: EnumProperty(name='Displacement Axis', items='XY', 'Y to displace X axis', 'Y constant; X sine displacement', 'YX', 'X to displace Y axis', 'X constant; Y sine displacement', 'ZX', 'X to displace Z axis', 'X constant; Y sine displacement', 'ZY', 'Y to displace Z axis', 'X constant; Y sine displacement', default='ZX')#
wave: EnumProperty(name='Wave', items='sine', 'Sine Wave', 'Sine Wave', 'triangle', 'Triangle Wave', 'triangle wave', 'cycloid', 'Cycloid', 'Sine wave rectification', 'invcycloid', 'Inverse Cycloid', 'Sine wave rectification', default='sine')#
amplitude: FloatProperty(name='Amplitude', default=0.01, min=0, max=10, precision=4, unit='LENGTH')#
period: FloatProperty(name='Period', default=0.5, min=0.001, max=100, precision=4, unit='LENGTH')#
beat_period: FloatProperty(name='Beat Period Offset', default=0.0, min=0.0, max=100, precision=4, unit='LENGTH')#
shift: FloatProperty(name='Phase Shift', default=0, min=-360, max=360, precision=4, step=100, unit='ROTATION')#
offset: FloatProperty(name='Offset', default=0, min=-1.0, max=1, precision=4, unit='LENGTH')#
iteration: IntProperty(name='Iteration', default=100, min=50, max=2000)#
max_t: FloatProperty(name='Wave Ends at X', default=0.5, min=-3.0, max=3, precision=4, unit='LENGTH')#
min_t: FloatProperty(name='Wave Starts at X', default=0, min=-3.0, max=3, precision=4, unit='LENGTH')#
wave_distance: FloatProperty(name='Distance Between Multiple Waves', default=0.0, min=0.0, max=100, precision=4, unit='LENGTH')#
wave_angle_offset: FloatProperty(name='Angle Offset for Multiple Waves', default=pi / 2, min=-200 * pi, max=200 * pi, precision=4, step=100, unit='ROTATION')#
wave_amount: IntProperty(name='Amount of Multiple Waves', default=1, min=1, max=2000)#
execute(context)[source]#
class CamCurveBoolean[source]#

Bases: bpy.types.Operator

Perform Boolean Operation on Two or More Curves

bl_idname = 'object.curve_boolean'#
bl_label = 'Curve Boolean'#
bl_options#
boolean_type: EnumProperty(name='Type', items='UNION', 'Union', '', 'DIFFERENCE', 'Difference', '', 'INTERSECT', 'Intersect', '', description='Boolean type', default='UNION')#
classmethod poll(context)[source]#
execute(context)[source]#
invoke(context, event)[source]#
class CamCurveConvexHull[source]#

Bases: bpy.types.Operator

Perform Hull Operation on Single or Multiple Curves

bl_idname = 'object.convex_hull'#
bl_label = 'Convex Hull'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#
class CamCurveIntarsion[source]#

Bases: bpy.types.Operator

Makes Curve Cuttable Both Inside and Outside, for Intarsion and Joints

bl_idname = 'object.curve_intarsion'#
bl_label = 'Intarsion'#
bl_options#
diameter: FloatProperty(name='Cutter Diameter', default=0.001, min=0, max=0.025, precision=4, unit='LENGTH')#
tolerance: FloatProperty(name='Cutout Tolerance', default=0.0001, min=0, max=0.005, precision=4, unit='LENGTH')#
backlight: FloatProperty(name='Backlight Seat', default=0.0, min=0, max=0.01, precision=4, unit='LENGTH')#
perimeter_cut: FloatProperty(name='Perimeter Cut Offset', default=0.0, min=0, max=0.1, precision=4, unit='LENGTH')#
base_thickness: FloatProperty(name='Base Material Thickness', default=0.0, min=0, max=0.1, precision=4, unit='LENGTH')#
intarsion_thickness: FloatProperty(name='Intarsion Material Thickness', default=0.0, min=0, max=0.1, precision=4, unit='LENGTH')#
backlight_depth_from_top: FloatProperty(name='Backlight Well Depth', default=0.0, min=0, max=0.1, precision=4, unit='LENGTH')#
classmethod poll(context)[source]#
execute(context)[source]#
invoke(context, event)[source]#
class CamCurveSimpleOvercuts[source]#

Bases: bpy.types.Operator

Adds Overcuts for Slots

bl_idname = 'object.curve_overcuts'#
bl_label = 'Simple Fillet Overcuts'#
bl_options#
diameter: FloatProperty(name='Diameter', default=0.003175, min=0, max=100, precision=4, unit='LENGTH')#
threshold: FloatProperty(name='Threshold', default=pi / 2 * 0.99, min=-3.14, max=3.14, precision=4, step=500, subtype='ANGLE', unit='ROTATION')#
do_outer: BoolProperty(name='Outer Polygons', default=True)#
invert: BoolProperty(name='Invert', default=False)#
classmethod poll(context)[source]#
execute(context)[source]#
invoke(context, event)[source]#
class CamCurveBoneFilletOvercuts[source]#

Bases: bpy.types.Operator

Adds Overcuts for Slots

bl_idname = 'object.curve_overcuts_b'#
bl_label = 'Bone Fillet Overcuts'#
bl_options#
diameter: FloatProperty(name='Tool Diameter', default=0.003175, description='Tool bit diameter used in cut operation', min=0, max=100, precision=4, unit='LENGTH')#
style: EnumProperty(name='Style', items='OPEDGE', 'opposite edge', 'place corner overcuts on opposite edges', 'DOGBONE', 'Dog-bone / Corner Point', 'place overcuts at center of corners', 'TBONE', 'T-bone', 'place corner overcuts on the same edge', default='DOGBONE', description='style of overcut to use')#
threshold: FloatProperty(name='Max Inside Angle', default=pi / 2, min=-3.14, max=3.14, description='The maximum angle to be considered as an inside corner', precision=4, step=500, subtype='ANGLE', unit='ROTATION')#
do_outer: BoolProperty(name='Include Outer Curve', description='Include the outer curve if there are curves inside', default=True)#
do_invert: BoolProperty(name='Invert', description='invert overcut operation on all curves', default=True)#
other_edge: BoolProperty(name='Other Edge', description='change to the other edge for the overcut to be on', default=False)#
classmethod poll(context)[source]#
execute(context)[source]#
invoke(context, event)[source]#
class CamCurveRemoveDoubles[source]#

Bases: bpy.types.Operator

Curve Remove Doubles

bl_idname = 'object.curve_remove_doubles'#
bl_label = 'Remove Curve Doubles'#
bl_options#
merge_distance: FloatProperty(name='Merge distance', default=0.0001, min=0, max=0.01)#
keep_bezier: BoolProperty(name='Keep bezier', default=False)#
classmethod poll(context)[source]#
execute(context)[source]#
draw(context)[source]#
invoke(context, event)[source]#
class CamMeshGetPockets[source]#

Bases: bpy.types.Operator

Detect Pockets in a Mesh and Extract Them as Curves

bl_idname = 'object.mesh_get_pockets'#
bl_label = 'Get Pocket Surfaces'#
bl_options#
threshold: FloatProperty(name='Horizontal Threshold', description='How horizontal the surface must be for a pocket: 1.0 perfectly flat, 0.0 is any orientation', default=0.99, min=0, max=1.0, precision=4)#
z_limit: FloatProperty(name='Z Limit', description='Maximum z height considered for pocket operation, default is 0.0', default=0.0, min=-1000.0, max=1000.0, precision=4, unit='LENGTH')#
classmethod poll(context)[source]#
execute(context)[source]#
class CamObjectSilhouette[source]#

Bases: bpy.types.Operator

Object Silhouette

bl_idname = 'object.silhouette'#
bl_label = 'Object Silhouette'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#
class CamOffsetSilhouete[source]#

Bases: bpy.types.Operator

Curve Offset Operation

bl_idname = 'object.silhouette_offset'#
bl_label = 'Silhouette & Offset'#
bl_options#
offset: FloatProperty(name='Offset', default=0.003, min=-100, max=100, precision=4, unit='LENGTH')#
mitre_limit: FloatProperty(name='Mitre Limit', default=2, min=1e-08, max=20, precision=4, unit='LENGTH')#
style: EnumProperty(name='Corner Type', items='1', 'Round', '', '2', 'Mitre', '', '3', 'Bevel', '')#
caps: EnumProperty(name='Cap Type', items='round', 'Round', '', 'square', 'Square', '', 'flat', 'Flat', '')#
align: EnumProperty(name='Alignment', items='worldxy', 'World XY', '', 'bottom', 'Base Bottom', '', 'top', 'Base Top', '')#
open_type: EnumProperty(name='Curve Type', items='dilate', 'Dilate open curve', '', 'leaveopen', 'Leave curve open', '', 'closecurve', 'Close curve', '', default='closecurve')#
classmethod poll(context)[source]#
is_straight(geom)[source]#
execute(context)[source]#
draw(context)[source]#
invoke(context, event)[source]#
class WM_OT_gcode_import[source]#

Bases: bpy.types.Operator, bpy_extras.io_utils.ImportHelper

Import G-code, Travel Lines Don’t Get Drawn

bl_idname = 'wm.gcode_import'#
bl_label = 'Import G-code'#
filename_ext = '.txt'#
filter_glob: StringProperty(default='*.*', options={'HIDDEN'}, maxlen=255)#
split_layers: BoolProperty(name='Split Layers', description='Save every layer as single Objects in Collection', default=False)#
subdivide: BoolProperty(name='Subdivide', description="Only Subdivide gcode segments that are bigger than 'Segment length' ", default=False)#
output: EnumProperty(name='Output Type', items='mesh', 'Mesh', 'Make a mesh output', 'curve', 'Curve', 'Make curve output', default='curve')#
max_segment_size: FloatProperty(name='', description='Only Segments bigger than this value get subdivided', default=0.001, min=0.0001, max=1.0, unit='LENGTH')#
execute(context)[source]#
class CamOperationAdd[source]#

Bases: bpy.types.Operator

Add New CAM Operation

bl_idname = 'scene.cam_operation_add'#
bl_label = 'Add New CAM Operation'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the camera operation based on the active object in the scene.

This method retrieves the active object from the Blender context and performs operations related to camera settings. It checks if an object is selected and retrieves its bounding box dimensions. If no object is found, it reports an error and cancels the operation. If an object is present, it adds a new camera operation to the scene, sets its properties, and ensures that a machine area object is present.

Parameters:

context – The context in which the operation is executed.

class CamOperationCopy[source]#

Bases: bpy.types.Operator

Copy CAM Operation

bl_idname = 'scene.cam_operation_copy'#
bl_label = 'Copy Active CAM Operation'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the camera operation in the given context.

This method handles the execution of camera operations within the Blender scene. It first checks if there are any camera operations available. If not, it returns a cancellation status. If there are operations, it copies the active operation, increments the active operation index, and updates the name and filename of the new operation. The function also ensures that the new operation’s name is unique by appending a copy suffix or incrementing a numeric suffix.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the status of the operation,

either {‘CANCELLED’} if no operations are available or {‘FINISHED’} if the operation was successfully executed.

Return type:

dict

class CamOperationMove[source]#

Bases: bpy.types.Operator

Move CAM Operation

bl_idname = 'scene.cam_operation_move'#
bl_label = 'Move CAM Operation in List'#
bl_options#
direction: EnumProperty(name='Direction', items='UP', 'Up', '', 'DOWN', 'Down', '', description='Direction', default='DOWN')#
classmethod poll(context)[source]#
execute(context)[source]#

Execute a camera operation based on the specified direction.

This method modifies the active camera operation in the Blender context based on the direction specified. If the direction is ‘UP’, it moves the active operation up in the list, provided it is not already at the top. Conversely, if the direction is not ‘UP’, it moves the active operation down in the list, as long as it is not at the bottom. The method updates the active operation index accordingly.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the operation has finished, with the key ‘FINISHED’.

Return type:

dict

class CamOperationRemove[source]#

Bases: bpy.types.Operator

Remove CAM Operation

bl_idname = 'scene.cam_operation_remove'#
bl_label = 'Remove CAM Operation'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the camera operation in the given context.

This function performs the active camera operation by deleting the associated object from the scene. It checks if there are any camera operations available and handles the deletion of the active operation’s object. If the active operation is removed, it updates the active operation index accordingly. Additionally, it manages a dictionary that tracks hidden objects.

Parameters:

context (bpy.context) – The Blender context containing the scene and operations.

Returns:

A dictionary indicating the result of the operation, either

{‘CANCELLED’} if no operations are available or {‘FINISHED’} if the operation was successfully executed.

Return type:

dict

class CamOrientationAdd[source]#

Bases: bpy.types.Operator

Add Orientation to CAM Operation, for Multiaxis Operations

bl_idname = 'scene.cam_orientation_add'#
bl_label = 'Add Orientation'#
bl_options#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the camera orientation operation in Blender.

This function retrieves the active camera operation from the current scene, creates an empty object to represent the camera orientation, and adds it to a specified group. The empty object is named based on the operation’s name and the current count of objects in the group. The size of the empty object is set to a predefined value for visibility.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the operation’s completion status,

typically {‘FINISHED’}.

Return type:

dict

class CamPackObjects[source]#

Bases: bpy.types.Operator

Calculate All CAM Paths

bl_idname = 'object.cam_pack_objects'#
bl_label = 'Pack Curves on Sheet'#
bl_options#
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=PRECISION, unit='LENGTH')#
sheet_y: FloatProperty(name='Y Size', description='Sheet size', min=0.001, max=10, default=0.5, precision=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=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=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, step=500, subtype='ANGLE', unit='ROTATION')#
invoke(context, event)[source]#
execute(context)[source]#

Execute the operation in the given context.

This function sets the Blender object mode to ‘OBJECT’, retrieves the currently selected objects, and calls the pack_curves function from the pack module. It is typically used to finalize operations on selected objects in Blender.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the completion status of the operation.

Return type:

dict

draw(context)[source]#
class PathExport[source]#

Bases: bpy.types.Operator

Export G-code. Can Be Used only when the Path Object Is Present

bl_idname = 'object.cam_export'#
bl_label = 'Export Operation G-code'#
bl_options#
execute(context)[source]#

Execute the camera operation and export the G-code path.

This method retrieves the active camera operation from the current scene and exports the corresponding G-code path to a specified filename. It prints the filename and relevant operation details to the console for debugging purposes. The G-code path is generated based on the camera path data associated with the active operation.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the completion status of the operation,

typically {‘FINISHED’}.

Return type:

dict

class PathExportChain[source]#

Bases: bpy.types.Operator

Calculate a Chain and Export the G-code Together.

bl_idname = 'object.cam_export_paths_chain'#
bl_label = 'Export CAM Paths in Current Chain as G-code'#
bl_options#
classmethod poll(context)[source]#

Check the validity of the active camera chain in the given context.

This method retrieves the currently active camera chain from the scene context and checks its validity using the isChainValid function. It returns a boolean indicating whether the active camera chain is valid or not.

Parameters:

context (object) – The context containing the scene and camera chain information.

Returns:

True if the active camera chain is valid, False otherwise.

Return type:

bool

execute(context)[source]#

Execute the camera path export process.

This function retrieves the active camera chain from the current scene and gathers the mesh data associated with the operations of that chain. It then exports the G-code path using the specified filename and the collected mesh data. The function is designed to be called within the context of a Blender operator.

Parameters:

context (bpy.context) – The context in which the operator is executed.

Returns:

A dictionary indicating the completion status of the operation,

typically {‘FINISHED’}.

Return type:

dict

class PathsAll[source]#

Bases: bpy.types.Operator

Calculate All CAM Paths

bl_idname = 'object.calculate_cam_paths_all'#
bl_label = 'Calculate All CAM Paths'#
bl_options#
execute(context)[source]#

Execute camera operations in the current Blender context.

This function iterates through the camera operations defined in the current scene and executes the background calculation for each operation. It sets the active camera operation index and prints the name of each operation being processed. This is typically used in a Blender add-on or script to automate camera path calculations.

Parameters:

context (bpy.context) – The current Blender context.

Returns:

A dictionary indicating the completion status of the operation,

typically {‘FINISHED’}.

Return type:

dict

draw(context)[source]#

Draws the user interface elements for the operation selection.

This method utilizes the Blender layout system to create a property search interface for selecting operations related to camera functionalities. It links the current instance’s operation property to the available camera operations defined in the Blender scene.

Parameters:

context (bpy.context) – The context in which the drawing occurs,

class PathsBackground[source]#

Bases: bpy.types.Operator

Calculate CAM Paths in Background. File Has to Be Saved Before.

bl_idname = 'object.calculate_cam_paths_background'#
bl_label = 'Calculate CAM Paths in Background'#
bl_options#
execute(context)[source]#

Execute the camera operation in the background.

This method initiates a background process to perform camera operations based on the current scene and active camera operation. It sets up the necessary paths for the script and starts a subprocess to handle the camera computations. Additionally, it manages threading to ensure that the main thread remains responsive while the background operation is executed.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the completion status of the operation.

Return type:

dict

class PathsChain[source]#

Bases: bpy.types.Operator, cam.operators.async_op.AsyncOperatorMixin

Calculate a Chain and Export the G-code Alltogether.

bl_idname = 'object.calculate_cam_paths_chain'#
bl_label = 'Calculate CAM Paths in Current Chain and Export Chain G-code'#
bl_options#
classmethod poll(context)[source]#

Check the validity of the active camera chain in the given context.

This method retrieves the active camera chain from the scene and checks its validity using the isChainValid function. It returns a boolean value indicating whether the camera chain is valid or not.

Parameters:

context (Context) – The context containing the scene and camera chain information.

Returns:

True if the active camera chain is valid, False otherwise.

Return type:

bool

async execute_async(context)[source]#

Execute asynchronous operations for camera path calculations.

This method sets the object mode for the Blender scene and processes a series of camera operations defined in the active camera chain. It reports the progress of each operation and handles any exceptions that may occur during the path calculation. After successful calculations, it exports the resulting mesh data to a specified G-code file.

Parameters:

context (bpy.context) – The Blender context containing scene and

Returns:

A dictionary indicating the result of the operation, typically {‘FINISHED’}.

Return type:

dict

class KillPathsBackground[source]#

Bases: bpy.types.Operator

Remove CAM Path Processes in Background.

bl_idname = 'object.kill_calculate_cam_paths_background'#
bl_label = 'Kill Background Computation of an Operation'#
bl_options#
execute(context)[source]#

Execute the camera operation in the given context.

This method retrieves the active camera operation from the scene and checks if there are any ongoing processes related to camera path calculations. If such processes exist and match the current operation, they are terminated. The method then marks the operation as not computing and returns a status indicating that the execution has finished.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary with a status key indicating the result of the execution.

Return type:

dict

class CalculatePath[source]#

Bases: bpy.types.Operator, cam.operators.async_op.AsyncOperatorMixin

Calculate CAM Paths

bl_idname = 'object.calculate_cam_path'#
bl_label = 'Calculate CAM Paths'#
bl_options#
classmethod poll(context)[source]#

Check if the current camera operation is valid.

This method checks the active camera operation in the given context and determines if it is valid. It retrieves the active operation from the scene’s camera operations and validates it using the isValid function. If the operation is valid, it returns True; otherwise, it returns False.

Parameters:

context (Context) – The context containing the scene and camera operations.

Returns:

True if the active camera operation is valid, False otherwise.

Return type:

bool

async execute_async(context)[source]#

Execute an asynchronous calculation of a path.

This method performs an asynchronous operation to calculate a path based on the provided context. It awaits the result of the calculation and prints the success status along with the return value. The return value can be used for further processing or analysis.

Parameters:

context (Any) – The context in which the path calculation is to be executed.

Returns:

The result of the path calculation.

Return type:

Any

class CAM_MATERIAL_PositionObject[source]#

Bases: bpy.types.Operator

bl_idname = 'object.material_cam_position'#
bl_label = 'Position Object for CAM Operation'#
bl_options#
execute(context)[source]#
draw(context)[source]#
class AddPresetCamCutter[source]#

Bases: bl_operators.presets.AddPresetBase, bpy.types.Operator

Add a Cutter Preset

bl_idname = 'render.cam_preset_cutter_add'#
bl_label = 'Add Cutter Preset'#
preset_menu = 'CAM_CUTTER_MT_presets'#
preset_defines = ['d = bpy.context.scene.cam_operations[bpy.context.scene.cam_active_operation]']#
preset_values = ['d.cutter_id', 'd.cutter_type', 'd.cutter_diameter', 'd.cutter_length', 'd.cutter_flutes',...#
preset_subdir = 'cam_cutters'#
class AddPresetCamMachine[source]#

Bases: bl_operators.presets.AddPresetBase, bpy.types.Operator

Add a Cam Machine Preset

bl_idname = 'render.cam_preset_machine_add'#
bl_label = 'Add Machine Preset'#
preset_menu = 'CAM_MACHINE_MT_presets'#
preset_defines = ['d = bpy.context.scene.cam_machine', 's = bpy.context.scene.unit_settings']#
preset_values = ['d.post_processor', 's.system', 's.length_unit', 'd.use_position_definitions',...#
preset_subdir = 'cam_machines'#
class AddPresetCamOperation[source]#

Bases: bl_operators.presets.AddPresetBase, bpy.types.Operator

Add an Operation Preset

bl_idname = 'render.cam_preset_operation_add'#
bl_label = 'Add Operation Preset'#
preset_menu = 'CAM_OPERATION_MT_presets'#
preset_defines = ['from pathlib import Path', 'bpy.ops.scene.cam_operation_add()', 'scene = bpy.context.scene',...#
preset_values = ['o.info.duration', 'o.info.chipload', 'o.info.warnings', 'o.material.estimate_from_model',...#
preset_subdir = 'cam_operations'#
class CAMSimulate[source]#

Bases: bpy.types.Operator, cam.operators.async_op.AsyncOperatorMixin

Simulate CAM Operation This Is Performed by: Creating an Image, Painting Z Depth of the Brush Subtractively. Works only for Some Operations, Can Not Be Used for 4-5 Axis.

bl_idname = 'object.cam_simulate'#
bl_label = 'CAM Simulation'#
bl_options#
operation: StringProperty(name='Operation', description='Specify the operation to calculate', default='Operation')#
async execute_async(context)[source]#

Execute an asynchronous simulation operation based on the active camera operation.

This method retrieves the current scene and the active camera operation. It constructs the operation name and checks if the corresponding object exists in the Blender data. If it does, it attempts to run the simulation asynchronously. If the simulation is cancelled, it returns a cancellation status. If the object does not exist, it reports an error and returns a finished status.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the status of the operation, either

{‘CANCELLED’} or {‘FINISHED’}.

Return type:

dict

draw(context)[source]#

Draws the user interface for selecting camera operations.

This method creates a layout element in the user interface that allows users to search and select a specific camera operation from a list of available operations defined in the current scene. It utilizes the Blender Python API to integrate with the UI.

Parameters:

context – The context in which the drawing occurs, typically provided by Blender’s UI system.

class CAMSimulateChain[source]#

Bases: bpy.types.Operator, cam.operators.async_op.AsyncOperatorMixin

Simulate CAM Chain, Compared to Single Op Simulation Just Writes Into One Image and Thus Enables to See how Ops Work Together.

bl_idname = 'object.cam_simulate_chain'#
bl_label = 'CAM Simulation'#
bl_options#
classmethod poll(context)[source]#

Check the validity of the active camera chain in the scene.

This method retrieves the currently active camera chain from the scene’s camera chains and checks its validity using the isChainValid function. It returns a boolean indicating whether the active camera chain is valid.

Parameters:

context (object) – The context containing the scene and its properties.

Returns:

True if the active camera chain is valid, False otherwise.

Return type:

bool

operation: StringProperty(name='Operation', description='Specify the operation to calculate', default='Operation')#
async execute_async(context)[source]#

Execute an asynchronous simulation for a specified camera chain.

This method retrieves the active camera chain from the current Blender scene and determines the operations associated with that chain. It checks if all operations are valid and can be simulated. If valid, it proceeds to execute the simulation asynchronously. If any operation is invalid, it logs a message and returns a finished status without performing the

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the status of the operation, either operation completed successfully.

Return type:

dict

draw(context)[source]#

Draw the user interface for selecting camera operations.

This function creates a user interface element that allows the user to search and select a specific camera operation from a list of available operations in the current scene. It utilizes the Blender Python API to create a property search layout.

Parameters:

context – The context in which the drawing occurs, typically containing information about the current scene and UI elements.

class CamSliceObjects[source]#

Bases: bpy.types.Operator

Slice a Mesh Object Horizontally

bl_idname = 'object.cam_slice_objects'#
bl_label = 'Slice Object - Useful for Lasercut Puzzles etc'#
bl_options#
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=PRECISION, unit='LENGTH')#
slice_above_0: 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)#
invoke(context, event)[source]#
execute(context)[source]#

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.

Parameters:

ob (bpy.types.Object) – The 3D object to be sliced.

draw(context)[source]#
classes[source]#
register()[source]#
unregister()[source]#