Skip to content

Render female pin header sockets with tapered square openings#295

Merged
rushabhcodes merged 3 commits into
tscircuit:mainfrom
rushabhcodes:fix/female-pinheader-tapered-square-socket
May 24, 2026
Merged

Render female pin header sockets with tapered square openings#295
rushabhcodes merged 3 commits into
tscircuit:mainfrom
rushabhcodes:fix/female-pinheader-tapered-square-socket

Conversation

@rushabhcodes
Copy link
Copy Markdown
Contributor

@rushabhcodes rushabhcodes commented May 24, 2026

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:

  • a square through-socket
  • a reduced tapered entry at the top

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

image

After

image

This PR includes snapshot coverage for the fix:

  • adds a top-center-angled female header snapshot test to clearly show the socket opening
  • validates the updated geometry visually in a view that makes the bug easy to inspect

Tests

  • tests/snapshots/pinrow6_female.test.ts
image

Copilot AI review requested due to automatic review settings May 24, 2026 15:05
@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

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

Project Deployment Actions Updated (UTC)
jscad-electronics Ready Ready Preview, Comment May 24, 2026 3:18pm

Request Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • socketCenterZ is computed from socketDepth / 2, which shifts the subtracting cuboid upward so the extra 0.1 depth only extends past the top of the body (it starts exactly at z). To ensure the cut reliably goes fully through (including tolerance) and stays aligned under inversion, center this subtraction shape on z + bodyHeight / 2 and 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.

Comment thread lib/FemaleHeader.tsx Outdated
Comment thread lib/FemaleHeader.tsx Outdated
Comment thread tests/snapshots/pinrow6_female.test.ts Outdated
@rushabhcodes rushabhcodes merged commit 71e4c68 into tscircuit:main May 24, 2026
6 checks passed
@rushabhcodes rushabhcodes deleted the fix/female-pinheader-tapered-square-socket branch May 24, 2026 16:01
@tscircuitbot
Copy link
Copy Markdown


Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

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


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.

4 participants