diff --git a/web/help.html b/web/help.html index d5f91fd..5681e00 100644 --- a/web/help.html +++ b/web/help.html @@ -30,6 +30,12 @@
If you're using Inkscape, set the document scale explicitly. Open File->Document Properties
+ and set the document Scale value to 0.01, as shown here:
+ This ensures that measurements in your SVG correspond directly to millimeters in KiCAD and helps avoid scaling issues when converting your design.
+The outline should be drawn on a layer named Edge.Cuts in your vector editor. Gingerbread handles this layer in a specific way to make sure that there is a 1-to-1 match
between the size and units in the SVG and KiCAD. This approach can't handle as many complex edge cases as the rasterization approach used by the graphic layers, but as
diff --git a/web/images/inkscape-document-properties.png b/web/images/inkscape-document-properties.png
new file mode 100644
index 0000000..e270b5c
Binary files /dev/null and b/web/images/inkscape-document-properties.png differ
diff --git a/web/scripts/path-data-polyfill.js b/web/scripts/path-data-polyfill.js
index 88463a5..2f99307 100644
--- a/web/scripts/path-data-polyfill.js
+++ b/web/scripts/path-data-polyfill.js
@@ -1033,8 +1033,9 @@ if (!SVGPathElement.prototype.getPathData || !SVGPathElement.prototype.setPathDa
];
// Get rid of redundant "A" segs when either rx or ry is 0
+ // (i.e. drop zero-radius arcs, keep everything else including the initial M).
pathData = pathData.filter((s) => {
- return s.type === "A" && (s.values[0] === 0 || s.values[1] === 0);
+ return !(s.type === "A" && (s.values[0] === 0 || s.values[1] === 0));
});
if (options && options.normalize === true) {
diff --git a/web/scripts/yak.js b/web/scripts/yak.js
index acf3522..a12fdf5 100644
--- a/web/scripts/yak.js
+++ b/web/scripts/yak.js
@@ -275,9 +275,11 @@ export function* SVGElement_to_paths(elm) {
for (const child of elm.children) {
yield* SVGElement_to_paths(child);
}
- } else {
+ } else if (elm instanceof SVGGeometryElement || (elm.getPathData && typeof elm.getPathData === 'function')) {
+ // Only process elements that are geometry elements or have getPathData method
yield* SVGGeometryElement_to_paths(elm);
}
+ // Skip non-geometry elements like