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

Class to traverse an item 's models or paths and ultimately render each path.

Hierarchy

  • Exporter

Index

Constructors

constructor

  • Parameters

    • map: IPathOriginFunctionMap

      Object containing properties: property name is the type of path, e.g. "line", "circle"; property value is a function to render a path. Function parameters are path and point.

    • Optional fixPoint: function

      Optional function to modify a point prior to export. Function parameter is a point; function must return a point.

    • Optional fixPath: function

      Optional function to modify a path prior to output. Function parameters are path and offset point; function must return a path.

    • Optional beginModel: function
        • (id: string, modelContext: IModel): void
        • Parameters

          • id: string
          • modelContext: IModel

          Returns void

    • Optional endModel: function
        • (modelContext: IModel): void
        • Parameters

          Returns void

    Returns Exporter

Properties

Private Optional beginModel

beginModel: function

Type declaration

    • (id: string, modelContext: IModel): void
    • Parameters

      • id: string
      • modelContext: IModel

      Returns void

Private Optional endModel

endModel: function

Type declaration

    • (modelContext: IModel): void
    • Parameters

      Returns void

Private Optional fixPath

fixPath: function

Optional function to modify a path prior to output. Function parameters are path and offset point; function must return a path.

Type declaration

Private Optional fixPoint

fixPoint: function

Optional function to modify a point prior to export. Function parameter is a point; function must return a point.

Type declaration

Private map

Object containing properties: property name is the type of path, e.g. "line", "circle"; property value is a function to render a path. Function parameters are path and point.

Methods

exportItem

  • exportItem(itemId: string, itemToExport: any, origin: IPoint): void

exportModel

  • exportModel(modelId: string, modelToExport: IModel, offset: IPoint): void
  • Export a model.

    Parameters

    • modelId: string
    • modelToExport: IModel

      The model to export.

    • offset: IPoint

      The offset position of the model.

    Returns void

exportPath

  • exportPath(id: string, pathToExport: IPath, offset: IPoint, layer: string): void
  • Export a path.

    Parameters

    • id: string
    • pathToExport: IPath

      The path to export.

    • offset: IPoint

      The offset position of the path.

    • layer: string

    Returns void

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