Smith.Assembly.Frame (Smith v0.1.0)

Copy Markdown View Source

Rigid-frame arithmetic used by assembly placement and joint evaluation.

This implementation module uses the same right-handed frame maps as Smith.Plane: an origin and unit u, v, and n axes. Geometry stays in OCEx; these functions only compose coordinates and produce rotation/translation options. Use Smith.Assembly and Smith.Plane to define a public model.

Summary

Functions

Composes frames, applying the second frame before the first.

Returns the identity frame at world zero.

Returns the inverse of a normalized rigid frame.

Converts a rigid frame to OCEx-compatible rotation-then-translation options.

Builds a frame from validated assembly rotation and position options.

Types

t()

@type t() :: %{origin: vector(), u: vector(), v: vector(), n: vector()}

vector()

@type vector() :: {number(), number(), number()}

Functions

compose(a, b)

@spec compose(t(), t()) :: t()

Composes frames, applying the second frame before the first.

identity()

@spec identity() :: t()

Returns the identity frame at world zero.

inverse(f)

@spec inverse(t()) :: t()

Returns the inverse of a normalized rigid frame.

options(f)

@spec options(t()) :: keyword()

Converts a rigid frame to OCEx-compatible rotation-then-translation options.

placement(opts)

@spec placement(keyword()) :: t()

Builds a frame from validated assembly rotation and position options.