Copyright © 2021 by K4.org
  (v.0.48.124)

Frame is a pure geometry object. It is used for geometric computations within rules. It is based on the three.js Matrix4 object.

Hierarchy

Implements

  • IKnown

Index

Constructors

constructor

  • new Frame(_matrix: Matrix4): Frame
  • Parameters

    • _matrix: Matrix4

    Returns Frame

Methods

describe

  • describe(): string
  • Returns a string of the form 'f<tx, ty, tz ...>' where tx, ty, and tz are the translation components of the transform matrix. The ellipsis are part of the output; only the 3 values are shown. Note that this is for display only. If all the values are needed, use mat43().

    Returns string

drag

  • Produces a frame that is this dragged by transV

    Parameters

    Returns Frame

equals

  • equals(f: Frame): boolean
  • Runs the three.js Matrix4.equals routine.

    Parameters

    • f: Frame

      Frame to compare to this

    Returns boolean

generatePattern

  • generatePattern(pattern: string, count: number, spacing: any, includeSource: boolean): Frame[]
  • Generates a set of Frames according to a desired pattern. The Frames are defined relative to this one.

    Parameters

    • pattern: string

      One of Linear, Rectangular, Cubic, Circular, Cylindrical

    • count: number

      The number of frames to generate in each direction. Can be overridden by the count parameter in spacing POJO.

    • spacing: any

      A POJO containing values required by the particular pattern.

    • includeSource: boolean

      If true then the first item will be included in the pattern as a copy of the source. Default is false.

    Returns Frame[]

get3

  • get3(): Matrix4
  • Returns the three.js implementation object

    Returns Matrix4

getEuler

  • getEuler(): any
  • Returns the 3 Euler angles for this transform as an object.

    Returns any

getInverse

  • Returns the inverse of this transform.

    Returns Frame

loadFromElements

  • loadFromElements(elements: number[]): Frame
  • Creates a new Frame by loading from an array of numbers. This is designed for use with the three.js Matrix4 elements property. Note: K4 only uses a 4x3 matrix.

    Parameters

    • elements: number[]

      An array of 16 elements in three.js ordering.

    Returns Frame

m43

  • m43(): number[]
  • Returns the matrix as an array. The order is the transpose of that used by three.js.

    Returns number[]

mat43

  • mat43(): string
  • Returns a string of comma-separated high-fidelity values. The array order is designed for direct-spread supply into Matrix4.set()

    Returns string

multiply

  • Multiplies (composes) this by f, returning a new Frame.

    Parameters

    • f: Frame

      The Frame to compose with this

    Returns Frame

rotate

  • Rotates this about an arbitrary axis in space

    Parameters

    • angle: number

      Angle of rotation in degrees

    • axis: Vector

      Vector defining rotation axis

    • basePoint: Point

      Point on axis

    Returns Frame

same

  • same(frame: Frame): boolean
  • Returns true if the frames produce the same point within the length tolerance

    Parameters

    • frame: Frame

      The Frame to match

    Returns boolean

scale

  • scale(sx: number, sy: number, sz: number): Frame
  • Scales this non-uniformly

    Parameters

    • sx: number

      X-scale

    • sy: number

      Y-scale

    • sz: number

      Z-scale

    Returns Frame

translate

  • translate(tx: number, ty: number, tz: number): Frame
  • Translates this frame along v<tx, ty, tz>

    Parameters

    • tx: number

      X-translation

    • ty: number

      Y-translation

    • tz: number

      Z-translation

    Returns Frame