pohlke.utils.helpers#

Contains all usefull functions for the add-on.

Classes#

GraphicalScale

Static class to produce the graphical scale figure.

Functions#

camera_attributes_updated(→ None)

Calculate the new camera parameters when an angle (alpha or beta) changes.

camera_type_updated(→ None)

Calculate the new camera parameters when the camera type changes.

Module Contents#

pohlke.utils.helpers.camera_attributes_updated(props: bpy.types.PropertyGroup | bpy.types.Operator, updated_angle: str) None[source]#

Calculate the new camera parameters when an angle (alpha or beta) changes.

Parameters:
propsUnion[bpy.types.PropertyGroup, bpy.types.Operator]

The Blender object containing the camera projection parameters

updated_anglestr

The changed angle (“beta” or “alpha”)

pohlke.utils.helpers.camera_type_updated(props: bpy.types.PropertyGroup | bpy.types.Operator) None[source]#

Calculate the new camera parameters when the camera type changes.

Parameters:
propsUnion[bpy.types.PropertyGroup, bpy.types.Operator]

The Blender object containing the camera projection parameters

class pohlke.utils.helpers.GraphicalScale[source]#

Static class to produce the graphical scale figure.

It is common to display a graphical scale on drawings in order to display the properties of the chosen axonometric or oblique projection.

classmethod populate_props(alpha: float, beta: float, shortening: float | None = None) None[source]#

Populate internal attributes with the necessary info for the figure.

Parameters:
alphafloat

Angle in radians.

betafloat

Angle in radians.

shortening{None, float}, optional

Oblique scale factor for z.

classmethod log_figure(position: Literal['ABOVE', 'BELOW'] = 'ABOVE') str[source]#

Compose the graphical scale figure.

Produces a formatted string in ASCII style showing the projeciton parameters as an “axonometric scale indicator” (used on architectural drawings).

Parameters:
position{“ABOVE”, “BELOW”}, optional

Camera position, which flips the figure upside down.

Returns:
str

Multiline string of the scale figure.

Notes

The function evaluates the alpha and beta angles in order to determine the type of axonometry. The numbers are rounded and the result is an approximation.

Examples

>>>
DIMETRIC*
-----------------
     131.40°
1.00 \     / 0.50
      \   /
       \ /
        o
097.20° | 131.40°
        |
        |
       1.00
-----------------
*approximation .5