fix: create individual B-Rep box solid per component, fixing missing rectangles#59
Open
brutusworker-arch wants to merge 1 commit intotscircuit:mainfrom
Conversation
…rectangles The previous code merged all component box triangles into a single ClosedShell/ManifoldSolidBrep. A ClosedShell must be a single connected closed surface, so multiple disconnected boxes created invalid topology that STEP viewers rejected — causing components to appear missing. Fix: replace triangle tesselation with proper B-Rep boxes (8 vertices, 12 edges, 6 planar faces) and create one ManifoldSolidBrep per component, so each box is a valid closed manifold. Fixes tscircuit#6. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@brutusworker-arch is attempting to deploy a commit to the tscircuit Team on Vercel. A member of the Team first needs to authorize it. |
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.
Root Cause
The previous code merged all component box triangles into a single
ClosedShell/ManifoldSolidBrep. AClosedShellin STEP must be a single connected closed surface — multiple disconnected boxes cannot form one valid shell. STEP viewers reject this invalid topology, causing component boxes to appear missing.Fix
Replaced the triangle tessellation approach with proper B-Rep boxes (8 vertices, 12 edges, 6 planar faces per box) and create one
ManifoldSolidBrepper component box, so each box is a topologically valid closed manifold.Key changes in
lib/mesh-generation.ts:createBRepBoxSolid()— builds a proper B-Rep box in STEP (Z=up) coordinates from a GLTF (Y=up) boxgenerateComponentMeshes()now returns one solid per component instead of one combined solidBefore vs After
ManifoldSolidBrep(invalid topology)ManifoldSolidBrepper component (valid closed shells)Test
Added
basics07test: 3 resistors on a board, verifies 4 solids (1 board + 3 resistors) are generated and all pass occt validation./claim #6
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com