Maker.js, a Microsoft Garage project, is a JavaScript library for creating and sharing modular line drawings for CNC and laser cutters.

View project on GitHub Star

Api - ICascadePoint Interface

Hierarchy

Index

Properties

$initial

$initial: any

The initial context object of the cascade.

$reset

$reset: function

Use the $original as the $result.

Type declaration

    • (): this
    • Returns this

$result

$result: any

The current final value of the cascade.

Methods

add

  • Add two points together and return the result as a new point object.

    Parameters

    • b: IPoint

      Second point.

    • Optional subtract: boolean

      Optional boolean to subtract instead of add.

    Returns ICascadePoint

    this cascade container, this.$result will be A new point object.

average

  • Get the average of two points.

    Parameters

    Returns ICascadePoint

    this cascade container, this.$result will be New point object which is the average of a and b.

clone

  • Clone a point into a new point.

    Returns ICascadePoint

    this cascade container, this.$result will be A new point with same values as the original.

closest

  • From an array of points, find the closest point to a given reference point.

    Parameters

    • pointOptions: IPoint[]

      Array of points to choose from.

    Returns ICascadePoint

    this cascade container, this.$result will be The first closest point from the pointOptions.

distort

  • Distort a point's coordinates.

    Parameters

    • scaleX: number

      The amount of x scaling.

    • scaleY: number

      The amount of y scaling.

    Returns ICascadePoint

    this cascade container, this.$result will be A new point.

mirror

  • Create a clone of a point, mirrored on either or both x and y axes.

    Parameters

    • mirrorX: boolean

      Boolean to mirror on the x axis.

    • mirrorY: boolean

      Boolean to mirror on the y axis.

    Returns ICascadePoint

    this cascade container, this.$result will be Mirrored point.

rotate

  • Rotate a point.

    Parameters

    • angleInDegrees: number

      The amount of rotation, in degrees.

    • Optional rotationOrigin: IPoint

      (default [0, 0]) The center point of rotation.

    Returns ICascadePoint

    this cascade container, this.$result will be A new point.

rounded

  • Round the values of a point.

    Parameters

    • Optional accuracy: number

      Optional exemplar number of decimal places.

    Returns ICascadePoint

    this cascade container, this.$result will be A new point with the values rounded.

scale

  • Scale a point's coordinates.

    Parameters

    • scaleValue: number

      The amount of scaling.

    Returns ICascadePoint

    this cascade container, this.$result will be A new point.

subtract

  • Subtract a point from another point, and return the result as a new point. Shortcut to Add(a, b, subtract = true).

    Parameters

    Returns ICascadePoint

    this cascade container, this.$result will be A new point object.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc