feat(proxy): add offset param to inset or outset traced shapes

Trace results can now be inset (negative) or outset (positive) by a
pixel amount. Offset the outline and holes in opposite directions with
clipper-lib's miter joins, then recombine with a boolean difference so
holes grow on inset and shrink on outset. Collapsed shapes return an
empty outline; a split outline keeps the largest ring. Document the
parameter and the new dependency.
This commit is contained in:
2026-08-08 15:37:27 +08:00
parent c7f4bd03fd
commit 9094ad58e0
12 changed files with 284 additions and 17 deletions
+2
View File
@@ -18,12 +18,14 @@
"@tts/tts": "workspace:*",
"@visioncortex/vtracer": "1.0.0-alpha.3",
"bson": "^6.10.4",
"clipper-lib": "^6.4.2",
"hono": "^4.6.14",
"sharp": "^0.35.3",
"svgpath": "^2.6.0",
"zod": "^3.24.1"
},
"devDependencies": {
"@types/clipper-lib": "^6.4.0",
"@types/node": "^22.10.2",
"tsx": "^4.19.2",
"typescript": "^5.7.2"