cam.utilities.geom_utils#

Fabex ‘geom_utils.py’ © 2012 Vilem Novak

Main functionality of Fabex. The functions here are called with operators defined in ‘ops.py’

Classes#

Functions#

circle(r, np)

Generate a circle defined by a given radius and number of points.

helix(r, np, zstart, pend, rev)

Generate a helix of points in 3D space.

get_container()

Get or create a container object for camera objects.

triangle(i, T, A)

s_sine(A, T[, dc_offset, phase_shift])

Module Contents#

circle(r, np)[source]#

Generate a circle defined by a given radius and number of points.

This function creates a polygon representing a circle by generating a list of points based on the specified radius and the number of points (np). It uses vector rotation to calculate the coordinates of each point around the circle. The resulting points are then used to create a polygon object.

Parameters:
  • r (float) – The radius of the circle.

  • np (int) – The number of points to generate around the circle.

Returns:

A polygon object representing the circle.

Return type:

spolygon.Polygon

helix(r, np, zstart, pend, rev)[source]#

Generate a helix of points in 3D space.

This function calculates a series of points that form a helix based on the specified parameters. It starts from a given radius and z-coordinate, and generates points by rotating around the z-axis while moving linearly along the z-axis. The number of points generated is determined by the number of turns (revolutions) and the number of points per revolution.

Parameters:
  • r (float) – The radius of the helix.

  • np (int) – The number of points per revolution.

  • zstart (float) – The starting z-coordinate for the helix.

  • pend (tuple) – A tuple containing the x, y, and z coordinates of the endpoint.

  • rev (int) – The number of revolutions to complete.

Returns:

A list of tuples representing the coordinates of the points in the

helix.

Return type:

list

get_container()[source]#

Get or create a container object for camera objects.

This function checks if a container object named ‘CAM_OBJECTS’ exists in the current Blender scene. If it does not exist, the function creates a new empty object of type ‘PLAIN_AXES’, names it ‘CAM_OBJECTS’, and sets its location to the origin (0, 0, 0). The newly created container is also hidden. If the container already exists, it simply retrieves and returns that object.

Returns:

The container object for camera objects, either newly created or

existing.

Return type:

bpy.types.Object

class Point(x, y, z)[source]#
triangle(i, T, A)[source]#
s_sine(A, T, dc_offset=0, phase_shift=0)[source]#