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 - ICascadePath 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

addTo

  • Add a path to a model. This is basically equivalent to:

    parentModel.paths[pathId] = childPath;
    

    with additional checks to make it safe for cascading.

    Parameters

    • parentModel: IModel

      The model to add to.

    • pathId: string

      The id of the path.

    • Optional overwrite: boolean

      (default false) Optional flag to overwrite any path referenced by pathId. Default is false, which will create an id similar to pathId.

    Returns ICascadePath

    this cascade container, this.$result will be The original path (for cascading).

alterLength

  • alterLength(distance: number, useOrigin?: boolean): ICascadePath
  • Alter a path by lengthening or shortening it.

    Parameters

    • distance: number

      Numeric amount of length to add or remove from the path. Use a positive number to lengthen, negative to shorten. When shortening: this function will not alter the path and will return null if the resulting path length is less than or equal to zero.

    • Optional useOrigin: boolean

      (default false) Optional flag to alter from the origin instead of the end of the path.

    Returns ICascadePath

    this cascade container, this.$result will be The original path (for cascading), or null if the path could not be altered.

breakAtPoint

  • Breaks a path in two. The supplied path will end at the supplied pointOfBreak, a new path is returned which begins at the pointOfBreak and ends at the supplied path's initial end point. For Circle, the original path will be converted in place to an Arc, and null is returned.

    Parameters

    • pointOfBreak: IPoint

      The point at which to break the path.

    Returns ICascadePath

    this cascade container, this.$result will be A new path of the same type, when path type is line or arc. Returns null for circle.

center

clone

copyProps

layer

mirror

move

moveRelative

rotate

scale

zero

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