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 - ConnectTheDots Class

Hierarchy

  • ConnectTheDots

Implements

Index

Constructors

Properties

Constructors

constructor

  • Create a model by connecting points designated in a string. The model will be 'closed' - i.e. the last point will connect to the first point.

    Example:

    var c = new makerjs.models.ConnectTheDots('-10 0 10 0 0 20'); // 3 coordinates to form a triangle
    

    Parameters

    • numericList: string

      String containing a list of numbers which can be delimited by spaces, commas, or anything non-numeric (Note: exponential notation is allowed).

    Returns ConnectTheDots

  • Create a model by connecting points designated in a string. The model may be closed, or left open.

    Example:

    var c = new makerjs.models.ConnectTheDots(false, '-10 0 10 0 0 20'); // 3 coordinates to form a polyline
    

    Parameters

    • isClosed: boolean

      Flag to specify if last point should connect to the first point.

    • numericList: string

      String containing a list of numbers which can be delimited by spaces, commas, or anything non-numeric (Note: exponential notation is allowed).

    Returns ConnectTheDots

  • Create a model by connecting points designated in a numeric array. The model will be 'closed' - i.e. the last point will connect to the first point.

    Example:

    var c = new makerjs.models.ConnectTheDots([-10, 0, 10, 0, 0, 20]); // 3 coordinates to form a triangle
    

    Parameters

    • coords: number[]

      Array of coordinates.

    Returns ConnectTheDots

  • Create a model by connecting points designated in a numeric array. The model may be closed, or left open.

    Example:

    var c = new makerjs.models.ConnectTheDots(false, [-10, 0, 10, 0, 0, 20]); // 3 coordinates to form a polyline
    

    Parameters

    • isClosed: boolean

      Flag to specify if last point should connect to the first point.

    • coords: number[]

      Array of coordinates.

    Returns ConnectTheDots

  • Create a model by connecting points designated in an array of points. The model may be closed, or left open.

    Example:

    var c = new makerjs.models.ConnectTheDots(false, [[-10, 0], [10, 0], [0, 20]]); // 3 coordinates left open
    

    Parameters

    • isClosed: boolean

      Flag to specify if last point should connect to the first point.

    • points: IPoint[]

      Array of IPoints.

    Returns ConnectTheDots

Properties

paths

paths: IPathMap

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