Skip to content

Add netlists and fix layout templates for svbpcb backend#414

Merged
ducky64 merged 19 commits intomasterfrom
svgpcbtemplate2
Jun 25, 2025
Merged

Add netlists and fix layout templates for svbpcb backend#414
ducky64 merged 19 commits intomasterfrom
svgpcbtemplate2

Conversation

@ducky64
Copy link
Copy Markdown
Collaborator

@ducky64 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

@ducky64 ducky64 requested a review from Copilot June 25, 2025 06:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 id string 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 H1 may 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([
Copy link

Copilot AI Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Missing semicolon after the board.setNetlist([...]) call. Consider adding a trailing semicolon for consistent statement termination.

Copilot uses AI. Check for mistakes.
id: 'D7'
})

board.setNetlist([
Copy link

Copilot AI Jun 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Copilot uses AI. Check for mistakes.
@ducky64 ducky64 merged commit a0bf421 into master Jun 25, 2025
12 checks passed
@ducky64 ducky64 deleted the svgpcbtemplate2 branch June 25, 2025 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants