--- layout: posts title: Api - exporter Namespace ---
Export a path to SVG path data.
IPath to export.
IPoint relative offset of the path object.
IPoint relative offset point of the export.
Optional accuracy of SVG path data.
Optional flag to use clockwise winding for circles.
String of SVG path data.
Renders an item in AutoDesk DFX file format.
Rendering options object.
String of DXF content.
Renders an item in AutoDesk DFX file format.
String of DXF content.
Renders an item in AutoDesk DFX file format.
String of DXF content.
Converts a model to a @jscad/csg CAG object - 2D to 2D. See https://en.wikibooks.org/wiki/OpenJSCAD_User_Guide#2D_Paths
Example:
//First, use npm install @jscad/csg from the command line in your jscad project
//Create a CAG instance from a model.
var { CAG } = require('@jscad/csg');
var model = new makerjs.models.Ellipse(70, 40);
var cag = makerjs.exporter.toJscadCAG(CAG, model, {maxArcFacet: 1});
@jscad/csg CAG engine, see https://www.npmjs.com/package/@jscad/csg
Model object to export.
jscad CAG object in 2D, or a map (keyed by layer id) of jscad CAG objects - if options.byLayers is true.
Converts a model to a @jscad/csg CSG object - 2D to 3D.
Example:
//First, use npm install @jscad/csg from the command line in your jscad project
//Create a CSG instance from a model.
var { CAG } = require('@jscad/csg');
var model = new makerjs.models.Ellipse(70, 40);
var csg = makerjs.exporter.toJscadCSG(CAG, model, {maxArcFacet: 1, extrude: 10});
@jscad/csg CAG engine, see https://www.npmjs.com/package/@jscad/csg
Model object to export.
Optional options object.
jscad CAG object in 2D, or a map (keyed by layer id) of jscad CAG objects - if options.byLayers is true.
Exports a model in STL format - 2D to 3D.
@jscad/stl-serializer, see https://www.npmjs.com/package/@jscad/stl-serializer
Model object to export.
Optional options object.
String in STL ASCII format.
Creates a string of JavaScript code for execution with a Jscad environment.
Model object to export.
Export options object.
String of JavaScript containing a main() function for Jscad.
Renders an item in JSON.
Item to render: may be a path, an array of paths, or a model object.
Rendering options object.
String of DXF content.
Injects drawing into a PDFKit document.
PDFKit.PDFDocument object. See https://pdfkit.org/
Model object to export.
Export options object.
String of PDF file contents.
Renders an item in SVG markup.
Rendering options object.
String of XML / SVG content.
Renders an item in SVG markup.
String of XML / SVG content.
Renders an item in SVG markup.
String of XML / SVG content.
Convert a model to SVG path data.
Model to export.
Optional ISVGPathDataRenderOptions object.
String of SVG path data (if options.byLayers is false) or an object map of path data by layer .
Convert a model to SVG path data.
Model to export.
Optional boolean flag to return a map of path data by layer.
Optional origin. Default x = 0, y = topmost y point in the model. Use [0, 0] to use the same origin as Maker.js, which will translate to negative Y values in SVG.
Optional accuracy of SVG decimals.
String of SVG path data (if byLayers is false) or an object map of path data by layer .
Named colors, safe for CSS and DXF 17 colors from https://www.w3.org/TR/CSS21/syndata.html#value-def-color mapped to DXF equivalent AutoDesk Color Index
Generated using TypeDoc
Map of MakerJs unit system to SVG unit system