Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 168 additions & 0 deletions docs/footprints/kicad-footprints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,171 @@ The text after `kicad:` follows the same convention as KiCad's `.pretty` directo
### Official KiCad footprint libraries

You can browse the official KiCad footprint libraries to discover valid `<Library>/<FootprintName>` values to use with the `kicad:` prefix. See: [KiCad Footprints (GitLab)](https://gitlab.com/kicad/libraries/kicad-footprints).

## Direct KiCad import

You can also import `.kicad_mod` files directly from your project. tscircuit automatically converts them to circuit JSON format.

import { TscircuitIframe } from "@site/src/components/TscircuitIframe"

<TscircuitIframe fsMap={{"index.tsx": `import kicadMod from "./myfootprint.kicad_mod"
export default () => (
<board width="10mm" height="10mm">
<chip
footprint={kicadMod}
name="U1"
/>
</board>
)`, "myfootprint.kicad_mod": `(footprint "R_0402_1005Metric"
(version 20241229)
(generator "kicad-footprint-generator")
(layer "F.Cu")
(descr "Resistor SMD 0402 (1005 Metric), square (rectangular) end terminal, IPC-7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator")
(tags "resistor")
(property "Reference" "REF**"
(at 0 -1.17 0)
(layer "F.SilkS")
(effects
(font
(size 1 1)
(thickness 0.15)
)
)
)
(property "Value" "R_0402_1005Metric"
(at 0 1.17 0)
(layer "F.Fab")
(effects
(font
(size 1 1)
(thickness 0.15)
)
)
)
(attr smd)
(fp_line
(start -0.153641 -0.38)
(end 0.153641 -0.38)
(stroke
(width 0.12)
(type solid)
)
(layer "F.SilkS")
)
(fp_line
(start -0.153641 0.38)
(end 0.153641 0.38)
(stroke
(width 0.12)
(type solid)
)
(layer "F.SilkS")
)
(fp_line
(start -0.93 -0.47)
(end 0.93 -0.47)
(stroke
(width 0.05)
(type solid)
)
(layer "F.CrtYd")
)
(fp_line
(start -0.93 0.47)
(end -0.93 -0.47)
(stroke
(width 0.05)
(type solid)
)
(layer "F.CrtYd")
)
(fp_line
(start 0.93 -0.47)
(end 0.93 0.47)
(stroke
(width 0.05)
(type solid)
)
(layer "F.CrtYd")
)
(fp_line
(start 0.93 0.47)
(end -0.93 0.47)
(stroke
(width 0.05)
(type solid)
)
(layer "F.CrtYd")
)
(fp_line
(start -0.525 -0.27)
(end 0.525 -0.27)
(stroke
(width 0.1)
(type solid)
)
(layer "F.Fab")
)
(fp_line
(start -0.525 0.27)
(end -0.525 -0.27)
(stroke
(width 0.1)
(type solid)
)
(layer "F.Fab")
)
(fp_line
(start 0.525 -0.27)
(end 0.525 0.27)
(stroke
(width 0.1)
(type solid)
)
(layer "F.Fab")
)
(fp_line
(start 0.525 0.27)
(end -0.525 0.27)
(stroke
(width 0.1)
(type solid)
)
(layer "F.Fab")
)
(fp_text user "\${REFERENCE}"
(at 0 0 0)
(layer "F.Fab")
(effects
(font
(size 0.26 0.26)
(thickness 0.04)
)
)
)
(pad "1" smd roundrect
(at -0.51 0)
(size 0.54 0.64)
(layers "F.Cu" "F.Mask" "F.Paste")
(roundrect_rratio 0.25)
)
(pad "2" smd roundrect
(at 0.51 0)
(size 0.54 0.64)
(layers "F.Cu" "F.Mask" "F.Paste")
(roundrect_rratio 0.25)
)
(embedded_fonts no)
(model "\${KICAD9_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0402_1005Metric.step"
(offset
(xyz 0 0 0)
)
(scale
(xyz 1 1 1)
)
(rotate
(xyz 0 0 0)
)
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

why in an iframe and not a CircuitPreview? (is it broken in circuit preview?)

`}} />