Skip to content

Implement constraint between groups with centerX/centerY#2006

Closed
legendary658 wants to merge 1 commit intotscircuit:mainfrom
legendary658:feat-constraint-groups
Closed

Implement constraint between groups with centerX/centerY#2006
legendary658 wants to merge 1 commit intotscircuit:mainfrom
legendary658:feat-constraint-groups

Conversation

@legendary658
Copy link

@legendary658 legendary658 commented Mar 4, 2026

/claim #1391

Summary

  • Adds centerX/centerY props to <constraint /> for absolute positioning of constraint clusters
  • Supports group selectors in constraints (e.g. left=".group1" right=".group2")
  • Updated constraint cluster solver to resolve group source_group_id in addition to pcb_component_id
  • Updated applyPackOutput to handle group members within clusters

Usage

<constraint pcb xDist="20mm" left=".group1" right=".group2" centerX={0} />

This sets a 20mm center-to-center distance between group1 and group2, centered at x=0.

Test plan

  • Existing constraint test (component-constraints01) still passes
  • New test: group-to-group constraint with xDist + centerX
  • New test: component constraint with xDist + centerX
  • TypeScript typecheck passes (tsc --noEmit)

@vercel
Copy link

vercel bot commented Mar 4, 2026

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

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment Mar 4, 2026 5:44pm

Request Review

Add support for <constraint> to work between groups, not just individual
components. Extends constraint props with centerX/centerY for absolute
positioning of constraint clusters.
@seveibar
Copy link
Contributor

seveibar commented Mar 6, 2026

this actually isn't too bad of a PR, but you're not allowed to extend props like that, you have to edit the tscircuit/props repo

fwiw we do not do bounties anymore, i've closed the original issue (it's still a valid issue but the bounty spam is/was too high)

we do automatic sponsorships for contributors, see contributions.tscircuit.com

@seveibar seveibar closed this Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants