pantograph2d 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{QuadraticBezier-DxieHk9z.js → QuadraticBezier-B2g_Iyyl.js} +15 -14
  2. package/dist/{QuadraticBezier-DxieHk9z.js.map → QuadraticBezier-B2g_Iyyl.js.map} +1 -1
  3. package/dist/{QuadraticBezier--UZr_xcV.cjs → QuadraticBezier-CuRsIP_D.cjs} +4 -4
  4. package/dist/{QuadraticBezier--UZr_xcV.cjs.map → QuadraticBezier-CuRsIP_D.cjs.map} +1 -1
  5. package/dist/{draw-BUUNobTS.cjs → draw-9Elv4xz6.cjs} +2 -2
  6. package/dist/{draw-BUUNobTS.cjs.map → draw-9Elv4xz6.cjs.map} +1 -1
  7. package/dist/{draw-lOWnIN1o.js → draw-BJW5kfm9.js} +3 -3
  8. package/dist/{draw-lOWnIN1o.js.map → draw-BJW5kfm9.js.map} +1 -1
  9. package/dist/{models-DCkOI0hV.js → models-DdZq-waE.js} +2 -2
  10. package/dist/{models-DCkOI0hV.js.map → models-DdZq-waE.js.map} +1 -1
  11. package/dist/{models-CCo90hZc.cjs → models-LHGiMarC.cjs} +2 -2
  12. package/dist/{models-CCo90hZc.cjs.map → models-LHGiMarC.cjs.map} +1 -1
  13. package/dist/pantograph/drawShape.cjs +1 -1
  14. package/dist/pantograph/drawShape.cjs.map +1 -1
  15. package/dist/pantograph/drawShape.js +374 -14
  16. package/dist/pantograph/drawShape.js.map +1 -1
  17. package/dist/pantograph/models.cjs +1 -1
  18. package/dist/pantograph/models.js +2 -2
  19. package/dist/pantograph/svg.cjs +1 -1
  20. package/dist/pantograph/svg.js +1 -1
  21. package/dist/pantograph.cjs +2 -2
  22. package/dist/pantograph.cjs.map +1 -1
  23. package/dist/pantograph.js +674 -568
  24. package/dist/pantograph.js.map +1 -1
  25. package/dist/{svg-BY5h3CDD.cjs → svg-BzloQ9l1.cjs} +2 -2
  26. package/dist/{svg-BY5h3CDD.cjs.map → svg-BzloQ9l1.cjs.map} +1 -1
  27. package/dist/{svg-BIphc_zE.js → svg-D8vwkQf7.js} +2 -2
  28. package/dist/{svg-BIphc_zE.js.map → svg-D8vwkQf7.js.map} +1 -1
  29. package/dist/types/src/algorithms/tesselate/tesselateSegment.d.ts +7 -0
  30. package/dist/types/src/api/drawShape.d.ts +3 -0
  31. package/dist/types/src/drawShape/index.d.ts +1 -1
  32. package/dist/types/src/main.d.ts +1 -1
  33. package/dist/types/src/operations.d.ts +1 -0
  34. package/dist/types/src/tesselationOperations.d.ts +15 -0
  35. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"svg-BIphc_zE.js","sources":["../src/export/svg/svgSegment.ts","../src/export/svg/svgLoop.ts","../src/export/svg/svgFigure.ts","../src/export/svg/svgDiagram.ts","../src/export/svg/svgStrand.ts","../src/export/svg/wrapSVG.ts"],"sourcesContent":["import { Arc } from \"../../models/segments/Arc.js\";\nimport { CubicBezier } from \"../../models/segments/CubicBezier.js\";\nimport { EllipseArc } from \"../../models/segments/EllipseArc.js\";\nimport { Line } from \"../../models/segments/Line.js\";\nimport { QuadraticBezier } from \"../../models/segments/QuadraticBezier.js\";\nimport { Segment } from \"../../models/segments/Segment.js\";\nimport { RAD2DEG } from \"../../vectorOperations.js\";\n\nfunction formatPoint([x, y]: [number, number]) {\n return `${x} ${y}`;\n}\n\nexport function svgSegmentToPath(segment: Segment) {\n if (segment instanceof Line) {\n return `L ${formatPoint(segment.lastPoint)}`;\n }\n if (segment instanceof Arc) {\n return `A ${segment.radius} ${segment.radius} 0 ${\n segment.angularLength > Math.PI ? \"1\" : \"0\"\n } ${segment.clockwise ? \"0\" : \"1\"} ${formatPoint(segment.lastPoint)}`;\n }\n if (segment instanceof EllipseArc) {\n return `A ${segment.majorRadius} ${segment.minorRadius} ${\n segment.tiltAngle * RAD2DEG\n } ${segment.deltaAngle > Math.PI ? \"1\" : \"0\"} ${\n segment.clockwise ? \"0\" : \"1\"\n } ${formatPoint(segment.lastPoint)}`;\n }\n\n if (segment instanceof QuadraticBezier) {\n return `Q ${[\n formatPoint(segment.controlPoint),\n formatPoint(segment.lastPoint),\n ].join(\" \")}`;\n }\n\n if (segment instanceof CubicBezier) {\n return `C ${[\n formatPoint(segment.firstControlPoint),\n formatPoint(segment.lastControlPoint),\n formatPoint(segment.lastPoint),\n ].join(\" \")}`;\n }\n\n throw new Error(\"Unknown segment type\");\n}\n","import type { Loop } from \"../../models/Loop.js\";\nimport { svgSegmentToPath } from \"./svgSegment.js\";\n\nexport function svgLoop(loop: Loop) {\n const start = `M ${loop.firstPoint.join(\" \")}`;\n const segments = loop.segments.map(svgSegmentToPath).join(\" \");\n return `${start} ${segments} Z`;\n}\n","import type { Figure } from \"../../models/Figure.js\";\nimport { svgLoop } from \"./svgLoop.js\";\n\nexport function svgFigure(figure: Figure) {\n const path = figure.allLoops.map(svgLoop).join(\" \");\n return `<path d=\"${path}\" />`;\n}\n","import { Diagram } from \"../../models/Diagram.js\";\nimport { svgFigure } from \"./svgFigure.js\";\n\nexport function svgDiagram(diagram: Diagram) {\n return `<g>\n ${diagram.figures.map(svgFigure).join(\"\\n\")}\n</g>`;\n}\n","import type { Strand } from \"../../models/Strand.js\";\nimport { svgSegmentToPath } from \"./svgSegment.js\";\n\nexport function svgStrand(strand: Strand) {\n const start = `M ${strand.firstPoint.join(\" \")}`;\n const segments = strand.segments.map(svgSegmentToPath).join(\" \");\n return `${start} ${segments}`;\n}\n","import { BoundingBox } from \"../../models/BoundingBox.js\";\n\nexport function svgViewbox(bbox: BoundingBox, margin = 1) {\n const minX = bbox.xMin - margin;\n const minY = bbox.yMin - margin;\n\n return `${minX} ${minY} ${bbox.width + 2 * margin} ${\n bbox.height + 2 * margin\n }`;\n}\n\n// The list comes from https://oreillymedia.github.io/Using_SVG/guide/units.html\nexport type SVGUnit = \"mm\" | \"cm\" | \"in\" | \"pc\" | \"px\" | \"pt\";\n\nexport function wrapSVG(\n body: string,\n boundingBox: BoundingBox,\n margin = 1,\n unit: null | SVGUnit,\n) {\n const vbox = svgViewbox(boundingBox, margin);\n const sizes = unit\n ? `width=\"${boundingBox.width + 2 * margin}${unit}\" height=\"${\n boundingBox.height + 2 * margin\n }${unit}\"`\n : \"\";\n\n return `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"${vbox}\" fill=\"none\" stroke=\"grey\" stroke-width=\"0.2%\" vector-effect=\"non-scaling-stroke\" ${sizes}>\n ${body}\n</svg>`;\n}\n"],"names":["formatPoint","x","y","svgSegmentToPath","segment","Line","Arc","EllipseArc","RAD2DEG","QuadraticBezier","CubicBezier","svgLoop","loop","start","segments","svgFigure","figure","svgDiagram","diagram","svgStrand","strand","svgViewbox","bbox","margin","minX","minY","wrapSVG","body","boundingBox","unit","vbox","sizes"],"mappings":";AAQA,SAASA,EAAY,CAACC,GAAGC,CAAC,GAAqB;AACtC,SAAA,GAAGD,CAAC,IAAIC,CAAC;AAClB;AAEO,SAASC,EAAiBC,GAAkB;AACjD,MAAIA,aAAmBC;AACrB,WAAO,KAAKL,EAAYI,EAAQ,SAAS,CAAC;AAE5C,MAAIA,aAAmBE;AACd,WAAA,KAAKF,EAAQ,MAAM,IAAIA,EAAQ,MAAM,MAC1CA,EAAQ,gBAAgB,KAAK,KAAK,MAAM,GAC1C,IAAIA,EAAQ,YAAY,MAAM,GAAG,IAAIJ,EAAYI,EAAQ,SAAS,CAAC;AAErE,MAAIA,aAAmBG;AACd,WAAA,KAAKH,EAAQ,WAAW,IAAIA,EAAQ,WAAW,IACpDA,EAAQ,YAAYI,CACtB,IAAIJ,EAAQ,aAAa,KAAK,KAAK,MAAM,GAAG,IAC1CA,EAAQ,YAAY,MAAM,GAC5B,IAAIJ,EAAYI,EAAQ,SAAS,CAAC;AAGpC,MAAIA,aAAmBK;AACrB,WAAO,KAAK;AAAA,MAC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,IAAQF,IACV,UAAUD,EAAY,QAAQ,IAAIL,CAAM,GAAGM,CAAI,aAC7CD,EAAY,SAAS,IAAIL,CAC3B,GAAGM,CAAI,MACP;AAEG,SAAA;AAAA,iEACwDC,CAAI,sFAAsFC,CAAK;AAAA,MAC1JJ,CAAI;AAAA;AAEV;"}
1
+ {"version":3,"file":"svg-D8vwkQf7.js","sources":["../src/export/svg/svgSegment.ts","../src/export/svg/svgLoop.ts","../src/export/svg/svgFigure.ts","../src/export/svg/svgDiagram.ts","../src/export/svg/svgStrand.ts","../src/export/svg/wrapSVG.ts"],"sourcesContent":["import { Arc } from \"../../models/segments/Arc.js\";\nimport { CubicBezier } from \"../../models/segments/CubicBezier.js\";\nimport { EllipseArc } from \"../../models/segments/EllipseArc.js\";\nimport { Line } from \"../../models/segments/Line.js\";\nimport { QuadraticBezier } from \"../../models/segments/QuadraticBezier.js\";\nimport { Segment } from \"../../models/segments/Segment.js\";\nimport { RAD2DEG } from \"../../vectorOperations.js\";\n\nfunction formatPoint([x, y]: [number, number]) {\n return `${x} ${y}`;\n}\n\nexport function svgSegmentToPath(segment: Segment) {\n if (segment instanceof Line) {\n return `L ${formatPoint(segment.lastPoint)}`;\n }\n if (segment instanceof Arc) {\n return `A ${segment.radius} ${segment.radius} 0 ${\n segment.angularLength > Math.PI ? \"1\" : \"0\"\n } ${segment.clockwise ? \"0\" : \"1\"} ${formatPoint(segment.lastPoint)}`;\n }\n if (segment instanceof EllipseArc) {\n return `A ${segment.majorRadius} ${segment.minorRadius} ${\n segment.tiltAngle * RAD2DEG\n } ${segment.deltaAngle > Math.PI ? \"1\" : \"0\"} ${\n segment.clockwise ? \"0\" : \"1\"\n } ${formatPoint(segment.lastPoint)}`;\n }\n\n if (segment instanceof QuadraticBezier) {\n return `Q ${[\n formatPoint(segment.controlPoint),\n formatPoint(segment.lastPoint),\n ].join(\" \")}`;\n }\n\n if (segment instanceof CubicBezier) {\n return `C ${[\n formatPoint(segment.firstControlPoint),\n formatPoint(segment.lastControlPoint),\n formatPoint(segment.lastPoint),\n ].join(\" \")}`;\n }\n\n throw new Error(\"Unknown segment type\");\n}\n","import type { Loop } from \"../../models/Loop.js\";\nimport { svgSegmentToPath } from \"./svgSegment.js\";\n\nexport function svgLoop(loop: Loop) {\n const start = `M ${loop.firstPoint.join(\" \")}`;\n const segments = loop.segments.map(svgSegmentToPath).join(\" \");\n return `${start} ${segments} Z`;\n}\n","import type { Figure } from \"../../models/Figure.js\";\nimport { svgLoop } from \"./svgLoop.js\";\n\nexport function svgFigure(figure: Figure) {\n const path = figure.allLoops.map(svgLoop).join(\" \");\n return `<path d=\"${path}\" />`;\n}\n","import { Diagram } from \"../../models/Diagram.js\";\nimport { svgFigure } from \"./svgFigure.js\";\n\nexport function svgDiagram(diagram: Diagram) {\n return `<g>\n ${diagram.figures.map(svgFigure).join(\"\\n\")}\n</g>`;\n}\n","import type { Strand } from \"../../models/Strand.js\";\nimport { svgSegmentToPath } from \"./svgSegment.js\";\n\nexport function svgStrand(strand: Strand) {\n const start = `M ${strand.firstPoint.join(\" \")}`;\n const segments = strand.segments.map(svgSegmentToPath).join(\" \");\n return `${start} ${segments}`;\n}\n","import { BoundingBox } from \"../../models/BoundingBox.js\";\n\nexport function svgViewbox(bbox: BoundingBox, margin = 1) {\n const minX = bbox.xMin - margin;\n const minY = bbox.yMin - margin;\n\n return `${minX} ${minY} ${bbox.width + 2 * margin} ${\n bbox.height + 2 * margin\n }`;\n}\n\n// The list comes from https://oreillymedia.github.io/Using_SVG/guide/units.html\nexport type SVGUnit = \"mm\" | \"cm\" | \"in\" | \"pc\" | \"px\" | \"pt\";\n\nexport function wrapSVG(\n body: string,\n boundingBox: BoundingBox,\n margin = 1,\n unit: null | SVGUnit,\n) {\n const vbox = svgViewbox(boundingBox, margin);\n const sizes = unit\n ? `width=\"${boundingBox.width + 2 * margin}${unit}\" height=\"${\n boundingBox.height + 2 * margin\n }${unit}\"`\n : \"\";\n\n return `<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"${vbox}\" fill=\"none\" stroke=\"grey\" stroke-width=\"0.2%\" vector-effect=\"non-scaling-stroke\" ${sizes}>\n ${body}\n</svg>`;\n}\n"],"names":["formatPoint","x","y","svgSegmentToPath","segment","Line","Arc","EllipseArc","RAD2DEG","QuadraticBezier","CubicBezier","svgLoop","loop","start","segments","svgFigure","figure","svgDiagram","diagram","svgStrand","strand","svgViewbox","bbox","margin","minX","minY","wrapSVG","body","boundingBox","unit","vbox","sizes"],"mappings":";AAQA,SAASA,EAAY,CAACC,GAAGC,CAAC,GAAqB;AACtC,SAAA,GAAGD,CAAC,IAAIC,CAAC;AAClB;AAEO,SAASC,EAAiBC,GAAkB;AACjD,MAAIA,aAAmBC;AACrB,WAAO,KAAKL,EAAYI,EAAQ,SAAS,CAAC;AAE5C,MAAIA,aAAmBE;AACd,WAAA,KAAKF,EAAQ,MAAM,IAAIA,EAAQ,MAAM,MAC1CA,EAAQ,gBAAgB,KAAK,KAAK,MAAM,GAC1C,IAAIA,EAAQ,YAAY,MAAM,GAAG,IAAIJ,EAAYI,EAAQ,SAAS,CAAC;AAErE,MAAIA,aAAmBG;AACd,WAAA,KAAKH,EAAQ,WAAW,IAAIA,EAAQ,WAAW,IACpDA,EAAQ,YAAYI,CACtB,IAAIJ,EAAQ,aAAa,KAAK,KAAK,MAAM,GAAG,IAC1CA,EAAQ,YAAY,MAAM,GAC5B,IAAIJ,EAAYI,EAAQ,SAAS,CAAC;AAGpC,MAAIA,aAAmBK;AACrB,WAAO,KAAK;AAAA,MACVT,EAAYI,EAAQ,YAAY;AAAA,MAChCJ,EAAYI,EAAQ,SAAS;AAAA,IAAA,EAC7B,KAAK,GAAG,CAAC;AAGb,MAAIA,aAAmBM;AACrB,WAAO,KAAK;AAAA,MACVV,EAAYI,EAAQ,iBAAiB;AAAA,MACrCJ,EAAYI,EAAQ,gBAAgB;AAAA,MACpCJ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+ import { Vector } from '../../definitions.js';
2
+ import { Segment } from '../../models/segments/Segment.js';
3
+ export type TesselateSegmentOptions = {
4
+ maxAngle?: number;
5
+ maxDepth?: number;
6
+ };
7
+ export declare function tesselateSegment(segment: Segment, options?: TesselateSegmentOptions): Vector[];
@@ -1,2 +1,5 @@
1
1
  export { drawCircle } from '../drawShape/drawCircle.js';
2
2
  export { drawRect } from '../drawShape/drawRect.js';
3
+ export { drawEllipse } from '../drawShape/drawEllipse.js';
4
+ export { drawPolysides } from '../drawShape/drawPolysides.js';
5
+ export { drawSVGPath } from '../drawShape/drawSVGPath.js';
@@ -1,5 +1,5 @@
1
1
  export { drawCircle } from './drawCircle.js';
2
2
  export { drawRect } from './drawRect.js';
3
- export { drawEllipse } from './drawEllipse.js';
4
3
  export { drawSVGPath } from './drawSVGPath.js';
4
+ export { drawEllipse } from './drawEllipse.js';
5
5
  export { drawPolysides } from './drawPolysides.js';
@@ -6,7 +6,7 @@ export declare function polarToCartesian(r: number, theta: number): Vector;
6
6
  export declare function cartesianToPolar([x, y]: Vector): [number, number];
7
7
  export type { Diagram, Figure, Loop, Strand, Stroke, TransformationMatrix, BoundingBox, Segment, Line, Arc, EllipseArc, CubicBezier, } from './models/exports.js';
8
8
  export { draw, DrawingPen } from './draw.js';
9
- export { fuseAll, fuse, cut, intersect, eraseStrand, confineStrand, offset, outlineStroke, fillet, chamfer, selectCorners, } from './operations.js';
9
+ export { fuseAll, fuse, cut, intersect, eraseStrand, confineStrand, offset, outlineStroke, fillet, chamfer, selectCorners, tesselate, tesselatePoints, } from './operations.js';
10
10
  export { exportSVG, svgBody } from './export/svg/exportSVG.js';
11
11
  export { exportJSON } from './export/json/exportJSON.js';
12
12
  export { importJSON } from './import/json/importJSON.js';
@@ -1,3 +1,4 @@
1
1
  export * from './booleanOperations.js';
2
2
  export * from './offsetOperations.js';
3
3
  export * from './featureOperations.js';
4
+ export * from './tesselationOperations.js';
@@ -0,0 +1,15 @@
1
+ import { Vector } from './definitions.js';
2
+ import { Segment } from './models/segments/Segment.js';
3
+ import { Diagram, Figure, Loop, Strand } from './models/exports';
4
+ import { TesselateSegmentOptions } from './algorithms/tesselate/tesselateSegment.js';
5
+ declare function tesselate(shape: Diagram, options?: TesselateSegmentOptions): Diagram;
6
+ declare function tesselate(shape: Figure, options?: TesselateSegmentOptions): Figure;
7
+ declare function tesselate(shape: Loop, options?: TesselateSegmentOptions): Loop;
8
+ declare function tesselate(shape: Strand, options?: TesselateSegmentOptions): Strand;
9
+ declare function tesselate(shape: Segment, options?: TesselateSegmentOptions): Segment[];
10
+ declare function tesselatePoints(shape: Diagram, options?: TesselateSegmentOptions): Vector[][][];
11
+ declare function tesselatePoints(shape: Figure, options?: TesselateSegmentOptions): Vector[][];
12
+ declare function tesselatePoints(shape: Loop, options?: TesselateSegmentOptions): Vector[];
13
+ declare function tesselatePoints(shape: Strand, options?: TesselateSegmentOptions): Vector[];
14
+ declare function tesselatePoints(shape: Segment, options?: TesselateSegmentOptions): Vector[];
15
+ export { tesselate, tesselatePoints };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pantograph2d",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Pantograph, the pure JS 2D CAD library",
5
5
  "type": "module",
6
6
  "main": "./dist/pantograph.cjs",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "require": {
29
29
  "default": "./dist/pantograph/models.cjs",
30
- "types": "./dist/types/src/api/drawShape.d.ts"
30
+ "types": "./dist/types/src/api/models.d.ts"
31
31
  }
32
32
  },
33
33
  "./drawShape": {
@@ -78,7 +78,7 @@
78
78
  "vitest": "^2.1.3",
79
79
  "xmldom": "^0.6.0"
80
80
  },
81
- "gitHead": "c9604dc6d42889ad5621c9dd7e54a2283d1bf58b",
81
+ "gitHead": "787b28dafa5153ed1ff51e5a80813834ce1fbca8",
82
82
  "dependencies": {
83
83
  "@types/flatbush": "^4.2.2",
84
84
  "flatbush": "^4.4.0",