Skip to content

Support independent and nested flex PCB folds - #4301

Merged
seveibar merged 6 commits into
mainfrom
fix/independent-pcb-bends
Oct 2, 2026
Merged

seveibar merged 6 commits into
mainfrom
fix/independent-pcb-bends

Conversation

@seveibar

@seveibar seveibar commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Flex boards with finite bends on different arms currently report a placement error and remain flat. Adopt the shared finite-region fold implementation so independent nonparallel arms fold successfully. Nested regions fold the child before carrying it with the parent. The original two-arm example with both bendSide="left" values also folds correctly: its vertical chord moves the body, while the right tip stays flat.

Add numeric CAD regressions and actual PCB/GLB snapshots for both arrangements, with explanatory PCB notes and optional finite bend lines. PCB placements remain flat, repeated rendering leaves Circuit JSON unchanged, and inverse CAD transforms recover the flat positions and orientations. Replace the obsolete all-nonparallel fallback fixture with crossing bend regions on a rectangle; that case retains the flat board, CAD, and schematic and shows its canonical placement error through published PoppyGL's existing labels.

The bend examples already declare material="flex". Adopt the exporter material fix so their 3D surfaces and edges use the default polyimide palette, with dark markings for contrast. Refresh six existing default-color flex PNGs without adding explicit color overrides. Existing explicit colors and all PCB/schematic snapshots remain unchanged.

Flex-utils #7, GLTF #232, and GLTF #233 are merged. Core uses published flex-utils 0.0.8 for its bundled fold implementation and published GLTF 0.0.141 for its 3D snapshot exporter. Both preview pins are replaced, with no remaining dependency prerequisite. PoppyGL remains published 0.0.29. Addresses tscircuit #5277, item 2.

Validation:

  • 25 flex, CAD, and affected schematic regressions pass across 22 files with 338 assertions, including the existing finite-tail, bend-zone, stiffener, and unexpected-error cases. Numeric checks cover emitted orientations, restored CAD basis directions, and complete unchanged fallback poses.
  • Three new PCB snapshots and the six refreshed real GLB-to-PNG snapshots were visually inspected. Both independent and nested success regressions fail against published flex-utils 0.0.7.
  • Installation with scripts disabled succeeds. The actual installed GLTF 0.0.141 package has all five distribution files byte-identical to the tested preview. All 15 flex snapshots remain byte-for-byte unchanged when replacing that preview with the published release. The material refresh changes exactly six default-color PNGs; existing explicit colors and all PCB/schematic snapshots stay unchanged.
  • TypeScript, build, formatting, and diff checks pass. Full CI passes on source 3e11388: all ten test shards, TypeScript, formatting, distribution smoke tests, package preview, and Vercel deployment.

@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
tscircuit-core-benchmarks Ready Ready Preview Oct 2, 2026 5:43am UTC

Request Review

@seveibar
seveibar marked this pull request as ready for review October 2, 2026 05:07
@seveibar
seveibar marked this pull request as draft October 2, 2026 05:21
@seveibar
seveibar marked this pull request as ready for review October 2, 2026 05:46
@seveibar
seveibar merged commit 5828585 into main Oct 2, 2026
20 checks passed
@seveibar
seveibar deleted the fix/independent-pcb-bends branch October 2, 2026 05:48
@tscircuitbot

Copy link
Copy Markdown
Contributor

Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

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


This branch was successfully deployed

1 active deployment
Preview — 3e113885 Deployed Oct 2, 2026 by vercel[bot]
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