Skip to content

fix: preserve flex rendering with shared fold diagnostics - #4279

Merged
seveibar merged 6 commits into
mainfrom
fix/flex-render-errors
Oct 2, 2026
Merged

seveibar merged 6 commits into
mainfrom
fix/flex-render-errors

Conversation

@seveibar

@seveibar seveibar commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Nonparallel PCB bends and CAD mounts inside bend zones currently abort renderUntilSettled() or 3D export. Emit pcb_placement_error records and preserve flat placements for these declared folding limitations so PCB, schematic, and 3D output remain available.

Board construction uses flex-utils' explicit folding result. CAD placement handles only PcbFoldError; unexpected failures propagate. An unsupported board keeps its CAD flat, while an invalid rigid mount stays flat and other valid mounts still fold. The shared helper covers footprint models, bounding boxes, and child <cadmodel> elements. Surface deformation, rigid meshes, and stiffener fallback remain in the shared exporter.

The standard toMatch3dSnapshot/PoppyGL regressions enable the exporter's showErrors option. GLTF stores full Circuit JSON messages in renderer-neutral scene metadata. The snapshot matcher forwards the exporter's adapter options to published poppygl@0.0.29, which draws the messages through its existing debugPoints labels. The adapter uses the current camera to place readable rows on screen, including errors without coordinates. Circuit geometry, camera and bounds are preserved. The PCB snapshot enables showBendLines and shows both finite bend segments with 0.5 mm BEND LINE labels. The underside close-up still checks the flat stiffener directly.

Uses published @tscircuit/flex-utils@0.0.7, poppygl@0.0.29, circuit-json-to-gltf@0.0.139, and circuit-to-svg@0.0.437. GLTF #231 and SVG #803 are merged and released. Both rendering options default to false.

Addresses items 2 and the rendering exception in item 3 of tscircuit#5277. Bend-zone DRC is covered separately by checks #370; independent nonparallel physical folds remain unsupported.

The released SVG renderer also includes upstream SVG #795 and SVG #796. Three existing schematic snapshots are refreshed with the already-reviewed paint order and selected-sheet framing; symbol positions and geometry are unchanged. The final published-version update adds only the bend labels to the PCB baseline; the 3D and schematic baselines are unchanged from the tested previews.

Validation: all 10 PCB-flex tests, 10 adjacent CAD tests across seven files, and all three affected schematic regressions pass (23 tests, 230 assertions). TypeScript, build, formatting, and installation with scripts disabled pass. Repeated settled renders preserve Circuit JSON and do not duplicate diagnostics. New PCB and 3D snapshots were visually inspected. The unexpected-error regression verifies that ordinary failures propagate. Actual GLB messages are rendered through the published PoppyGL API.

Full CI passes on the published renderer versions and refreshed PCB snapshot: all ten test shards, TypeScript, formatting, dist smoke tests, package preview, continuous releases, and Vercel.

@vercel

vercel Bot commented Oct 1, 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 3:17am UTC

Request Review

@seveibar seveibar changed the title fix: report PCB fold errors without aborting rendering fix: preserve flex rendering with shared fold diagnostics Oct 1, 2026
@seveibar
seveibar marked this pull request as draft October 2, 2026 01:03
@seveibar
seveibar marked this pull request as ready for review October 2, 2026 03:24
@seveibar
seveibar merged commit 0450e9d into main Oct 2, 2026
20 checks passed
@seveibar
seveibar deleted the fix/flex-render-errors branch October 2, 2026 03:29
@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 — fde96841 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