--- layout: posts title: Api - ConnectTheDots Class ---

Hierarchy

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

Generated using TypeDoc