Standalone vias incorrectly require component courtyards and emit empty footprint references
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 58
- Forks
- 203
- Avg merge
- 7h 39m
- Merged PRs (30d)
- 286
Description
Versions: @tscircuit/core 0.0.1892, tscircuit 0.0.2516, Bun 1.4.2; Linux.
An ordinary standalone <via name="VGND" pcbX={0} pcbY={0} holeDiameter={.3} outerDiameter={.6} connectsTo="net.GND"/> creates a pseudo pcb_component whose source_component_id is source_manually_placed_via_0. The courtyard check then emits pcb_component_missing_courtyard_warning: "component has no courtyard".
A drilled via is not an assembled component and should not require a component courtyard. Please distinguish source_manually_placed_via from assembled source components. Retain via copper/drill/edge checks.
Minimal complete reproduction:
import React from 'react'
import {Circuit} from '@tscircuit/core'
const explicitOnly=async()=>{const h:any={};return {on:(e:string,f:any)=>{h[e]=f},start:()=>h.complete({traces:[]})}}
const c=new Circuit()
c.add(<board width={10} height={10} layers={2} autorouter={{algorithmFn:explicitOnly}}>
<net name="GND"/>
{[['J1',-2],['J2',2]].map(([name,x])=><React.Fragment key={name}>
<chip name={String(name)} pcbX={Number(x)} pcbY={0} pinLabels={{pin1:'GND'}} footprint={<footprint><platedhole portHints={['1']} holeDiameter={.8} outerDiameter={1.4} shape="circle" pcbX={0} pcbY={0}/><courtyardcircle radius={1} pcbX={0} pcbY={0}/></footprint>}/>
<trace from={name+'.pin1'} to="net.GND"/>
</React.Fragment>)}
<via name="VGND" pcbX={0} pcbY={0} holeDiameter={.3} outerDiameter={.6} connectsTo="net.GND"/>
<copperpour layer="bottom" connectsTo="net.GND" clearance={.16} boardEdgeMargin={.31}/>
</board>)
await c.renderUntilSettled()
const j=c.getCircuitJson();await Bun.write(new URL('./circuit.json',import.meta.url),JSON.stringify(j,null,2))
console.log(JSON.stringify(j.filter((r:any)=>r.type.includes('error')||r.type.includes('warning')),null,2))
The KiCad exporter also emits an empty anonymous footprint/reference field for these via containers (in addition to the correct actual via). Native DRC reports text thickness 0.0003 mm for that empty reference. Our packaging adapter hides the empty reference and preserves the plated via. If this belongs in the exporter, please track that consequence there. No implementation PR is in progress.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal reproduction, renderUntilSettled, and getCircuitJson to trace the courtyard warning for source_manually_placed_via. Then inspect the KiCad exporter output for the empty anonymous footprint/reference. Done means standalone vias retain copper, drill, and edge checks without requiring courtyards, and no empty reference is emitted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100