circuit-json 0.0.531 → 0.0.533

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,6 +181,7 @@ 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)
182
186
  - [PcbStackup](#pcbstackup)
183
187
  - [PcbStiffener](#pcbstiffener)
@@ -187,10 +191,10 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
187
191
  - [PcbTraceError](#pcbtraceerror)
188
192
  - [PcbTraceHint](#pcbtracehint)
189
193
  - [PcbTraceMissingError](#pcbtracemissingerror)
194
+ - [PcbTraceStyleWarning](#pcbtracestylewarning)
190
195
  - [PcbTraceTooLongError](#pcbtracetoolongerror)
191
196
  - [PcbTraceTooLongWarning](#pcbtracetoolongwarning)
192
197
  - [PcbTraceTooManyViasWarning](#pcbtracetoomanyviaswarning)
193
- - [PcbTraceStyleWarning](#pcbtracestylewarning)
194
198
  - [PcbTraceWarning](#pcbtracewarning)
195
199
  - [PcbVia](#pcbvia)
196
200
  - [PcbViaClearanceError](#pcbviaclearanceerror)
@@ -216,15 +220,15 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
216
220
  - [SchematicPort](#schematicport)
217
221
  - [SchematicRect](#schematicrect)
218
222
  - [SchematicSheet](#schematicsheet)
223
+ - [SchematicSheetStylingWarning](#schematicsheetstylingwarning)
219
224
  - [SchematicSymbol](#schematicsymbol)
220
225
  - [SchematicTable](#schematictable)
221
226
  - [SchematicTableCell](#schematictablecell)
222
227
  - [SchematicText](#schematictext)
228
+ - [SchematicTextPart](#schematictextpart)
223
229
  - [SchematicTrace](#schematictrace)
224
230
  - [SchematicVoltageProbe](#schematicvoltageprobe)
225
231
  - [Simulation Elements](#simulation-elements)
226
- - [SimulationReturnCurrentContact](#simulationreturncurrentcontact)
227
- - [SimulationReturnCurrentGridJson](#simulationreturncurrentgridjson)
228
232
  - [SimulationAcSweepCurrentGraph](#simulationacsweepcurrentgraph)
229
233
  - [SimulationAcSweepVoltageGraph](#simulationacsweepvoltagegraph)
230
234
  - [SimulationAnalysisResult](#simulationanalysisresult)
@@ -244,7 +248,9 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
244
248
  - [SimulationPcbReturnCurrentHeatmap](#simulationpcbreturncurrentheatmap)
245
249
  - [SimulationPcbReturnCurrentMarker](#simulationpcbreturncurrentmarker)
246
250
  - [SimulationPcbReturnCurrentResult](#simulationpcbreturncurrentresult)
251
+ - [SimulationReturnCurrentContact](#simulationreturncurrentcontact)
247
252
  - [SimulationReturnCurrentExcitation](#simulationreturncurrentexcitation)
253
+ - [SimulationReturnCurrentGridJson](#simulationreturncurrentgridjson)
248
254
  - [SimulationSpiceSubcircuit](#simulationspicesubcircuit)
249
255
  - [SimulationSwitch](#simulationswitch)
250
256
  - [SimulationTerminalPort](#simulationterminalport)
@@ -253,6 +259,11 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
253
259
  - [SimulationUnknownExperimentError](#simulationunknownexperimenterror)
254
260
  - [SimulationVoltageProbe](#simulationvoltageprobe)
255
261
  - [SimulationVoltageSource](#simulationvoltagesource)
262
+ - [Drawing Elements](#drawing-elements)
263
+ - [DrawingDimensionLine](#drawingdimensionline)
264
+ - [DrawingPage](#drawingpage)
265
+ - [DrawingPageTitleBlock](#drawingpagetitleblock)
266
+ - [DrawingPartView](#drawingpartview)
256
267
 
257
268
  <!-- toc:end -->
258
269
 
@@ -273,9 +284,7 @@ const resistor: SourceSimpleResistor = simple_source_resistor.parse({
273
284
  console.log(resistor.resistance) // 1000
274
285
 
275
286
  // This is the common way to parse/transform any element
276
- any_circuit_element.parse({
277
- /* ... */
278
- })
287
+ any_circuit_element.parse({/* ... */})
279
288
  ```
280
289
 
281
290
  ## Base Units
@@ -382,11 +391,11 @@ interface SourceBus {
382
391
  target_differential_impedance?: number
383
392
  /** Ordered polarity for a resolved point-to-point differential pair. */
384
393
  differential_pair?: {
385
- positive_source_trace_id: string
386
- negative_source_trace_id: string
387
- trace_gap?: number
388
- max_uncoupled_length?: number
389
- }
394
+ positive_source_trace_id: string
395
+ negative_source_trace_id: string
396
+ trace_gap?: number
397
+ max_uncoupled_length?: number
398
+ }
390
399
  /** Additional traces for length comparison, without changing electrical membership. */
391
400
  length_match_source_trace_ids?: string[]
392
401
  min_length?: SourceBusRouteLength
@@ -406,17 +415,16 @@ interface SourceBus {
406
415
 
407
416
  /** A routed length in mm, or an offset from the longest endpoint Manhattan distance.
408
417
  * Explicit references are resolved source traces; omitted references use the bus
409
- * members and length_match_source_trace_ids. */
410
- type SourceBusRouteLength =
418
+ * members and length_match_source_trace_ids. */ type SourceBusRouteLength =
411
419
  | number
412
420
  | {
413
- reference: "longest_manhattan"
414
- source_trace_ids?: string[]
415
- offset?: number
416
- }
421
+ reference: "longest_manhattan"
422
+ source_trace_ids?: string[]
423
+ offset?: number
424
+ }
417
425
 
418
- /** Centerline separation in mm or a multiple of the larger local trace width. */
419
- type SourceBusTraceSpacing = number | { width_multiplier: number }
426
+ /** Centerline separation in mm or a multiple of the larger local trace width. */ type SourceBusTraceSpacing =
427
+ number | { width_multiplier: number }
420
428
  ```
421
429
 
422
430
  ### SourceComponentAvailabilityWarning
@@ -439,7 +447,6 @@ interface SourceComponentAvailabilityWarning {
439
447
  }
440
448
  ```
441
449
 
442
-
443
450
  ### SourceComponentBase
444
451
 
445
452
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/base/source_component_base.ts)
@@ -537,6 +544,7 @@ interface SourceConfusingNetNameWarning {
537
544
  Datasheet information for a manufacturer part number, supplied with Circuit JSON.
538
545
 
539
546
  ```typescript
547
+ /** Datasheet information for a manufacturer part number, supplied with Circuit JSON. */
540
548
  interface SourceDatasheet {
541
549
  type: "source_datasheet"
542
550
  source_datasheet_id: string
@@ -650,7 +658,7 @@ interface SourceManuallyPlacedVia {
650
658
  type: "source_manually_placed_via"
651
659
  source_manually_placed_via_id: string
652
660
  source_group_id: string
653
- source_net_id: string
661
+ source_net_id?: string
654
662
  subcircuit_id?: string
655
663
  source_trace_id?: string
656
664
  }
@@ -808,6 +816,8 @@ interface SourcePcbGroundPlane {
808
816
 
809
817
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/properties/source_pin_attributes.ts)
810
818
 
819
+ Allowed relative deviation from requires_voltage, e.g. 0.05 for ±5%.
820
+
811
821
  ```typescript
812
822
  interface SourcePinAttributes {
813
823
  is_input?: boolean
@@ -996,6 +1006,22 @@ interface SourceRefdesConventionWarning {
996
1006
  }
997
1007
  ```
998
1008
 
1009
+ ### SourceRuntimeError
1010
+
1011
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_runtime_error.ts)
1012
+
1013
+ ```typescript
1014
+ interface SourceRuntimeError extends Pick<
1015
+ BaseCircuitJsonError,
1016
+ "message" | "error_type"
1017
+ > {
1018
+ type: "source_runtime_error"
1019
+ source_runtime_error_id: string
1020
+ error_type: "source_runtime_error"
1021
+ phase_name?: string
1022
+ }
1023
+ ```
1024
+
999
1025
  ### SourceSimpleAmmeter
1000
1026
 
1001
1027
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/source/source_simple_ammeter.ts)
@@ -1063,8 +1089,14 @@ Defines a simple connector component
1063
1089
  /** Defines a simple connector component */
1064
1090
  interface SourceSimpleConnector extends SourceComponentBase {
1065
1091
  ftype: "simple_connector"
1066
- standard?: "usb_c" | "m2"
1092
+ /** Connector interface or product family, such as usb_c, m2, or jst_ph */
1093
+ standard?: SourceSimpleConnectorStandard
1094
+ /** Number of electrical circuits in the connector */
1095
+ pin_count?: number
1067
1096
  }
1097
+
1098
+ type SourceSimpleConnectorStandard =
1099
+ (typeof source_simple_connector_standards)[number]
1068
1100
  ```
1069
1101
 
1070
1102
  ### SourceSimpleCrystal
@@ -1504,6 +1536,26 @@ interface CadCable {
1504
1536
  }
1505
1537
  ```
1506
1538
 
1539
+ ### CadCollisionError
1540
+
1541
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/cad/cad_collision_error.ts)
1542
+
1543
+ Union silhouette of solid intersection, projected along face normal (mm²
1544
+
1545
+ ```typescript
1546
+ interface CadCollisionError extends BaseCircuitJsonError {
1547
+ type: "cad_collision_error"
1548
+ cad_collision_error_id: string
1549
+ error_type: "cad_collision_error"
1550
+ cad_component_ids: string[]
1551
+ pcb_component_ids?: string[]
1552
+ source_component_ids: string[]
1553
+ /** Union silhouette of solid intersection, projected along face normal (mm² */
1554
+ intersection_area_mm2: number
1555
+ threshold_area_mm2: number
1556
+ }
1557
+ ```
1558
+
1507
1559
  ### CadComponent
1508
1560
 
1509
1561
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/cad/cad_component.ts)
@@ -1583,41 +1635,6 @@ interface CadReferenceSurface {
1583
1635
 
1584
1636
  ## PCB Elements
1585
1637
 
1586
- ### PcbFabricatorExtraChargeWarning
1587
-
1588
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_fabricator_extra_charge_warning.ts)
1589
-
1590
- Records an extra charge for the selected fabricator preset. An intended trigger
1591
- is a via hole diameter strictly below 0.3 mm with `jlcpcb_economy`,
1592
- `jlcpcb_standard`, `jlcpcb_economy_20260912`, or `jlcpcb_standard_20260912`.
1593
- A diameter of exactly 0.3 mm does not meet this condition. The producer detects
1594
- the condition and emits this record; parsing Circuit JSON does not run the check.
1595
-
1596
- ```typescript
1597
- interface PcbFabricatorExtraChargeWarning {
1598
- type: "pcb_fabricator_extra_charge_warning"
1599
- pcb_fabricator_extra_charge_warning_id: string
1600
- warning_type: "pcb_fabricator_extra_charge_warning"
1601
- message: string
1602
- fabricator_preset: string
1603
- pcb_board_id?: string
1604
- pcb_via_ids?: string[]
1605
- subcircuit_id?: string
1606
- }
1607
- ```
1608
-
1609
- The ID and `warning_type` are generated when omitted from input. For example:
1610
-
1611
- ```json
1612
- {
1613
- "type": "pcb_fabricator_extra_charge_warning",
1614
- "fabricator_preset": "jlcpcb_economy",
1615
- "message": "Via hole diameter 0.25 mm is below 0.3 mm and incurs an extra charge",
1616
- "pcb_board_id": "pcb_board_0",
1617
- "pcb_via_ids": ["pcb_via_0"]
1618
- }
1619
- ```
1620
-
1621
1638
  ### PcbAutoroutingError
1622
1639
 
1623
1640
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_autorouting_error.ts)
@@ -1659,8 +1676,6 @@ interface PcbBend {
1659
1676
  }
1660
1677
  ```
1661
1678
 
1662
- [Examples and coordinate/rendering semantics](docs/pcb-flex.md)
1663
-
1664
1679
  ### PcbBoard
1665
1680
 
1666
1681
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_board.ts)
@@ -1692,7 +1707,7 @@ interface PcbBoard extends ManufacturingDrcProperties {
1692
1707
  center: Point
1693
1708
  outline?: Point[]
1694
1709
  shape?: "rect" | "polygon"
1695
- material: "fr4" | "fr1"
1710
+ material: "fr4" | "fr1" | "flex"
1696
1711
  solder_mask_color?: string
1697
1712
  silkscreen_color?: string
1698
1713
  anchor_position?: Point
@@ -1723,35 +1738,6 @@ interface PcbBreakoutPoint {
1723
1738
  }
1724
1739
  ```
1725
1740
 
1726
- ### PcbBusRoutingConstraintError
1727
-
1728
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_error.ts)
1729
-
1730
- 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`.
1731
-
1732
- | `routing_rule` | Required measurements | Optional bounds |
1733
- | --- | --- | --- |
1734
- | `length_skew` | `actual_length_skew`, `maximum_length_skew` | — |
1735
- | `min_length` | `actual_trace_length`, `minimum_trace_length` | — |
1736
- | `max_length` | `actual_trace_length`, `maximum_trace_length` | — |
1737
- | `target_length` | `actual_trace_length`, `target_trace_length`, `length_tolerance` | — |
1738
- | `pcb_trace_spacing` | `actual_centerline_spacing`, `minimum_centerline_spacing` | — |
1739
- | `pcb_spacing_to_other_signals` | `actual_centerline_spacing`, `minimum_centerline_spacing` | — |
1740
- | `impedance_target` | `target_impedance` | `minimum_impedance`, `maximum_impedance` (at least one) |
1741
-
1742
- ```typescript
1743
- if (error.routing_rule === "max_length") {
1744
- // Narrowed to the maximum-length variant; these fields are required.
1745
- console.log(error.actual_trace_length, error.maximum_trace_length)
1746
- }
1747
- ```
1748
-
1749
- ### PcbBusRoutingConstraintWarning
1750
-
1751
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_warning.ts)
1752
-
1753
- 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.
1754
-
1755
1741
  ### PcbBusLengthSkewError
1756
1742
 
1757
1743
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_length_skew_error.ts)
@@ -1773,6 +1759,66 @@ interface PcbBusLengthSkewError extends BaseCircuitJsonError {
1773
1759
  }
1774
1760
  ```
1775
1761
 
1762
+ ### PcbBusRoutingConstraintError
1763
+
1764
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_error.ts)
1765
+
1766
+ ```typescript
1767
+ type PcbBusRoutingConstraintError =
1768
+ WithErrorContext<PcbBusRoutingConstraintViolation>
1769
+
1770
+ /** Rule-specific routing measurements. Lengths and centreline spacing are mm; impedance is ohms. */ type PcbBusRoutingConstraintViolation =
1771
+ | {
1772
+ routing_rule: "length_skew"
1773
+ actual_length_skew: number
1774
+ maximum_length_skew: number
1775
+ }
1776
+ | {
1777
+ routing_rule: "min_length"
1778
+ actual_trace_length: number
1779
+ minimum_trace_length: number
1780
+ }
1781
+ | {
1782
+ routing_rule: "max_length"
1783
+ actual_trace_length: number
1784
+ maximum_trace_length: number
1785
+ }
1786
+ | {
1787
+ routing_rule: "target_length"
1788
+ actual_trace_length: number
1789
+ target_trace_length: number
1790
+ length_tolerance: number
1791
+ }
1792
+ | {
1793
+ routing_rule: "pcb_trace_spacing"
1794
+ other_pcb_trace_id: string
1795
+ other_source_trace_id?: string
1796
+ actual_centerline_spacing: number
1797
+ minimum_centerline_spacing: number
1798
+ }
1799
+ | {
1800
+ routing_rule: "pcb_spacing_to_other_signals"
1801
+ other_pcb_trace_id: string
1802
+ other_source_trace_id?: string
1803
+ actual_centerline_spacing: number
1804
+ minimum_centerline_spacing: number
1805
+ }
1806
+ | {
1807
+ routing_rule: "impedance_target"
1808
+ target_impedance: number
1809
+ minimum_impedance?: number
1810
+ maximum_impedance?: number
1811
+ }
1812
+ ```
1813
+
1814
+ ### PcbBusRoutingConstraintWarning
1815
+
1816
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_bus_routing_constraint_warning.ts)
1817
+
1818
+ ```typescript
1819
+ type PcbBusRoutingConstraintWarning = WithWarningContext<WarningRule>
1820
+ ```
1821
+
1776
1822
  ### PcbComponent
1777
1823
 
1778
1824
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_component.ts)
@@ -1804,6 +1850,25 @@ interface PcbComponentInvalidLayerError extends BaseCircuitJsonError {
1804
1850
  }
1805
1851
  ```
1806
1852
 
1853
+ ### PcbComponentMissingCourtyardWarning
1854
+
1855
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_component_missing_courtyard_warning.ts)
1856
+
1857
+ Warning emitted when a PCB component has no courtyard geometry
1858
+
1859
+ ```typescript
1860
+ /** Warning emitted when a PCB component has no courtyard geometry */
1861
+ interface PcbComponentMissingCourtyardWarning {
1862
+ type: "pcb_component_missing_courtyard_warning"
1863
+ pcb_component_missing_courtyard_warning_id: string
1864
+ warning_type: "pcb_component_missing_courtyard_warning"
1865
+ message: string
1866
+ pcb_component_id: string
1867
+ source_component_id?: string
1868
+ subcircuit_id?: string
1869
+ }
1870
+ ```
1871
+
1807
1872
  ### PcbComponentNotOnBoardEdgeError
1808
1873
 
1809
1874
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_component_not_on_board_edge_error.ts)
@@ -2217,15 +2282,36 @@ interface PcbFabricationNoteText {
2217
2282
  layer: VisibleLayer
2218
2283
  anchor_position: Point
2219
2284
  anchor_alignment:
2220
- | "center"
2221
- | "top_left"
2222
- | "top_right"
2223
- | "bottom_left"
2224
- | "bottom_right"
2285
+ "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right"
2225
2286
  color?: string
2226
2287
  }
2227
2288
  ```
2228
2289
 
2290
+ ### PcbFabricatorExtraChargeWarning
2291
+
2292
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_fabricator_extra_charge_warning.ts)
2293
+
2294
+ Selected preset, for example jlcpcb_economy or jlcpcb_standard_20260912.
2295
+
2296
+ ```typescript
2297
+ /** Warning that a design feature incurs an extra charge for the selected
2298
+ * fabricator preset. For JLCPCB economy or standard presets (including dated
2299
+ * variants), via hole diameters below 0.3 mm are an intended use case.
2300
+ * The producer detects the condition; this record describes the warning. */
2301
+ interface PcbFabricatorExtraChargeWarning {
2302
+ type: "pcb_fabricator_extra_charge_warning"
2303
+ pcb_fabricator_extra_charge_warning_id: string
2304
+ warning_type: "pcb_fabricator_extra_charge_warning"
2305
+ message: string
2306
+ /** Selected preset, for example jlcpcb_economy or jlcpcb_standard_20260912. */
2307
+ fabricator_preset: string
2308
+ pcb_board_id?: string
2309
+ /** Vias responsible for the extra charge, when the warning concerns vias. */
2310
+ pcb_via_ids?: string[]
2311
+ subcircuit_id?: string
2312
+ }
2313
+ ```
2314
+
2229
2315
  ### PcbFootprintOverlapError
2230
2316
 
2231
2317
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_footprint_overlap_error.ts)
@@ -2346,24 +2432,13 @@ interface PcbHoleCircle {
2346
2432
 
2347
2433
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_keepout.ts)
2348
2434
 
2349
- A keepout region on specified PCB layers, with rectangle, circle, or outline geometry.
2350
-
2351
- `warning_only: true` makes the region advisory: routing and copper placement may
2352
- cross it, and overlap checks should emit `pcb_keepout_overlap_warning` records
2353
- instead of errors for that keepout. Omitted or `false` retains normal enforcement.
2354
- The parser preserves omission; it does not insert a default. Only boolean values
2355
- are accepted. `excluded_pcb_component_ids` continues to exempt the listed
2356
- components from keepout diagnostics, including warnings.
2357
-
2358
- This is a data contract: parsing a keepout does not run routing or DRC. Producers
2359
- and consumers must implement the advisory behavior. Unrelated DRC violations and
2360
- violations of other, enforcing keepouts remain errors. Existing documents require
2361
- no migration; older consumers may ignore the flag and enforce the region normally.
2435
+ PCB components excluded from keepout DRC enforcement.
2362
2436
 
2363
2437
  ```typescript
2364
2438
  interface PcbKeepoutOutline {
2365
2439
  type: "pcb_keepout"
2366
2440
  shape: "outline"
2441
+ pcb_component_id?: string
2367
2442
  pcb_group_id?: string
2368
2443
  subcircuit_id?: string
2369
2444
  outline: Point[]
@@ -2373,17 +2448,21 @@ interface PcbKeepoutOutline {
2373
2448
  description?: string
2374
2449
  /** PCB components excluded from keepout DRC enforcement. */
2375
2450
  excluded_pcb_component_ids?: string[]
2376
- /**
2377
- * When true, this keepout is advisory: it does not block routing or copper
2451
+ /** When true, this keepout is advisory: it does not block routing or copper
2378
2452
  * placement, and DRC reports overlaps as pcb_keepout_overlap_warning records.
2379
- * False or omitted preserves normal enforcement. Component exclusions still apply.
2380
- */
2453
+ * False or omitted preserves normal enforcement. Component exclusions still apply. */
2454
+
2381
2455
  warning_only?: boolean
2456
+ /** Allow trace crossings without keepout diagnostics; copper pours remain excluded. */
2457
+ allow_traces?: boolean
2458
+ /** Allow components and their pads/plated holes without keepout diagnostics; copper pours remain excluded. */
2459
+ allow_placements?: boolean
2382
2460
  }
2383
2461
 
2384
2462
  interface PCBKeepoutRect {
2385
2463
  type: "pcb_keepout"
2386
2464
  shape: "rect"
2465
+ pcb_component_id?: string
2387
2466
  pcb_group_id?: string
2388
2467
  subcircuit_id?: string
2389
2468
  center: Point
@@ -2394,17 +2473,21 @@ interface PCBKeepoutRect {
2394
2473
  description?: string
2395
2474
  /** PCB components excluded from keepout DRC enforcement. */
2396
2475
  excluded_pcb_component_ids?: string[]
2397
- /**
2398
- * When true, this keepout is advisory: it does not block routing or copper
2476
+ /** When true, this keepout is advisory: it does not block routing or copper
2399
2477
  * placement, and DRC reports overlaps as pcb_keepout_overlap_warning records.
2400
- * False or omitted preserves normal enforcement. Component exclusions still apply.
2401
- */
2478
+ * False or omitted preserves normal enforcement. Component exclusions still apply. */
2479
+
2402
2480
  warning_only?: boolean
2481
+ /** Allow trace crossings without keepout diagnostics; copper pours remain excluded. */
2482
+ allow_traces?: boolean
2483
+ /** Allow components and their pads/plated holes without keepout diagnostics; copper pours remain excluded. */
2484
+ allow_placements?: boolean
2403
2485
  }
2404
2486
 
2405
2487
  interface PCBKeepoutCircle {
2406
2488
  type: "pcb_keepout"
2407
2489
  shape: "circle"
2490
+ pcb_component_id?: string
2408
2491
  pcb_group_id?: string
2409
2492
  subcircuit_id?: string
2410
2493
  center: Point
@@ -2414,12 +2497,15 @@ interface PCBKeepoutCircle {
2414
2497
  description?: string
2415
2498
  /** PCB components excluded from keepout DRC enforcement. */
2416
2499
  excluded_pcb_component_ids?: string[]
2417
- /**
2418
- * When true, this keepout is advisory: it does not block routing or copper
2500
+ /** When true, this keepout is advisory: it does not block routing or copper
2419
2501
  * placement, and DRC reports overlaps as pcb_keepout_overlap_warning records.
2420
- * False or omitted preserves normal enforcement. Component exclusions still apply.
2421
- */
2502
+ * False or omitted preserves normal enforcement. Component exclusions still apply. */
2503
+
2422
2504
  warning_only?: boolean
2505
+ /** Allow trace crossings without keepout diagnostics; copper pours remain excluded. */
2506
+ allow_traces?: boolean
2507
+ /** Allow components and their pads/plated holes without keepout diagnostics; copper pours remain excluded. */
2508
+ allow_placements?: boolean
2423
2509
  }
2424
2510
 
2425
2511
  type PCBKeepout = PCBKeepoutRect | PCBKeepoutCircle | PcbKeepoutOutline
@@ -2637,11 +2723,7 @@ interface PcbNoteText {
2637
2723
  text?: string
2638
2724
  anchor_position: Point
2639
2725
  anchor_alignment:
2640
- | "center"
2641
- | "top_left"
2642
- | "top_right"
2643
- | "bottom_left"
2644
- | "bottom_right"
2726
+ "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right"
2645
2727
  layer: VisibleLayer
2646
2728
  is_mirrored_from_top_view?: boolean
2647
2729
  color?: string
@@ -2749,6 +2831,24 @@ interface PcbPanelizationPlacementError extends BaseCircuitJsonError {
2749
2831
  }
2750
2832
  ```
2751
2833
 
2834
+ ### PcbPin1Location
2835
+
2836
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/properties/pcb_pin1_location.ts)
2837
+
2838
+ ```typescript
2839
+ type PcbPin1Location =
2840
+ | "leftside_top"
2841
+ | "leftside_bottom"
2842
+ | "rightside_top"
2843
+ | "rightside_bottom"
2844
+ | "topside_left"
2845
+ | "topside_right"
2846
+ | "bottomside_left"
2847
+ | "bottomside_right"
2848
+
2849
+ type PcbPin1LocationRotation = 0 | 90 | 180 | 270
2850
+ ```
2851
+
2752
2852
  ### PcbPlacementError
2753
2853
 
2754
2854
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_placement_error.ts)
@@ -2973,7 +3073,6 @@ interface PcbPreflightRoutingError extends BaseCircuitJsonError {
2973
3073
  }
2974
3074
  ```
2975
3075
 
2976
-
2977
3076
  ### PcbRouteHints
2978
3077
 
2979
3078
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/properties/pcb_route_hints.ts)
@@ -3178,6 +3277,21 @@ interface PcbSilkscreenText {
3178
3277
  }
3179
3278
  ```
3180
3279
 
3280
+ ### PcbSoldermaskOpening
3281
+
3282
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_soldermask_opening.ts)
3283
+
3284
+ ```typescript
3285
+ interface PcbSoldermaskOpeningBase {
3286
+ type: "pcb_soldermask_opening"
3287
+ pcb_soldermask_opening_id: string
3288
+ layer: "top" | "bottom"
3289
+ pcb_component_id?: string
3290
+ pcb_group_id?: string
3291
+ subcircuit_id?: string
3292
+ }
3293
+ ```
3294
+
3181
3295
  ### PcbSolderPaste
3182
3296
 
3183
3297
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_solder_paste.ts)
@@ -3261,18 +3375,17 @@ interface PcbDielectricStackupLayer {
3261
3375
  }
3262
3376
 
3263
3377
  type PcbStackupLayer =
3264
- | PcbSoldermaskStackupLayer
3265
- | PcbCopperStackupLayer
3266
- | PcbDielectricStackupLayer
3378
+ PcbSoldermaskStackupLayer | PcbCopperStackupLayer | PcbDielectricStackupLayer
3267
3379
  ```
3268
3380
 
3269
3381
  ### PcbStiffener
3270
3382
 
3271
3383
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_stiffener.ts)
3272
3384
 
3273
- Defines bonded mechanical reinforcement with rectangular or polygon geometry.
3385
+ Common properties of bonded PCB reinforcement.
3274
3386
 
3275
3387
  ```typescript
3388
+ /** Common properties of bonded PCB reinforcement. */
3276
3389
  interface PcbStiffenerBase {
3277
3390
  type: "pcb_stiffener"
3278
3391
  pcb_stiffener_id: string
@@ -3289,33 +3402,8 @@ interface PcbStiffenerBase {
3289
3402
  /** Adhesive thickness in mm; omission means unspecified, not zero. */
3290
3403
  adhesive_thickness?: Length
3291
3404
  }
3292
-
3293
- interface PcbStiffenerRect extends PcbStiffenerBase {
3294
- shape: "rect"
3295
- /** Relative to the flat board center, in mm. */
3296
- center: Point
3297
- /** Degrees counterclockwise in the flat top view; omission means zero. */
3298
- rotation?: Rotation
3299
- width: Length
3300
- height: Length
3301
- outline?: never
3302
- }
3303
-
3304
- interface PcbStiffenerPolygon extends PcbStiffenerBase {
3305
- shape: "polygon"
3306
- /** Implicitly closed vertices relative to the flat board center, in mm. All placement/rotation is baked in. */
3307
- outline: Point[]
3308
- center?: never
3309
- rotation?: never
3310
- width?: never
3311
- height?: never
3312
- }
3313
-
3314
- type PcbStiffener = PcbStiffenerRect | PcbStiffenerPolygon
3315
3405
  ```
3316
3406
 
3317
- [Examples and coordinate/rendering semantics](docs/pcb-flex.md)
3318
-
3319
3407
  ### PcbText
3320
3408
 
3321
3409
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_text.ts)
@@ -3364,18 +3452,17 @@ interface PcbThermalSpoke {
3364
3452
 
3365
3453
  ### PcbTrace
3366
3454
 
3367
- A `wire` route point can taper its outgoing segment using `start_width`,
3368
- `end_width`, and `width_interpolation_mode` (`linear` or `quadratic`).
3369
- See the [wire taper geometry contract](docs/pcb-trace-teardrops.md).
3370
-
3371
3455
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace.ts)
3372
3456
 
3457
+ Outgoing segment taper; all three fields must be specified together.
3458
+
3373
3459
  ```typescript
3374
3460
  interface PcbTraceRoutePointWire {
3375
3461
  route_type: "wire"
3376
3462
  x: Distance
3377
3463
  y: Distance
3378
3464
  width: Distance
3465
+ /** Outgoing segment taper; all three fields must be specified together. */
3379
3466
  start_width?: Distance
3380
3467
  end_width?: Distance
3381
3468
  width_interpolation_mode?: "linear" | "quadratic"
@@ -3386,24 +3473,8 @@ interface PcbTraceRoutePointWire {
3386
3473
  layer: LayerRef
3387
3474
  }
3388
3475
 
3389
- interface PcbTraceRoutePointVia {
3390
- route_type: "via"
3391
- x: Distance
3392
- y: Distance
3393
- copper_pour_id?: string
3394
- is_inside_copper_pour?: boolean
3395
- hole_diameter?: Distance
3396
- outer_diameter?: Distance
3397
- tented_on_top?: boolean
3398
- tented_on_bottom?: boolean
3399
- from_layer: LayerRef
3400
- to_layer: LayerRef
3401
- }
3402
-
3403
3476
  type PcbTraceRoutePoint =
3404
- | PcbTraceRoutePointWire
3405
- | PcbTraceRoutePointVia
3406
- | PcbTraceRoutePointThroughPad
3477
+ PcbTraceRoutePointWire | PcbTraceRoutePointVia | PcbTraceRoutePointThroughPad
3407
3478
  ```
3408
3479
 
3409
3480
  ### PcbTraceError
@@ -3465,6 +3536,38 @@ interface PcbTraceMissingError extends BaseCircuitJsonError {
3465
3536
  }
3466
3537
  ```
3467
3538
 
3539
+ ### PcbTraceStyleWarning
3540
+
3541
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace_style_warning.ts)
3542
+
3543
+ A long segment at an odd angle, identified by its trace and route endpoints.
3544
+
3545
+ ```typescript
3546
+ /** A long segment at an odd angle, identified by its trace and route endpoints. */
3547
+ interface PcbTraceStyleWarning {
3548
+ type: "pcb_trace_style_warning"
3549
+ pcb_trace_style_warning_id: string
3550
+ warning_type: "pcb_trace_style_warning"
3551
+ message: string
3552
+ styling_issue_type: "long_segment_at_odd_angle"
3553
+ pcb_trace_id: string
3554
+ source_trace_id?: string
3555
+ subcircuit_id?: string
3556
+ layer: LayerRef
3557
+ start_route_index: number
3558
+ end_route_index: number
3559
+ segment_start: Point
3560
+ segment_end: Point
3561
+ center: Point
3562
+ segment_length: Distance
3563
+ minimum_segment_length: Distance
3564
+ angle_degrees: number
3565
+ nearest_allowed_angle_degrees: number
3566
+ angle_deviation_degrees: number
3567
+ angle_tolerance_degrees: number
3568
+ }
3569
+ ```
3570
+
3468
3571
  ### PcbTraceTooLongError
3469
3572
 
3470
3573
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace_too_long_error.ts)
@@ -3531,38 +3634,6 @@ interface PcbTraceTooManyViasWarning {
3531
3634
  }
3532
3635
  ```
3533
3636
 
3534
- ### PcbTraceStyleWarning
3535
-
3536
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace_style_warning.ts)
3537
-
3538
- A long segment at an odd angle, identified by its trace and route endpoints.
3539
-
3540
- ```typescript
3541
- /** A long segment at an odd angle, identified by its trace and route endpoints. */
3542
- interface PcbTraceStyleWarning {
3543
- type: "pcb_trace_style_warning"
3544
- pcb_trace_style_warning_id: string
3545
- warning_type: "pcb_trace_style_warning"
3546
- message: string
3547
- styling_issue_type: "long_segment_at_odd_angle"
3548
- pcb_trace_id: string
3549
- source_trace_id?: string
3550
- subcircuit_id?: string
3551
- layer: LayerRef
3552
- start_route_index: number
3553
- end_route_index: number
3554
- segment_start: Point
3555
- segment_end: Point
3556
- center: Point
3557
- segment_length: Distance
3558
- minimum_segment_length: Distance
3559
- angle_degrees: number
3560
- nearest_allowed_angle_degrees: number
3561
- angle_deviation_degrees: number
3562
- angle_tolerance_degrees: number
3563
- }
3564
- ```
3565
-
3566
3637
  ### PcbTraceWarning
3567
3638
 
3568
3639
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_trace_warning.ts)
@@ -3614,6 +3685,8 @@ interface PcbVia {
3614
3685
  /** PCB ports belonging to this via, including layer ports and aliases. */
3615
3686
  pcb_port_ids?: string[]
3616
3687
  pcb_trace_id?: string
3688
+ source_trace_id?: string
3689
+ source_net_id?: string
3617
3690
  net_is_assignable?: boolean
3618
3691
  net_assigned?: boolean
3619
3692
  tented_on_top?: boolean
@@ -3621,10 +3694,6 @@ interface PcbVia {
3621
3694
  }
3622
3695
  ```
3623
3696
 
3624
- Legacy `is_tented` input is deprecated and transformed into `tented_on_top` and
3625
- `tented_on_bottom`. Explicit per-side values take precedence. Parsed output omits
3626
- `is_tented`; both per-side fields are optional.
3627
-
3628
3697
  ### PcbViaClearanceError
3629
3698
 
3630
3699
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/pcb/pcb_via_clearance_error.ts)
@@ -3797,8 +3866,7 @@ interface SchematicPortArrangementBySides {
3797
3866
  }
3798
3867
 
3799
3868
  type SchematicPortArrangement =
3800
- | SchematicPortArrangementBySize
3801
- | SchematicPortArrangementBySides
3869
+ SchematicPortArrangementBySize | SchematicPortArrangementBySides
3802
3870
  ```
3803
3871
 
3804
3872
  ### SchematicComponentOverlapWarning
@@ -3847,9 +3915,7 @@ interface SchematicComponentStylingWarning {
3847
3915
 
3848
3916
  ```typescript
3849
3917
  type SchematicDebugObject =
3850
- | SchematicDebugRect
3851
- | SchematicDebugLine
3852
- | SchematicDebugPoint
3918
+ SchematicDebugRect | SchematicDebugLine | SchematicDebugPoint
3853
3919
 
3854
3920
  interface SchematicDebugRect {
3855
3921
  type: "schematic_debug_object"
@@ -3893,9 +3959,7 @@ interface SchematicElementOutsideSheetWarning {
3893
3959
  message: string
3894
3960
  schematic_sheet_id: string
3895
3961
  schematic_element_type:
3896
- | "schematic_component"
3897
- | "schematic_net_label"
3898
- | "schematic_trace"
3962
+ "schematic_component" | "schematic_net_label" | "schematic_trace"
3899
3963
  schematic_element_id: string
3900
3964
  }
3901
3965
  ```
@@ -3917,7 +3981,7 @@ interface SchematicError extends BaseCircuitJsonError {
3917
3981
 
3918
3982
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_graphic.ts)
3919
3983
 
3920
- References a graphic asset or inline SVG content with optional centered layout bounds on a schematic sheet. At least one graphic source is required.
3984
+ References a graphic asset or inline SVG content on a schematic sheet.
3921
3985
 
3922
3986
  ```typescript
3923
3987
  /** References a graphic asset or inline SVG content on a schematic sheet. */
@@ -4043,6 +4107,8 @@ interface SchematicMissingSheetWarning {
4043
4107
 
4044
4108
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_net_label.ts)
4045
4109
 
4110
+ Display-only superscript suffix, e.g. "1" in GND¹. Does not change net identity.
4111
+
4046
4112
  ```typescript
4047
4113
  interface SchematicNetLabel {
4048
4114
  type: "schematic_net_label"
@@ -4107,6 +4173,11 @@ interface SchematicPort {
4107
4173
  true_ccw_index?: number
4108
4174
  pin_number?: number
4109
4175
  display_pin_label?: string
4176
+ /** Ordered parts of the pin label with per-part styling.
4177
+ * For example, `A~{BC}D` is represented as `A`, overlined `BC`, then `D`.
4178
+ * Consumers that do not support styled text can use `display_pin_label`. */
4179
+
4180
+ display_pin_label_text_parts?: SchematicTextPart[]
4110
4181
  display_pin_label_font_size?: number
4111
4182
  subcircuit_id?: string
4112
4183
  is_connected?: boolean
@@ -4158,7 +4229,7 @@ interface SchematicSheet {
4158
4229
  schematic_sheet_id: string
4159
4230
  name?: string
4160
4231
  sheet_index?: number
4161
- sheet_size?: "a4" | "ansi_b"
4232
+ sheet_size?: SchematicSheetSize
4162
4233
  sheet_width?: number
4163
4234
  sheet_height?: number
4164
4235
  subcircuit_id?: string
@@ -4166,6 +4237,25 @@ interface SchematicSheet {
4166
4237
  }
4167
4238
  ```
4168
4239
 
4240
+ ### SchematicSheetStylingWarning
4241
+
4242
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_sheet_styling_warning.ts)
4243
+
4244
+ Style warning emitted when a schematic sheet uses a non-default size.
4245
+
4246
+ ```typescript
4247
+ /** Style warning emitted when a schematic sheet uses a non-default size. */
4248
+ interface SchematicSheetStylingWarning {
4249
+ type: "schematic_sheet_styling_warning"
4250
+ schematic_sheet_styling_warning_id: string
4251
+ warning_type: "schematic_sheet_styling_warning"
4252
+ message: string
4253
+ schematic_sheet_id: string
4254
+ styling_issue_type: "non_default_sheet_size"
4255
+ subcircuit_id?: string
4256
+ }
4257
+ ```
4258
+
4169
4259
  ### SchematicSymbol
4170
4260
 
4171
4261
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_symbol.ts)
@@ -4234,6 +4324,8 @@ interface SchematicTableCell {
4234
4324
 
4235
4325
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_text.ts)
4236
4326
 
4327
+ Display-only superscript suffix, e.g. "1" in GND¹ for an inline net label.
4328
+
4237
4329
  ```typescript
4238
4330
  interface SchematicText {
4239
4331
  type: "schematic_text"
@@ -4241,7 +4333,17 @@ interface SchematicText {
4241
4333
  schematic_component_id?: string
4242
4334
  schematic_symbol_id?: string
4243
4335
  schematic_text_id: string
4336
+ /** Set when the text annotates a trace rather than a component, as an inline
4337
+ * net label does - the net name drawn alongside a point-to-point wire instead
4338
+ * of as an anchored `schematic_net_label`. Lets consumers tell such a label
4339
+ * apart from free-standing text and resolve the net it belongs to. */
4340
+
4341
+ source_trace_id?: string
4244
4342
  text: string
4343
+ /** Ordered parts with per-part display options.
4344
+ * Consumers that do not support styled text can use `text`. */
4345
+
4346
+ text_parts?: SchematicTextPart[]
4245
4347
  /** Display-only superscript suffix, e.g. "1" in GND¹ for an inline net label. */
4246
4348
  display_superscript?: string
4247
4349
  font_size: number
@@ -4256,6 +4358,22 @@ interface SchematicText {
4256
4358
  }
4257
4359
  ```
4258
4360
 
4361
+ ### SchematicTextPart
4362
+
4363
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_text_part.ts)
4364
+
4365
+ One part of schematic text with its display options.
4366
+
4367
+ ```typescript
4368
+ /** One part of schematic text with its display options. */
4369
+ interface SchematicTextPart {
4370
+ /** The literal text displayed for this part. */
4371
+ text: string
4372
+ /** Draw a line above this part, typically indicating an active-low signal. */
4373
+ is_overlined?: boolean
4374
+ }
4375
+ ```
4376
+
4259
4377
  ### SchematicTrace
4260
4378
 
4261
4379
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/schematic/schematic_trace.ts)
@@ -4298,53 +4416,6 @@ interface SchematicVoltageProbe {
4298
4416
 
4299
4417
  ## Simulation Elements
4300
4418
 
4301
- ### SimulationReturnCurrentContact
4302
-
4303
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_contact.ts)
4304
-
4305
- ```typescript
4306
- interface SimulationReturnCurrentContactBase {
4307
- x: number
4308
- y: number
4309
- layer: LayerRef
4310
- }
4311
-
4312
- interface SimulationReturnCurrentPortContact extends SimulationReturnCurrentContactBase {
4313
- contact_type: "pcb_port"
4314
- pcb_port_id: string
4315
- }
4316
-
4317
- interface SimulationReturnCurrentViaContact extends SimulationReturnCurrentContactBase {
4318
- contact_type: "pcb_via"
4319
- pcb_via_id: string
4320
- }
4321
-
4322
- interface SimulationReturnCurrentCopperPourContact extends SimulationReturnCurrentContactBase {
4323
- contact_type: "pcb_copper_pour"
4324
- pcb_copper_pour_id: string
4325
- }
4326
- ```
4327
-
4328
- ### SimulationReturnCurrentGridJson
4329
-
4330
- [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_grid_json.ts)
4331
-
4332
- ```typescript
4333
- type SimulationReturnCurrentGridJson =
4334
- | {
4335
- field_type: "real"
4336
- sheet_current_x: (number | null)[]
4337
- sheet_current_y: (number | null)[]
4338
- }
4339
- | {
4340
- field_type: "complex_phasor"
4341
- sheet_current_x_real: (number | null)[]
4342
- sheet_current_x_imag: (number | null)[]
4343
- sheet_current_y_real: (number | null)[]
4344
- sheet_current_y_imag: (number | null)[]
4345
- }
4346
- ```
4347
-
4348
4419
  ### SimulationAcSweepCurrentGraph
4349
4420
 
4350
4421
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_ac_sweep_current_graph.ts)
@@ -4387,8 +4458,7 @@ interface SimulationAcSweepVoltageGraph {
4387
4458
 
4388
4459
  ```typescript
4389
4460
  type SimulationAnalysisResult =
4390
- | SimulationVoltageAnalysisResult
4391
- | SimulationCurrentAnalysisResult
4461
+ SimulationVoltageAnalysisResult | SimulationCurrentAnalysisResult
4392
4462
 
4393
4463
  type SimulationNonTransientVoltageAnalysisResult =
4394
4464
  | SimulationDcOperatingPointVoltage
@@ -4401,12 +4471,10 @@ type SimulationNonTransientCurrentAnalysisResult =
4401
4471
  | SimulationAcSweepCurrentGraph
4402
4472
 
4403
4473
  type SimulationVoltageAnalysisResult =
4404
- | SimulationTransientVoltageGraph
4405
- | SimulationNonTransientVoltageAnalysisResult
4474
+ SimulationTransientVoltageGraph | SimulationNonTransientVoltageAnalysisResult
4406
4475
 
4407
4476
  type SimulationCurrentAnalysisResult =
4408
- | SimulationTransientCurrentGraph
4409
- | SimulationNonTransientCurrentAnalysisResult
4477
+ SimulationTransientCurrentGraph | SimulationNonTransientCurrentAnalysisResult
4410
4478
  ```
4411
4479
 
4412
4480
  ### SimulationComplexSample
@@ -4447,8 +4515,7 @@ interface SimulationCurrentProbe {
4447
4515
 
4448
4516
  ```typescript
4449
4517
  type SimulationCurrentSource =
4450
- | SimulationDcCurrentSource
4451
- | SimulationAcCurrentSource
4518
+ SimulationDcCurrentSource | SimulationAcCurrentSource
4452
4519
 
4453
4520
  /** Defines a DC current source for simulation purposes. It forces a current
4454
4521
  * between two source ports. */
@@ -4567,6 +4634,8 @@ interface SimulationExperiment {
4567
4634
  simulation_experiment_id: string
4568
4635
  name: string
4569
4636
  experiment_type: ExperimentType
4637
+ subcircuit_id?: string
4638
+ spice_engine?: string
4570
4639
  time_per_step?: number // ms
4571
4640
  start_time_ms?: number // ms
4572
4641
  end_time_ms?: number // ms
@@ -4652,20 +4721,17 @@ type SimulationParameterSweep =
4652
4721
  | SimulationVoltageParameterSweep
4653
4722
  | SimulationCurrentParameterSweep
4654
4723
 
4655
- interface SimulationResistanceParameterSweep
4656
- extends SimulationParameterSweepBase {
4724
+ interface SimulationResistanceParameterSweep extends SimulationParameterSweepBase {
4657
4725
  parameter_type: "resistance"
4658
4726
  resistor_source_component_id: string
4659
4727
  }
4660
4728
 
4661
- interface SimulationCapacitanceParameterSweep
4662
- extends SimulationParameterSweepBase {
4729
+ interface SimulationCapacitanceParameterSweep extends SimulationParameterSweepBase {
4663
4730
  parameter_type: "capacitance"
4664
4731
  capacitor_source_component_id: string
4665
4732
  }
4666
4733
 
4667
- interface SimulationInductanceParameterSweep
4668
- extends SimulationParameterSweepBase {
4734
+ interface SimulationInductanceParameterSweep extends SimulationParameterSweepBase {
4669
4735
  parameter_type: "inductance"
4670
4736
  inductor_source_component_id: string
4671
4737
  }
@@ -4743,8 +4809,7 @@ interface SimulationPcbReturnCurrentHeatmap {
4743
4809
 
4744
4810
  ```typescript
4745
4811
  type SimulationPcbReturnCurrentMarker =
4746
- | SimulationPcbReturnCurrentPortMarker
4747
- | SimulationPcbReturnCurrentViaMarker
4812
+ SimulationPcbReturnCurrentPortMarker | SimulationPcbReturnCurrentViaMarker
4748
4813
 
4749
4814
  interface SimulationReturnCurrentMarkerBase {
4750
4815
  type: "simulation_pcb_return_current_marker"
@@ -4791,6 +4856,33 @@ interface SimulationPcbReturnCurrentResult {
4791
4856
  }
4792
4857
  ```
4793
4858
 
4859
+ ### SimulationReturnCurrentContact
4860
+
4861
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_contact.ts)
4862
+
4863
+ ```typescript
4864
+ interface SimulationReturnCurrentContactBase {
4865
+ x: number
4866
+ y: number
4867
+ layer: LayerRef
4868
+ }
4869
+
4870
+ interface SimulationReturnCurrentPortContact extends SimulationReturnCurrentContactBase {
4871
+ contact_type: "pcb_port"
4872
+ pcb_port_id: string
4873
+ }
4874
+
4875
+ interface SimulationReturnCurrentViaContact extends SimulationReturnCurrentContactBase {
4876
+ contact_type: "pcb_via"
4877
+ pcb_via_id: string
4878
+ }
4879
+
4880
+ interface SimulationReturnCurrentCopperPourContact extends SimulationReturnCurrentContactBase {
4881
+ contact_type: "pcb_copper_pour"
4882
+ pcb_copper_pour_id: string
4883
+ }
4884
+ ```
4885
+
4794
4886
  ### SimulationReturnCurrentExcitation
4795
4887
 
4796
4888
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_excitation.ts)
@@ -4810,6 +4902,26 @@ interface SimulationReturnCurrentExcitation {
4810
4902
  }
4811
4903
  ```
4812
4904
 
4905
+ ### SimulationReturnCurrentGridJson
4906
+
4907
+ [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_return_current_grid_json.ts)
4908
+
4909
+ ```typescript
4910
+ type SimulationReturnCurrentGridJson =
4911
+ | {
4912
+ field_type: "real"
4913
+ sheet_current_x: (number | null)[]
4914
+ sheet_current_y: (number | null)[]
4915
+ }
4916
+ | {
4917
+ field_type: "complex_phasor"
4918
+ sheet_current_x_real: (number | null)[]
4919
+ sheet_current_x_imag: (number | null)[]
4920
+ sheet_current_y_real: (number | null)[]
4921
+ sheet_current_y_imag: (number | null)[]
4922
+ }
4923
+ ```
4924
+
4813
4925
  ### SimulationSpiceSubcircuit
4814
4926
 
4815
4927
  [Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_spice_subcircuit.ts)
@@ -4893,6 +5005,7 @@ interface SimulationTransientVoltageGraph {
4893
5005
  type: "simulation_transient_voltage_graph"
4894
5006
  simulation_transient_voltage_graph_id: string
4895
5007
  simulation_experiment_id: string
5008
+ simulation_voltage_probe_id?: string
4896
5009
  simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
4897
5010
  timestamps_ms?: number[]
4898
5011
  voltage_levels: number[]
@@ -4951,8 +5064,7 @@ interface SimulationVoltageProbe {
4951
5064
 
4952
5065
  ```typescript
4953
5066
  type SimulationVoltageSource =
4954
- | SimulationDcVoltageSource
4955
- | SimulationAcVoltageSource
5067
+ SimulationDcVoltageSource | SimulationAcVoltageSource
4956
5068
 
4957
5069
  /** Defines a DC voltage source for simulation purposes. It applies a voltage
4958
5070
  * difference between two source ports. */
@@ -4994,4 +5106,98 @@ interface SimulationAcVoltageSource {
4994
5106
  }
4995
5107
  ```
4996
5108
 
5109
+ ## Drawing Elements
5110
+
5111
+ ### DrawingDimensionLine
5112
+
5113
+ ```typescript
5114
+ /** Resolved drawing strokes in page-centered paper mm, +X right/+Y up.
5115
+ * Core computes the model measurement, projection, placement and formatted text.
5116
+ * A renderer draws these supplied coordinates without resolving model geometry.
5117
+ * The preformatted text is preserved exactly and need not equal paper length. */
5118
+ interface DrawingDimensionLine {
5119
+ type: "drawing_dimension_line"
5120
+ drawing_dimension_line_id: string
5121
+ drawing_part_view_id: string
5122
+ /** Distinct endpoints of the visible dimension line, in paper mm. */
5123
+ start: { x: number; y: number }
5124
+ end: { x: number; y: number }
5125
+ /** Required preformatted measured value, preserved exactly. */
5126
+ text: string
5127
+ /** Optional attachment of a witness line leading to start. */
5128
+ edge_ref_start?: { x: number; y: number }
5129
+ /** Independently optional attachment of a witness line leading to end. */
5130
+ edge_ref_end?: { x: number; y: number }
5131
+ /** Exact nonblank model feature name; optional metadata only. */
5132
+ edge_ref_name?: string
5133
+ /** Stable annotation identity, separate from the measured text. */
5134
+ name?: string
5135
+ }
5136
+ ```
5137
+
5138
+ ### DrawingPage
5139
+
5140
+ ```typescript
5141
+ interface DrawingPage {
5142
+ type: "drawing_page"
5143
+ drawing_page_id: string
5144
+ name?: string
5145
+ display_name?: string
5146
+ page_size?: DrawingPageSize
5147
+ orientation?: "landscape" | "portrait"
5148
+ width: number
5149
+ height: number
5150
+ }
5151
+ ```
5152
+
5153
+ ### DrawingPageTitleBlock
5154
+
5155
+ ```typescript
5156
+ interface DrawingPageTitleBlock {
5157
+ type: "drawing_page_title_block"
5158
+ drawing_page_title_block_id: string
5159
+ drawing_page_id: string
5160
+ title: string
5161
+ legal_owner?: string
5162
+ identification_number?: string
5163
+ revision_index?: string
5164
+ date_of_issue?: string
5165
+ creator?: string
5166
+ approval_person?: string
5167
+ sheet_number?: number
5168
+ number_of_sheets?: number
5169
+ }
5170
+ ```
5171
+
5172
+ ### DrawingPartView
5173
+
5174
+ ```typescript
5175
+ interface DrawingPartView {
5176
+ type: "drawing_part_view"
5177
+ drawing_part_view_id: string
5178
+ drawing_page_id: string
5179
+ /** Resolved geometry selection for this part view; omitted selectors mean the entire assembly. */
5180
+ source_group_id?: string
5181
+ source_component_ids?: string[]
5182
+ name?: string
5183
+ display_name?: string
5184
+ direction: DrawingPartViewDirection
5185
+ center: { x: number; y: number }
5186
+ width: number
5187
+ height: number
5188
+ /** Model-to-paper ratio; omitted means fit with a margin. */
5189
+ scale?: number
5190
+ /** False when omitted. Hidden edges are dashed. */
5191
+ show_hidden_edges?: boolean
5192
+ section?: DrawingSectionPlane
5193
+ }
5194
+
5195
+ interface DrawingSectionPlane {
5196
+ axis: "x" | "y" | "z"
5197
+ offset: number
5198
+ keep_side: "less" | "greater"
5199
+ hatch_spacing?: number
5200
+ }
5201
+ ```
5202
+
4997
5203
  <!-- circuit-json-docs:end -->