Skip to content

feat(board): propagate solderMaskColor prop to pcb_board.solder_mask_color#2343

Open
podarok wants to merge 3 commits into
tscircuit:mainfrom
EnergyCitizen:feat/ubuntu-font
Open

feat(board): propagate solderMaskColor prop to pcb_board.solder_mask_color#2343
podarok wants to merge 3 commits into
tscircuit:mainfrom
EnergyCitizen:feat/ubuntu-font

Conversation

@podarok
Copy link
Copy Markdown

@podarok podarok commented May 28, 2026

Summary

Propagates the solderMaskColor prop from <board> into pcb_board.solder_mask_color so downstream renderers (gltf, custom 3D viewers, fab-doc generators) can read the requested solder mask finish from Circuit JSON.

Use case

<board solderMaskColor="red"> is accepted at the props layer (BoardColor enum: green, red, blue, purple, black, white, yellow, not_specified) but @tscircuit/core currently drops the value during board emission. Renderers downstream have no way to honor the request — the GLTF viewer defaults to green regardless of what the consumer set, and fab order automation can't read the color from the artifact bundle.

EnergyCitizen's vBMS carrier-board project ran into this when adding red solder mask for visual identity. The PR at tscircuit/circuit-json-to-gltf (companion) maps the field to seven preset fab finish colors; this PR is the producer side.

Change

// lib/components/normal-components/Board.ts (pcb_board.insert call)
const pcb_board = db.pcb_board.insert({
  // ...existing fields...
  material: props.material,
  solder_mask_color: props.solderMaskColor, // ← new
  // ...
})

Back-compat

  • solderMaskColor remains optional on the Board props (no change in @tscircuit/props).
  • Boards that don't set the prop emit pcb_board without the field — identical to pre-PR behavior.
  • Circuit JSON consumers that don't read the field see no diff.

Test plan

  • bun run build clean
  • <board solderMaskColor="red"> → pcb_board entry contains solder_mask_color: "red"
  • <board> (no prop) → pcb_board entry has no solder_mask_color
  • Existing tests pass

Related

  • tscircuit/circuit-json-to-gltf companion PR — maps pcb_board.solder_mask_color → 3D fab finish color (7 presets)
  • @tscircuit/props already defines BoardColor enum + accepts the prop

podarok added 2 commits May 28, 2026 14:27
@tscircuit/core already preserves silkscreentext.font through to
Circuit JSON. The ZodEnum that gated values lives in
@tscircuit/props (forked separately at EnergyCitizen/props
feat/ubuntu-font, 0.0.538-ec.1).

Real glyph rasterization happens in renderer pkgs (circuit-to-svg
for preview SVG, @tscircuit/cli for Gerber, circuit-json-to-gltf
for 3D). Those repos are the next forks in the W15 chain.

Marker doc UBUNTU-FONT-INTEGRATION.md captures the architecture so
future contributors understand why this fork branch exists without
src changes.
…color

W15.P4.C EnergyCitizen fork.

Board normal-component accepted solderMaskColor prop via @tscircuit/props BoardProps but never threaded it into the emitted pcb_board entry. Downstream consumers (circuit-json-to-gltf, custom 3D viewers, fab-doc generators) had no way to read the requested solder mask color from Circuit JSON.

Add solder_mask_color field to the pcb_board.insert() call alongside material + dimension constraints. Value is the BoardColor enum string (green/red/blue/purple/black/white/yellow/not_specified) — same shape that @energycitizen/circuit-json-to-gltf maps to fab finish colors at render time.

Back-compat: solderMaskColor is optional. Boards without the prop emit pcb_board without the field — same as before this commit.

Version 0.0.1272 -> 0.0.1272-ec.1 (EnergyCitizen pre-release).

Depends on circuit-json schema accepting solder_mask_color on pcb_board; this is already supported via circuit-json passthrough — verified by checking that no schema validation rejected the field in our test build.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

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

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment May 28, 2026 4:09pm

Request Review

@github-actions
Copy link
Copy Markdown

This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant