Skip to content

Support anchor_position and anchor_alignment for pcb_group#1513

Merged
seveibar merged 9 commits intotscircuit:mainfrom
MustafaMulla29:anchor
Oct 17, 2025
Merged

Support anchor_position and anchor_alignment for pcb_group#1513
seveibar merged 9 commits intotscircuit:mainfrom
MustafaMulla29:anchor

Conversation

@MustafaMulla29
Copy link
Copy Markdown
Contributor

@MustafaMulla29 MustafaMulla29 commented Oct 16, 2025

/closes tscircuit/pcb-viewer#408

@seveibar is this how it should be done? or am i overcomplicating this?

@vercel
Copy link
Copy Markdown

vercel bot commented Oct 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview Comment Oct 17, 2025 4:25pm

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

Good work but you need to add <pcbnotetext or <silkcreentext at different coordinates eg (0,0), (5,5) and (10,10) and also text at the an anchor position with the position and alognment so that its clear from the snapshot that its working

@MustafaMulla29
Copy link
Copy Markdown
Contributor Author

@seveibar is it working correctly?

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

Closer but reading the tests it doesnt seem obvious that the anchor is working. Instead of doing two components in the group maybe do a single dip8 (to make it bigger)

Related but you dont need to immediately address, this code is likely broken for nested groups. Using pcbX/pcbY directly basically always fails for nesting, supposed to use this._getGlobalPcbPositionBeforeLayout

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

I still cant tell if its working, use tscircuit/circuit-to-svg#389

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

Snapshot quality is still low. The 5,5 and 10,10 were just illustrative examples of coordinates, they are useless as used. The 10,10 is supposed to represent the top right of the bounds, you can either move the group or move the text but readability is still really bad. Improve the silkscreen text anchors as well (to the same anchor) for clarity, change size as necessary

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

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

Please check the snapshots 😭 they are all misaligned

Image

@seveibar
Copy link
Copy Markdown
Contributor

Maybe title the snapshot and draw the anchor separately from the text

@seveibar
Copy link
Copy Markdown
Contributor

Please make sure it is super clear whats happening, also in general the bounds of the snapshots are all off, adjust the board so we can see whats happening or have it be autosized (you can set the board anchor for simplicity i think)

@seveibar seveibar merged commit 525bd4c into tscircuit:main Oct 17, 2025
11 checks passed
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.

Display the anchor of a pcb group

2 participants