@@ -39,9 +39,7 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
3939## Table of Contents
4040
4141<!-- toc:start -->
42-
4342- [ Circuit JSON Specification ` circuit-json ` ] ( #circuit-json-specification-circuit-json )
44-
4543 - [ Things You Can Do With Circuit JSON] ( #things-you-can-do-with-circuit-json )
4644 - [ Typescript Usage] ( #typescript-usage )
4745
@@ -79,6 +77,8 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
7977 - [ SourceSimpleTransistor] ( #sourcesimpletransistor )
8078 - [ SourceTrace] ( #sourcetrace )
8179 - [ SourceTraceNotConnectedError] ( #sourcetracenotconnectederror )
80+ - [ CAD Components] ( #cad-components )
81+ - [ CadComponent] ( #cadcomponent )
8282 - [ PCB Elements] ( #pcb-elements )
8383 - [ PcbAutoroutingError] ( #pcbautoroutingerror )
8484 - [ PcbBoard] ( #pcbboard )
@@ -214,7 +214,6 @@ There are 3 main element prefixes:
214214- ` schematic_ ` - e.g. ` schematic_component ` . Anything required to render the Schematic
215215
216216<!-- circuit-json-docs:start -->
217-
218217## Source Components
219218
220219### SourceComponentBase
@@ -253,13 +252,13 @@ interface SourceFailedToCreateComponentError {
253252 subcircuit_id? : string
254253 parent_source_component_id? : string
255254 pcb_center? : {
256- x? : number
257- y? : number
258- }
255+ x? : number
256+ y? : number
257+ }
259258 schematic_center? : {
260- x? : number
261- y? : number
262- }
259+ x? : number
260+ y? : number
261+ }
263262}
264263```
265264
@@ -748,6 +747,36 @@ interface SourceTraceNotConnectedError {
748747}
749748```
750749
750+ ## CAD Components
751+
752+ ### CadComponent
753+
754+ [ Source] ( https://github.com/tscircuit/circuit-json/blob/main/src/cad/cad_component.ts )
755+
756+ ``` typescript
757+ interface CadComponent {
758+ type: " cad_component"
759+ cad_component_id: string
760+ pcb_component_id: string
761+ source_component_id: string
762+ position: Point3
763+ rotation? : Point3
764+ size? : Point3
765+ layer? : LayerRef
766+ subcircuit_id? : string
767+ footprinter_string? : string
768+ model_obj_url? : string
769+ model_stl_url? : string
770+ model_3mf_url? : string
771+ model_gltf_url? : string
772+ model_glb_url? : string
773+ model_step_url? : string
774+ model_wrl_url? : string
775+ model_unit_to_mm_scale_factor? : number
776+ model_jscad? : any
777+ }
778+ ```
779+
751780## PCB Elements
752781
753782### PcbAutoroutingError
@@ -839,7 +868,8 @@ interface PcbComponent {
839868Error emitted when a PCB component is placed outside the board boundaries
840869
841870``` typescript
842- /** Error emitted when a PCB component is placed outside the board boundaries */ interface PcbComponentOutsideBoardError {
871+ /** Error emitted when a PCB component is placed outside the board boundaries */
872+ interface PcbComponentOutsideBoardError {
843873 type: " pcb_component_outside_board_error"
844874 pcb_component_outside_board_error_id: string
845875 error_type: " pcb_component_outside_board_error"
@@ -848,11 +878,11 @@ Error emitted when a PCB component is placed outside the board boundaries
848878 pcb_board_id: string
849879 component_center: Point
850880 component_bounds: {
851- min_x: number
852- max_x: number
853- min_y: number
854- max_y: number
855- }
881+ min_x: number
882+ max_x: number
883+ min_y: number
884+ max_y: number
885+ }
856886 subcircuit_id? : string
857887 source_component_id? : string
858888}
@@ -941,12 +971,11 @@ interface PcbFabricationNoteText {
941971 text: string
942972 layer: VisibleLayer
943973 anchor_position: Point
944- anchor_alignment:
945- | " center"
946- | " top_left"
947- | " top_right"
948- | " bottom_left"
949- | " bottom_right"
974+ anchor_alignment: | " center"
975+ | " top_left"
976+ | " top_right"
977+ | " bottom_left"
978+ | " bottom_right"
950979 color? : string
951980}
952981```
@@ -958,7 +987,8 @@ interface PcbFabricationNoteText {
958987Error emitted when a pcb footprint overlaps with another element
959988
960989``` typescript
961- /** Error emitted when a pcb footprint overlaps with another element */ interface PcbFootprintOverlapError {
990+ /** Error emitted when a pcb footprint overlaps with another element */
991+ interface PcbFootprintOverlapError {
962992 type: " pcb_footprint_overlap_error"
963993 pcb_error_id: string
964994 error_type: " pcb_footprint_overlap_error"
@@ -1029,8 +1059,8 @@ interface PcbGroup {
10291059 description? : string
10301060 layout_mode? : string
10311061 autorouter_configuration? : {
1032- trace_clearance: Length
1033- }
1062+ trace_clearance: Length
1063+ }
10341064 autorouter_used_string? : string
10351065}
10361066```
@@ -1446,11 +1476,11 @@ interface PcbSilkscreenText {
14461476 text: string
14471477 is_knockout? : boolean
14481478 knockout_padding? : {
1449- left: Length
1450- top: Length
1451- bottom: Length
1452- right: Length
1453- }
1479+ left: Length
1480+ top: Length
1481+ bottom: Length
1482+ right: Length
1483+ }
14541484 ccw_rotation? : number
14551485 layer: LayerRef
14561486 is_mirrored? : boolean
@@ -1642,7 +1672,8 @@ interface PcbVia {
16421672Draws a styled arc on the schematic
16431673
16441674``` typescript
1645- /** Draws a styled arc on the schematic */ interface SchematicArc {
1675+ /** Draws a styled arc on the schematic */
1676+ interface SchematicArc {
16461677 type: " schematic_arc"
16471678 schematic_arc_id: string
16481679 schematic_component_id: string
@@ -1682,7 +1713,8 @@ interface SchematicBox {
16821713Draws a styled circle on the schematic
16831714
16841715``` typescript
1685- /** Draws a styled circle on the schematic */ interface SchematicCircle {
1716+ /** Draws a styled circle on the schematic */
1717+ interface SchematicCircle {
16861718 type: " schematic_circle"
16871719 schematic_circle_id: string
16881720 schematic_component_id: string
@@ -1710,13 +1742,13 @@ interface SchematicComponent {
17101742 schematic_component_id: string
17111743 pin_spacing? : number
17121744 pin_styles? : Record <
1713- string ,
1714- {
1715- left_margin? : number
1716- right_margin? : number
1717- top_margin? : number
1718- bottom_margin? : number
1719- }
1745+ string ,
1746+ {
1747+ left_margin? : number
1748+ right_margin? : number
1749+ top_margin? : number
1750+ bottom_margin? : number
1751+ }
17201752 >
17211753 box_width? : number
17221754 symbol_name? : string
@@ -1742,9 +1774,9 @@ interface SchematicPortArrangementBySides {
17421774 right_side? : { pins: number []; direction? : " top-to-bottom" | " bottom-to-top" }
17431775 top_side? : { pins: number []; direction? : " left-to-right" | " right-to-left" }
17441776 bottom_side? : {
1745- pins: number []
1746- direction? : " left-to-right" | " right-to-left"
1747- }
1777+ pins: number []
1778+ direction? : " left-to-right" | " right-to-left"
1779+ }
17481780}
17491781
17501782type SchematicPortArrangement =
@@ -1850,7 +1882,8 @@ interface SchematicLayoutError {
18501882Draws a styled line on the schematic
18511883
18521884``` typescript
1853- /** Draws a styled line on the schematic */ interface SchematicLine {
1885+ /** Draws a styled line on the schematic */
1886+ interface SchematicLine {
18541887 type: " schematic_line"
18551888 schematic_line_id: string
18561889 schematic_component_id: string
@@ -1902,8 +1935,8 @@ interface SchematicNetLabel {
19021935 text: string
19031936 symbol_name? : string | undefined
19041937 /** When true the net label can be repositioned. When false the label's
1905- * position is fixed by the element it is attached to. */
1906-
1938+ * position is fixed by the element it is attached to. */
1939+
19071940 is_movable? : boolean
19081941 subcircuit_id? : string
19091942}
@@ -1955,7 +1988,8 @@ interface SchematicPort {
19551988Draws a styled rectangle on the schematic
19561989
19571990``` typescript
1958- /** Draws a styled rectangle on the schematic */ interface SchematicRect {
1991+ /** Draws a styled rectangle on the schematic */
1992+ interface SchematicRect {
19591993 type: " schematic_rect"
19601994 schematic_rect_id: string
19611995 schematic_component_id: string
@@ -2033,9 +2067,9 @@ interface SchematicText {
20332067 text: string
20342068 font_size: number
20352069 position: {
2036- x: number
2037- y: number
2038- }
2070+ x: number
2071+ y: number
2072+ }
20392073 rotation: number
20402074 anchor: NinePointAnchor | FivePointAnchor
20412075 color: string
@@ -2050,13 +2084,13 @@ interface SchematicText {
20502084``` typescript
20512085interface SchematicTraceEdge {
20522086 from: {
2053- x: number
2054- y: number
2055- }
2087+ x: number
2088+ y: number
2089+ }
20562090 to: {
2057- x: number
2058- y: number
2059- }
2091+ x: number
2092+ y: number
2093+ }
20602094 is_crossing? : boolean
20612095 from_schematic_port_id? : string
20622096 to_schematic_port_id? : string
0 commit comments