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 Module

Index

Variables

Private chainLinkToPathDataMap

chainLinkToPathDataMap: IChainLinkToPathDataMap

Private dxfUnit

dxfUnit: object

Type declaration

  • [unitType: string]: number

Private svgPathDataMap

svgPathDataMap: ISvgPathDataMap

svgUnit

Map of MakerJs unit system to SVG unit system

Functions

chainToSVGPathData

exportFromOptionsMap

Private facetSizeToResolution

  • facetSizeToResolution(arcOrCircle: IPathCircle, facetSize: number): number

Private getBezierModelsWithPaths

Private getPathDataByLayer

pathToSVGPathData

Private pathsToOpenJsCad

  • pathsToOpenJsCad(modelContext: IModel, facetSize?: number): string

Private startSvgPathData

Private svgArcData

  • svgArcData(d: ISvgPathData, radius: number, endPoint: IPoint, largeArc?: boolean, decreasing?: boolean): void

Private svgBezierData

Private svgCircleData

Private svgCoords

toDXF

  • Renders an item in AutoDesk DFX file format.

    Parameters

    Returns string

    String of DXF content.

  • Renders an item in AutoDesk DFX file format.

    Parameters

    Returns string

    String of DXF content.

  • Renders an item in AutoDesk DFX file format.

    Parameters

    Returns string

    String of DXF content.

toOpenJsCad

  • Creates a string of JavaScript code for execution with the OpenJsCad engine.

    Parameters

    Returns string

    String of JavaScript containing a main() function for OpenJsCad.

  • Creates a string of JavaScript code for execution with the OpenJsCad engine.

    Parameters

    Returns string

    String of JavaScript containing a main() function for OpenJsCad.

  • Creates a string of JavaScript code for execution with the OpenJsCad engine.

    Parameters

    Returns string

    String of JavaScript containing a main() function for OpenJsCad.

toPDF

  • Injects drawing into a PDFKit document.

    Parameters

    • doc: PDFDocument
    • modelToExport: IModel

      Model object to export.

    • Optional options: IPDFRenderOptions

      Export options object.

    Returns void

    String of PDF file contents.

toSTL

  • Executes a JavaScript string with the OpenJsCad engine - converts 2D to 3D.

    Parameters

    • modelToExport: IModel

      Model object to export.

    • Default value options: IOpenJsCadOptions = {}

      Export options object.

    Returns string

    String of STL format of 3D object.

toSVG

  • Renders an item in SVG markup.

    Parameters

    Returns string

    String of XML / SVG content.

  • Renders an item in SVG markup.

    Parameters

    Returns string

    String of XML / SVG content.

  • Renders an item in SVG markup.

    Parameters

    Returns string

    String of XML / SVG content.

Private tryGetModelUnits

  • tryGetModelUnits(itemToExport: any): string
  • Try to get the unit system from a model

    Parameters

    • itemToExport: any

    Returns string

Private wrap

  • wrap(prefix: string, content: string, condition: any): string
  • Parameters

    • prefix: string
    • content: string
    • condition: any

    Returns string

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