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

Hierarchy

  • RoundRectangle

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

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