Render female pin header sockets with tapered square openings#295
Merged
rushabhcodes merged 3 commits intoMay 24, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR updates the FemaleHeader 3D geometry to render female pin header sockets with a square through-opening and a tapered entry, improving top-down visual accuracy. It also adds a snapshot test that uses a camera angle intended to make the socket opening easy to validate.
Changes:
- Replace the female header socket subtraction from a cylindrical cavity to a square socket with a tapered (hulled) entry.
- Add a new snapshot test for a 6-pin, 2-row female pinrow using a top-angled camera preset.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lib/FemaleHeader.tsx |
Changes the socket cutout geometry to a square through-socket plus tapered entry. |
tests/snapshots/pinrow6_female.test.ts |
Adds a snapshot test rendering a female pinrow from an angle that highlights the socket opening. |
Comments suppressed due to low confidence (1)
lib/FemaleHeader.tsx:32
socketCenterZis computed fromsocketDepth / 2, which shifts the subtracting cuboid upward so the extra 0.1 depth only extends past the top of the body (it starts exactly atz). To ensure the cut reliably goes fully through (including tolerance) and stays aligned under inversion, center this subtraction shape onz + bodyHeight / 2and let the extra depth extend equally above and below.
const socketEntryHeight = Math.min(bodyHeight * 0.18, pitch * 0.24)
const socketDepth = bodyHeight + 0.1
const socketCenterZ = flipZ(z + socketDepth / 2)
const socketEntryCenterZ = flipZ(z + bodyHeight - socketEntryHeight / 2)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…update test description for clarity
imrishabh18
approved these changes
May 24, 2026
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
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.
Summary
This PR fixes the female pin header 3D model so the socket opening is no longer rendered as a circular hole.
Female headers are now modeled with:
This makes the rendered part look much closer to a real female pin header, especially when viewed from above.
Why this matters
This is a subtle but important rendering accuracy fix. The previous circular cavity made female headers look visibly incorrect in generated previews, while the updated geometry better matches real connector
socket shapes.
Reproduction and validation
Before
After
This PR includes snapshot coverage for the fix:
Tests