Add netlists and fix layout templates for svbpcb backend#414
Merged
Add netlists and fix layout templates for svbpcb backend#414
Conversation
Collaborator
ducky64
commented
Jun 25, 2025
- Change placement data structure to not require name on elements, storing elements as a list
- Add a blackbox block for arrange_blocks, used to place layout templates
- Add _svgpcb_bbox to the template API, to return a bounding box to be used in initial placement
- Refactors svgpcb template APIs to assert instead of returning optional, in most cases those errors cannot be handled
There was a problem hiding this comment.
Pull Request Overview
Updates all example .svgpcb.js files to align with the new backend API by removing explicit element names, using generic sequential IDs, and adding explicit netlist definitions.
- Renamed component variables (e.g.,
usb_conn,reg_ic) to generic IDs (J1,U1,R1, etc.) with inline comments preserving the original logical names. - Inserted
board.setNetlist([...])calls at the end of each example to define nets explicitly. - Removed now-unnecessary
idstring names and updated templates to the asserted API.
Reviewed Changes
Copilot reviewed 50 out of 54 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/TofArray/TofArray.svgpcb.js | Renamed elements to generic IDs and added netlist |
| examples/TestBlinkyWithSchematicImport/TestBlinkyWithSchematicImport.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyWithModeledSchematicImport/TestBlinkyWithModeledSchematicImport.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyWithLibraryExport/TestBlinkyWithLibraryExport.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyWithLibrary/TestBlinkyWithLibrary.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyPacked/TestBlinkyPacked.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyMicro/TestBlinkyMicro.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyExpanded/TestBlinkyExpanded.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyEmpty/TestBlinkyEmpty.svgpcb.js | Added empty netlist call |
| examples/TestBlinkyComplete/TestBlinkyComplete.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyChain/TestBlinkyChain.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyBasicBattery/TestBlinkyBasicBattery.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyBasic/TestBlinkyBasic.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyArray/TestBlinkyArray.svgpcb.js | Generic IDs and netlist block added |
| examples/TestBlinkyImplicit/TestBlinkyImplicit.svgpcb.js | Generic IDs and netlist block added |
Comments suppressed due to low confidence (1)
examples/TofArray/TofArray.svgpcb.js:4
- [nitpick] The generic variable name
H1may be ambiguous when scanning code. Consider using a more descriptive identifier (e.g.,toolingHole1) to improve readability.
const H1 = board.add(JlcToolingHole_1_152mm, {
| id: 'D7' | ||
| }) | ||
|
|
||
| board.setNetlist([ |
There was a problem hiding this comment.
[nitpick] Missing semicolon after the board.setNetlist([...]) call. Consider adding a trailing semicolon for consistent statement termination.
| id: 'D7' | ||
| }) | ||
|
|
||
| board.setNetlist([ |
There was a problem hiding this comment.
[nitpick] The inline netlist definition is quite large. Consider extracting it into a separate constant or JSON file to declutter the example and improve readability.
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.