cam.utilities.orient_utils#

Fabex ‘orient_utils.py’ © 2012 Vilem Novak

Functions#

add_orientation_object(o)

Set up orientation for a milling object.

remove_orientation_object(o)

Remove an orientation object from the current Blender scene.

rotation_to_2_axes(e, axescombination)

Converts an Orientation Object Rotation to Rotation Defined by 2

Module Contents#

add_orientation_object(o)[source]#

Set up orientation for a milling object.

This function creates an orientation object in the Blender scene for 4-axis and 5-axis milling operations. It checks if an orientation object with the specified name already exists, and if not, it adds a new empty object of type ‘ARROWS’. The function then configures the rotation locks and initial rotation angles based on the specified machine axes and rotary axis.

Parameters:

o (object) – An object containing properties such as name,

remove_orientation_object(o)[source]#

Remove an orientation object from the current Blender scene.

This function constructs the name of the orientation object based on the name of the provided object and attempts to find and delete it from the Blender scene. If the orientation object exists, it will be removed using the delob function.

Parameters:

o (Object) – The object whose orientation object is to be removed.

rotation_to_2_axes(e, axescombination)[source]#

Converts an Orientation Object Rotation to Rotation Defined by 2 Rotational Axes on the Machine.

This function takes an orientation object and a specified axes combination, and computes the angles of rotation around two axes based on the provided orientation. It supports different axes combinations for indexed machining. The function utilizes vector mathematics to determine the angles of rotation and returns them as a tuple.

Parameters:
  • e (OrientationObject) – The orientation object representing the rotation.

  • axescombination (str) – A string indicating the axes combination (‘CA’ or ‘CB’).

Returns:

A tuple containing two angles (float) representing the rotation around the specified axes.

Return type:

tuple