Conversation
The DSN (boundary (path ...)) describes the true board shape, but only its bounding box was used. PcbBoard already supports outline/shape, so populate them from the boundary path using the same transformDsnUnitToMm matrix. For the Smoothieboard fixture the outline goes from 4 corners to its real 38 vertices. Guarded to >4 distinct points so rectangular boards are unchanged; width/height/center are untouched. Incremental progress on tscircuit#54. Written with AI assistance (Claude).
Author
|
The single failing check (
I could not attach the regenerated 214 KB SVG through the web editor. If you enable "Allow edits by maintainers" pushes or just run |
Convert DSN boundary paths to a pcb_board and assert that a non-rectangular path yields a polygon outline with its real vertices (closed and open paths, plus the Smoothieboard fixture), while a rectangular path keeps the bounding box and gets no outline. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Uve3CM6GBS4y8gdk9KSHw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Incremental progress on #54 (Smoothie Board conversion).
Problem
convertDsnPcbToCircuitJsonreads the DSN(boundary (path ...))but only uses it to derivecenter,widthandheight. The polygon itself is discarded, so every board is emitted as its bounding rectangle.For the Smoothieboard fixture the boundary path has 38 distinct vertices (rounded corners, non-rectangular edges). The rendered SVG collapsed all of that into 4 corners:
Change
PcbBoardincircuit-jsonalready supportsoutline?: Point[]andshape?: "rect" | "polygon"— nothing was populating them. This fills them from the boundary path, transformed with the sametransformDsnUnitToMmmatrix used everywhere else in the converter.The closing vertex is dropped when present, and the outline is only emitted when the path has more than 4 distinct points, so genuinely rectangular boards keep their current output.
Verification
bun test-> 54 pass, 1 skip. The only snapshot affected isrepro7-smoothie-board, which is the intended effect.bunx tsc --noEmitclean,bunx biome formatclean.width/height/centerare unchanged (129.548 x 105.029 mm) — this only adds geometry that was being thrown away.Note:
tests/repros/__snapshots__/repro7-smoothie-board.snap.svgneeds regenerating (bun test -u); I could not attach the 214 KB SVG through the web editor. Happy to push it if you prefer.Written with AI assistance (Claude). Happy to adjust the >4-point heuristic or split this further.