mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-12-01 19:11:34 -05:00
fix(io): close SVG outlines that stop just short of their start
Boxes.py with a burn above 0 leaves out an outline's last corner, so the curved BreadBox sides ended 0.14 mm open and Separate split their slots and edges into stray parts. Import now closes a subpath of three or more segments that ends within 0.5 mm of its start, and warns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3b19fda767
commit
db18075bec
4 files changed
+60
-1
No files matched your search
@@ -24,6 +24,7 @@ Import takes path centerlines: `path`, `rect` (with rounded corners), `circle`,
|
||||
- Malformed path data fails the import instead of importing part of a shape.
|
||||
- A Bézier curve that ends where it starts is dropped, with a warning, when its subpath draws anything else: it would pinch off the outline at one point and import as a hole no cut can make. Boxes.py draws one at each inside corner when its burn (kerf) is above 0, and that burn also enlarges every part, so the warning asks for burn 0. A loop that is its subpath's whole drawing stays.
|
||||
- A straight segment that turns straight back along the one before it leaves only their net line, so an overshoot past a corner and back (Boxes.py does this at its corners) does not break the outline when collinear lines are merged. A segment that returns exactly to the previous one's start keeps that line, as a slit cut there and back.
|
||||
- A subpath with no `Z` that draws at least three segments and ends within 0.02 in (0.5 mm) of its start is closed with a line, with a warning. Boxes.py leaves out an outline's last corner when its burn is above 0 (a gap of burn × √2), and an open outline could not hold its part's holes when the file is separated. A wider gap, or a shorter path, stays open.
|
||||
- Elements with `display` none or `visibility` hidden or collapse are skipped, as are definition elements such as `defs` and `clipPath`. `<style>` sheets are not read, so CSS-class hiding is not honored.
|
||||
- Text, images, nested `svg`, `use` of a `symbol`, and shapes sized in percentages are skipped and listed in `CadImportResult.Warnings`.
|
||||
- Layers come from `data-layer`, an Inkscape layer label, or the `id` of a top-level group (Illustrator). `ETCH`, `SCRIBE`, `RAPID` and `PLATE` are dropped, so an exported plate reads back as its parts.
|
||||
|
||||
Reference in new issue
Block a user