Show the error cube when a footprint has no 3D model - #963
Draft
addibble wants to merge 1 commit into
Draft
Conversation
jscad-electronics reports "I have no body for this footprint" by returning an empty model rather than by throwing. `FootprinterModel` then built an empty THREE.Group: no geometry, no error, nothing added to the scene. The component was simply absent from the board, indistinguishable from one that was never placed. That silence is expensive to debug. A board authored with parametric chip footprints (`res_p0.8656mm_...`, which jscad-electronics has no body for) lost 26 of its 36 passives -- every resistor among them -- and the only signal was noticing by eye that they were gone. Both viewers already wrap every model in a ThreeErrorBoundary backed by `Error3d`, which draws the red cube and shows the message on hover. All this needs is something to catch: throw during render, naming the footprint, and the missing part becomes visible in the place you are already looking, rather than a component you have to notice the absence of. Tests render the component inside that boundary and assert what the boundary caught. The upstream silence is asserted too, so if jscad-electronics ever reports this itself -- or grows a body for these footprints (tscircuit/jscad-electronics#319) -- the test says so rather than leaving a guard for a condition that no longer happens.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
jscad-electronics reports "I have no body for this footprint" by returning
an empty model rather than by throwing.
FootprinterModelthen built anempty THREE.Group: no geometry, no error, nothing added to the scene. The
component was simply absent from the board, indistinguishable from one
that was never placed.
That silence is expensive to debug. A board authored with parametric chip
footprints (
res_p0.8656mm_..., which jscad-electronics has no body for)lost 26 of its 36 passives -- every resistor among them -- and the only
signal was noticing by eye that they were gone.
Both viewers already wrap every model in a ThreeErrorBoundary backed by
Error3d, which draws the red cube and shows the message on hover. Allthis needs is something to catch: throw during render, naming the
footprint, and the missing part becomes visible in the place you are
already looking, rather than a component you have to notice the absence of.
Tests render the component inside that boundary and assert what the
boundary caught. The upstream silence is asserted too, so if
jscad-electronics ever reports this itself -- or grows a body for these
footprints (tscircuit/jscad-electronics#319) -- the test says so rather
than leaving a guard for a condition that no longer happens.