Skip to content

Support independent and nested PCB bend axes - #7

Merged
seveibar merged 1 commit into
mainfrom
fix/independent-pcb-bends
Oct 2, 2026
Merged

seveibar merged 1 commit into
mainfrom
fix/independent-pcb-bends

Conversation

@seveibar

@seveibar seveibar commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Finite bends on separate PCB arms are currently rejected whenever their moving directions differ. Allow independent regions to fold about different axes, and allow a nested fold to move with its parent's rigid distal region. This supports both the two outward arms and the original body-moving arrangement from tscircuit#5277.

Derive fold order from finite moving-region containment: fold children first, then carry them with their parents. A nested region must lie entirely beyond its parent's curved strip. Edge-aware polygon containment handles concave outlines. Partially overlapping regions, equal regions, and intersecting curved strips still return typed folding errors. Calls without a board outline retain the parallel, same-moving-direction requirement.

The existing point, direction, inverse CAD, surface, and rigid-mesh transforms are reused. Geometry does not depend on record order, endpoint direction, or outline winding. The original fixture's vertical bend_side: "left" deliberately moves the main body; its snapshot preserves that direction and shows the right tip staying fixed.

Validation: all 32 tests pass (2,029 assertions), including existing visual baselines, parallel serial folds, opposite moving directions, negative angles, rigid forward/inverse transforms, incompatible intersections, and concave containment. TypeScript, build, formatting, and diff checks pass. Three new PNG snapshots use the existing toMatchPngSnapshot/PoppyGL conventions and were visually inspected. No README changes.

Independent arms:

Independent arms

Original body-moving arrangement:

Nested body fold

Full GitHub CI passes for the source commit, including tests, typecheck, and build. Downstream consumer PRs use immutable built preview dbe07e49220c40ec3f0109b7d566561ce5e58bc9 until this helper is merged and released.

@tscircuitbot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

PR Rating: ⭐⭐⭐
Impact: Major

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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