--- layout: posts title: Api - RoundRectangle Class ---

Hierarchy

Implements

Index

Constructors

Properties

Constructors

constructor

  • Create a round rectangle from width, height, and corner radius.

    Example:

    var r = new makerjs.models.RoundRectangle(100, 50, 5);
    

    Parameters

    • width: number

      Width of the rectangle.

    • height: number

      Height of the rectangle.

    • radius: number

      Corner radius.

    Returns RoundRectangle

  • Create a round rectangle which will surround a model.

    Example:

    var b = new makerjs.models.BoltRectangle(30, 20, 1); //draw a bolt rectangle so we have something to surround
    var r = new makerjs.models.RoundRectangle(b, 2.5);   //surround it
    

    Parameters

    • modelToSurround: IModel

      IModel object.

    • margin: number

      Distance from the model. This will also become the corner radius.

    Returns RoundRectangle

Properties

origin

origin: IPoint

paths

paths: IPathMap

Generated using TypeDoc