Open bug report

Board GLBs: exposed pads come out gray, should be copper (or a chosen finish)

John Lauer · 22d ago

Board GLBs from step2glb convert --molecule --board ... give the exposed copper (pads, test points) a flat 0.5 gray material (from the KiCad STEP export). In renders and the wiki 3D viewer the pads read as gray, not copper, and people ask why.

Seen on john/buck-12v5v-molecule: material mat_26 (baseColor 0.5, 0.5, 0.5) is the pad layer. Fix applied there by hand: baseColorFactor [0.80, 0.36, 0.17], metallic 0.75, roughness 0.38, renamed AdomCopperPads. With metallic 1.0 it reflects the neutral studio environment and looks near white, so keep metallic below 1.

Suggestion: detect the KiCad copper/pad body in the STEP (the thin layer just above the substrate top) and give it a named copper material by default, with an option for ENIG gold or HASL silver finishes.

2 Replies

John Lauer · 22d ago

Follow-up: the colour alone is not enough. The board's translucent solder mask layer (alpha 0.83, about 0.01 mm above the pads) covers the pads with no openings, so any pad colour comes out peach. Lifting the pad node 0.04 mm above the mask fixed it (baseColor 0.72/0.30/0.10, metallic 0.55, roughness 0.42). The real fix is mask openings at the pads, or pads drawn above the mask.

John Lauer · 21d ago

Update from adom-aiflow 0.1.47, which now handles this on its side (adom-aiflow board-glb copper, then the board-glb check gate), and a correction to the follow-up above.

Correction: the KiCad mask already has openings. I decoded the Draco _soldermask mesh of the buck GLB (KiCad 10 export with --include-soldermask): it is two flat faces (z 1.56 mm top, -0.05 mm bottom) and the top face is open at all 58 pad centres; the bottom is open at the 10 through-hole pads. The pale look came from the material: mat_26 sets only baseColorFactor, so glTF's defaults apply (metallic 1, roughness 1), a fully rough metal that reads grey, then pale peach once recoloured. Giving the pad layer copper with explicit metallic 0.55 / roughness 0.42 and NOT lifting the pads renders the same as the lifted hand fix (renders attached: before, after). The 0.04 mm lift is not needed.

What aiflow does now (by construction, from the .kicad_pcb):

  • finds the board layers by STEP product / mesh name (<board>_pad, _via, _copper, _soldermask, _PCB), never by material index, and gives pads and vias a new copper material (or --finish enig|hasl), tracks/zones copper under the mask; the shared KiCad material is left alone;
  • rebuilds the mask as outline minus the F.Mask / B.Mask apertures (pad shape plus mask margin from pad, footprint or board setup; mask graphics and zones; untented vias; drill holes; solder_mask_min_width), uncompressed so the gate can prove the openings;
  • optional solder (--paste solder) only on F.Paste / B.Paste apertures of fitted parts (paste margin and ratio, DNP skipped); test points, contacts and pins stay bare copper;
  • generates pad copper from F.Cu / B.Cu pad shapes if the STEP was exported without --include-pads;
  • gate: pad colour in the finish range with explicit metal/roughness, mask open at every exposed pad centre, no solder on paste-less pads, GLB pads line up with the board file.

What step2glb should do so nobody needs the post-process:

  1. Name the KiCad board layers' materials and give them explicit PBR: <board>_pad and _via as copper (baseColor about [0.72, 0.30, 0.10], metallic 0.55, roughness 0.42) or a requested finish (--finish copper|enig|hasl); _copper (tracks/zones) copper too. Never leave metallic/roughness unset on any board layer (the KiCad export gives _copper [0.7, 0.61, 0] and _pad 0.5 grey with no PBR).
  2. Key this on the STEP product names KiCad writes (<board>_pad, _via, _copper, _soldermask, _silkscreen, _PCB), not on a material index or z height.
  3. Keep the mask as KiCad exports it (it has the openings); with --board, optionally rebuild it from the F.Mask / B.Mask apertures for exports that lack it, and report mask_openings per side and exposed_pads_covered: 0 in the stats.
  4. Optional --paste solder: add a thin solder face on F.Paste / B.Paste apertures only (the service already reads the board for the footprint JSON).
  5. Add a stat the caller can gate on, e.g. pad_material: {name, rgb, metallic, roughness} and a warning when pads are uncoloured.
  6. Recommend the export flags in the skill: kicad-cli pcb export step --subst-models --include-tracks --include-pads --include-zones --include-soldermask --include-silkscreen.

close-gray

close-new

Log in to reply.