easyeda 0.0.383 → 0.0.384

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.
@@ -21,16 +21,27 @@ __export(dist_exports, {
21
21
  cad_component: () => cad_component,
22
22
  cad_model_axis_directions: () => cad_model_axis_directions,
23
23
  cad_model_formats: () => cad_model_formats,
24
+ cad_reference_surface: () => cad_reference_surface,
24
25
  capacitance: () => capacitance,
25
26
  circle_shape: () => circle_shape,
26
27
  circuit_json_footprint_load_error: () => circuit_json_footprint_load_error,
27
28
  current: () => current,
28
29
  distance: () => distance,
30
+ drawingPageSizes: () => drawingPageSizes,
31
+ drawing_dimension_line: () => drawing_dimension_line,
32
+ drawing_page: () => drawing_page,
33
+ drawing_page_size: () => drawing_page_size,
34
+ drawing_page_title_block: () => drawing_page_title_block,
35
+ drawing_part_view: () => drawing_part_view,
36
+ drawing_part_view_direction: () => drawing_part_view_direction,
37
+ drawing_section_plane: () => drawing_section_plane,
29
38
  duration_ms: () => duration_ms,
30
39
  experiment_type: () => experiment_type,
31
40
  external_footprint_load_error: () => external_footprint_load_error,
32
41
  frequency: () => frequency,
42
+ getDrawingPageDimensions: () => getDrawingPageDimensions,
33
43
  getRotationBetweenPcbPin1Locations: () => getRotationBetweenPcbPin1Locations,
44
+ getSimulationReturnCurrentGridJsonSchema: () => getSimulationReturnCurrentGridJsonSchema,
34
45
  getZodPrefixedIdWithDefault: () => getZodPrefixedIdWithDefault,
35
46
  inductance: () => inductance,
36
47
  insertionDirectionToCanonical: () => insertionDirectionToCanonical,
@@ -147,6 +158,12 @@ __export(dist_exports, {
147
158
  pcb_smtpad_pill: () => pcb_smtpad_pill,
148
159
  pcb_solder_paste: () => pcb_solder_paste,
149
160
  pcb_soldermask_opening: () => pcb_soldermask_opening,
161
+ pcb_spice_channel: () => pcb_spice_channel,
162
+ pcb_stackup: () => pcb_stackup,
163
+ pcb_stackup_copper_layer: () => pcb_stackup_copper_layer,
164
+ pcb_stackup_dielectric_layer: () => pcb_stackup_dielectric_layer,
165
+ pcb_stackup_layer: () => pcb_stackup_layer,
166
+ pcb_stackup_soldermask_layer: () => pcb_stackup_soldermask_layer,
150
167
  pcb_stiffener: () => pcb_stiffener,
151
168
  pcb_stiffener_polygon: () => pcb_stiffener_polygon,
152
169
  pcb_stiffener_rect: () => pcb_stiffener_rect,
@@ -160,6 +177,7 @@ __export(dist_exports, {
160
177
  pcb_trace_route_point_through_pad: () => pcb_trace_route_point_through_pad,
161
178
  pcb_trace_route_point_via: () => pcb_trace_route_point_via,
162
179
  pcb_trace_route_point_wire: () => pcb_trace_route_point_wire,
180
+ pcb_trace_style_warning: () => pcb_trace_style_warning,
163
181
  pcb_trace_too_long_error: () => pcb_trace_too_long_error,
164
182
  pcb_trace_too_long_warning: () => pcb_trace_too_long_warning,
165
183
  pcb_trace_too_many_vias_warning: () => pcb_trace_too_many_vias_warning,
@@ -208,6 +226,7 @@ __export(dist_exports, {
208
226
  schematic_rect: () => schematic_rect,
209
227
  schematic_sheet: () => schematic_sheet,
210
228
  schematic_sheet_size: () => schematic_sheet_size,
229
+ schematic_sheet_styling_warning: () => schematic_sheet_styling_warning,
211
230
  schematic_symbol: () => schematic_symbol,
212
231
  schematic_table: () => schematic_table,
213
232
  schematic_table_cell: () => schematic_table_cell,
@@ -229,15 +248,29 @@ __export(dist_exports, {
229
248
  simulation_dc_sweep_unit: () => simulation_dc_sweep_unit,
230
249
  simulation_dc_sweep_voltage_graph: () => simulation_dc_sweep_voltage_graph,
231
250
  simulation_dc_voltage_source: () => simulation_dc_voltage_source,
251
+ simulation_digital_stimulus: () => simulation_digital_stimulus,
232
252
  simulation_experiment: () => simulation_experiment,
253
+ simulation_eye_diagram: () => simulation_eye_diagram,
254
+ simulation_ibis_model: () => simulation_ibis_model,
255
+ simulation_ibis_pin_state: () => simulation_ibis_pin_state,
233
256
  simulation_op_amp: () => simulation_op_amp,
234
257
  simulation_oscilloscope_trace: () => simulation_oscilloscope_trace,
235
258
  simulation_parameter_sweep: () => simulation_parameter_sweep,
236
259
  simulation_parameter_sweep_coordinate: () => simulation_parameter_sweep_coordinate,
237
260
  simulation_parameter_type: () => simulation_parameter_type,
238
261
  simulation_parameter_unit: () => simulation_parameter_unit,
262
+ simulation_pcb_return_current_field: () => simulation_pcb_return_current_field,
263
+ simulation_pcb_return_current_heatmap: () => simulation_pcb_return_current_heatmap,
264
+ simulation_pcb_return_current_marker: () => simulation_pcb_return_current_marker,
265
+ simulation_pcb_return_current_result: () => simulation_pcb_return_current_result,
266
+ simulation_return_current_contact: () => simulation_return_current_contact,
267
+ simulation_return_current_excitation: () => simulation_return_current_excitation,
268
+ simulation_return_current_field_asset: () => simulation_return_current_field_asset,
269
+ simulation_return_current_grid_json: () => simulation_return_current_grid_json,
270
+ simulation_return_current_image_asset: () => simulation_return_current_image_asset,
239
271
  simulation_spice_subcircuit: () => simulation_spice_subcircuit,
240
272
  simulation_switch: () => simulation_switch,
273
+ simulation_terminal_port: () => simulation_terminal_port,
241
274
  simulation_transient_current_graph: () => simulation_transient_current_graph,
242
275
  simulation_transient_voltage_graph: () => simulation_transient_voltage_graph,
243
276
  simulation_unknown_experiment_error: () => simulation_unknown_experiment_error,
@@ -247,11 +280,13 @@ __export(dist_exports, {
247
280
  source_ambiguous_port_reference: () => source_ambiguous_port_reference,
248
281
  source_board: () => source_board,
249
282
  source_bus: () => source_bus,
283
+ source_component_availability_warning: () => source_component_availability_warning,
250
284
  source_component_base: () => source_component_base,
251
285
  source_component_internal_connection: () => source_component_internal_connection,
252
286
  source_component_misconfigured_error: () => source_component_misconfigured_error,
253
287
  source_component_pins_underspecified_warning: () => source_component_pins_underspecified_warning,
254
288
  source_confusing_net_name_warning: () => source_confusing_net_name_warning,
289
+ source_datasheet: () => source_datasheet,
255
290
  source_failed_to_create_component_error: () => source_failed_to_create_component_error,
256
291
  source_group: () => source_group,
257
292
  source_i2c_misconfigured_error: () => source_i2c_misconfigured_error,
@@ -4644,7 +4679,20 @@ var length = external_exports.string().or(external_exports.number()).transform((
4644
4679
  var frequency = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "Hz").value);
4645
4680
  var distance = length;
4646
4681
  var current = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v, "A").value);
4647
- var duration_ms = external_exports.string().or(external_exports.number()).transform((v) => parseAndConvertSiUnit(v).value);
4682
+ var duration_ms = external_exports.string().or(external_exports.number()).transform((v, context) => {
4683
+ try {
4684
+ const { value, unitOfValue } = parseAndConvertSiUnit(v);
4685
+ if ((unitOfValue === null || unitOfValue === "ms") && Number.isFinite(value)) {
4686
+ return value;
4687
+ }
4688
+ } catch {
4689
+ }
4690
+ context.addIssue({
4691
+ code: external_exports.ZodIssueCode.custom,
4692
+ message: "Expected a finite number of milliseconds or a time unit"
4693
+ });
4694
+ return external_exports.NEVER;
4695
+ });
4648
4696
  var time = duration_ms;
4649
4697
  var ms = duration_ms;
4650
4698
  var timestamp = external_exports.string().datetime();
@@ -4982,7 +5030,9 @@ var source_simple_chip = source_component_base.extend({
4982
5030
  });
4983
5031
  expectTypesMatch(true);
4984
5032
  var source_printed_part = source_component_base.extend({
4985
- ftype: external_exports.literal("printedpart")
5033
+ ftype: external_exports.literal("printedpart"),
5034
+ material: external_exports.enum(["pla", "petg", "nylon"]).optional(),
5035
+ color: external_exports.string().trim().min(1).optional()
4986
5036
  });
4987
5037
  expectTypesMatch(true);
4988
5038
  var source_subassembly = source_component_base.extend({
@@ -5295,6 +5345,21 @@ var source_refdes_convention_warning = external_exports.object({
5295
5345
  "Warning emitted when a source component reference designator does not match the component type convention"
5296
5346
  );
5297
5347
  expectTypesMatch(true);
5348
+ var source_component_availability_warning = external_exports.object({
5349
+ type: external_exports.literal("source_component_availability_warning"),
5350
+ source_component_availability_warning_id: getZodPrefixedIdWithDefault(
5351
+ "source_component_availability_warning"
5352
+ ),
5353
+ warning_type: external_exports.literal("source_component_availability_warning").default("source_component_availability_warning"),
5354
+ message: external_exports.string(),
5355
+ source_component_id: external_exports.string(),
5356
+ subcircuit_id: external_exports.string().optional(),
5357
+ supplier_name,
5358
+ supplier_part_numbers: external_exports.array(external_exports.string()).nonempty()
5359
+ }).describe(
5360
+ "Warning emitted when no supplier alternative can be confirmed in stock. Availability may be unknown or change over time."
5361
+ );
5362
+ expectTypesMatch(true);
5298
5363
  var source_simple_voltage_probe = source_component_base.extend({
5299
5364
  ftype: external_exports.literal("simple_voltage_probe")
5300
5365
  });
@@ -5345,7 +5410,16 @@ var source_simple_voltage_source = source_component_base.extend({
5345
5410
  expectTypesMatch(
5346
5411
  true
5347
5412
  );
5413
+ var source_datasheet = external_exports.object({
5414
+ type: external_exports.literal("source_datasheet"),
5415
+ source_datasheet_id: external_exports.string(),
5416
+ manufacturer_part_number: external_exports.string(),
5417
+ datasheet_pdf_urls: external_exports.array(external_exports.string().url()),
5418
+ description: external_exports.string().optional()
5419
+ });
5420
+ expectTypesMatch(true);
5348
5421
  var any_source_component = external_exports.union([
5422
+ source_datasheet,
5349
5423
  source_simple_resistor,
5350
5424
  source_simple_capacitor,
5351
5425
  source_simple_diode,
@@ -5386,6 +5460,7 @@ var any_source_component = external_exports.union([
5386
5460
  source_pin_missing_trace_warning,
5387
5461
  source_missing_manufacturer_part_number_warning,
5388
5462
  source_refdes_convention_warning,
5463
+ source_component_availability_warning,
5389
5464
  source_i2c_misconfigured_error,
5390
5465
  source_component_misconfigured_error
5391
5466
  ]);
@@ -6058,6 +6133,20 @@ var schematic_component_styling_warning = external_exports.object({
6058
6133
  "Warning emitted when a schematic component has a visual styling issue"
6059
6134
  );
6060
6135
  expectTypesMatch(true);
6136
+ var schematic_sheet_styling_warning = external_exports.object({
6137
+ type: external_exports.literal("schematic_sheet_styling_warning"),
6138
+ schematic_sheet_styling_warning_id: getZodPrefixedIdWithDefault(
6139
+ "schematic_sheet_styling_warning"
6140
+ ),
6141
+ warning_type: external_exports.literal("schematic_sheet_styling_warning").default("schematic_sheet_styling_warning"),
6142
+ message: external_exports.string(),
6143
+ schematic_sheet_id: external_exports.string(),
6144
+ styling_issue_type: external_exports.literal("non_default_sheet_size"),
6145
+ subcircuit_id: external_exports.string().optional()
6146
+ }).describe(
6147
+ "Style warning emitted when a schematic sheet uses a non-default size"
6148
+ );
6149
+ expectTypesMatch(true);
6061
6150
  var schematic_element_outside_sheet_warning = external_exports.object({
6062
6151
  type: external_exports.literal("schematic_element_outside_sheet_warning"),
6063
6152
  schematic_element_outside_sheet_warning_id: getZodPrefixedIdWithDefault(
@@ -6310,6 +6399,7 @@ var pcb_component = external_exports.object({
6310
6399
  pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
6311
6400
  source_component_id: external_exports.string(),
6312
6401
  center: point,
6402
+ footprint_origin: point.optional(),
6313
6403
  layer: layer_ref,
6314
6404
  rotation,
6315
6405
  display_offset_x: external_exports.string().optional().describe(
@@ -7054,6 +7144,33 @@ var pcb_trace_warning = external_exports.object({
7054
7144
  subcircuit_id: external_exports.string().optional()
7055
7145
  }).describe("Defines a trace warning on the PCB");
7056
7146
  expectTypesMatch(true);
7147
+ var pcb_trace_style_warning = external_exports.object({
7148
+ type: external_exports.literal("pcb_trace_style_warning"),
7149
+ pcb_trace_style_warning_id: getZodPrefixedIdWithDefault(
7150
+ "pcb_trace_style_warning"
7151
+ ),
7152
+ warning_type: external_exports.literal("pcb_trace_style_warning").default("pcb_trace_style_warning"),
7153
+ message: external_exports.string(),
7154
+ styling_issue_type: external_exports.literal("long_segment_at_odd_angle"),
7155
+ pcb_trace_id: external_exports.string(),
7156
+ source_trace_id: external_exports.string().optional(),
7157
+ subcircuit_id: external_exports.string().optional(),
7158
+ layer: layer_ref,
7159
+ start_route_index: external_exports.number().int().nonnegative(),
7160
+ end_route_index: external_exports.number().int().nonnegative(),
7161
+ segment_start: point,
7162
+ segment_end: point,
7163
+ center: point,
7164
+ segment_length: distance,
7165
+ minimum_segment_length: distance,
7166
+ angle_degrees: external_exports.number().min(0).lt(360),
7167
+ nearest_allowed_angle_degrees: external_exports.number().min(0).lt(360).multipleOf(45),
7168
+ angle_deviation_degrees: external_exports.number().min(0).max(22.5),
7169
+ angle_tolerance_degrees: external_exports.number().min(0).lt(22.5)
7170
+ }).describe(
7171
+ "Warning for a long PCB trace segment whose direction deviates from a multiple of 45 degrees"
7172
+ );
7173
+ expectTypesMatch(true);
7057
7174
  var pcb_trace_too_long_error = external_exports.object({
7058
7175
  type: external_exports.literal("pcb_trace_too_long_error"),
7059
7176
  pcb_trace_too_long_error_id: getZodPrefixedIdWithDefault(
@@ -7343,6 +7460,53 @@ var pcb_board = external_exports.object({
7343
7460
  position_mode: external_exports.enum(["relative_to_panel_anchor", "none"]).optional()
7344
7461
  }).merge(manufacturing_drc_properties).describe("Defines the board outline of the PCB");
7345
7462
  expectTypesMatch(true);
7463
+ var positive_length = length.pipe(external_exports.number().finite().positive());
7464
+ var nonnegative_length = length.pipe(external_exports.number().finite().nonnegative());
7465
+ var positive_number = external_exports.number().finite().positive();
7466
+ var nonnegative_number = external_exports.number().finite().nonnegative();
7467
+ var pcb_stackup_soldermask_layer = external_exports.object({
7468
+ layer_type: external_exports.literal("soldermask").describe("Soldermask layer"),
7469
+ thickness: positive_length.optional().describe("Soldermask thickness in mm, omitted when unknown"),
7470
+ relative_permittivity: positive_number.optional().describe("Soldermask relative permittivity")
7471
+ });
7472
+ expectTypesMatch(true);
7473
+ var pcb_stackup_copper_layer = external_exports.object({
7474
+ layer_type: external_exports.literal("copper").describe("Copper layer"),
7475
+ layer: layer_ref.describe("PCB copper layer, such as top, inner1 or bottom"),
7476
+ thickness: positive_length.describe("Copper thickness in mm"),
7477
+ electrical_conductivity_s_per_m: positive_number.optional().describe(
7478
+ "Electrical conductivity in S/m, consumers may assume 5.8e7 (annealed copper) when omitted"
7479
+ ),
7480
+ rms_surface_roughness: nonnegative_length.optional().describe("RMS copper surface roughness in mm")
7481
+ });
7482
+ expectTypesMatch(true);
7483
+ var pcb_stackup_dielectric_layer = external_exports.object({
7484
+ layer_type: external_exports.literal("dielectric").describe("Dielectric layer"),
7485
+ dielectric_type: external_exports.enum(["core", "prepreg"]).optional().describe("Core or prepreg construction"),
7486
+ material_name: external_exports.string().optional().describe("Fabricator material name, such as FR-4 or 7628"),
7487
+ thickness: positive_length.describe("Dielectric thickness in mm"),
7488
+ relative_permittivity: positive_number.optional().describe("Dielectric relative permittivity, Dk"),
7489
+ loss_tangent: nonnegative_number.optional().describe("Dielectric loss tangent, Df"),
7490
+ dielectric_properties_frequency_hz: positive_number.optional().describe(
7491
+ "Frequency in Hz at which relative_permittivity and loss_tangent were measured"
7492
+ )
7493
+ });
7494
+ expectTypesMatch(true);
7495
+ var pcb_stackup_layer = external_exports.discriminatedUnion("layer_type", [
7496
+ pcb_stackup_soldermask_layer,
7497
+ pcb_stackup_copper_layer,
7498
+ pcb_stackup_dielectric_layer
7499
+ ]);
7500
+ expectTypesMatch(true);
7501
+ var pcb_stackup = external_exports.object({
7502
+ type: external_exports.literal("pcb_stackup"),
7503
+ pcb_stackup_id: getZodPrefixedIdWithDefault("pcb_stackup"),
7504
+ pcb_board_id: external_exports.string().describe("Board described by this stackup"),
7505
+ subcircuit_id: external_exports.string().optional(),
7506
+ plated_hole_copper_thickness: positive_length.optional().describe("Copper thickness of plated hole and via barrel walls in mm"),
7507
+ layers: external_exports.array(pcb_stackup_layer).min(1).describe("Physical layers ordered from top to bottom")
7508
+ }).describe("Physical layer construction and material data for a PCB board");
7509
+ expectTypesMatch(true);
7346
7510
  var finite_point = point.extend({
7347
7511
  x: length.pipe(external_exports.number().finite()),
7348
7512
  y: length.pipe(external_exports.number().finite())
@@ -7366,7 +7530,7 @@ var pcb_bend = external_exports.object({
7366
7530
  "Defines a finite-radius bend on a flat PCB for runtime CAD folding"
7367
7531
  );
7368
7532
  expectTypesMatch(true);
7369
- var positive_length = length.pipe(external_exports.number().finite().positive());
7533
+ var positive_length2 = length.pipe(external_exports.number().finite().positive());
7370
7534
  var finite_point2 = point.extend({
7371
7535
  x: length.pipe(external_exports.number().finite()),
7372
7536
  y: length.pipe(external_exports.number().finite())
@@ -7380,15 +7544,15 @@ var pcb_stiffener_base = external_exports.object({
7380
7544
  name: external_exports.string().optional(),
7381
7545
  layer: external_exports.enum(["top", "bottom"]),
7382
7546
  material: external_exports.enum(["fr4", "polyimide", "stainless_steel", "aluminum"]),
7383
- thickness: positive_length,
7547
+ thickness: positive_length2,
7384
7548
  adhesive_thickness: length.pipe(external_exports.number().finite().nonnegative()).optional()
7385
7549
  });
7386
7550
  var pcb_stiffener_rect = pcb_stiffener_base.extend({
7387
7551
  shape: external_exports.literal("rect"),
7388
7552
  center: finite_point2,
7389
7553
  rotation: rotation.pipe(external_exports.number().finite()).optional(),
7390
- width: positive_length,
7391
- height: positive_length,
7554
+ width: positive_length2,
7555
+ height: positive_length2,
7392
7556
  outline: external_exports.never().optional()
7393
7557
  });
7394
7558
  expectTypesMatch(true);
@@ -7818,6 +7982,7 @@ expectTypesMatch(
7818
7982
  var pcb_keepout_outline = external_exports.object({
7819
7983
  type: external_exports.literal("pcb_keepout"),
7820
7984
  shape: external_exports.literal("outline"),
7985
+ pcb_component_id: external_exports.string().optional(),
7821
7986
  pcb_group_id: external_exports.string().optional(),
7822
7987
  subcircuit_id: external_exports.string().optional(),
7823
7988
  outline: external_exports.array(point).min(2),
@@ -7833,6 +7998,7 @@ var pcb_keepout_outline = external_exports.object({
7833
7998
  var pcb_keepout = external_exports.object({
7834
7999
  type: external_exports.literal("pcb_keepout"),
7835
8000
  shape: external_exports.literal("rect"),
8001
+ pcb_component_id: external_exports.string().optional(),
7836
8002
  pcb_group_id: external_exports.string().optional(),
7837
8003
  subcircuit_id: external_exports.string().optional(),
7838
8004
  center: point,
@@ -7851,6 +8017,7 @@ var pcb_keepout = external_exports.object({
7851
8017
  external_exports.object({
7852
8018
  type: external_exports.literal("pcb_keepout"),
7853
8019
  shape: external_exports.literal("circle"),
8020
+ pcb_component_id: external_exports.string().optional(),
7854
8021
  pcb_group_id: external_exports.string().optional(),
7855
8022
  subcircuit_id: external_exports.string().optional(),
7856
8023
  center: point,
@@ -8445,6 +8612,9 @@ var cad_component = external_exports.object({
8445
8612
  ]).optional(),
8446
8613
  model_object_fit: external_exports.enum(["contain_within_bounds", "fill_bounds"]).optional().default("contain_within_bounds"),
8447
8614
  model_jscad: external_exports.any().optional(),
8615
+ color: external_exports.string().trim().min(1).optional().describe(
8616
+ "Explicit color override for CAD geometry, including authored JSCAD material colors. Omit to preserve model materials."
8617
+ ),
8448
8618
  show_as_translucent_model: external_exports.boolean().optional(),
8449
8619
  show_as_bounding_box: external_exports.boolean().optional(),
8450
8620
  show_hidden_edges: external_exports.boolean().optional(),
@@ -8464,12 +8634,20 @@ var cad_collision_error = base_circuit_json_error.extend({
8464
8634
  "An aperture-bearing part intersects the finished enclosure. The intersection_area_mm2 is the union silhouette area of the solid intersection projected along the aperture face normal, in the right-handed Circuit JSON world frame (+X right, +Y top, +Z above). It is an area in square millimetres, not intersection volume or surface area. This indicates possible aperture misplacement, insufficient size/depth, or body clearance problems; it does not prove which cause applies."
8465
8635
  );
8466
8636
  expectTypesMatch(true);
8637
+ var connectorPin1Position = point3.refine(
8638
+ (point22) => [point22.x, point22.y, point22.z].every(Number.isFinite),
8639
+ "Connector pin 1 positions must be finite"
8640
+ ).describe(
8641
+ "Resolved pin 1 position at the connector mating face, in right-handed circuit world, millimeters: +X right, +Y top, +Z above. An absolute point, not a direction. Computed by the circuit producer from endpoint geometry. Together with the endpoint path tangent, fixes connector roll and identifies its pin 1 side; renderers must not infer it from footprints."
8642
+ );
8467
8643
  var cad_cable = external_exports.object({
8468
8644
  type: external_exports.literal("cad_cable"),
8469
8645
  cad_cable_id: external_exports.string(),
8470
8646
  name: external_exports.string().min(1),
8471
8647
  from_source_component_id: external_exports.string(),
8472
8648
  to_source_component_id: external_exports.string(),
8649
+ from_connector_pin1_position: connectorPin1Position.optional(),
8650
+ to_connector_pin1_position: connectorPin1Position.optional(),
8473
8651
  cableprinter_string: external_exports.string().min(1).describe(
8474
8652
  'Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'
8475
8653
  ),
@@ -8489,6 +8667,65 @@ var cad_cable = external_exports.object({
8489
8667
  "A physical assembly cable with a resolved 3D route. Several cables are independent cad_cable records, each with its own endpoints, definition and path. Does not imply electrical pin mapping."
8490
8668
  );
8491
8669
  expectTypesMatch(true);
8670
+ var FRAME_TOLERANCE = 1e-6;
8671
+ var unitDirection = external_exports.object({
8672
+ x: external_exports.number().finite(),
8673
+ y: external_exports.number().finite(),
8674
+ z: external_exports.number().finite()
8675
+ }).refine(
8676
+ (v) => Math.abs(Math.hypot(v.x, v.y, v.z) - 1) <= FRAME_TOLERANCE,
8677
+ "Reference surface directions must be unit vectors"
8678
+ );
8679
+ var extent = distance.pipe(external_exports.number().finite().positive());
8680
+ var cad_reference_surface = external_exports.object({
8681
+ type: external_exports.literal("cad_reference_surface"),
8682
+ cad_reference_surface_id: external_exports.string().min(1),
8683
+ source_component_id: external_exports.string().min(1).describe(
8684
+ "Owning assembly part's source component ID. The part may have no CAD geometry."
8685
+ ),
8686
+ name: external_exports.string().trim().min(1).describe(
8687
+ "Reference name, unique within the owning part, e.g. shade in STEM.shade."
8688
+ ),
8689
+ shape: external_exports.literal("rect"),
8690
+ center: point3.refine(
8691
+ (p) => [p.x, p.y, p.z].every(Number.isFinite),
8692
+ "Reference surface centers must be finite"
8693
+ ).describe(
8694
+ "Resolved surface center in right-handed circuit-world XYZ, millimeters: +X right, +Y top, +Z above. An absolute point after assembly placement."
8695
+ ),
8696
+ normal: unitDirection.describe(
8697
+ "Outward unit normal in circuit-world XYZ. Dimensionless direction; transform with the part's rotation, without translation."
8698
+ ),
8699
+ x_axis: unitDirection.describe(
8700
+ "In-plane unit X direction in circuit-world XYZ, perpendicular to normal. The second tangent is normal cross x_axis, giving a right-handed frame."
8701
+ ),
8702
+ width: extent.optional().describe(
8703
+ "Rectangular extent along x_axis in millimeters. Supply together with height. Omission leaves the surface's display size unspecified."
8704
+ ),
8705
+ height: extent.optional().describe(
8706
+ "Rectangular extent along normal cross x_axis in millimeters. Supply together with width."
8707
+ ),
8708
+ subcircuit_id: external_exports.string().optional()
8709
+ }).superRefine((surface, ctx) => {
8710
+ if (surface.width === void 0 !== (surface.height === void 0))
8711
+ ctx.addIssue({
8712
+ code: external_exports.ZodIssueCode.custom,
8713
+ path: ["width"],
8714
+ message: "Provide width and height together"
8715
+ });
8716
+ const { normal: n, x_axis: x } = surface;
8717
+ if (Math.abs(n.x * x.x + n.y * x.y + n.z * x.z) > FRAME_TOLERANCE)
8718
+ ctx.addIssue({
8719
+ code: external_exports.ZodIssueCode.custom,
8720
+ path: ["x_axis"],
8721
+ message: "x_axis must be perpendicular to normal"
8722
+ });
8723
+ }).describe(
8724
+ "A named assembly mounting surface with a resolved world-space frame. Reference geometry for optional visualization; does not add solid material or electrical connectivity. The producer resolves part placement independently of CAD-model offsets; renderers consume the world frame without reapplying the owning model's transform."
8725
+ );
8726
+ expectTypesMatch(
8727
+ true
8728
+ );
8492
8729
  var wave_shape = external_exports.enum(["sinewave", "square", "triangle", "sawtooth"]);
8493
8730
  var percentage = external_exports.union([external_exports.string(), external_exports.number()]).transform((val) => {
8494
8731
  if (typeof val === "string") {
@@ -8601,7 +8838,8 @@ var experiment_type = external_exports.union([
8601
8838
  external_exports.literal("spice_dc_sweep"),
8602
8839
  external_exports.literal("spice_dc_operating_point"),
8603
8840
  external_exports.literal("spice_transient_analysis"),
8604
- external_exports.literal("spice_ac_analysis")
8841
+ external_exports.literal("spice_ac_analysis"),
8842
+ external_exports.literal("pcb_return_current")
8605
8843
  ]);
8606
8844
  var spice_simulation_options = external_exports.object({
8607
8845
  method: external_exports.enum(["trap", "gear"]).optional(),
@@ -8609,6 +8847,59 @@ var spice_simulation_options = external_exports.object({
8609
8847
  abstol: external_exports.union([external_exports.number(), external_exports.string()]).optional(),
8610
8848
  vntol: external_exports.union([external_exports.number(), external_exports.string()]).optional()
8611
8849
  }).describe("SPICE solver options for a simulation experiment");
8850
+ var pcb_spice_channel = external_exports.object({
8851
+ reduction: external_exports.union([
8852
+ external_exports.literal("routed-copper"),
8853
+ external_exports.literal("straightened-stages")
8854
+ ]),
8855
+ sections: external_exports.number().int().min(1).max(128),
8856
+ lanes: external_exports.array(
8857
+ external_exports.object({
8858
+ name: external_exports.string().min(1),
8859
+ driver_source_port_id: external_exports.string().min(1),
8860
+ receiver_source_port_id: external_exports.string().min(1)
8861
+ })
8862
+ ).min(1).max(3),
8863
+ reference_source_port_id: external_exports.string().min(1),
8864
+ passive_source_component_ids: external_exports.array(external_exports.string().min(1)).optional(),
8865
+ extraction: external_exports.object({
8866
+ minimum_frequency_hz: external_exports.number().finite().positive(),
8867
+ maximum_frequency_hz: external_exports.number().finite().positive(),
8868
+ model_frequency_hz: external_exports.number().finite().positive(),
8869
+ filaments: external_exports.number().int().positive(),
8870
+ refinement_filaments: external_exports.number().int().positive(),
8871
+ convergence_tolerance: external_exports.number().finite().positive(),
8872
+ capacitance_tolerance: external_exports.number().finite().positive(),
8873
+ reciprocity_tolerance: external_exports.number().finite().positive(),
8874
+ dc_resistance_tolerance: external_exports.number().finite().positive(),
8875
+ max_panel_length_mm: external_exports.number().finite().positive(),
8876
+ ground_mesh_size_mm: external_exports.number().finite().positive().optional()
8877
+ }).refine(
8878
+ (extraction) => extraction.refinement_filaments > extraction.filaments,
8879
+ {
8880
+ path: ["refinement_filaments"],
8881
+ message: "refinement_filaments must be greater than filaments"
8882
+ }
8883
+ ),
8884
+ relative_permittivity: external_exports.number().finite().positive().optional(),
8885
+ via_plating_thickness_mm: external_exports.number().finite().positive().optional(),
8886
+ via_equivalent_width_mm: external_exports.number().finite().positive().optional(),
8887
+ omit_through_via_stubs: external_exports.boolean().optional(),
8888
+ straightened_stage_profiles: external_exports.record(
8889
+ external_exports.object({
8890
+ spacing_mm: external_exports.number().finite().positive(),
8891
+ relative_permittivity: external_exports.number().finite().positive(),
8892
+ return: external_exports.object({
8893
+ width_mm: external_exports.number().finite().positive(),
8894
+ thickness_mm: external_exports.number().finite().positive(),
8895
+ length_factor: external_exports.number().finite().positive(),
8896
+ center_y_mm: external_exports.number().finite(),
8897
+ center_z_mm: external_exports.number().finite()
8898
+ })
8899
+ })
8900
+ ).optional()
8901
+ });
8902
+ expectTypesMatch(true);
8612
8903
  var simulation_experiment = external_exports.object({
8613
8904
  type: external_exports.literal("simulation_experiment"),
8614
8905
  simulation_experiment_id: getZodPrefixedIdWithDefault(
@@ -8616,10 +8907,13 @@ var simulation_experiment = external_exports.object({
8616
8907
  ),
8617
8908
  name: external_exports.string(),
8618
8909
  experiment_type,
8910
+ subcircuit_id: external_exports.string().optional(),
8911
+ spice_engine: external_exports.string().optional(),
8619
8912
  time_per_step: duration_ms.optional(),
8620
8913
  start_time_ms: ms.optional(),
8621
8914
  end_time_ms: ms.optional(),
8622
8915
  spice_options: spice_simulation_options.optional(),
8916
+ pcb_spice_channel: pcb_spice_channel.optional(),
8623
8917
  dc_sweep_voltage_source_id: external_exports.string().optional(),
8624
8918
  dc_sweep_current_source_id: external_exports.string().optional(),
8625
8919
  dc_sweep_start: external_exports.number().optional(),
@@ -8710,6 +9004,7 @@ var simulation_transient_voltage_graph = external_exports.object({
8710
9004
  "simulation_transient_voltage_graph"
8711
9005
  ),
8712
9006
  simulation_experiment_id: external_exports.string(),
9007
+ simulation_voltage_probe_id: external_exports.string().optional(),
8713
9008
  simulation_parameter_sweep_coordinate: simulation_parameter_sweep_coordinate.optional(),
8714
9009
  timestamps_ms: external_exports.array(external_exports.number()).optional(),
8715
9010
  voltage_levels: external_exports.array(external_exports.number()),
@@ -9084,8 +9379,551 @@ var simulation_oscilloscope_trace = external_exports.object({
9084
9379
  }
9085
9380
  });
9086
9381
  expectTypesMatch(true);
9382
+ var ibisAssetPath = external_exports.string().min(1).regex(/^(?!\s|[a-z][a-z\d+.-]*:|[/\\])[^\\\u0000-\u001f\u007f]+$/i);
9383
+ var simulation_ibis_model = external_exports.object({
9384
+ type: external_exports.literal("simulation_ibis_model"),
9385
+ simulation_ibis_model_id: getZodPrefixedIdWithDefault(
9386
+ "simulation_ibis_model"
9387
+ ),
9388
+ source_component_id: external_exports.string().min(1),
9389
+ // Consumers must still apply their own fetch policy to prevent SSRF.
9390
+ ibis_model_asset: asset.extend({
9391
+ project_relative_path: ibisAssetPath,
9392
+ url: external_exports.string().url().regex(/^https?:\/\//i).or(ibisAssetPath)
9393
+ }).describe(
9394
+ "Reference to the .ibs file containing the vendor's IBIS models"
9395
+ ),
9396
+ ibis_component_name: external_exports.string().min(1).describe("Name of the [Component] section in the IBIS file"),
9397
+ ibis_pin_name_to_source_port_id: external_exports.record(external_exports.string().min(1), external_exports.string().min(1)).refine(
9398
+ (pins) => Object.keys(pins).length > 0,
9399
+ "At least one physical IBIS pin is required"
9400
+ ).describe(
9401
+ "Maps pin names from the IBIS [Pin] table, such as A1 or 12, to physical source_port_id values"
9402
+ ),
9403
+ ibis_pin_name_to_model_name: external_exports.record(external_exports.string().min(1), external_exports.string().min(1)).optional().describe(
9404
+ "Maps an IBIS pin name to the selected [Model] name when its [Model Selector] has multiple buffers"
9405
+ ),
9406
+ ibis_pin_name_to_reference_source_port_ids: external_exports.record(
9407
+ external_exports.string().min(1),
9408
+ external_exports.object({
9409
+ pullup_reference_source_port_id: external_exports.string().min(1).optional(),
9410
+ pulldown_reference_source_port_id: external_exports.string().min(1).optional(),
9411
+ power_clamp_reference_source_port_id: external_exports.string().min(1).optional(),
9412
+ ground_clamp_reference_source_port_id: external_exports.string().min(1).optional(),
9413
+ external_reference_source_port_id: external_exports.string().min(1).optional()
9414
+ }).strict()
9415
+ ).optional().describe(
9416
+ "Maps each IBIS signal pin name to the physical source ports used as its buffer supply/clamp references"
9417
+ ),
9418
+ model_value_corner: external_exports.union([external_exports.literal("typical"), external_exports.literal("minimum"), external_exports.literal("maximum")]).describe(
9419
+ "Selects the typ, min, or max column of numerical data in the IBIS model"
9420
+ ),
9421
+ include_package_parasitics: external_exports.boolean().describe(
9422
+ "Whether the runner includes the IBIS vendor's package resistance, inductance, and capacitance"
9423
+ )
9424
+ }).superRefine((model, context) => {
9425
+ const boundPins = new Set(
9426
+ Object.keys(model.ibis_pin_name_to_source_port_id)
9427
+ );
9428
+ for (const field of [
9429
+ "ibis_pin_name_to_model_name",
9430
+ "ibis_pin_name_to_reference_source_port_ids"
9431
+ ]) {
9432
+ for (const pin of Object.keys(model[field] ?? {})) {
9433
+ if (!boundPins.has(pin)) {
9434
+ context.addIssue({
9435
+ code: external_exports.ZodIssueCode.custom,
9436
+ path: [field, pin],
9437
+ message: `IBIS pin "${pin}" must be bound in ibis_pin_name_to_source_port_id`
9438
+ });
9439
+ }
9440
+ }
9441
+ }
9442
+ }).describe(
9443
+ "Attaches an IBIS component and its physical pin bindings to a source component"
9444
+ );
9445
+ var simulation_ibis_pin_state = external_exports.object({
9446
+ type: external_exports.literal("simulation_ibis_pin_state"),
9447
+ simulation_ibis_pin_state_id: getZodPrefixedIdWithDefault(
9448
+ "simulation_ibis_pin_state"
9449
+ ),
9450
+ simulation_experiment_id: external_exports.string().min(1),
9451
+ source_port_id: external_exports.string().min(1),
9452
+ is_output: external_exports.boolean().describe(
9453
+ "True selects output mode; false selects input mode for this experiment"
9454
+ ),
9455
+ is_output_enabled: external_exports.boolean().optional()
9456
+ }).superRefine((pin, context) => {
9457
+ if (pin.is_output && pin.is_output_enabled === void 0 || !pin.is_output && pin.is_output_enabled !== void 0) {
9458
+ context.addIssue({
9459
+ code: external_exports.ZodIssueCode.custom,
9460
+ path: ["is_output_enabled"],
9461
+ message: "Only output pins require an explicit is_output_enabled boolean"
9462
+ });
9463
+ }
9464
+ }).describe(
9465
+ "Declares an IBIS pin's direction and output-enable state for one experiment"
9466
+ );
9467
+ var MAX_PATTERN_BITS = 65536;
9468
+ var simulation_digital_stimulus = external_exports.object({
9469
+ type: external_exports.literal("simulation_digital_stimulus"),
9470
+ simulation_digital_stimulus_id: getZodPrefixedIdWithDefault(
9471
+ "simulation_digital_stimulus"
9472
+ ),
9473
+ name: external_exports.string().min(1),
9474
+ simulation_experiment_id: external_exports.string().min(1),
9475
+ source_port_id: external_exports.string().min(1),
9476
+ bit_duration_ms: ms.refine((milliseconds) => milliseconds > 0),
9477
+ start_time_ms: ms.refine((milliseconds) => milliseconds >= 0),
9478
+ initial_state: external_exports.union([external_exports.literal(0), external_exports.literal(1)]),
9479
+ inverted: external_exports.boolean(),
9480
+ transmission_pattern: external_exports.object({
9481
+ transmission_type: external_exports.literal("bits"),
9482
+ bits: external_exports.string().max(MAX_PATTERN_BITS).regex(/^[01]+$/).or(
9483
+ external_exports.array(external_exports.union([external_exports.literal(0), external_exports.literal(1)])).min(1).max(MAX_PATTERN_BITS)
9484
+ ),
9485
+ repeat: external_exports.boolean()
9486
+ }).strict()
9487
+ }).describe(
9488
+ "Declares a digital transmission pattern and bit duration in milliseconds for a physical source port"
9489
+ );
9490
+ var simulation_eye_diagram = external_exports.object({
9491
+ type: external_exports.literal("simulation_eye_diagram"),
9492
+ simulation_eye_diagram_id: getZodPrefixedIdWithDefault(
9493
+ "simulation_eye_diagram"
9494
+ ),
9495
+ name: external_exports.string().min(1),
9496
+ simulation_experiment_id: external_exports.string().min(1),
9497
+ simulation_voltage_probe_id: external_exports.string().min(1),
9498
+ unit_interval_ms: ms.refine((milliseconds) => milliseconds > 0),
9499
+ time_origin_ms: ms,
9500
+ start_time_ms: ms.refine((milliseconds) => milliseconds >= 0).optional(),
9501
+ end_time_ms: ms.refine((milliseconds) => milliseconds > 0).optional()
9502
+ }).superRefine((eye, context) => {
9503
+ if (eye.start_time_ms !== void 0 && eye.end_time_ms !== void 0 && eye.start_time_ms >= eye.end_time_ms) {
9504
+ context.addIssue({
9505
+ code: external_exports.ZodIssueCode.custom,
9506
+ path: ["end_time_ms"],
9507
+ message: "Eye gate end must follow its start"
9508
+ });
9509
+ }
9510
+ }).describe(
9511
+ "Declares probe-bound eye folding, fixed origin and optional measurement gate in milliseconds"
9512
+ );
9513
+ var contact_position = external_exports.object({
9514
+ x: external_exports.number().finite(),
9515
+ y: external_exports.number().finite(),
9516
+ layer: layer_ref
9517
+ });
9518
+ var simulation_return_current_contact = external_exports.discriminatedUnion("contact_type", [
9519
+ contact_position.extend({
9520
+ contact_type: external_exports.literal("pcb_port"),
9521
+ pcb_port_id: external_exports.string().min(1)
9522
+ }),
9523
+ contact_position.extend({
9524
+ contact_type: external_exports.literal("pcb_via"),
9525
+ pcb_via_id: external_exports.string().min(1)
9526
+ }),
9527
+ contact_position.extend({
9528
+ contact_type: external_exports.literal("pcb_copper_pour"),
9529
+ pcb_copper_pour_id: external_exports.string().min(1)
9530
+ })
9531
+ ]).describe("Identifies the reference conductor at a return-current contact");
9532
+ expectTypesMatch(true);
9533
+ var simulation_terminal_port = external_exports.object({
9534
+ signal_pcb_port_id: external_exports.string().min(1),
9535
+ reference_pcb_port_id: external_exports.string().min(1).optional(),
9536
+ reference_layer: layer_ref,
9537
+ resistance: external_exports.number().finite().positive()
9538
+ }).describe(
9539
+ "A two-terminal return-current excitation port with resistance in ohms"
9540
+ );
9541
+ expectTypesMatch(true);
9542
+ var simulation_return_current_excitation = external_exports.object({
9543
+ type: external_exports.literal("simulation_return_current_excitation"),
9544
+ simulation_return_current_excitation_id: getZodPrefixedIdWithDefault(
9545
+ "simulation_return_current_excitation"
9546
+ ),
9547
+ simulation_experiment_id: external_exports.string().min(1),
9548
+ pcb_trace_id: external_exports.string().min(1),
9549
+ ground_source_net_id: external_exports.string().min(1),
9550
+ current: external_exports.number().finite(),
9551
+ return_source: simulation_return_current_contact,
9552
+ return_sink: simulation_return_current_contact,
9553
+ source_port: simulation_terminal_port.optional(),
9554
+ load_port: simulation_terminal_port.optional()
9555
+ }).describe(
9556
+ "Excites a signal trace with signed current in amperes, peak for AC; return_source is near the load and return_sink near the driver for positive current"
9557
+ );
9558
+ expectTypesMatch(true);
9559
+ var simulation_pcb_return_current_result = external_exports.object({
9560
+ type: external_exports.literal("simulation_pcb_return_current_result"),
9561
+ simulation_pcb_return_current_result_id: getZodPrefixedIdWithDefault(
9562
+ "simulation_pcb_return_current_result"
9563
+ ),
9564
+ simulation_experiment_id: external_exports.string().min(1),
9565
+ pcb_board_id: external_exports.string().min(1),
9566
+ simulation_return_current_excitation_ids: external_exports.array(external_exports.string().min(1)).min(1).refine(
9567
+ (ids) => new Set(ids).size === ids.length,
9568
+ "Excitation IDs must be unique"
9569
+ ),
9570
+ frequency_hz: external_exports.number().finite().positive().optional()
9571
+ }).describe(
9572
+ "A PCB return-current result at one frequency, or a frequency-independent result when frequency_hz is absent"
9573
+ );
9574
+ expectTypesMatch(true);
9575
+ function createSimulationReturnCurrentAssetSchema(mimetypes) {
9576
+ return asset.extend({
9577
+ project_relative_path: external_exports.string().min(1),
9578
+ url: external_exports.string().url()
9579
+ }).superRefine((value, context) => {
9580
+ if (!mimetypes.includes(value.mimetype)) {
9581
+ context.addIssue({
9582
+ code: external_exports.ZodIssueCode.custom,
9583
+ path: ["mimetype"],
9584
+ message: `Expected one of: ${mimetypes.join(", ")}`
9585
+ });
9586
+ }
9587
+ if (value.url.startsWith("data:")) {
9588
+ const mediaType = /^data:([^;,]*)(?:;[^,]*)?,/i.exec(value.url)?.[1];
9589
+ if (mediaType?.toLowerCase() !== value.mimetype) {
9590
+ context.addIssue({
9591
+ code: external_exports.ZodIssueCode.custom,
9592
+ path: ["url"],
9593
+ message: "Data URL media type must match asset.mimetype"
9594
+ });
9595
+ }
9596
+ }
9597
+ });
9598
+ }
9599
+ var simulation_return_current_field_asset = createSimulationReturnCurrentAssetSchema([
9600
+ "application/json",
9601
+ "application/gzip"
9602
+ ]);
9603
+ var simulation_return_current_image_asset = createSimulationReturnCurrentAssetSchema(["image/png", "image/webp"]);
9604
+ var simulation_pcb_return_current_field = external_exports.object({
9605
+ type: external_exports.literal("simulation_pcb_return_current_field"),
9606
+ simulation_pcb_return_current_field_id: getZodPrefixedIdWithDefault(
9607
+ "simulation_pcb_return_current_field"
9608
+ ),
9609
+ simulation_pcb_return_current_result_id: external_exports.string().min(1),
9610
+ layer: layer_ref,
9611
+ source_net_id: external_exports.string().min(1),
9612
+ field_type: external_exports.enum(["real", "complex_phasor"]),
9613
+ min_x: external_exports.number().finite(),
9614
+ min_y: external_exports.number().finite(),
9615
+ columns: external_exports.number().int().positive().safe(),
9616
+ rows: external_exports.number().int().positive().safe(),
9617
+ cell_width: external_exports.number().finite().positive(),
9618
+ cell_height: external_exports.number().finite().positive(),
9619
+ copper_thickness: external_exports.number().finite().positive(),
9620
+ data_format: external_exports.literal("simulation_return_current_grid_json_v1"),
9621
+ field_asset: simulation_return_current_field_asset
9622
+ }).superRefine((field, context) => {
9623
+ if (!Number.isSafeInteger(field.columns * field.rows)) {
9624
+ context.addIssue({
9625
+ code: external_exports.ZodIssueCode.custom,
9626
+ path: ["columns"],
9627
+ message: "The grid cell count must be a safe integer"
9628
+ });
9629
+ }
9630
+ }).describe(
9631
+ "A sampled sheet-current field in A/mm, using plain or gzipped JSON Asset URLs; dimensions are PCB millimeters"
9632
+ );
9633
+ expectTypesMatch(true);
9634
+ var channel = external_exports.array(external_exports.number().finite().nullable()).min(1);
9635
+ var simulation_return_current_grid_json = external_exports.discriminatedUnion("field_type", [
9636
+ external_exports.object({
9637
+ field_type: external_exports.literal("real"),
9638
+ sheet_current_x: channel,
9639
+ sheet_current_y: channel
9640
+ }),
9641
+ external_exports.object({
9642
+ field_type: external_exports.literal("complex_phasor"),
9643
+ sheet_current_x_real: channel,
9644
+ sheet_current_x_imag: channel,
9645
+ sheet_current_y_real: channel,
9646
+ sheet_current_y_imag: channel
9647
+ })
9648
+ ]).superRefine((grid2, context) => {
9649
+ const channels = grid2.field_type === "real" ? [grid2.sheet_current_x, grid2.sheet_current_y] : [
9650
+ grid2.sheet_current_x_real,
9651
+ grid2.sheet_current_x_imag,
9652
+ grid2.sheet_current_y_real,
9653
+ grid2.sheet_current_y_imag
9654
+ ];
9655
+ const first = channels[0];
9656
+ if (channels.some((values) => values.length !== first.length)) {
9657
+ context.addIssue({
9658
+ code: external_exports.ZodIssueCode.custom,
9659
+ message: "Current channels must have equal lengths"
9660
+ });
9661
+ return;
9662
+ }
9663
+ for (let index = 0; index < first.length; index++) {
9664
+ const masked = first[index] === null;
9665
+ if (channels.some((values) => values[index] === null !== masked)) {
9666
+ context.addIssue({
9667
+ code: external_exports.ZodIssueCode.custom,
9668
+ message: `Cell ${index} must be null in every channel or finite in every channel`
9669
+ });
9670
+ return;
9671
+ }
9672
+ }
9673
+ }).describe(
9674
+ "Decoded real or complex sheet-current arrays with a shared conductor mask"
9675
+ );
9676
+ expectTypesMatch(true);
9677
+ function getSimulationReturnCurrentGridJsonSchema(field) {
9678
+ const count = field.columns * field.rows;
9679
+ if (!Number.isSafeInteger(field.columns) || field.columns <= 0 || !Number.isSafeInteger(field.rows) || field.rows <= 0 || !Number.isSafeInteger(count))
9680
+ throw new Error("Grid dimensions must be positive safe integers");
9681
+ return simulation_return_current_grid_json.superRefine((grid2, context) => {
9682
+ if (grid2.field_type !== field.field_type) {
9683
+ context.addIssue({
9684
+ code: external_exports.ZodIssueCode.custom,
9685
+ path: ["field_type"],
9686
+ message: "Decoded field_type must match the parent field"
9687
+ });
9688
+ }
9689
+ const first = grid2.field_type === "real" ? grid2.sheet_current_x : grid2.sheet_current_x_real;
9690
+ if (first.length !== count) {
9691
+ context.addIssue({
9692
+ code: external_exports.ZodIssueCode.custom,
9693
+ message: `Each current channel must have ${count} entries (columns * rows)`
9694
+ });
9695
+ }
9696
+ });
9697
+ }
9698
+ var simulation_pcb_return_current_heatmap = external_exports.object({
9699
+ type: external_exports.literal("simulation_pcb_return_current_heatmap"),
9700
+ simulation_pcb_return_current_heatmap_id: getZodPrefixedIdWithDefault(
9701
+ "simulation_pcb_return_current_heatmap"
9702
+ ),
9703
+ simulation_pcb_return_current_result_id: external_exports.string().min(1),
9704
+ layer: layer_ref,
9705
+ source_net_id: external_exports.string().min(1),
9706
+ min_x: external_exports.number().finite(),
9707
+ min_y: external_exports.number().finite(),
9708
+ max_x: external_exports.number().finite(),
9709
+ max_y: external_exports.number().finite(),
9710
+ image_asset: simulation_return_current_image_asset
9711
+ }).superRefine((heatmap, context) => {
9712
+ for (const axis of ["x", "y"]) {
9713
+ if (heatmap[`max_${axis}`] <= heatmap[`min_${axis}`]) {
9714
+ context.addIssue({
9715
+ code: external_exports.ZodIssueCode.custom,
9716
+ path: [`max_${axis}`],
9717
+ message: "Heatmap bounds must have positive width and height"
9718
+ });
9719
+ }
9720
+ }
9721
+ }).describe(
9722
+ "A transparent PNG/WebP current-density overlay in A/mm\xB2; the top-left pixel maps to (min_x, max_y)"
9723
+ );
9724
+ expectTypesMatch(true);
9725
+ var marker_base = external_exports.object({
9726
+ type: external_exports.literal("simulation_pcb_return_current_marker"),
9727
+ simulation_pcb_return_current_marker_id: getZodPrefixedIdWithDefault(
9728
+ "simulation_pcb_return_current_marker"
9729
+ ),
9730
+ simulation_pcb_return_current_result_id: external_exports.string().min(1),
9731
+ role: external_exports.enum([
9732
+ "signal_source",
9733
+ "signal_load",
9734
+ "return_source",
9735
+ "return_sink",
9736
+ "signal_transition",
9737
+ "return_transition"
9738
+ ]),
9739
+ label: external_exports.string().optional(),
9740
+ label_x: external_exports.number().finite().optional(),
9741
+ label_y: external_exports.number().finite().optional()
9742
+ });
9743
+ var simulation_pcb_return_current_marker = external_exports.discriminatedUnion("target_type", [
9744
+ marker_base.extend({
9745
+ target_type: external_exports.literal("pcb_port"),
9746
+ pcb_port_id: external_exports.string().min(1),
9747
+ layer: layer_ref
9748
+ }),
9749
+ marker_base.extend({
9750
+ target_type: external_exports.literal("pcb_via"),
9751
+ pcb_via_id: external_exports.string().min(1),
9752
+ from_layer: layer_ref,
9753
+ to_layer: layer_ref
9754
+ })
9755
+ ]).superRefine((marker, context) => {
9756
+ if (marker.label_x === void 0 !== (marker.label_y === void 0)) {
9757
+ context.addIssue({
9758
+ code: external_exports.ZodIssueCode.custom,
9759
+ path: ["label_x"],
9760
+ message: "label_x and label_y must be provided together"
9761
+ });
9762
+ }
9763
+ if (marker.target_type === "pcb_via" && marker.from_layer === marker.to_layer) {
9764
+ context.addIssue({
9765
+ code: external_exports.ZodIssueCode.custom,
9766
+ path: ["to_layer"],
9767
+ message: "A via transition must connect distinct layers"
9768
+ });
9769
+ }
9770
+ }).describe(
9771
+ "A signal/return port or via highlight; markers do not assert measured via-transfer currents"
9772
+ );
9773
+ expectTypesMatch(true);
9774
+ var drawingPageSizes = {
9775
+ iso_a0: [1189, 841],
9776
+ iso_a1: [841, 594],
9777
+ iso_a2: [594, 420],
9778
+ iso_a3: [420, 297],
9779
+ iso_a4: [297, 210],
9780
+ ansi_a: [279.4, 215.9],
9781
+ ansi_b: [431.8, 279.4],
9782
+ ansi_c: [558.8, 431.8],
9783
+ ansi_d: [863.6, 558.8],
9784
+ ansi_e: [1117.6, 863.6]
9785
+ };
9786
+ var drawing_page_size = external_exports.enum([
9787
+ "iso_a0",
9788
+ "iso_a1",
9789
+ "iso_a2",
9790
+ "iso_a3",
9791
+ "iso_a4",
9792
+ "ansi_a",
9793
+ "ansi_b",
9794
+ "ansi_c",
9795
+ "ansi_d",
9796
+ "ansi_e"
9797
+ ]);
9798
+ function getDrawingPageDimensions(size2, orientation2 = "landscape") {
9799
+ const [width, height] = drawingPageSizes[size2];
9800
+ return orientation2 === "portrait" ? { width: height, height: width } : { width, height };
9801
+ }
9802
+ var drawing_page = external_exports.object({
9803
+ type: external_exports.literal("drawing_page"),
9804
+ drawing_page_id: external_exports.string().min(1),
9805
+ name: external_exports.string().optional(),
9806
+ display_name: external_exports.string().optional(),
9807
+ page_size: drawing_page_size.optional(),
9808
+ orientation: external_exports.enum(["landscape", "portrait"]).optional(),
9809
+ width: external_exports.number().finite().positive(),
9810
+ height: external_exports.number().finite().positive()
9811
+ }).superRefine((page, ctx) => {
9812
+ if (!page.page_size) {
9813
+ if (page.orientation)
9814
+ ctx.addIssue({
9815
+ code: "custom",
9816
+ path: ["orientation"],
9817
+ message: "Orientation requires page_size; custom pages use explicit dimensions"
9818
+ });
9819
+ return;
9820
+ }
9821
+ const expected = getDrawingPageDimensions(page.page_size, page.orientation);
9822
+ if (Math.abs(page.width - expected.width) > 1e-6 || Math.abs(page.height - expected.height) > 1e-6)
9823
+ ctx.addIssue({
9824
+ code: "custom",
9825
+ path: ["page_size"],
9826
+ message: "Dimensions must match the named sheet size and orientation"
9827
+ });
9828
+ }).describe(
9829
+ "A paper-space drawing page containing configured part views. Dimensions are mm."
9830
+ );
9831
+ expectTypesMatch(true);
9832
+ var drawing_part_view_direction = external_exports.enum([
9833
+ "x_positive",
9834
+ "x_negative",
9835
+ "y_positive",
9836
+ "y_negative",
9837
+ "z_positive",
9838
+ "z_negative",
9839
+ "isometric"
9840
+ ]);
9841
+ var drawing_section_plane = external_exports.object({
9842
+ axis: external_exports.enum(["x", "y", "z"]),
9843
+ offset: external_exports.number().finite(),
9844
+ keep_side: external_exports.enum(["less", "greater"]),
9845
+ hatch_spacing: external_exports.number().finite().positive().optional()
9846
+ });
9847
+ var drawing_part_view = external_exports.object({
9848
+ type: external_exports.literal("drawing_part_view"),
9849
+ drawing_part_view_id: external_exports.string().min(1),
9850
+ drawing_page_id: external_exports.string().min(1),
9851
+ source_group_id: external_exports.string().min(1).optional(),
9852
+ source_component_ids: external_exports.array(external_exports.string().min(1)).optional(),
9853
+ name: external_exports.string().optional(),
9854
+ display_name: external_exports.string().optional(),
9855
+ direction: drawing_part_view_direction,
9856
+ center: external_exports.object({ x: external_exports.number().finite(), y: external_exports.number().finite() }),
9857
+ width: external_exports.number().finite().positive(),
9858
+ height: external_exports.number().finite().positive(),
9859
+ scale: external_exports.number().finite().positive().optional(),
9860
+ show_hidden_edges: external_exports.boolean().optional(),
9861
+ section: drawing_section_plane.optional()
9862
+ }).describe(
9863
+ "A configured orthographic view of selected assembly geometry. Paper coordinates are mm, origin at sheet center, +X right/+Y up. Directions and section planes use CAD world coordinates in mm with +Z up."
9864
+ );
9865
+ expectTypesMatch(
9866
+ true
9867
+ );
9868
+ expectTypesMatch(true);
9869
+ var drawing_page_title_block = external_exports.object({
9870
+ type: external_exports.literal("drawing_page_title_block"),
9871
+ drawing_page_title_block_id: external_exports.string().min(1),
9872
+ drawing_page_id: external_exports.string().min(1),
9873
+ title: external_exports.string().min(1),
9874
+ legal_owner: external_exports.string().optional(),
9875
+ identification_number: external_exports.string().optional(),
9876
+ revision_index: external_exports.string().optional(),
9877
+ date_of_issue: external_exports.string().optional(),
9878
+ creator: external_exports.string().optional(),
9879
+ approval_person: external_exports.string().optional(),
9880
+ sheet_number: external_exports.number().int().positive().optional(),
9881
+ number_of_sheets: external_exports.number().int().positive().optional()
9882
+ }).refine(
9883
+ (block) => block.sheet_number == null || block.number_of_sheets == null || block.sheet_number <= block.number_of_sheets,
9884
+ {
9885
+ message: "sheet_number must not exceed number_of_sheets",
9886
+ path: ["sheet_number"]
9887
+ }
9888
+ );
9889
+ expectTypesMatch(true);
9890
+ var paper_point = external_exports.object({
9891
+ x: external_exports.number().finite(),
9892
+ y: external_exports.number().finite()
9893
+ });
9894
+ var drawing_dimension_line = external_exports.object({
9895
+ type: external_exports.literal("drawing_dimension_line"),
9896
+ drawing_dimension_line_id: external_exports.string().trim().min(1),
9897
+ drawing_part_view_id: external_exports.string().trim().min(1),
9898
+ start: paper_point,
9899
+ end: paper_point,
9900
+ text: external_exports.string().refine(
9901
+ (text) => text.trim().length > 0,
9902
+ "Dimension text must not be blank"
9903
+ ),
9904
+ edge_ref_start: paper_point.optional(),
9905
+ edge_ref_end: paper_point.optional(),
9906
+ edge_ref_name: external_exports.string().refine(
9907
+ (name) => name.trim().length > 0,
9908
+ "Edge reference name must not be blank"
9909
+ ).optional(),
9910
+ name: external_exports.string().trim().min(1).optional()
9911
+ }).refine(
9912
+ (line2) => line2.start.x !== line2.end.x || line2.start.y !== line2.end.y,
9913
+ { message: "Dimension line endpoints must be distinct", path: ["end"] }
9914
+ ).describe(
9915
+ "A resolved dimension annotation associated with a drawing part view. start/end and optional edge_ref_start/edge_ref_end use page-centered paper mm, +X right/+Y up. Core resolves model measurement and formats the required text before emitting this record; renderers draw the supplied line, text and optional witness attachments without resolving native geometry or deriving values from paper length. Each witness attachment is independently optional. edge_ref_name is optional exact nonblank model-feature metadata, never a geometry definition or a rendering dependency."
9916
+ );
9917
+ expectTypesMatch(
9918
+ true
9919
+ );
9087
9920
  var any_circuit_element = external_exports.union([
9921
+ drawing_page,
9922
+ drawing_page_title_block,
9923
+ drawing_part_view,
9924
+ drawing_dimension_line,
9088
9925
  source_runtime_error,
9926
+ source_datasheet,
9089
9927
  source_trace,
9090
9928
  source_bus,
9091
9929
  source_port,
@@ -9121,6 +9959,7 @@ var any_circuit_element = external_exports.union([
9121
9959
  source_unnamed_trace_warning,
9122
9960
  source_confusing_net_name_warning,
9123
9961
  source_missing_manufacturer_part_number_warning,
9962
+ source_component_availability_warning,
9124
9963
  source_refdes_convention_warning,
9125
9964
  source_no_power_pin_defined_warning,
9126
9965
  source_no_ground_pin_defined_warning,
@@ -9150,6 +9989,7 @@ var any_circuit_element = external_exports.union([
9150
9989
  pcb_text,
9151
9990
  pcb_trace,
9152
9991
  pcb_trace_warning,
9992
+ pcb_trace_style_warning,
9153
9993
  pcb_trace_too_long_warning,
9154
9994
  pcb_trace_too_long_error,
9155
9995
  pcb_bus_length_skew_error,
@@ -9159,6 +9999,7 @@ var any_circuit_element = external_exports.union([
9159
9999
  pcb_solder_paste,
9160
10000
  pcb_soldermask_opening,
9161
10001
  pcb_board,
10002
+ pcb_stackup,
9162
10003
  pcb_bend,
9163
10004
  pcb_stiffener,
9164
10005
  pcb_panel,
@@ -9232,6 +10073,7 @@ var any_circuit_element = external_exports.union([
9232
10073
  schematic_manual_edit_conflict_warning,
9233
10074
  schematic_component_overlap_warning,
9234
10075
  schematic_component_styling_warning,
10076
+ schematic_sheet_styling_warning,
9235
10077
  schematic_missing_sheet_warning,
9236
10078
  schematic_element_outside_sheet_warning,
9237
10079
  schematic_graphic,
@@ -9241,10 +10083,20 @@ var any_circuit_element = external_exports.union([
9241
10083
  schematic_table_cell,
9242
10084
  cad_component,
9243
10085
  cad_cable,
10086
+ cad_reference_surface,
9244
10087
  cad_collision_error,
9245
10088
  simulation_voltage_source,
9246
10089
  simulation_current_source,
9247
10090
  simulation_experiment,
10091
+ simulation_ibis_model,
10092
+ simulation_ibis_pin_state,
10093
+ simulation_digital_stimulus,
10094
+ simulation_eye_diagram,
10095
+ simulation_return_current_excitation,
10096
+ simulation_pcb_return_current_result,
10097
+ simulation_pcb_return_current_field,
10098
+ simulation_pcb_return_current_heatmap,
10099
+ simulation_pcb_return_current_marker,
9248
10100
  simulation_transient_voltage_graph,
9249
10101
  simulation_transient_current_graph,
9250
10102
  simulation_dc_operating_point_voltage,
@@ -17649,6 +18501,31 @@ var transformInsertionDirection = (direction, opts) => {
17649
18501
  }
17650
18502
  return vecToInsertionDirection({ x, y });
17651
18503
  };
18504
+ var getTransformedRectRotation = (rotation2, matrix2) => {
18505
+ const isReflected = matrix2.a * matrix2.d - matrix2.b * matrix2.c < 0;
18506
+ return decomposeTSR(compose(matrix2, rotateDEG(rotation2)), false, isReflected).rotation.angle * 180 / Math.PI;
18507
+ };
18508
+ var transformPcbSolderPasteRectangle = (paste, matrix2) => {
18509
+ const center = applyToPoint(matrix2, { x: paste.x, y: paste.y });
18510
+ paste.x = center.x;
18511
+ paste.y = center.y;
18512
+ const rotation2 = getTransformedRectRotation(
18513
+ paste.shape === "rotated_rect" ? paste.ccw_rotation : 0,
18514
+ matrix2
18515
+ );
18516
+ const quarterTurns = Math.round(rotation2 / 90);
18517
+ if (Math.abs(rotation2 - quarterTurns * 90) < 1e-8) {
18518
+ if (Math.abs(quarterTurns) % 2 === 1) {
18519
+ ;
18520
+ [paste.width, paste.height] = [paste.height, paste.width];
18521
+ }
18522
+ Object.assign(paste, { shape: "rect" });
18523
+ Reflect.deleteProperty(paste, "ccw_rotation");
18524
+ } else {
18525
+ Object.assign(paste, { shape: "rotated_rect", ccw_rotation: rotation2 });
18526
+ }
18527
+ return paste;
18528
+ };
17652
18529
  var transformPcbSoldermaskOpening = (opening, matrix2) => {
17653
18530
  if (opening.shape === "polygon") {
17654
18531
  opening.points = opening.points.map((point4) => applyToPoint(matrix2, point4));
@@ -17659,8 +18536,7 @@ var transformPcbSoldermaskOpening = (opening, matrix2) => {
17659
18536
  opening.y = center.y;
17660
18537
  if (opening.shape === "circle") return opening;
17661
18538
  const rectRotation = opening.shape === "rotated_rect" ? opening.ccw_rotation : 0;
17662
- const isReflected = matrix2.a * matrix2.d - matrix2.b * matrix2.c < 0;
17663
- const transformedRotation = decomposeTSR(compose(matrix2, rotateDEG(rectRotation)), false, isReflected).rotation.angle * 180 / Math.PI;
18539
+ const transformedRotation = getTransformedRectRotation(rectRotation, matrix2);
17664
18540
  if (Math.abs(transformedRotation) < 1e-8) {
17665
18541
  Object.assign(opening, { shape: "rect" });
17666
18542
  Reflect.deleteProperty(opening, "ccw_rotation");
@@ -17673,28 +18549,47 @@ var transformPcbSoldermaskOpening = (opening, matrix2) => {
17673
18549
  return opening;
17674
18550
  };
17675
18551
  var transformPCBElement = (elm, matrix2) => {
18552
+ if (elm.type === "pcb_cutout") {
18553
+ if (elm.shape === "polygon") {
18554
+ elm.points = elm.points.map((point4) => applyToPoint(matrix2, point4));
18555
+ } else if (elm.shape === "path") {
18556
+ elm.route = elm.route.map((point4) => applyToPoint(matrix2, point4));
18557
+ } else {
18558
+ elm.center = applyToPoint(matrix2, elm.center);
18559
+ if (elm.shape === "rect") {
18560
+ elm.rotation = getTransformedRectRotation(elm.rotation ?? 0, matrix2);
18561
+ }
18562
+ }
18563
+ return elm;
18564
+ }
17676
18565
  if (elm.type === "pcb_soldermask_opening") {
17677
18566
  return transformPcbSoldermaskOpening(elm, matrix2);
17678
18567
  }
18568
+ if (elm.type === "pcb_solder_paste" && (elm.shape === "rect" || elm.shape === "rotated_rect")) {
18569
+ return transformPcbSolderPasteRectangle(elm, matrix2);
18570
+ }
18571
+ if ((elm.type === "pcb_smtpad" || elm.type === "pcb_solder_paste") && elm.shape === "polygon") {
18572
+ elm.points = elm.points.map((point4) => applyToPoint(matrix2, point4));
18573
+ if (elm.type === "pcb_solder_paste" && elm.holes) {
18574
+ elm.holes = elm.holes.map(
18575
+ (hole) => hole.map((point4) => applyToPoint(matrix2, point4))
18576
+ );
18577
+ }
18578
+ return elm;
18579
+ }
17679
18580
  const tsr = decomposeTSR(matrix2);
17680
18581
  const flipPadWidthHeight = Math.abs(getQuarterTurns(tsr.rotation.angle)) % 2 === 1;
17681
18582
  const rotationDegrees = tsr.rotation.angle / Math.PI * 180;
17682
18583
  const isFlipped = tsr.scale.sy < 0;
17683
18584
  if (elm.type === "pcb_plated_hole" || elm.type === "pcb_hole" || elm.type === "pcb_via" || elm.type === "pcb_smtpad" || elm.type === "pcb_solder_paste" || elm.type === "pcb_port") {
17684
18585
  const { x, y } = applyToPoint(matrix2, {
17685
- x: Number(elm.x),
17686
- y: Number(elm.y)
18586
+ x: elm.x,
18587
+ y: elm.y
17687
18588
  });
17688
18589
  elm.x = x;
17689
18590
  elm.y = y;
17690
- if (elm.type === "pcb_smtpad" && elm.shape === "polygon" && Array.isArray(elm.points)) {
17691
- elm.points = elm.points.map((point4) => {
17692
- const tp = applyToPoint(matrix2, { x: point4.x, y: point4.y });
17693
- return {
17694
- x: tp.x,
17695
- y: tp.y
17696
- };
17697
- });
18591
+ if (elm.type === "pcb_smtpad" && (elm.shape === "rotated_rect" || elm.shape === "rotated_pill")) {
18592
+ elm.ccw_rotation = getTransformedRectRotation(elm.ccw_rotation, matrix2);
17698
18593
  }
17699
18594
  } else if (elm.type === "pcb_keepout" && elm.shape === "outline") {
17700
18595
  elm.outline = elm.outline.map((point4) => applyToPoint(matrix2, point4));
@@ -17702,17 +18597,24 @@ var transformPCBElement = (elm, matrix2) => {
17702
18597
  elm.center = applyToPoint(matrix2, elm.center);
17703
18598
  } else if (elm.type === "pcb_silkscreen_text" || elm.type === "pcb_fabrication_note_text" || elm.type === "pcb_note_text") {
17704
18599
  elm.anchor_position = applyToPoint(matrix2, elm.anchor_position);
18600
+ if (elm.type === "pcb_silkscreen_text") {
18601
+ const textTransform = compose(matrix2, rotateDEG(elm.ccw_rotation ?? 0));
18602
+ elm.ccw_rotation = Math.atan2(textTransform.b, textTransform.a) * 180 / Math.PI;
18603
+ }
17705
18604
  } else if (elm.type === "pcb_copper_text") {
17706
18605
  if (elm.anchor_position) {
17707
18606
  elm.anchor_position = applyToPoint(matrix2, elm.anchor_position);
17708
18607
  }
17709
18608
  } else if (elm.type === "pcb_courtyard_rect") {
17710
18609
  elm.center = applyToPoint(matrix2, elm.center);
17711
- elm.ccw_rotation = ((elm.ccw_rotation ?? 0) + rotationDegrees) % 360;
18610
+ elm.ccw_rotation = getTransformedRectRotation(elm.ccw_rotation ?? 0, matrix2);
17712
18611
  } else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_silkscreen_pill" || elm.type === "pcb_silkscreen_oval" || elm.type === "pcb_note_rect" || elm.type === "pcb_courtyard_circle") {
17713
18612
  elm.center = applyToPoint(matrix2, elm.center);
17714
18613
  } else if (elm.type === "pcb_component") {
17715
18614
  elm.center = applyToPoint(matrix2, elm.center);
18615
+ if (elm.footprint_origin) {
18616
+ elm.footprint_origin = applyToPoint(matrix2, elm.footprint_origin);
18617
+ }
17716
18618
  elm.rotation = elm.rotation + rotationDegrees;
17717
18619
  elm.rotation = elm.rotation % 360;
17718
18620
  if (elm.cable_insertion_center) {
@@ -17791,7 +18693,7 @@ var transformPCBElements = (elms, matrix2) => {
17791
18693
  let transformedElms = elms.map((elm) => transformPCBElement(elm, matrix2));
17792
18694
  if (flipPadWidthHeight) {
17793
18695
  transformedElms = transformedElms.map((elm) => {
17794
- if ((elm.type === "pcb_smtpad" || elm.type === "pcb_solder_paste") && (elm.shape === "rect" || elm.shape === "pill")) {
18696
+ if (elm.type === "pcb_smtpad" && (elm.shape === "rect" || elm.shape === "pill") || elm.type === "pcb_solder_paste" && elm.shape === "pill") {
17795
18697
  ;
17796
18698
  [elm.width, elm.height] = [elm.height, elm.width];
17797
18699
  }
@@ -19605,22 +20507,15 @@ var convertEasyEdaJsonToCircuitJsonWithPinAttributes = (easyEdaJson, {
19605
20507
  scale(1, -1)
19606
20508
  );
19607
20509
  const elementsForTransform = circuitElements.filter(
19608
- (e) => !(e.type === "pcb_smtpad" && e.shape === "polygon") && e.type !== "cad_component"
20510
+ (e) => !(e.type === "pcb_smtpad" && e.shape === "polygon") && e.type !== "pcb_silkscreen_text" && e.type !== "cad_component"
19609
20511
  );
19610
20512
  transformPCBElements(elementsForTransform, matrix2);
19611
20513
  for (const e of circuitElements) {
19612
- if (e.type === "pcb_cutout") {
19613
- if (e.shape === "polygon") {
19614
- e.points = e.points.map((p) => applyToPoint(matrix2, p));
19615
- } else if (e.shape === "circle" || e.shape === "rect") {
19616
- e.center = applyToPoint(matrix2, e.center);
19617
- } else if ("route" in e) {
19618
- const cutoutPath = e;
19619
- cutoutPath.route = cutoutPath.route.map(
19620
- (p) => applyToPoint(matrix2, p)
19621
- );
19622
- }
19623
- } else if (e.type === "pcb_smtpad" && e.shape === "polygon") {
20514
+ if (e.type !== "pcb_silkscreen_text") continue;
20515
+ e.anchor_position = applyToPoint(matrix2, e.anchor_position);
20516
+ }
20517
+ for (const e of circuitElements) {
20518
+ if (e.type === "pcb_smtpad" && e.shape === "polygon") {
19624
20519
  e.points = e.points.map((p) => applyToPoint(matrix2, p));
19625
20520
  }
19626
20521
  }