cam.pattern#

BlenderCAM ‘pattern.py’ © 2012 Vilem Novak

Functions to read CAM path patterns and return CAM path chunks.

Functions#

getPathPatternParallel(o, angle)

Generate path chunks for parallel movement based on object dimensions

getPathPattern(operation)

Generate a path pattern based on the specified operation strategy.

getPathPattern4axis(operation)

Generate path patterns for a specified operation along a rotary axis.

Module Contents#

getPathPatternParallel(o, angle)[source]#

Generate path chunks for parallel movement based on object dimensions and angle.

This function calculates a series of path chunks for a given object, taking into account its dimensions and the specified angle. It utilizes both a traditional method and an alternative algorithm (currently disabled) to generate these paths. The paths are constructed by iterating over calculated vectors and applying transformations based on the object’s properties. The resulting path chunks can be used for various movement types, including conventional and climb movements.

Parameters:
  • o (object) – An object containing properties such as dimensions and movement type.

  • angle (float) – The angle to rotate the path generation.

Returns:

A list of path chunks generated based on the object’s dimensions and

angle.

Return type:

list

getPathPattern(operation)[source]#

Generate a path pattern based on the specified operation strategy.

This function constructs a path pattern for a given operation by analyzing its parameters and applying different strategies such as ‘PARALLEL’, ‘CROSS’, ‘BLOCK’, ‘SPIRAL’, ‘CIRCLES’, and ‘OUTLINEFILL’. Each strategy dictates how the path is built, utilizing various geometric calculations and conditions to ensure the path adheres to the specified operational constraints. The function also handles the orientation and direction of the path based on the movement settings provided in the operation.

Parameters:

operation (object) – An object containing parameters for path generation, including strategy, movement type, and geometric bounds.

Returns:

A list of path chunks representing the generated path pattern.

Return type:

list

getPathPattern4axis(operation)[source]#

Generate path patterns for a specified operation along a rotary axis.

This function constructs a series of path chunks based on the provided operation’s parameters, including the rotary axis, strategy, and dimensions. It calculates the necessary angles and positions for the cutter based on the specified strategy (PARALLELR, PARALLEL, or HELIX) and generates the corresponding path chunks for machining operations.

Parameters:

operation (object) – An object containing parameters for the machining operation, including min and max coordinates, rotary axis configuration, distance settings, and movement strategy.

Returns:

A list of path chunks generated for the specified operation.

Return type:

list