How to use the makerjs.importer function in makerjs

To help you get started, weā€™ve selected a few makerjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / maker.js / packages / maker.js / examples / textOnChain.js View on Github external
function TextOnChain(font, text, fontSize, baseline, reversed, contain, rotate, svgPathData, showPath) {

    var textModel = new makerjs.models.Text(font, text, fontSize);

    var svgPath = makerjs.importer.fromSVGPathData(svgPathData);
    
    var chain = makerjs.model.findSingleChain(svgPath);

    makerjs.layout.childrenOnChain(textModel, chain, baseline, reversed, contain, rotate);

    this.models = {
        text: textModel
    };

    if (showPath) {
        this.models.svgPath = svgPath;
    }
}

makerjs

Maker.js, a Microsoft Garage project, is a JavaScript library for creating and sharing modular line drawings for CNC and laser cutters.

Apache-2.0
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis