From 635f116910d4bca4ed48f754741d17028e8dc28c Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Thu, 22 Jan 2026 21:55:37 -0800 Subject: [PATCH 1/4] Bump version to 0.19.1 in package.json --- packages/maker.js/package-lock.json | 2 +- packages/maker.js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/maker.js/package-lock.json b/packages/maker.js/package-lock.json index 1a7c03e7..9f9f4fc4 100644 --- a/packages/maker.js/package-lock.json +++ b/packages/maker.js/package-lock.json @@ -1,6 +1,6 @@ { "name": "makerjs", - "version": "0.19.0", + "version": "0.19.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/maker.js/package.json b/packages/maker.js/package.json index 69dfea1a..faac64ba 100644 --- a/packages/maker.js/package.json +++ b/packages/maker.js/package.json @@ -1,6 +1,6 @@ { "name": "makerjs", - "version": "0.19.0", + "version": "0.19.1", "description": "Maker.js, a Microsoft Garage project, is a JavaScript library for creating and sharing modular line drawings for CNC and laser cutters.", "main": "dist/index.js", "types": "dist/index.d.ts", From e165c4f1564c48eec68f0209471e0a957e0c6961 Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Thu, 22 Jan 2026 21:56:03 -0800 Subject: [PATCH 2/4] new build --- docs/target/js/browser.maker.js | 37 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/docs/target/js/browser.maker.js b/docs/target/js/browser.maker.js index e6a9547f..37e8fe3b 100644 --- a/docs/target/js/browser.maker.js +++ b/docs/target/js/browser.maker.js @@ -39,7 +39,7 @@ and limitations under the License. * author: Dan Marshall / Microsoft Corporation * maintainers: Dan Marshall * homepage: https://maker.js.org - * version: 0.19.0 + * version: 0.19.1 * * browserify: * license: MIT (http://opensource.org/licenses/MIT) @@ -7592,20 +7592,29 @@ var MakerJs; /** * Convert a chain to SVG path data. * - * @param chain Chain to convert. + * @param c Chain to convert. * @param offset IPoint relative offset point. * @param accuracy Optional accuracy of SVG path data. + * @param clockwise Optional flag to specify desired winding direction for nonzero fill rule. * @returns String of SVG path data. */ - function chainToSVGPathData(chain, offset, accuracy) { + function chainToSVGPathData(c, offset, accuracy, clockwise) { function offsetPoint(p) { return MakerJs.point.add(p, offset); } - var first = chain.links[0]; + // If clockwise direction is specified, check if chain needs to be reversed + if (clockwise !== undefined) { + var isClockwise = MakerJs.measure.isChainClockwise(c); + if (isClockwise !== null && isClockwise !== clockwise) { + c = MakerJs.cloneObject(c); + MakerJs.chain.reverse(c); + } + } + var first = c.links[0]; var firstPoint = offsetPoint(svgCoords(first.endPoints[first.reversed ? 1 : 0])); var d = ['M', MakerJs.round(firstPoint[0], accuracy), MakerJs.round(firstPoint[1], accuracy)]; - for (var i = 0; i < chain.links.length; i++) { - var link = chain.links[i]; + for (var i = 0; i < c.links.length; i++) { + var link = c.links[i]; var pathContext = link.walkedPath.pathContext; var fn = chainLinkToPathDataMap[pathContext.type]; if (fn) { @@ -7617,7 +7626,7 @@ var MakerJs; fn(fixedPath, offsetPoint(svgCoords(link.endPoints[link.reversed ? 0 : 1])), link.reversed, d, accuracy); } } - if (chain.endless) { + if (c.endless) { d.push('Z'); } return d.join(' '); @@ -7693,16 +7702,16 @@ var MakerJs; } pathDataByLayer[layer] = []; function doChains(cs, clockwise) { - cs.forEach(function (chain) { - if (chain.links.length > 1) { - var pathData = chainToSVGPathData(chain, offset, accuracy); + cs.forEach(function (c) { + if (c.links.length > 1) { + var pathData = chainToSVGPathData(c, offset, accuracy, clockwise); pathDataByLayer[layer].push(pathData); } else { - single(chain.links[0].walkedPath, clockwise); + single(c.links[0].walkedPath, clockwise); } - if (chain.contains) { - doChains(chain.contains, !clockwise); + if (c.contains) { + doChains(c.contains, !clockwise); } }); } @@ -10523,7 +10532,7 @@ var MakerJs; ]; })(models = MakerJs.models || (MakerJs.models = {})); })(MakerJs || (MakerJs = {})); -MakerJs.version = "0.19.0"; +MakerJs.version = "0.19.1"; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"clone":2,"graham_scan":3,"kdbush":4}]},{},[]); From dbf475941837c206044369cc8b9bbffc75702603 Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Thu, 22 Jan 2026 21:56:14 -0800 Subject: [PATCH 3/4] Bump makerjs version to 0.19.1 in package-lock.json --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 23c7ce21..fcf1c3bb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4524,7 +4524,7 @@ }, "packages/maker.js": { "name": "makerjs", - "version": "0.19.0", + "version": "0.19.1", "license": "Apache-2.0", "dependencies": { "@danmarshall/jscad-typings": "^1.0.0", From f6038820d83a1b7123346e748cb05c7e29a34e9e Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Thu, 22 Jan 2026 21:56:24 -0800 Subject: [PATCH 4/4] regen docs --- .../makerjs.exporter.iflowannotation.html | 2 +- ...rjs.exporter.isvgelementrenderoptions.html | 10 +++--- ...js.exporter.isvgpathdatarenderoptions.html | 6 ++-- .../makerjs.exporter.isvgrenderoptions.html | 36 +++++++++---------- .../makerjs.importer.isvgimportoptions.html | 2 +- docs/docs/api/modules/makerjs.exporter.html | 26 ++++++++------ docs/docs/api/modules/makerjs.importer.html | 2 +- 7 files changed, 45 insertions(+), 39 deletions(-) diff --git a/docs/docs/api/interfaces/makerjs.exporter.iflowannotation.html b/docs/docs/api/interfaces/makerjs.exporter.iflowannotation.html index 135713cd..162b41be 100644 --- a/docs/docs/api/interfaces/makerjs.exporter.iflowannotation.html +++ b/docs/docs/api/interfaces/makerjs.exporter.iflowannotation.html @@ -39,7 +39,7 @@

size

size: number
diff --git a/docs/docs/api/interfaces/makerjs.exporter.isvgelementrenderoptions.html b/docs/docs/api/interfaces/makerjs.exporter.isvgelementrenderoptions.html index 5a5acb20..559d83e5 100644 --- a/docs/docs/api/interfaces/makerjs.exporter.isvgelementrenderoptions.html +++ b/docs/docs/api/interfaces/makerjs.exporter.isvgelementrenderoptions.html @@ -48,7 +48,7 @@

Optional className

className: string
@@ -63,7 +63,7 @@

Optional cssStyle

cssStyle: string
@@ -78,7 +78,7 @@

Optional fill

fill: string
@@ -93,7 +93,7 @@

Optional stroke

stroke: string
@@ -108,7 +108,7 @@

Optional strokeWidth

strokeWidth: string
diff --git a/docs/docs/api/interfaces/makerjs.exporter.isvgpathdatarenderoptions.html b/docs/docs/api/interfaces/makerjs.exporter.isvgpathdatarenderoptions.html index 49790912..5357f5cc 100644 --- a/docs/docs/api/interfaces/makerjs.exporter.isvgpathdatarenderoptions.html +++ b/docs/docs/api/interfaces/makerjs.exporter.isvgpathdatarenderoptions.html @@ -64,7 +64,7 @@

Optional byLayers

byLayers: boolean
@@ -79,7 +79,7 @@

Optional fillRule

fillRule: "nonzero" | "evenodd"
@@ -94,7 +94,7 @@

Optional origin

origin: IPoint
diff --git a/docs/docs/api/interfaces/makerjs.exporter.isvgrenderoptions.html b/docs/docs/api/interfaces/makerjs.exporter.isvgrenderoptions.html index 350d7621..da6cb668 100644 --- a/docs/docs/api/interfaces/makerjs.exporter.isvgrenderoptions.html +++ b/docs/docs/api/interfaces/makerjs.exporter.isvgrenderoptions.html @@ -82,7 +82,7 @@

Optional annotate

annotate: boolean
@@ -98,7 +98,7 @@

Optional className

@@ -113,7 +113,7 @@

Optional closingTags

closingTags: boolean
@@ -129,7 +129,7 @@

Optional cssStyle

@@ -145,7 +145,7 @@

Optional fill

@@ -160,7 +160,7 @@

Optional fillRule

fillRule: "nonzero" | "evenodd"
@@ -175,7 +175,7 @@

Optional flow

@@ -190,7 +190,7 @@

Optional fontSize

fontSize: string
@@ -205,7 +205,7 @@

Optional layerOptions

layerOptions: object
@@ -228,7 +228,7 @@

Optional origin

origin: IPoint
@@ -243,7 +243,7 @@

Optional scale

scale: number
@@ -258,7 +258,7 @@

Optional scalingStrokescalingStroke: boolean

@@ -274,7 +274,7 @@

Optional stroke

@@ -289,7 +289,7 @@

Optional strokeLineC
strokeLineCap: string
@@ -305,7 +305,7 @@

Optional strokeWidth

@@ -320,7 +320,7 @@

Optional svgAttrs

svgAttrs: IXmlTagAttrs
@@ -351,7 +351,7 @@

Optional useSvgPath<
useSvgPathOnly: boolean
@@ -366,7 +366,7 @@

Optional viewBox

viewBox: boolean
diff --git a/docs/docs/api/interfaces/makerjs.importer.isvgimportoptions.html b/docs/docs/api/interfaces/makerjs.importer.isvgimportoptions.html index c3a2ca08..b4d4595e 100644 --- a/docs/docs/api/interfaces/makerjs.importer.isvgimportoptions.html +++ b/docs/docs/api/interfaces/makerjs.importer.isvgimportoptions.html @@ -39,7 +39,7 @@

Optional bezierAccuracybezierAccuracy: number

diff --git a/docs/docs/api/modules/makerjs.exporter.html b/docs/docs/api/modules/makerjs.exporter.html index 0df8c75e..5a88e4ec 100644 --- a/docs/docs/api/modules/makerjs.exporter.html +++ b/docs/docs/api/modules/makerjs.exporter.html @@ -68,7 +68,7 @@

svgUnit

@@ -84,13 +84,13 @@

Functions

chainToSVGPathData

    -
  • chainToSVGPathData(chain: IChain, offset: IPoint, accuracy?: number): string
  • +
  • chainToSVGPathData(c: IChain, offset: IPoint, accuracy?: number, clockwise?: boolean): string

Returns string

String of SVG path data.

@@ -134,7 +140,7 @@

pathToSVGPathData

  • @@ -549,7 +555,7 @@

    toSVG

  • @@ -577,7 +583,7 @@

    Returns string
    @@ -600,7 +606,7 @@

    Returns string
    @@ -633,7 +639,7 @@

    toSVGPathData

  • @@ -665,7 +671,7 @@

    Returns
    diff --git a/docs/docs/api/modules/makerjs.importer.html b/docs/docs/api/modules/makerjs.importer.html index f4fd03bc..ab00caf8 100644 --- a/docs/docs/api/modules/makerjs.importer.html +++ b/docs/docs/api/modules/makerjs.importer.html @@ -35,7 +35,7 @@

    fromSVGPathData