circuit-json 0.0.530 → 0.0.532

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -42,7 +42,6 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
42
42
  <!-- toc:start -->
43
43
 
44
44
  - [Circuit JSON Specification `circuit-json`](#circuit-json-specification-circuit-json)
45
-
46
45
  - [Things You Can Do With Circuit JSON](#things-you-can-do-with-circuit-json)
47
46
  - [Typescript Usage](#typescript-usage)
48
47
 
@@ -79,6 +78,7 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
79
78
  - [SourceProjectMetadata](#sourceprojectmetadata)
80
79
  - [SourcePropertyIgnoredWarning](#sourcepropertyignoredwarning)
81
80
  - [SourceRefdesConventionWarning](#sourcerefdesconventionwarning)
81
+ - [SourceRuntimeError](#sourceruntimeerror)
82
82
  - [SourceSimpleAmmeter](#sourcesimpleammeter)
83
83
  - [SourceSimpleBattery](#sourcesimplebattery)
84
84
  - [SourceSimpleCapacitor](#sourcesimplecapacitor)
@@ -113,19 +113,20 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
113
113
  - [UnknownErrorFindingPart](#unknownerrorfindingpart)
114
114
  - [CAD Components](#cad-components)
115
115
  - [CadCable](#cadcable)
116
+ - [CadCollisionError](#cadcollisionerror)
116
117
  - [CadComponent](#cadcomponent)
117
118
  - [CadReferenceSurface](#cadreferencesurface)
118
119
  - [PCB Elements](#pcb-elements)
119
- - [PcbFabricatorExtraChargeWarning](#pcbfabricatorextrachargewarning)
120
120
  - [PcbAutoroutingError](#pcbautoroutingerror)
121
121
  - [PcbBend](#pcbbend)
122
122
  - [PcbBoard](#pcbboard)
123
123
  - [PcbBreakoutPoint](#pcbbreakoutpoint)
124
+ - [PcbBusLengthSkewError](#pcbbuslengthskewerror)
124
125
  - [PcbBusRoutingConstraintError](#pcbbusroutingconstrainterror)
125
126
  - [PcbBusRoutingConstraintWarning](#pcbbusroutingconstraintwarning)
126
- - [PcbBusLengthSkewError](#pcbbuslengthskewerror)
127
127
  - [PcbComponent](#pcbcomponent)
128
128
  - [PcbComponentInvalidLayerError](#pcbcomponentinvalidlayererror)
129
+ - [PcbComponentMissingCourtyardWarning](#pcbcomponentmissingcourtyardwarning)
129
130
  - [PcbComponentNotOnBoardEdgeError](#pcbcomponentnotonboardedgeerror)
130
131
  - [PcbComponentOutsideBoardError](#pcbcomponentoutsideboarderror)
131
132
  - [PcbConnectorNotInAccessibleOrientationWarning](#pcbconnectornotinaccessibleorientationwarning)
@@ -143,6 +144,7 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
143
144
  - [PcbFabricationNotePath](#pcbfabricationnotepath)
144
145
  - [PcbFabricationNoteRect](#pcbfabricationnoterect)
145
146
  - [PcbFabricationNoteText](#pcbfabricationnotetext)
147
+ - [PcbFabricatorExtraChargeWarning](#pcbfabricatorextrachargewarning)
146
148
  - [PcbFootprintOverlapError](#pcbfootprintoverlaperror)
147
149
  - [PcbGroundPlane](#pcbgroundplane)
148
150
  - [PcbGroundPlaneRegion](#pcbgroundplaneregion)
@@ -163,6 +165,7 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
163
165
  - [PcbPadTraceClearanceError](#pcbpadtraceclearanceerror)
164
166
  - [PcbPanel](#pcbpanel)
165
167
  - [PcbPanelizationPlacementError](#pcbpanelizationplacementerror)
168
+ - [PcbPin1Location](#pcbpin1location)
166
169
  - [PcbPlacementError](#pcbplacementerror)
167
170
  - [PcbPlatedHole](#pcbplatedhole)
168
171
  - [PcbPort](#pcbport)
@@ -178,7 +181,9 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
178
181
  - [PcbSilkscreenPill](#pcbsilkscreenpill)
179
182
  - [PcbSilkscreenRect](#pcbsilkscreenrect)
180
183
  - [PcbSilkscreenText](#pcbsilkscreentext)
184
+ - [PcbSoldermaskOpening](#pcbsoldermaskopening)
181
185
  - [PcbSolderPaste](#pcbsolderpaste)
186
+ - [PcbStackup](#pcbstackup)
182
187
  - [PcbStiffener](#pcbstiffener)
183
188
  - [PcbText](#pcbtext)
184
189
  - [PcbThermalSpoke](#pcbthermalspoke)
@@ -186,10 +191,10 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
186
191
  - [PcbTraceError](#pcbtraceerror)
187
192
  - [PcbTraceHint](#pcbtracehint)
188
193
  - [PcbTraceMissingError](#pcbtracemissingerror)
194
+ - [PcbTraceStyleWarning](#pcbtracestylewarning)
189
195
  - [PcbTraceTooLongError](#pcbtracetoolongerror)
190
196
  - [PcbTraceTooLongWarning](#pcbtracetoolongwarning)
191
197
  - [PcbTraceTooManyViasWarning](#pcbtracetoomanyviaswarning)
192
- - [PcbTraceStyleWarning](#pcbtracestylewarning)
193
198
  - [PcbTraceWarning](#pcbtracewarning)
194
199
  - [PcbVia](#pcbvia)
195
200
  - [PcbViaClearanceError](#pcbviaclearanceerror)
@@ -215,15 +220,15 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
215
220
  - [SchematicPort](#schematicport)
216
221
  - [SchematicRect](#schematicrect)
217
222
  - [SchematicSheet](#schematicsheet)
223
+ - [SchematicSheetStylingWarning](#schematicsheetstylingwarning)
218
224
  - [SchematicSymbol](#schematicsymbol)
219
225
  - [SchematicTable](#schematictable)
220
226
  - [SchematicTableCell](#schematictablecell)
221
227
  - [SchematicText](#schematictext)
228
+ - [SchematicTextPart](#schematictextpart)
222
229
  - [SchematicTrace](#schematictrace)
223
230
  - [SchematicVoltageProbe](#schematicvoltageprobe)
224
231
  - [Simulation Elements](#simulation-elements)
225
- - [SimulationReturnCurrentContact](#simulationreturncurrentcontact)
226
- - [SimulationReturnCurrentGridJson](#simulationreturncurrentgridjson)
227
232
  - [SimulationAcSweepCurrentGraph](#simulationacsweepcurrentgraph)
228
233
  - [SimulationAcSweepVoltageGraph](#simulationacsweepvoltagegraph)
229
234
  - [SimulationAnalysisResult](#simulationanalysisresult)
@@ -243,7 +248,9 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
243
248
  - [SimulationPcbReturnCurrentHeatmap](#simulationpcbreturncurrentheatmap)
244
249
  - [SimulationPcbReturnCurrentMarker](#simulationpcbreturncurrentmarker)
245
250
  - [SimulationPcbReturnCurrentResult](#simulationpcbreturncurrentresult)
251
+ - [SimulationReturnCurrentContact](#simulationreturncurrentcontact)
246
252
  - [SimulationReturnCurrentExcitation](#simulationreturncurrentexcitation)
253
+ - [SimulationReturnCurrentGridJson](#simulationreturncurrentgridjson)
247
254
  - [SimulationSpiceSubcircuit](#simulationspicesubcircuit)
248
255
  - [SimulationSwitch](#simulationswitch)
249
256
  - [SimulationTerminalPort](#simulationterminalport)
@@ -252,6 +259,10 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
252
259
  - [SimulationUnknownExperimentError](#simulationunknownexperimenterror)
253
260
  - [SimulationVoltageProbe](#simulationvoltageprobe)
254
261
  - [SimulationVoltageSource](#simulationvoltagesource)
262
+ - [Drawing Elements](#drawing-elements)
263
+ - [DrawingPage](#drawingpage)
264
+ - [DrawingPageTitleBlock](#drawingpagetitleblock)
265
+ - [DrawingPartView](#drawingpartview)
255
266
 
256
267
  <!-- toc:end -->
257
268
 
@@ -272,9 +283,7 @@ const resistor: SourceSimpleResistor = simple_source_resistor.parse({
272
283
  console.log(resistor.resistance) // 1000
273
284
 
274
285
  // This is the common way to parse/transform any element
275
- any_circuit_element.parse({
276
- /* ... */
277
- })
286
+ any_circuit_element.parse({/* ... */})
278
287
  ```
279
288
 
280
289
  ## Base Units
@@ -381,11 +390,11 @@ interface SourceBus {
381
390
  target_differential_impedance?: number
382
391
  /** Ordered polarity for a resolved point-to-point differential pair. */
383
392
  differential_pair?: {
384
- positive_source_trace_id: string
385
- negative_source_trace_id: string
386
- trace_gap?: number
387
- max_uncoupled_length?: number
388
- }
393
+ positive_source_trace_id: string
394
+ negative_source_trace_id: string
395
+ trace_gap?: number
396
+ max_uncoupled_length?: number
397
+ }
389
398
  /** Additional traces for length comparison, without changing electrical membership. */
390
399
  length_match_source_trace_ids?: string[]
391
400
  min_length?: SourceBusRouteLength
@@ -405,17 +414,16 @@ interface SourceBus {
405
414
 
406
415
  /** A routed length in mm, or an offset from the longest endpoint Manhattan distance.
407
416
  * Explicit references are resolved source traces; omitted references use the bus
408
- * members and length_match_source_trace_ids. */
409
- type SourceBusRouteLength =
417
+ * members and length_match_source_trace_ids. */ type SourceBusRouteLength =
410
418
  | number
411
419
  | {
412
- reference: "longest_manhattan"
413
- source_trace_ids?: string[]
414
- offset?: number
415
- }
420
+ reference: "longest_manhattan"
421
+ source_trace_ids?: string[]
422
+ offset?: number
423
+ }
416
424
 
417
- /** Centerline separation in mm or a multiple of the larger local trace width. */
418
- type SourceBusTraceSpacing = number | { width_multiplier: number }
425
+ /** Centerline separation in mm or a multiple of the larger local trace width. */ type SourceBusTraceSpacing =
426
+ number | { width_multiplier: number }
419
427
  ```
420
428
 
421
429
  ### SourceComponentAvailabilityWarning
@@ -438,7 +446,6 @@ interface SourceComponentAvailabilityWarning {
438
446
  }
439
447
  ```
440
448
 
441
-
442
449
  ### SourceComponentBase
443
450
 
444
451
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/base/source_component_base.ts)
@@ -536,6 +543,7 @@ interface SourceConfusingNetNameWarning {
536
543
  Datasheet information for a manufacturer part number, supplied with Circuit JSON.
537
544
 
538
545
  ```typescript
546
+ /** Datasheet information for a manufacturer part number, supplied with Circuit JSON. */
539
547
  interface SourceDatasheet {
540
548
  type: "source_datasheet"
541
549
  source_datasheet_id: string
@@ -649,7 +657,7 @@ interface SourceManuallyPlacedVia {
649
657
  type: "source_manually_placed_via"
650
658
  source_manually_placed_via_id: string
651
659
  source_group_id: string
652
- source_net_id: string
660
+ source_net_id?: string
653
661
  subcircuit_id?: string
654
662
  source_trace_id?: string
655
663
  }
@@ -807,6 +815,8 @@ interface SourcePcbGroundPlane {
807
815
 
808
816
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/properties/source_pin_attributes.ts)
809
817
 
818
+ Allowed relative deviation from requires_voltage, e.g. 0.05 for ±5%.
819
+
810
820
  ```typescript
811
821
  interface SourcePinAttributes {
812
822
  is_input?: boolean
@@ -995,6 +1005,22 @@ interface SourceRefdesConventionWarning {
995
1005
  }
996
1006
  ```
997
1007
 
1008
+ ### SourceRuntimeError
1009
+
1010
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_runtime_error.ts)
1011
+
1012
+ ```typescript
1013
+ interface SourceRuntimeError extends Pick<
1014
+ BaseCircuitJsonError,
1015
+ "message" | "error_type"
1016
+ > {
1017
+ type: "source_runtime_error"
1018
+ source_runtime_error_id: string
1019
+ error_type: "source_runtime_error"
1020
+ phase_name?: string
1021
+ }
1022
+ ```
1023
+
998
1024
  ### SourceSimpleAmmeter
999
1025
 
1000
1026
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_simple_ammeter.ts)
@@ -1062,8 +1088,14 @@ Defines a simple connector component
1062
1088
  /** Defines a simple connector component */
1063
1089
  interface SourceSimpleConnector extends SourceComponentBase {
1064
1090
  ftype: "simple_connector"
1065
- standard?: "usb_c" | "m2"
1091
+ /** Connector interface or product family, such as usb_c, m2, or jst_ph */
1092
+ standard?: SourceSimpleConnectorStandard
1093
+ /** Number of electrical circuits in the connector */
1094
+ pin_count?: number
1066
1095
  }
1096
+
1097
+ type SourceSimpleConnectorStandard =
1098
+ (typeof source_simple_connector_standards)[number]
1067
1099
  ```
1068
1100
 
1069
1101
  ### SourceSimpleCrystal
@@ -1503,6 +1535,26 @@ interface CadCable {
1503
1535
  }
1504
1536
  ```
1505
1537
 
1538
+ ### CadCollisionError
1539
+
1540
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/cad/cad_collision_error.ts)
1541
+
1542
+ Union silhouette of solid intersection, projected along face normal (mm²
1543
+
1544
+ ```typescript
1545
+ interface CadCollisionError extends BaseCircuitJsonError {
1546
+ type: "cad_collision_error"
1547
+ cad_collision_error_id: string
1548
+ error_type: "cad_collision_error"
1549
+ cad_component_ids: string[]
1550
+ pcb_component_ids?: string[]
1551
+ source_component_ids: string[]
1552
+ /** Union silhouette of solid intersection, projected along face normal (mm² */
1553
+ intersection_area_mm2: number
1554
+ threshold_area_mm2: number
1555
+ }
1556
+ ```
1557
+
1506
1558
  ### CadComponent
1507
1559
 
1508
1560
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/cad/cad_component.ts)
@@ -1582,41 +1634,6 @@ interface CadReferenceSurface {
1582
1634
 
1583
1635
  ## PCB Elements
1584
1636
 
1585
- ### PcbFabricatorExtraChargeWarning
1586
-
1587
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_fabricator_extra_charge_warning.ts)
1588
-
1589
- Records an extra charge for the selected fabricator preset. An intended trigger
1590
- is a via hole diameter strictly below 0.3 mm with `jlcpcb_economy`,
1591
- `jlcpcb_standard`, `jlcpcb_economy_20260912`, or `jlcpcb_standard_20260912`.
1592
- A diameter of exactly 0.3 mm does not meet this condition. The producer detects
1593
- the condition and emits this record; parsing Circuit JSON does not run the check.
1594
-
1595
- ```typescript
1596
- interface PcbFabricatorExtraChargeWarning {
1597
- type: "pcb_fabricator_extra_charge_warning"
1598
- pcb_fabricator_extra_charge_warning_id: string
1599
- warning_type: "pcb_fabricator_extra_charge_warning"
1600
- message: string
1601
- fabricator_preset: string
1602
- pcb_board_id?: string
1603
- pcb_via_ids?: string[]
1604
- subcircuit_id?: string
1605
- }
1606
- ```
1607
-
1608
- The ID and `warning_type` are generated when omitted from input. For example:
1609
-
1610
- ```json
1611
- {
1612
- "type": "pcb_fabricator_extra_charge_warning",
1613
- "fabricator_preset": "jlcpcb_economy",
1614
- "message": "Via hole diameter 0.25 mm is below 0.3 mm and incurs an extra charge",
1615
- "pcb_board_id": "pcb_board_0",
1616
- "pcb_via_ids": ["pcb_via_0"]
1617
- }
1618
- ```
1619
-
1620
1637
  ### PcbAutoroutingError
1621
1638
 
1622
1639
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_autorouting_error.ts)
@@ -1658,8 +1675,6 @@ interface PcbBend {
1658
1675
  }
1659
1676
  ```
1660
1677
 
1661
- [Examples and coordinate/rendering semantics](docs/pcb-flex.md)
1662
-
1663
1678
  ### PcbBoard
1664
1679
 
1665
1680
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_board.ts)
@@ -1691,7 +1706,7 @@ interface PcbBoard extends ManufacturingDrcProperties {
1691
1706
  center: Point
1692
1707
  outline?: Point[]
1693
1708
  shape?: "rect" | "polygon"
1694
- material: "fr4" | "fr1"
1709
+ material: "fr4" | "fr1" | "flex"
1695
1710
  solder_mask_color?: string
1696
1711
  silkscreen_color?: string
1697
1712
  anchor_position?: Point
@@ -1722,35 +1737,6 @@ interface PcbBreakoutPoint {
1722
1737
  }
1723
1738
  ```
1724
1739
 
1725
- ### PcbBusRoutingConstraintError
1726
-
1727
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_error.ts)
1728
-
1729
- A discriminated union of bus/pair constraint violations. Every variant includes `source_bus_id`, `source_trace_ids`, `pcb_trace_ids`, `message`, and the error identity fields. Lengths and centerline spacing are mm; impedance is ohms. Spacing variants also require `other_pcb_trace_id` and may include `other_source_trace_id`.
1730
-
1731
- | `routing_rule` | Required measurements | Optional bounds |
1732
- | --- | --- | --- |
1733
- | `length_skew` | `actual_length_skew`, `maximum_length_skew` | — |
1734
- | `min_length` | `actual_trace_length`, `minimum_trace_length` | — |
1735
- | `max_length` | `actual_trace_length`, `maximum_trace_length` | — |
1736
- | `target_length` | `actual_trace_length`, `target_trace_length`, `length_tolerance` | — |
1737
- | `pcb_trace_spacing` | `actual_centerline_spacing`, `minimum_centerline_spacing` | — |
1738
- | `pcb_spacing_to_other_signals` | `actual_centerline_spacing`, `minimum_centerline_spacing` | — |
1739
- | `impedance_target` | `target_impedance` | `minimum_impedance`, `maximum_impedance` (at least one) |
1740
-
1741
- ```typescript
1742
- if (error.routing_rule === "max_length") {
1743
- // Narrowed to the maximum-length variant; these fields are required.
1744
- console.log(error.actual_trace_length, error.maximum_trace_length)
1745
- }
1746
- ```
1747
-
1748
- ### PcbBusRoutingConstraintWarning
1749
-
1750
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_warning.ts)
1751
-
1752
- An unverified constraint, discriminated by `routing_rule`: `route_geometry`, `reference_geometry`, `spacing_geometry`, `target_length`, or `physical_impedance`. Every variant includes `source_bus_id`, `source_trace_ids`, `pcb_trace_ids`, `message`, and warning identity fields. Missing geometry uses an empty `pcb_trace_ids` array; these warnings contain no measurements and must not be interpreted as a pass.
1753
-
1754
1740
  ### PcbBusLengthSkewError
1755
1741
 
1756
1742
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_length_skew_error.ts)
@@ -1772,6 +1758,66 @@ interface PcbBusLengthSkewError extends BaseCircuitJsonError {
1772
1758
  }
1773
1759
  ```
1774
1760
 
1761
+ ### PcbBusRoutingConstraintError
1762
+
1763
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_error.ts)
1764
+
1765
+ ```typescript
1766
+ type PcbBusRoutingConstraintError =
1767
+ WithErrorContext<PcbBusRoutingConstraintViolation>
1768
+
1769
+ /** Rule-specific routing measurements. Lengths and centreline spacing are mm; impedance is ohms. */ type PcbBusRoutingConstraintViolation =
1770
+ | {
1771
+ routing_rule: "length_skew"
1772
+ actual_length_skew: number
1773
+ maximum_length_skew: number
1774
+ }
1775
+ | {
1776
+ routing_rule: "min_length"
1777
+ actual_trace_length: number
1778
+ minimum_trace_length: number
1779
+ }
1780
+ | {
1781
+ routing_rule: "max_length"
1782
+ actual_trace_length: number
1783
+ maximum_trace_length: number
1784
+ }
1785
+ | {
1786
+ routing_rule: "target_length"
1787
+ actual_trace_length: number
1788
+ target_trace_length: number
1789
+ length_tolerance: number
1790
+ }
1791
+ | {
1792
+ routing_rule: "pcb_trace_spacing"
1793
+ other_pcb_trace_id: string
1794
+ other_source_trace_id?: string
1795
+ actual_centerline_spacing: number
1796
+ minimum_centerline_spacing: number
1797
+ }
1798
+ | {
1799
+ routing_rule: "pcb_spacing_to_other_signals"
1800
+ other_pcb_trace_id: string
1801
+ other_source_trace_id?: string
1802
+ actual_centerline_spacing: number
1803
+ minimum_centerline_spacing: number
1804
+ }
1805
+ | {
1806
+ routing_rule: "impedance_target"
1807
+ target_impedance: number
1808
+ minimum_impedance?: number
1809
+ maximum_impedance?: number
1810
+ }
1811
+ ```
1812
+
1813
+ ### PcbBusRoutingConstraintWarning
1814
+
1815
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_warning.ts)
1816
+
1817
+ ```typescript
1818
+ type PcbBusRoutingConstraintWarning = WithWarningContext<WarningRule>
1819
+ ```
1820
+
1775
1821
  ### PcbComponent
1776
1822
 
1777
1823
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_component.ts)
@@ -1803,6 +1849,25 @@ interface PcbComponentInvalidLayerError extends BaseCircuitJsonError {
1803
1849
  }
1804
1850
  ```
1805
1851
 
1852
+ ### PcbComponentMissingCourtyardWarning
1853
+
1854
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_component_missing_courtyard_warning.ts)
1855
+
1856
+ Warning emitted when a PCB component has no courtyard geometry
1857
+
1858
+ ```typescript
1859
+ /** Warning emitted when a PCB component has no courtyard geometry */
1860
+ interface PcbComponentMissingCourtyardWarning {
1861
+ type: "pcb_component_missing_courtyard_warning"
1862
+ pcb_component_missing_courtyard_warning_id: string
1863
+ warning_type: "pcb_component_missing_courtyard_warning"
1864
+ message: string
1865
+ pcb_component_id: string
1866
+ source_component_id?: string
1867
+ subcircuit_id?: string
1868
+ }
1869
+ ```
1870
+
1806
1871
  ### PcbComponentNotOnBoardEdgeError
1807
1872
 
1808
1873
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_component_not_on_board_edge_error.ts)
@@ -2216,15 +2281,36 @@ interface PcbFabricationNoteText {
2216
2281
  layer: VisibleLayer
2217
2282
  anchor_position: Point
2218
2283
  anchor_alignment:
2219
- | "center"
2220
- | "top_left"
2221
- | "top_right"
2222
- | "bottom_left"
2223
- | "bottom_right"
2284
+ "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right"
2224
2285
  color?: string
2225
2286
  }
2226
2287
  ```
2227
2288
 
2289
+ ### PcbFabricatorExtraChargeWarning
2290
+
2291
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_fabricator_extra_charge_warning.ts)
2292
+
2293
+ Selected preset, for example jlcpcb_economy or jlcpcb_standard_20260912.
2294
+
2295
+ ```typescript
2296
+ /** Warning that a design feature incurs an extra charge for the selected
2297
+ * fabricator preset. For JLCPCB economy or standard presets (including dated
2298
+ * variants), via hole diameters below 0.3 mm are an intended use case.
2299
+ * The producer detects the condition; this record describes the warning. */
2300
+ interface PcbFabricatorExtraChargeWarning {
2301
+ type: "pcb_fabricator_extra_charge_warning"
2302
+ pcb_fabricator_extra_charge_warning_id: string
2303
+ warning_type: "pcb_fabricator_extra_charge_warning"
2304
+ message: string
2305
+ /** Selected preset, for example jlcpcb_economy or jlcpcb_standard_20260912. */
2306
+ fabricator_preset: string
2307
+ pcb_board_id?: string
2308
+ /** Vias responsible for the extra charge, when the warning concerns vias. */
2309
+ pcb_via_ids?: string[]
2310
+ subcircuit_id?: string
2311
+ }
2312
+ ```
2313
+
2228
2314
  ### PcbFootprintOverlapError
2229
2315
 
2230
2316
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_footprint_overlap_error.ts)
@@ -2345,24 +2431,13 @@ interface PcbHoleCircle {
2345
2431
 
2346
2432
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_keepout.ts)
2347
2433
 
2348
- A keepout region on specified PCB layers, with rectangle, circle, or outline geometry.
2349
-
2350
- `warning_only: true` makes the region advisory: routing and copper placement may
2351
- cross it, and overlap checks should emit `pcb_keepout_overlap_warning` records
2352
- instead of errors for that keepout. Omitted or `false` retains normal enforcement.
2353
- The parser preserves omission; it does not insert a default. Only boolean values
2354
- are accepted. `excluded_pcb_component_ids` continues to exempt the listed
2355
- components from keepout diagnostics, including warnings.
2356
-
2357
- This is a data contract: parsing a keepout does not run routing or DRC. Producers
2358
- and consumers must implement the advisory behavior. Unrelated DRC violations and
2359
- violations of other, enforcing keepouts remain errors. Existing documents require
2360
- no migration; older consumers may ignore the flag and enforce the region normally.
2434
+ PCB components excluded from keepout DRC enforcement.
2361
2435
 
2362
2436
  ```typescript
2363
2437
  interface PcbKeepoutOutline {
2364
2438
  type: "pcb_keepout"
2365
2439
  shape: "outline"
2440
+ pcb_component_id?: string
2366
2441
  pcb_group_id?: string
2367
2442
  subcircuit_id?: string
2368
2443
  outline: Point[]
@@ -2372,17 +2447,21 @@ interface PcbKeepoutOutline {
2372
2447
  description?: string
2373
2448
  /** PCB components excluded from keepout DRC enforcement. */
2374
2449
  excluded_pcb_component_ids?: string[]
2375
- /**
2376
- * When true, this keepout is advisory: it does not block routing or copper
2450
+ /** When true, this keepout is advisory: it does not block routing or copper
2377
2451
  * placement, and DRC reports overlaps as pcb_keepout_overlap_warning records.
2378
- * False or omitted preserves normal enforcement. Component exclusions still apply.
2379
- */
2452
+ * False or omitted preserves normal enforcement. Component exclusions still apply. */
2453
+
2380
2454
  warning_only?: boolean
2455
+ /** Allow trace crossings without keepout diagnostics; copper pours remain excluded. */
2456
+ allow_traces?: boolean
2457
+ /** Allow components and their pads/plated holes without keepout diagnostics; copper pours remain excluded. */
2458
+ allow_placements?: boolean
2381
2459
  }
2382
2460
 
2383
2461
  interface PCBKeepoutRect {
2384
2462
  type: "pcb_keepout"
2385
2463
  shape: "rect"
2464
+ pcb_component_id?: string
2386
2465
  pcb_group_id?: string
2387
2466
  subcircuit_id?: string
2388
2467
  center: Point
@@ -2393,17 +2472,21 @@ interface PCBKeepoutRect {
2393
2472
  description?: string
2394
2473
  /** PCB components excluded from keepout DRC enforcement. */
2395
2474
  excluded_pcb_component_ids?: string[]
2396
- /**
2397
- * When true, this keepout is advisory: it does not block routing or copper
2475
+ /** When true, this keepout is advisory: it does not block routing or copper
2398
2476
  * placement, and DRC reports overlaps as pcb_keepout_overlap_warning records.
2399
- * False or omitted preserves normal enforcement. Component exclusions still apply.
2400
- */
2477
+ * False or omitted preserves normal enforcement. Component exclusions still apply. */
2478
+
2401
2479
  warning_only?: boolean
2480
+ /** Allow trace crossings without keepout diagnostics; copper pours remain excluded. */
2481
+ allow_traces?: boolean
2482
+ /** Allow components and their pads/plated holes without keepout diagnostics; copper pours remain excluded. */
2483
+ allow_placements?: boolean
2402
2484
  }
2403
2485
 
2404
2486
  interface PCBKeepoutCircle {
2405
2487
  type: "pcb_keepout"
2406
2488
  shape: "circle"
2489
+ pcb_component_id?: string
2407
2490
  pcb_group_id?: string
2408
2491
  subcircuit_id?: string
2409
2492
  center: Point
@@ -2413,12 +2496,15 @@ interface PCBKeepoutCircle {
2413
2496
  description?: string
2414
2497
  /** PCB components excluded from keepout DRC enforcement. */
2415
2498
  excluded_pcb_component_ids?: string[]
2416
- /**
2417
- * When true, this keepout is advisory: it does not block routing or copper
2499
+ /** When true, this keepout is advisory: it does not block routing or copper
2418
2500
  * placement, and DRC reports overlaps as pcb_keepout_overlap_warning records.
2419
- * False or omitted preserves normal enforcement. Component exclusions still apply.
2420
- */
2501
+ * False or omitted preserves normal enforcement. Component exclusions still apply. */
2502
+
2421
2503
  warning_only?: boolean
2504
+ /** Allow trace crossings without keepout diagnostics; copper pours remain excluded. */
2505
+ allow_traces?: boolean
2506
+ /** Allow components and their pads/plated holes without keepout diagnostics; copper pours remain excluded. */
2507
+ allow_placements?: boolean
2422
2508
  }
2423
2509
 
2424
2510
  type PCBKeepout = PCBKeepoutRect | PCBKeepoutCircle | PcbKeepoutOutline
@@ -2636,11 +2722,7 @@ interface PcbNoteText {
2636
2722
  text?: string
2637
2723
  anchor_position: Point
2638
2724
  anchor_alignment:
2639
- | "center"
2640
- | "top_left"
2641
- | "top_right"
2642
- | "bottom_left"
2643
- | "bottom_right"
2725
+ "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right"
2644
2726
  layer: VisibleLayer
2645
2727
  is_mirrored_from_top_view?: boolean
2646
2728
  color?: string
@@ -2748,6 +2830,24 @@ interface PcbPanelizationPlacementError extends BaseCircuitJsonError {
2748
2830
  }
2749
2831
  ```
2750
2832
 
2833
+ ### PcbPin1Location
2834
+
2835
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/properties/pcb_pin1_location.ts)
2836
+
2837
+ ```typescript
2838
+ type PcbPin1Location =
2839
+ | "leftside_top"
2840
+ | "leftside_bottom"
2841
+ | "rightside_top"
2842
+ | "rightside_bottom"
2843
+ | "topside_left"
2844
+ | "topside_right"
2845
+ | "bottomside_left"
2846
+ | "bottomside_right"
2847
+
2848
+ type PcbPin1LocationRotation = 0 | 90 | 180 | 270
2849
+ ```
2850
+
2751
2851
  ### PcbPlacementError
2752
2852
 
2753
2853
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_placement_error.ts)
@@ -2972,7 +3072,6 @@ interface PcbPreflightRoutingError extends BaseCircuitJsonError {
2972
3072
  }
2973
3073
  ```
2974
3074
 
2975
-
2976
3075
  ### PcbRouteHints
2977
3076
 
2978
3077
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/properties/pcb_route_hints.ts)
@@ -3177,6 +3276,21 @@ interface PcbSilkscreenText {
3177
3276
  }
3178
3277
  ```
3179
3278
 
3279
+ ### PcbSoldermaskOpening
3280
+
3281
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_soldermask_opening.ts)
3282
+
3283
+ ```typescript
3284
+ interface PcbSoldermaskOpeningBase {
3285
+ type: "pcb_soldermask_opening"
3286
+ pcb_soldermask_opening_id: string
3287
+ layer: "top" | "bottom"
3288
+ pcb_component_id?: string
3289
+ pcb_group_id?: string
3290
+ subcircuit_id?: string
3291
+ }
3292
+ ```
3293
+
3180
3294
  ### PcbSolderPaste
3181
3295
 
3182
3296
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_solder_paste.ts)
@@ -3200,13 +3314,77 @@ interface PcbSolderPasteCircle {
3200
3314
  }
3201
3315
  ```
3202
3316
 
3317
+ ### PcbStackup
3318
+
3319
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_stackup.ts)
3320
+
3321
+ Physical layer construction and material data for a PCB board.
3322
+
3323
+ ```typescript
3324
+ /** Physical layer construction and material data for a PCB board. */
3325
+ interface PcbStackup {
3326
+ type: "pcb_stackup"
3327
+ pcb_stackup_id: string
3328
+ /** Board described by this stackup. */
3329
+ pcb_board_id: string
3330
+ subcircuit_id?: string
3331
+ /** Copper thickness of plated hole and via barrel walls in mm. */
3332
+ plated_hole_copper_thickness?: Length
3333
+ /** Physical layers ordered from top to bottom. */
3334
+ layers: PcbStackupLayer[]
3335
+ }
3336
+
3337
+ /** A soldermask layer in the physical board stack. */
3338
+ interface PcbSoldermaskStackupLayer {
3339
+ layer_type: "soldermask"
3340
+ /** Soldermask thickness in mm, omitted when unknown. */
3341
+ thickness?: Length
3342
+ /** Soldermask relative permittivity. */
3343
+ relative_permittivity?: number
3344
+ }
3345
+
3346
+ /** A copper layer in the physical board stack. */
3347
+ interface PcbCopperStackupLayer {
3348
+ layer_type: "copper"
3349
+ /** PCB copper layer, such as top, inner1 or bottom. */
3350
+ layer: LayerRef
3351
+ /** Copper thickness in mm. */
3352
+ thickness: Length
3353
+ /** Electrical conductivity in S/m, consumers may assume 5.8e7 (annealed copper) when omitted. */
3354
+ electrical_conductivity_s_per_m?: number
3355
+ /** RMS copper surface roughness in mm. */
3356
+ rms_surface_roughness?: Length
3357
+ }
3358
+
3359
+ /** An insulating layer in the physical board stack. */
3360
+ interface PcbDielectricStackupLayer {
3361
+ layer_type: "dielectric"
3362
+ /** Core or prepreg construction. */
3363
+ dielectric_type?: "core" | "prepreg"
3364
+ /** Fabricator material name, such as FR-4 or 7628. */
3365
+ material_name?: string
3366
+ /** Dielectric thickness in mm. */
3367
+ thickness: Length
3368
+ /** Dielectric relative permittivity, Dk. */
3369
+ relative_permittivity?: number
3370
+ /** Dielectric loss tangent, Df. */
3371
+ loss_tangent?: number
3372
+ /** Frequency in Hz at which relative_permittivity and loss_tangent were measured. */
3373
+ dielectric_properties_frequency_hz?: number
3374
+ }
3375
+
3376
+ type PcbStackupLayer =
3377
+ PcbSoldermaskStackupLayer | PcbCopperStackupLayer | PcbDielectricStackupLayer
3378
+ ```
3379
+
3203
3380
  ### PcbStiffener
3204
3381
 
3205
3382
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_stiffener.ts)
3206
3383
 
3207
- Defines bonded mechanical reinforcement with rectangular or polygon geometry.
3384
+ Common properties of bonded PCB reinforcement.
3208
3385
 
3209
3386
  ```typescript
3387
+ /** Common properties of bonded PCB reinforcement. */
3210
3388
  interface PcbStiffenerBase {
3211
3389
  type: "pcb_stiffener"
3212
3390
  pcb_stiffener_id: string
@@ -3223,33 +3401,8 @@ interface PcbStiffenerBase {
3223
3401
  /** Adhesive thickness in mm; omission means unspecified, not zero. */
3224
3402
  adhesive_thickness?: Length
3225
3403
  }
3226
-
3227
- interface PcbStiffenerRect extends PcbStiffenerBase {
3228
- shape: "rect"
3229
- /** Relative to the flat board center, in mm. */
3230
- center: Point
3231
- /** Degrees counterclockwise in the flat top view; omission means zero. */
3232
- rotation?: Rotation
3233
- width: Length
3234
- height: Length
3235
- outline?: never
3236
- }
3237
-
3238
- interface PcbStiffenerPolygon extends PcbStiffenerBase {
3239
- shape: "polygon"
3240
- /** Implicitly closed vertices relative to the flat board center, in mm. All placement/rotation is baked in. */
3241
- outline: Point[]
3242
- center?: never
3243
- rotation?: never
3244
- width?: never
3245
- height?: never
3246
- }
3247
-
3248
- type PcbStiffener = PcbStiffenerRect | PcbStiffenerPolygon
3249
3404
  ```
3250
3405
 
3251
- [Examples and coordinate/rendering semantics](docs/pcb-flex.md)
3252
-
3253
3406
  ### PcbText
3254
3407
 
3255
3408
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_text.ts)
@@ -3298,18 +3451,17 @@ interface PcbThermalSpoke {
3298
3451
 
3299
3452
  ### PcbTrace
3300
3453
 
3301
- A `wire` route point can taper its outgoing segment using `start_width`,
3302
- `end_width`, and `width_interpolation_mode` (`linear` or `quadratic`).
3303
- See the [wire taper geometry contract](docs/pcb-trace-teardrops.md).
3304
-
3305
3454
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace.ts)
3306
3455
 
3456
+ Outgoing segment taper; all three fields must be specified together.
3457
+
3307
3458
  ```typescript
3308
3459
  interface PcbTraceRoutePointWire {
3309
3460
  route_type: "wire"
3310
3461
  x: Distance
3311
3462
  y: Distance
3312
3463
  width: Distance
3464
+ /** Outgoing segment taper; all three fields must be specified together. */
3313
3465
  start_width?: Distance
3314
3466
  end_width?: Distance
3315
3467
  width_interpolation_mode?: "linear" | "quadratic"
@@ -3320,24 +3472,8 @@ interface PcbTraceRoutePointWire {
3320
3472
  layer: LayerRef
3321
3473
  }
3322
3474
 
3323
- interface PcbTraceRoutePointVia {
3324
- route_type: "via"
3325
- x: Distance
3326
- y: Distance
3327
- copper_pour_id?: string
3328
- is_inside_copper_pour?: boolean
3329
- hole_diameter?: Distance
3330
- outer_diameter?: Distance
3331
- tented_on_top?: boolean
3332
- tented_on_bottom?: boolean
3333
- from_layer: LayerRef
3334
- to_layer: LayerRef
3335
- }
3336
-
3337
3475
  type PcbTraceRoutePoint =
3338
- | PcbTraceRoutePointWire
3339
- | PcbTraceRoutePointVia
3340
- | PcbTraceRoutePointThroughPad
3476
+ PcbTraceRoutePointWire | PcbTraceRoutePointVia | PcbTraceRoutePointThroughPad
3341
3477
  ```
3342
3478
 
3343
3479
  ### PcbTraceError
@@ -3399,6 +3535,38 @@ interface PcbTraceMissingError extends BaseCircuitJsonError {
3399
3535
  }
3400
3536
  ```
3401
3537
 
3538
+ ### PcbTraceStyleWarning
3539
+
3540
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace_style_warning.ts)
3541
+
3542
+ A long segment at an odd angle, identified by its trace and route endpoints.
3543
+
3544
+ ```typescript
3545
+ /** A long segment at an odd angle, identified by its trace and route endpoints. */
3546
+ interface PcbTraceStyleWarning {
3547
+ type: "pcb_trace_style_warning"
3548
+ pcb_trace_style_warning_id: string
3549
+ warning_type: "pcb_trace_style_warning"
3550
+ message: string
3551
+ styling_issue_type: "long_segment_at_odd_angle"
3552
+ pcb_trace_id: string
3553
+ source_trace_id?: string
3554
+ subcircuit_id?: string
3555
+ layer: LayerRef
3556
+ start_route_index: number
3557
+ end_route_index: number
3558
+ segment_start: Point
3559
+ segment_end: Point
3560
+ center: Point
3561
+ segment_length: Distance
3562
+ minimum_segment_length: Distance
3563
+ angle_degrees: number
3564
+ nearest_allowed_angle_degrees: number
3565
+ angle_deviation_degrees: number
3566
+ angle_tolerance_degrees: number
3567
+ }
3568
+ ```
3569
+
3402
3570
  ### PcbTraceTooLongError
3403
3571
 
3404
3572
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace_too_long_error.ts)
@@ -3465,38 +3633,6 @@ interface PcbTraceTooManyViasWarning {
3465
3633
  }
3466
3634
  ```
3467
3635
 
3468
- ### PcbTraceStyleWarning
3469
-
3470
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace_style_warning.ts)
3471
-
3472
- A long segment at an odd angle, identified by its trace and route endpoints.
3473
-
3474
- ```typescript
3475
- /** A long segment at an odd angle, identified by its trace and route endpoints. */
3476
- interface PcbTraceStyleWarning {
3477
- type: "pcb_trace_style_warning"
3478
- pcb_trace_style_warning_id: string
3479
- warning_type: "pcb_trace_style_warning"
3480
- message: string
3481
- styling_issue_type: "long_segment_at_odd_angle"
3482
- pcb_trace_id: string
3483
- source_trace_id?: string
3484
- subcircuit_id?: string
3485
- layer: LayerRef
3486
- start_route_index: number
3487
- end_route_index: number
3488
- segment_start: Point
3489
- segment_end: Point
3490
- center: Point
3491
- segment_length: Distance
3492
- minimum_segment_length: Distance
3493
- angle_degrees: number
3494
- nearest_allowed_angle_degrees: number
3495
- angle_deviation_degrees: number
3496
- angle_tolerance_degrees: number
3497
- }
3498
- ```
3499
-
3500
3636
  ### PcbTraceWarning
3501
3637
 
3502
3638
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace_warning.ts)
@@ -3548,6 +3684,8 @@ interface PcbVia {
3548
3684
  /** PCB ports belonging to this via, including layer ports and aliases. */
3549
3685
  pcb_port_ids?: string[]
3550
3686
  pcb_trace_id?: string
3687
+ source_trace_id?: string
3688
+ source_net_id?: string
3551
3689
  net_is_assignable?: boolean
3552
3690
  net_assigned?: boolean
3553
3691
  tented_on_top?: boolean
@@ -3555,10 +3693,6 @@ interface PcbVia {
3555
3693
  }
3556
3694
  ```
3557
3695
 
3558
- Legacy `is_tented` input is deprecated and transformed into `tented_on_top` and
3559
- `tented_on_bottom`. Explicit per-side values take precedence. Parsed output omits
3560
- `is_tented`; both per-side fields are optional.
3561
-
3562
3696
  ### PcbViaClearanceError
3563
3697
 
3564
3698
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_via_clearance_error.ts)
@@ -3731,8 +3865,7 @@ interface SchematicPortArrangementBySides {
3731
3865
  }
3732
3866
 
3733
3867
  type SchematicPortArrangement =
3734
- | SchematicPortArrangementBySize
3735
- | SchematicPortArrangementBySides
3868
+ SchematicPortArrangementBySize | SchematicPortArrangementBySides
3736
3869
  ```
3737
3870
 
3738
3871
  ### SchematicComponentOverlapWarning
@@ -3781,9 +3914,7 @@ interface SchematicComponentStylingWarning {
3781
3914
 
3782
3915
  ```typescript
3783
3916
  type SchematicDebugObject =
3784
- | SchematicDebugRect
3785
- | SchematicDebugLine
3786
- | SchematicDebugPoint
3917
+ SchematicDebugRect | SchematicDebugLine | SchematicDebugPoint
3787
3918
 
3788
3919
  interface SchematicDebugRect {
3789
3920
  type: "schematic_debug_object"
@@ -3827,9 +3958,7 @@ interface SchematicElementOutsideSheetWarning {
3827
3958
  message: string
3828
3959
  schematic_sheet_id: string
3829
3960
  schematic_element_type:
3830
- | "schematic_component"
3831
- | "schematic_net_label"
3832
- | "schematic_trace"
3961
+ "schematic_component" | "schematic_net_label" | "schematic_trace"
3833
3962
  schematic_element_id: string
3834
3963
  }
3835
3964
  ```
@@ -3851,7 +3980,7 @@ interface SchematicError extends BaseCircuitJsonError {
3851
3980
 
3852
3981
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_graphic.ts)
3853
3982
 
3854
- References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet. At least one graphic source is required.
3983
+ References a graphic asset or inline SVG content on a schematic sheet.
3855
3984
 
3856
3985
  ```typescript
3857
3986
  /** References a graphic asset or inline SVG content on a schematic sheet. */
@@ -3977,6 +4106,8 @@ interface SchematicMissingSheetWarning {
3977
4106
 
3978
4107
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_net_label.ts)
3979
4108
 
4109
+ Display-only superscript suffix, e.g. "1" in GND¹. Does not change net identity.
4110
+
3980
4111
  ```typescript
3981
4112
  interface SchematicNetLabel {
3982
4113
  type: "schematic_net_label"
@@ -4041,6 +4172,11 @@ interface SchematicPort {
4041
4172
  true_ccw_index?: number
4042
4173
  pin_number?: number
4043
4174
  display_pin_label?: string
4175
+ /** Ordered parts of the pin label with per-part styling.
4176
+ * For example, `A~{BC}D` is represented as `A`, overlined `BC`, then `D`.
4177
+ * Consumers that do not support styled text can use `display_pin_label`. */
4178
+
4179
+ display_pin_label_text_parts?: SchematicTextPart[]
4044
4180
  display_pin_label_font_size?: number
4045
4181
  subcircuit_id?: string
4046
4182
  is_connected?: boolean
@@ -4092,7 +4228,7 @@ interface SchematicSheet {
4092
4228
  schematic_sheet_id: string
4093
4229
  name?: string
4094
4230
  sheet_index?: number
4095
- sheet_size?: "a4" | "ansi_b"
4231
+ sheet_size?: SchematicSheetSize
4096
4232
  sheet_width?: number
4097
4233
  sheet_height?: number
4098
4234
  subcircuit_id?: string
@@ -4100,6 +4236,25 @@ interface SchematicSheet {
4100
4236
  }
4101
4237
  ```
4102
4238
 
4239
+ ### SchematicSheetStylingWarning
4240
+
4241
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_sheet_styling_warning.ts)
4242
+
4243
+ Style warning emitted when a schematic sheet uses a non-default size.
4244
+
4245
+ ```typescript
4246
+ /** Style warning emitted when a schematic sheet uses a non-default size. */
4247
+ interface SchematicSheetStylingWarning {
4248
+ type: "schematic_sheet_styling_warning"
4249
+ schematic_sheet_styling_warning_id: string
4250
+ warning_type: "schematic_sheet_styling_warning"
4251
+ message: string
4252
+ schematic_sheet_id: string
4253
+ styling_issue_type: "non_default_sheet_size"
4254
+ subcircuit_id?: string
4255
+ }
4256
+ ```
4257
+
4103
4258
  ### SchematicSymbol
4104
4259
 
4105
4260
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_symbol.ts)
@@ -4168,6 +4323,8 @@ interface SchematicTableCell {
4168
4323
 
4169
4324
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_text.ts)
4170
4325
 
4326
+ Display-only superscript suffix, e.g. "1" in GND¹ for an inline net label.
4327
+
4171
4328
  ```typescript
4172
4329
  interface SchematicText {
4173
4330
  type: "schematic_text"
@@ -4175,7 +4332,17 @@ interface SchematicText {
4175
4332
  schematic_component_id?: string
4176
4333
  schematic_symbol_id?: string
4177
4334
  schematic_text_id: string
4335
+ /** Set when the text annotates a trace rather than a component, as an inline
4336
+ * net label does - the net name drawn alongside a point-to-point wire instead
4337
+ * of as an anchored `schematic_net_label`. Lets consumers tell such a label
4338
+ * apart from free-standing text and resolve the net it belongs to. */
4339
+
4340
+ source_trace_id?: string
4178
4341
  text: string
4342
+ /** Ordered parts with per-part display options.
4343
+ * Consumers that do not support styled text can use `text`. */
4344
+
4345
+ text_parts?: SchematicTextPart[]
4179
4346
  /** Display-only superscript suffix, e.g. "1" in GND¹ for an inline net label. */
4180
4347
  display_superscript?: string
4181
4348
  font_size: number
@@ -4190,6 +4357,22 @@ interface SchematicText {
4190
4357
  }
4191
4358
  ```
4192
4359
 
4360
+ ### SchematicTextPart
4361
+
4362
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_text_part.ts)
4363
+
4364
+ One part of schematic text with its display options.
4365
+
4366
+ ```typescript
4367
+ /** One part of schematic text with its display options. */
4368
+ interface SchematicTextPart {
4369
+ /** The literal text displayed for this part. */
4370
+ text: string
4371
+ /** Draw a line above this part, typically indicating an active-low signal. */
4372
+ is_overlined?: boolean
4373
+ }
4374
+ ```
4375
+
4193
4376
  ### SchematicTrace
4194
4377
 
4195
4378
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_trace.ts)
@@ -4232,53 +4415,6 @@ interface SchematicVoltageProbe {
4232
4415
 
4233
4416
  ## Simulation Elements
4234
4417
 
4235
- ### SimulationReturnCurrentContact
4236
-
4237
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_contact.ts)
4238
-
4239
- ```typescript
4240
- interface SimulationReturnCurrentContactBase {
4241
- x: number
4242
- y: number
4243
- layer: LayerRef
4244
- }
4245
-
4246
- interface SimulationReturnCurrentPortContact extends SimulationReturnCurrentContactBase {
4247
- contact_type: "pcb_port"
4248
- pcb_port_id: string
4249
- }
4250
-
4251
- interface SimulationReturnCurrentViaContact extends SimulationReturnCurrentContactBase {
4252
- contact_type: "pcb_via"
4253
- pcb_via_id: string
4254
- }
4255
-
4256
- interface SimulationReturnCurrentCopperPourContact extends SimulationReturnCurrentContactBase {
4257
- contact_type: "pcb_copper_pour"
4258
- pcb_copper_pour_id: string
4259
- }
4260
- ```
4261
-
4262
- ### SimulationReturnCurrentGridJson
4263
-
4264
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_grid_json.ts)
4265
-
4266
- ```typescript
4267
- type SimulationReturnCurrentGridJson =
4268
- | {
4269
- field_type: "real"
4270
- sheet_current_x: (number | null)[]
4271
- sheet_current_y: (number | null)[]
4272
- }
4273
- | {
4274
- field_type: "complex_phasor"
4275
- sheet_current_x_real: (number | null)[]
4276
- sheet_current_x_imag: (number | null)[]
4277
- sheet_current_y_real: (number | null)[]
4278
- sheet_current_y_imag: (number | null)[]
4279
- }
4280
- ```
4281
-
4282
4418
  ### SimulationAcSweepCurrentGraph
4283
4419
 
4284
4420
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_ac_sweep_current_graph.ts)
@@ -4321,8 +4457,7 @@ interface SimulationAcSweepVoltageGraph {
4321
4457
 
4322
4458
  ```typescript
4323
4459
  type SimulationAnalysisResult =
4324
- | SimulationVoltageAnalysisResult
4325
- | SimulationCurrentAnalysisResult
4460
+ SimulationVoltageAnalysisResult | SimulationCurrentAnalysisResult
4326
4461
 
4327
4462
  type SimulationNonTransientVoltageAnalysisResult =
4328
4463
  | SimulationDcOperatingPointVoltage
@@ -4335,12 +4470,10 @@ type SimulationNonTransientCurrentAnalysisResult =
4335
4470
  | SimulationAcSweepCurrentGraph
4336
4471
 
4337
4472
  type SimulationVoltageAnalysisResult =
4338
- | SimulationTransientVoltageGraph
4339
- | SimulationNonTransientVoltageAnalysisResult
4473
+ SimulationTransientVoltageGraph | SimulationNonTransientVoltageAnalysisResult
4340
4474
 
4341
4475
  type SimulationCurrentAnalysisResult =
4342
- | SimulationTransientCurrentGraph
4343
- | SimulationNonTransientCurrentAnalysisResult
4476
+ SimulationTransientCurrentGraph | SimulationNonTransientCurrentAnalysisResult
4344
4477
  ```
4345
4478
 
4346
4479
  ### SimulationComplexSample
@@ -4381,8 +4514,7 @@ interface SimulationCurrentProbe {
4381
4514
 
4382
4515
  ```typescript
4383
4516
  type SimulationCurrentSource =
4384
- | SimulationDcCurrentSource
4385
- | SimulationAcCurrentSource
4517
+ SimulationDcCurrentSource | SimulationAcCurrentSource
4386
4518
 
4387
4519
  /** Defines a DC current source for simulation purposes. It forces a current
4388
4520
  * between two source ports. */
@@ -4501,6 +4633,8 @@ interface SimulationExperiment {
4501
4633
  simulation_experiment_id: string
4502
4634
  name: string
4503
4635
  experiment_type: ExperimentType
4636
+ subcircuit_id?: string
4637
+ spice_engine?: string
4504
4638
  time_per_step?: number // ms
4505
4639
  start_time_ms?: number // ms
4506
4640
  end_time_ms?: number // ms
@@ -4586,20 +4720,17 @@ type SimulationParameterSweep =
4586
4720
  | SimulationVoltageParameterSweep
4587
4721
  | SimulationCurrentParameterSweep
4588
4722
 
4589
- interface SimulationResistanceParameterSweep
4590
- extends SimulationParameterSweepBase {
4723
+ interface SimulationResistanceParameterSweep extends SimulationParameterSweepBase {
4591
4724
  parameter_type: "resistance"
4592
4725
  resistor_source_component_id: string
4593
4726
  }
4594
4727
 
4595
- interface SimulationCapacitanceParameterSweep
4596
- extends SimulationParameterSweepBase {
4728
+ interface SimulationCapacitanceParameterSweep extends SimulationParameterSweepBase {
4597
4729
  parameter_type: "capacitance"
4598
4730
  capacitor_source_component_id: string
4599
4731
  }
4600
4732
 
4601
- interface SimulationInductanceParameterSweep
4602
- extends SimulationParameterSweepBase {
4733
+ interface SimulationInductanceParameterSweep extends SimulationParameterSweepBase {
4603
4734
  parameter_type: "inductance"
4604
4735
  inductor_source_component_id: string
4605
4736
  }
@@ -4677,8 +4808,7 @@ interface SimulationPcbReturnCurrentHeatmap {
4677
4808
 
4678
4809
  ```typescript
4679
4810
  type SimulationPcbReturnCurrentMarker =
4680
- | SimulationPcbReturnCurrentPortMarker
4681
- | SimulationPcbReturnCurrentViaMarker
4811
+ SimulationPcbReturnCurrentPortMarker | SimulationPcbReturnCurrentViaMarker
4682
4812
 
4683
4813
  interface SimulationReturnCurrentMarkerBase {
4684
4814
  type: "simulation_pcb_return_current_marker"
@@ -4725,6 +4855,33 @@ interface SimulationPcbReturnCurrentResult {
4725
4855
  }
4726
4856
  ```
4727
4857
 
4858
+ ### SimulationReturnCurrentContact
4859
+
4860
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_contact.ts)
4861
+
4862
+ ```typescript
4863
+ interface SimulationReturnCurrentContactBase {
4864
+ x: number
4865
+ y: number
4866
+ layer: LayerRef
4867
+ }
4868
+
4869
+ interface SimulationReturnCurrentPortContact extends SimulationReturnCurrentContactBase {
4870
+ contact_type: "pcb_port"
4871
+ pcb_port_id: string
4872
+ }
4873
+
4874
+ interface SimulationReturnCurrentViaContact extends SimulationReturnCurrentContactBase {
4875
+ contact_type: "pcb_via"
4876
+ pcb_via_id: string
4877
+ }
4878
+
4879
+ interface SimulationReturnCurrentCopperPourContact extends SimulationReturnCurrentContactBase {
4880
+ contact_type: "pcb_copper_pour"
4881
+ pcb_copper_pour_id: string
4882
+ }
4883
+ ```
4884
+
4728
4885
  ### SimulationReturnCurrentExcitation
4729
4886
 
4730
4887
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_excitation.ts)
@@ -4744,6 +4901,26 @@ interface SimulationReturnCurrentExcitation {
4744
4901
  }
4745
4902
  ```
4746
4903
 
4904
+ ### SimulationReturnCurrentGridJson
4905
+
4906
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_grid_json.ts)
4907
+
4908
+ ```typescript
4909
+ type SimulationReturnCurrentGridJson =
4910
+ | {
4911
+ field_type: "real"
4912
+ sheet_current_x: (number | null)[]
4913
+ sheet_current_y: (number | null)[]
4914
+ }
4915
+ | {
4916
+ field_type: "complex_phasor"
4917
+ sheet_current_x_real: (number | null)[]
4918
+ sheet_current_x_imag: (number | null)[]
4919
+ sheet_current_y_real: (number | null)[]
4920
+ sheet_current_y_imag: (number | null)[]
4921
+ }
4922
+ ```
4923
+
4747
4924
  ### SimulationSpiceSubcircuit
4748
4925
 
4749
4926
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_spice_subcircuit.ts)
@@ -4827,6 +5004,7 @@ interface SimulationTransientVoltageGraph {
4827
5004
  type: "simulation_transient_voltage_graph"
4828
5005
  simulation_transient_voltage_graph_id: string
4829
5006
  simulation_experiment_id: string
5007
+ simulation_voltage_probe_id?: string
4830
5008
  simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
4831
5009
  timestamps_ms?: number[]
4832
5010
  voltage_levels: number[]
@@ -4885,8 +5063,7 @@ interface SimulationVoltageProbe {
4885
5063
 
4886
5064
  ```typescript
4887
5065
  type SimulationVoltageSource =
4888
- | SimulationDcVoltageSource
4889
- | SimulationAcVoltageSource
5066
+ SimulationDcVoltageSource | SimulationAcVoltageSource
4890
5067
 
4891
5068
  /** Defines a DC voltage source for simulation purposes. It applies a voltage
4892
5069
  * difference between two source ports. */
@@ -4928,4 +5105,71 @@ interface SimulationAcVoltageSource {
4928
5105
  }
4929
5106
  ```
4930
5107
 
5108
+ ## Drawing Elements
5109
+
5110
+ ### DrawingPage
5111
+
5112
+ ```typescript
5113
+ interface DrawingPage {
5114
+ type: "drawing_page"
5115
+ drawing_page_id: string
5116
+ name?: string
5117
+ display_name?: string
5118
+ page_size?: DrawingPageSize
5119
+ orientation?: "landscape" | "portrait"
5120
+ width: number
5121
+ height: number
5122
+ }
5123
+ ```
5124
+
5125
+ ### DrawingPageTitleBlock
5126
+
5127
+ ```typescript
5128
+ interface DrawingPageTitleBlock {
5129
+ type: "drawing_page_title_block"
5130
+ drawing_page_title_block_id: string
5131
+ drawing_page_id: string
5132
+ title: string
5133
+ legal_owner?: string
5134
+ identification_number?: string
5135
+ revision_index?: string
5136
+ date_of_issue?: string
5137
+ creator?: string
5138
+ approval_person?: string
5139
+ sheet_number?: number
5140
+ number_of_sheets?: number
5141
+ }
5142
+ ```
5143
+
5144
+ ### DrawingPartView
5145
+
5146
+ ```typescript
5147
+ interface DrawingPartView {
5148
+ type: "drawing_part_view"
5149
+ drawing_part_view_id: string
5150
+ drawing_page_id: string
5151
+ /** Resolved geometry selection for this part view; omitted selectors mean the entire assembly. */
5152
+ source_group_id?: string
5153
+ source_component_ids?: string[]
5154
+ name?: string
5155
+ display_name?: string
5156
+ direction: DrawingPartViewDirection
5157
+ center: { x: number; y: number }
5158
+ width: number
5159
+ height: number
5160
+ /** Model-to-paper ratio; omitted means fit with a margin. */
5161
+ scale?: number
5162
+ /** False when omitted. Hidden edges are dashed. */
5163
+ show_hidden_edges?: boolean
5164
+ section?: DrawingSectionPlane
5165
+ }
5166
+
5167
+ interface DrawingSectionPlane {
5168
+ axis: "x" | "y" | "z"
5169
+ offset: number
5170
+ keep_side: "less" | "greater"
5171
+ hatch_spacing?: number
5172
+ }
5173
+ ```
5174
+
4931
5175
  <!-- circuit-json-docs:end -->