easyeda 0.0.370 → 0.0.372
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/dist/browser/index.js +281 -44
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +2414 -2171
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +2400 -2151
- package/dist/main.cjs.map +1 -1
- package/package.json +11 -5
package/dist/browser/index.js
CHANGED
|
@@ -16,6 +16,7 @@ __export(dist_exports, {
|
|
|
16
16
|
battery_capacity: () => battery_capacity,
|
|
17
17
|
brep_shape: () => brep_shape,
|
|
18
18
|
cadModelDefaultDirectionMap: () => cadModelDefaultDirectionMap,
|
|
19
|
+
cad_cable: () => cad_cable,
|
|
19
20
|
cad_collision_error: () => cad_collision_error,
|
|
20
21
|
cad_component: () => cad_component,
|
|
21
22
|
cad_model_axis_directions: () => cad_model_axis_directions,
|
|
@@ -63,6 +64,8 @@ __export(dist_exports, {
|
|
|
63
64
|
pcb_board: () => pcb_board,
|
|
64
65
|
pcb_breakout_point: () => pcb_breakout_point,
|
|
65
66
|
pcb_bus_length_skew_error: () => pcb_bus_length_skew_error,
|
|
67
|
+
pcb_bus_routing_constraint_error: () => pcb_bus_routing_constraint_error,
|
|
68
|
+
pcb_bus_routing_constraint_warning: () => pcb_bus_routing_constraint_warning,
|
|
66
69
|
pcb_component: () => pcb_component,
|
|
67
70
|
pcb_component_invalid_layer_error: () => pcb_component_invalid_layer_error,
|
|
68
71
|
pcb_component_missing_courtyard_warning: () => pcb_component_missing_courtyard_warning,
|
|
@@ -257,6 +260,7 @@ __export(dist_exports, {
|
|
|
257
260
|
source_manually_placed_via: () => source_manually_placed_via,
|
|
258
261
|
source_missing_manufacturer_part_number_warning: () => source_missing_manufacturer_part_number_warning,
|
|
259
262
|
source_missing_property_error: () => source_missing_property_error,
|
|
263
|
+
source_motor: () => source_motor,
|
|
260
264
|
source_net: () => source_net,
|
|
261
265
|
source_no_ground_pin_defined_warning: () => source_no_ground_pin_defined_warning,
|
|
262
266
|
source_no_power_pin_defined_warning: () => source_no_power_pin_defined_warning,
|
|
@@ -266,6 +270,7 @@ __export(dist_exports, {
|
|
|
266
270
|
source_pin_missing_trace_warning: () => source_pin_missing_trace_warning,
|
|
267
271
|
source_pin_must_be_connected_error: () => source_pin_must_be_connected_error,
|
|
268
272
|
source_port: () => source_port,
|
|
273
|
+
source_printed_part: () => source_printed_part,
|
|
269
274
|
source_project_metadata: () => source_project_metadata,
|
|
270
275
|
source_property_ignored_warning: () => source_property_ignored_warning,
|
|
271
276
|
source_refdes_convention_warning: () => source_refdes_convention_warning,
|
|
@@ -298,6 +303,7 @@ __export(dist_exports, {
|
|
|
298
303
|
source_simple_transistor: () => source_simple_transistor,
|
|
299
304
|
source_simple_voltage_probe: () => source_simple_voltage_probe,
|
|
300
305
|
source_simple_voltage_source: () => source_simple_voltage_source,
|
|
306
|
+
source_subassembly: () => source_subassembly,
|
|
301
307
|
source_trace: () => source_trace,
|
|
302
308
|
source_trace_not_connected_error: () => source_trace_not_connected_error,
|
|
303
309
|
source_unnamed_trace_warning: () => source_unnamed_trace_warning,
|
|
@@ -4975,6 +4981,18 @@ var source_simple_chip = source_component_base.extend({
|
|
|
4975
4981
|
ftype: external_exports.literal("simple_chip")
|
|
4976
4982
|
});
|
|
4977
4983
|
expectTypesMatch(true);
|
|
4984
|
+
var source_printed_part = source_component_base.extend({
|
|
4985
|
+
ftype: external_exports.literal("printedpart")
|
|
4986
|
+
});
|
|
4987
|
+
expectTypesMatch(true);
|
|
4988
|
+
var source_subassembly = source_component_base.extend({
|
|
4989
|
+
ftype: external_exports.literal("subassembly")
|
|
4990
|
+
});
|
|
4991
|
+
expectTypesMatch(true);
|
|
4992
|
+
var source_motor = source_component_base.extend({
|
|
4993
|
+
ftype: external_exports.literal("motor")
|
|
4994
|
+
});
|
|
4995
|
+
expectTypesMatch(true);
|
|
4978
4996
|
var source_simple_power_source = source_component_base.extend({
|
|
4979
4997
|
ftype: external_exports.literal("simple_power_source"),
|
|
4980
4998
|
voltage
|
|
@@ -5002,6 +5020,13 @@ var source_simple_ammeter = source_component_base.extend({
|
|
|
5002
5020
|
ftype: external_exports.literal("simple_ammeter")
|
|
5003
5021
|
});
|
|
5004
5022
|
expectTypesMatch(true);
|
|
5023
|
+
var pin_voltage = external_exports.union([
|
|
5024
|
+
external_exports.number(),
|
|
5025
|
+
external_exports.string().trim().regex(
|
|
5026
|
+
/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*(?:[fpnumkKMGTµμ]?V?|V)?$/,
|
|
5027
|
+
"Expected a scalar voltage, optionally with SI units"
|
|
5028
|
+
)
|
|
5029
|
+
]).pipe(voltage).pipe(external_exports.number().finite());
|
|
5005
5030
|
var source_pin_attributes = external_exports.object({
|
|
5006
5031
|
is_input: external_exports.boolean().optional(),
|
|
5007
5032
|
is_output: external_exports.boolean().optional(),
|
|
@@ -5020,8 +5045,9 @@ var source_pin_attributes = external_exports.object({
|
|
|
5020
5045
|
requires_power: external_exports.boolean().optional(),
|
|
5021
5046
|
provides_ground: external_exports.boolean().optional(),
|
|
5022
5047
|
requires_ground: external_exports.boolean().optional(),
|
|
5023
|
-
provides_voltage:
|
|
5024
|
-
requires_voltage:
|
|
5048
|
+
provides_voltage: pin_voltage.optional(),
|
|
5049
|
+
requires_voltage: pin_voltage.optional(),
|
|
5050
|
+
required_voltage_tolerance: external_exports.number().finite().min(0).max(1).optional(),
|
|
5025
5051
|
do_not_connect: external_exports.boolean().optional(),
|
|
5026
5052
|
include_in_board_pinout: external_exports.boolean().optional(),
|
|
5027
5053
|
can_use_internal_pullup: external_exports.boolean().optional(),
|
|
@@ -5246,10 +5272,10 @@ var source_missing_manufacturer_part_number_warning = external_exports.object({
|
|
|
5246
5272
|
warning_type: external_exports.literal("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),
|
|
5247
5273
|
message: external_exports.string(),
|
|
5248
5274
|
source_component_id: external_exports.string(),
|
|
5249
|
-
standard: external_exports.string(),
|
|
5275
|
+
standard: external_exports.string().optional(),
|
|
5250
5276
|
subcircuit_id: external_exports.string().optional()
|
|
5251
5277
|
}).describe(
|
|
5252
|
-
"Warning emitted when a
|
|
5278
|
+
"Warning emitted when a source component is missing its manufacturer part number"
|
|
5253
5279
|
);
|
|
5254
5280
|
expectTypesMatch(true);
|
|
5255
5281
|
var source_refdes_convention_warning = external_exports.object({
|
|
@@ -5327,6 +5353,9 @@ var any_source_component = external_exports.union([
|
|
|
5327
5353
|
source_simple_led,
|
|
5328
5354
|
source_simple_ground,
|
|
5329
5355
|
source_simple_chip,
|
|
5356
|
+
source_printed_part,
|
|
5357
|
+
source_subassembly,
|
|
5358
|
+
source_motor,
|
|
5330
5359
|
source_simple_power_source,
|
|
5331
5360
|
source_simple_current_source,
|
|
5332
5361
|
source_simple_ammeter,
|
|
@@ -5595,12 +5624,43 @@ var source_confusing_net_name_warning = external_exports.object({
|
|
|
5595
5624
|
"Warning emitted when electrically disconnected source nets share a name"
|
|
5596
5625
|
);
|
|
5597
5626
|
expectTypesMatch(true);
|
|
5627
|
+
var route_length = external_exports.union([
|
|
5628
|
+
external_exports.number().nonnegative().finite(),
|
|
5629
|
+
external_exports.object({
|
|
5630
|
+
reference: external_exports.literal("longest_manhattan"),
|
|
5631
|
+
source_trace_ids: external_exports.array(external_exports.string()).min(1).optional(),
|
|
5632
|
+
offset: external_exports.number().finite().optional()
|
|
5633
|
+
})
|
|
5634
|
+
]);
|
|
5635
|
+
var trace_spacing = external_exports.union([
|
|
5636
|
+
external_exports.number().positive().finite(),
|
|
5637
|
+
external_exports.object({ width_multiplier: external_exports.number().positive().finite() })
|
|
5638
|
+
]);
|
|
5598
5639
|
var source_bus = external_exports.object({
|
|
5599
5640
|
type: external_exports.literal("source_bus"),
|
|
5600
5641
|
source_bus_id: external_exports.string(),
|
|
5601
5642
|
name: external_exports.string().optional(),
|
|
5602
5643
|
source_trace_ids: external_exports.array(external_exports.string()).min(1),
|
|
5603
5644
|
max_length_skew: external_exports.number().nonnegative().finite().optional(),
|
|
5645
|
+
target_impedance: external_exports.number().positive().finite().optional(),
|
|
5646
|
+
target_differential_impedance: external_exports.number().positive().finite().optional(),
|
|
5647
|
+
differential_pair: external_exports.object({
|
|
5648
|
+
positive_source_trace_id: external_exports.string(),
|
|
5649
|
+
negative_source_trace_id: external_exports.string(),
|
|
5650
|
+
trace_gap: external_exports.number().positive().finite().optional(),
|
|
5651
|
+
max_uncoupled_length: external_exports.number().nonnegative().finite().optional()
|
|
5652
|
+
}).optional(),
|
|
5653
|
+
length_match_source_trace_ids: external_exports.array(external_exports.string()).min(1).optional(),
|
|
5654
|
+
min_length: route_length.optional(),
|
|
5655
|
+
max_length: route_length.optional(),
|
|
5656
|
+
target_length: route_length.optional(),
|
|
5657
|
+
length_tolerance: external_exports.number().nonnegative().finite().optional(),
|
|
5658
|
+
pcb_trace_spacing: trace_spacing.optional(),
|
|
5659
|
+
pcb_spacing_to_other_signals: trace_spacing.optional(),
|
|
5660
|
+
target_impedance_min: external_exports.number().positive().finite().optional(),
|
|
5661
|
+
target_impedance_max: external_exports.number().positive().finite().optional(),
|
|
5662
|
+
target_differential_impedance_min: external_exports.number().positive().finite().optional(),
|
|
5663
|
+
target_differential_impedance_max: external_exports.number().positive().finite().optional(),
|
|
5604
5664
|
subcircuit_id: external_exports.string().optional()
|
|
5605
5665
|
});
|
|
5606
5666
|
expectTypesMatch(true);
|
|
@@ -6813,13 +6873,24 @@ var pcb_solder_paste_oval = external_exports.object({
|
|
|
6813
6873
|
pcb_component_id: external_exports.string().optional(),
|
|
6814
6874
|
pcb_smtpad_id: external_exports.string().optional()
|
|
6815
6875
|
});
|
|
6876
|
+
var pcb_solder_paste_polygon = polygon_shape.extend({
|
|
6877
|
+
type: external_exports.literal("pcb_solder_paste"),
|
|
6878
|
+
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
6879
|
+
pcb_group_id: external_exports.string().optional(),
|
|
6880
|
+
subcircuit_id: external_exports.string().optional(),
|
|
6881
|
+
holes: external_exports.array(polygon_shape.shape.points).optional(),
|
|
6882
|
+
layer: layer_ref,
|
|
6883
|
+
pcb_component_id: external_exports.string().optional(),
|
|
6884
|
+
pcb_smtpad_id: external_exports.string().optional()
|
|
6885
|
+
});
|
|
6816
6886
|
var pcb_solder_paste = external_exports.union([
|
|
6817
6887
|
pcb_solder_paste_circle,
|
|
6818
6888
|
pcb_solder_paste_rect,
|
|
6819
6889
|
pcb_solder_paste_pill,
|
|
6820
6890
|
pcb_solder_paste_rotated_rect,
|
|
6821
6891
|
pcb_solder_paste_rotated_pill,
|
|
6822
|
-
pcb_solder_paste_oval
|
|
6892
|
+
pcb_solder_paste_oval,
|
|
6893
|
+
pcb_solder_paste_polygon
|
|
6823
6894
|
]).describe("Defines solderpaste on the PCB");
|
|
6824
6895
|
expectTypesMatch(true);
|
|
6825
6896
|
expectTypesMatch(true);
|
|
@@ -6831,6 +6902,7 @@ expectTypesMatch(
|
|
|
6831
6902
|
true
|
|
6832
6903
|
);
|
|
6833
6904
|
expectTypesMatch(true);
|
|
6905
|
+
expectTypesMatch(true);
|
|
6834
6906
|
var opening_base = external_exports.object({
|
|
6835
6907
|
type: external_exports.literal("pcb_soldermask_opening"),
|
|
6836
6908
|
pcb_soldermask_opening_id: getZodPrefixedIdWithDefault(
|
|
@@ -7047,6 +7119,102 @@ var pcb_trace_too_many_vias_warning = external_exports.object({
|
|
|
7047
7119
|
"Warning emitted when a PCB trace has more vias than its maximum allowed count"
|
|
7048
7120
|
);
|
|
7049
7121
|
expectTypesMatch(true);
|
|
7122
|
+
var error_base = base_circuit_json_error.extend({
|
|
7123
|
+
type: external_exports.literal("pcb_bus_routing_constraint_error"),
|
|
7124
|
+
pcb_bus_routing_constraint_error_id: getZodPrefixedIdWithDefault(
|
|
7125
|
+
"pcb_bus_routing_constraint_error"
|
|
7126
|
+
),
|
|
7127
|
+
error_type: external_exports.literal("pcb_bus_routing_constraint_error").default("pcb_bus_routing_constraint_error"),
|
|
7128
|
+
source_bus_id: external_exports.string(),
|
|
7129
|
+
source_trace_ids: external_exports.array(external_exports.string()).min(1),
|
|
7130
|
+
pcb_trace_ids: external_exports.array(external_exports.string()),
|
|
7131
|
+
subcircuit_id: external_exports.string().optional()
|
|
7132
|
+
});
|
|
7133
|
+
var pcb_bus_routing_constraint_error = external_exports.discriminatedUnion("routing_rule", [
|
|
7134
|
+
error_base.extend({
|
|
7135
|
+
routing_rule: external_exports.literal("length_skew"),
|
|
7136
|
+
actual_length_skew: external_exports.number().nonnegative().finite(),
|
|
7137
|
+
maximum_length_skew: external_exports.number().nonnegative().finite()
|
|
7138
|
+
}),
|
|
7139
|
+
error_base.extend({
|
|
7140
|
+
routing_rule: external_exports.literal("min_length"),
|
|
7141
|
+
actual_trace_length: external_exports.number().nonnegative().finite(),
|
|
7142
|
+
minimum_trace_length: external_exports.number().finite()
|
|
7143
|
+
}),
|
|
7144
|
+
error_base.extend({
|
|
7145
|
+
routing_rule: external_exports.literal("max_length"),
|
|
7146
|
+
actual_trace_length: external_exports.number().nonnegative().finite(),
|
|
7147
|
+
maximum_trace_length: external_exports.number().finite()
|
|
7148
|
+
}),
|
|
7149
|
+
error_base.extend({
|
|
7150
|
+
routing_rule: external_exports.literal("target_length"),
|
|
7151
|
+
actual_trace_length: external_exports.number().nonnegative().finite(),
|
|
7152
|
+
target_trace_length: external_exports.number().finite(),
|
|
7153
|
+
length_tolerance: external_exports.number().nonnegative().finite()
|
|
7154
|
+
}),
|
|
7155
|
+
error_base.extend({
|
|
7156
|
+
routing_rule: external_exports.literal("pcb_trace_spacing"),
|
|
7157
|
+
other_pcb_trace_id: external_exports.string(),
|
|
7158
|
+
other_source_trace_id: external_exports.string().optional(),
|
|
7159
|
+
actual_centerline_spacing: external_exports.number().nonnegative().finite(),
|
|
7160
|
+
minimum_centerline_spacing: external_exports.number().positive().finite()
|
|
7161
|
+
}),
|
|
7162
|
+
error_base.extend({
|
|
7163
|
+
routing_rule: external_exports.literal("pcb_spacing_to_other_signals"),
|
|
7164
|
+
other_pcb_trace_id: external_exports.string(),
|
|
7165
|
+
other_source_trace_id: external_exports.string().optional(),
|
|
7166
|
+
actual_centerline_spacing: external_exports.number().nonnegative().finite(),
|
|
7167
|
+
minimum_centerline_spacing: external_exports.number().positive().finite()
|
|
7168
|
+
}),
|
|
7169
|
+
error_base.extend({
|
|
7170
|
+
routing_rule: external_exports.literal("impedance_target"),
|
|
7171
|
+
target_impedance: external_exports.number().positive().finite(),
|
|
7172
|
+
minimum_impedance: external_exports.number().positive().finite().optional(),
|
|
7173
|
+
maximum_impedance: external_exports.number().positive().finite().optional()
|
|
7174
|
+
})
|
|
7175
|
+
]).superRefine((error, ctx) => {
|
|
7176
|
+
if (error.routing_rule !== "impedance_target") return;
|
|
7177
|
+
if (error.minimum_impedance === void 0 && error.maximum_impedance === void 0)
|
|
7178
|
+
ctx.addIssue({
|
|
7179
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7180
|
+
path: ["minimum_impedance"],
|
|
7181
|
+
message: "Provide an impedance bound"
|
|
7182
|
+
});
|
|
7183
|
+
if (error.minimum_impedance !== void 0 && error.maximum_impedance !== void 0 && error.minimum_impedance > error.maximum_impedance)
|
|
7184
|
+
ctx.addIssue({
|
|
7185
|
+
code: external_exports.ZodIssueCode.custom,
|
|
7186
|
+
path: ["maximum_impedance"],
|
|
7187
|
+
message: "Impedance bounds must be ordered"
|
|
7188
|
+
});
|
|
7189
|
+
}).describe(
|
|
7190
|
+
"A declared bus or differential-pair routing constraint is violated."
|
|
7191
|
+
);
|
|
7192
|
+
expectTypesMatch(true);
|
|
7193
|
+
var warning_base = external_exports.object({
|
|
7194
|
+
type: external_exports.literal("pcb_bus_routing_constraint_warning"),
|
|
7195
|
+
pcb_bus_routing_constraint_warning_id: getZodPrefixedIdWithDefault(
|
|
7196
|
+
"pcb_bus_routing_constraint_warning"
|
|
7197
|
+
),
|
|
7198
|
+
warning_type: external_exports.literal("pcb_bus_routing_constraint_warning").default("pcb_bus_routing_constraint_warning"),
|
|
7199
|
+
source_bus_id: external_exports.string(),
|
|
7200
|
+
source_trace_ids: external_exports.array(external_exports.string()).min(1),
|
|
7201
|
+
pcb_trace_ids: external_exports.array(external_exports.string()),
|
|
7202
|
+
message: external_exports.string(),
|
|
7203
|
+
subcircuit_id: external_exports.string().optional()
|
|
7204
|
+
}).describe(
|
|
7205
|
+
"A declared bus or pair constraint could not be verified; this is not a pass."
|
|
7206
|
+
);
|
|
7207
|
+
var pcb_bus_routing_constraint_warning = external_exports.discriminatedUnion(
|
|
7208
|
+
"routing_rule",
|
|
7209
|
+
[
|
|
7210
|
+
warning_base.extend({ routing_rule: external_exports.literal("route_geometry") }),
|
|
7211
|
+
warning_base.extend({ routing_rule: external_exports.literal("reference_geometry") }),
|
|
7212
|
+
warning_base.extend({ routing_rule: external_exports.literal("spacing_geometry") }),
|
|
7213
|
+
warning_base.extend({ routing_rule: external_exports.literal("target_length") }),
|
|
7214
|
+
warning_base.extend({ routing_rule: external_exports.literal("physical_impedance") })
|
|
7215
|
+
]
|
|
7216
|
+
);
|
|
7217
|
+
expectTypesMatch(true);
|
|
7050
7218
|
var pcb_trace_error = base_circuit_json_error.extend({
|
|
7051
7219
|
type: external_exports.literal("pcb_trace_error"),
|
|
7052
7220
|
pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
|
|
@@ -7480,7 +7648,9 @@ var pcb_fabrication_note_path = external_exports.object({
|
|
|
7480
7648
|
layer: layer_ref,
|
|
7481
7649
|
route: external_exports.array(point),
|
|
7482
7650
|
stroke_width: length,
|
|
7483
|
-
color: external_exports.string().optional()
|
|
7651
|
+
color: external_exports.string().optional(),
|
|
7652
|
+
is_filled: external_exports.boolean().optional(),
|
|
7653
|
+
has_stroke: external_exports.boolean().optional()
|
|
7484
7654
|
}).describe(
|
|
7485
7655
|
"Defines a fabrication path on the PCB for fabricators or assemblers"
|
|
7486
7656
|
);
|
|
@@ -8294,6 +8464,31 @@ var cad_collision_error = base_circuit_json_error.extend({
|
|
|
8294
8464
|
"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."
|
|
8295
8465
|
);
|
|
8296
8466
|
expectTypesMatch(true);
|
|
8467
|
+
var cad_cable = external_exports.object({
|
|
8468
|
+
type: external_exports.literal("cad_cable"),
|
|
8469
|
+
cad_cable_id: external_exports.string(),
|
|
8470
|
+
name: external_exports.string().min(1),
|
|
8471
|
+
from_source_component_id: external_exports.string(),
|
|
8472
|
+
to_source_component_id: external_exports.string(),
|
|
8473
|
+
cableprinter_string: external_exports.string().min(1).describe(
|
|
8474
|
+
'Physical cable definition, e.g. "usb_c" or "jst_ph_pins6". Independent of the route.'
|
|
8475
|
+
),
|
|
8476
|
+
path: external_exports.array(point3).min(2).refine(
|
|
8477
|
+
(path) => path.every(
|
|
8478
|
+
(point22, i) => [point22.x, point22.y, point22.z].every(Number.isFinite) && (i === 0 || Math.hypot(
|
|
8479
|
+
point22.x - path[i - 1].x,
|
|
8480
|
+
point22.y - path[i - 1].y,
|
|
8481
|
+
point22.z - path[i - 1].z
|
|
8482
|
+
) > 1e-8)
|
|
8483
|
+
),
|
|
8484
|
+
"Cable paths require finite, distinct consecutive points"
|
|
8485
|
+
).describe(
|
|
8486
|
+
"Resolved cable centerline points in right-handed circuit world, millimeters: +X right, +Y top, +Z above. First/last samples are connector wire exits; their tangents point into/out of the cable. Includes routing/slack; renderers must not recompute the path."
|
|
8487
|
+
)
|
|
8488
|
+
}).describe(
|
|
8489
|
+
"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
|
+
);
|
|
8491
|
+
expectTypesMatch(true);
|
|
8297
8492
|
var wave_shape = external_exports.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
8298
8493
|
var percentage = external_exports.union([external_exports.string(), external_exports.number()]).transform((val) => {
|
|
8299
8494
|
if (typeof val === "string") {
|
|
@@ -8978,6 +9173,8 @@ var any_circuit_element = external_exports.union([
|
|
|
8978
9173
|
pcb_silkscreen_circle,
|
|
8979
9174
|
pcb_silkscreen_oval,
|
|
8980
9175
|
pcb_silkscreen_graphic,
|
|
9176
|
+
pcb_bus_routing_constraint_error,
|
|
9177
|
+
pcb_bus_routing_constraint_warning,
|
|
8981
9178
|
pcb_trace_error,
|
|
8982
9179
|
pcb_trace_missing_error,
|
|
8983
9180
|
pcb_placement_error,
|
|
@@ -9043,6 +9240,7 @@ var any_circuit_element = external_exports.union([
|
|
|
9043
9240
|
schematic_table,
|
|
9044
9241
|
schematic_table_cell,
|
|
9045
9242
|
cad_component,
|
|
9243
|
+
cad_cable,
|
|
9046
9244
|
cad_collision_error,
|
|
9047
9245
|
simulation_voltage_source,
|
|
9048
9246
|
simulation_current_source,
|
|
@@ -18100,6 +18298,43 @@ function generateArcFromSweep(startX, startY, endX, endY, radius, largeArcFlag,
|
|
|
18100
18298
|
// lib/utils/easyeda-unit-to-mm.ts
|
|
18101
18299
|
var mil10ToMm = (value) => value * 10 * 0.0254;
|
|
18102
18300
|
|
|
18301
|
+
// lib/utils/expand-easyeda-path-data.ts
|
|
18302
|
+
var expandEasyEdaPathData = (pathData) => {
|
|
18303
|
+
const rawRoute = [];
|
|
18304
|
+
let currentPoint;
|
|
18305
|
+
for (const commandMatch of pathData.matchAll(/([MLAZ])([^MLAZ]*)/gi)) {
|
|
18306
|
+
const command = commandMatch[1]?.toUpperCase();
|
|
18307
|
+
const values = commandMatch[2]?.match(/[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g)?.map(Number) ?? [];
|
|
18308
|
+
if ((command === "M" || command === "L") && values.length >= 2) {
|
|
18309
|
+
currentPoint = { x: values[0], y: values[1] };
|
|
18310
|
+
rawRoute.push(currentPoint);
|
|
18311
|
+
} else if (command === "A" && currentPoint && values.length >= 7) {
|
|
18312
|
+
const [radiusX, , , largeArcFlag, sweepFlag, endX, endY] = values;
|
|
18313
|
+
const generatedArcRoute = generateArcFromSweep(
|
|
18314
|
+
currentPoint.x,
|
|
18315
|
+
currentPoint.y,
|
|
18316
|
+
endX,
|
|
18317
|
+
endY,
|
|
18318
|
+
radiusX,
|
|
18319
|
+
largeArcFlag === 1,
|
|
18320
|
+
sweepFlag === 1
|
|
18321
|
+
);
|
|
18322
|
+
const maxArcSegments = 16;
|
|
18323
|
+
const arcRoute = generatedArcRoute.length <= maxArcSegments + 1 ? generatedArcRoute : Array.from(
|
|
18324
|
+
{ length: maxArcSegments + 1 },
|
|
18325
|
+
(_, pointIndex) => generatedArcRoute.at(
|
|
18326
|
+
Math.round(
|
|
18327
|
+
pointIndex * (generatedArcRoute.length - 1) / maxArcSegments
|
|
18328
|
+
)
|
|
18329
|
+
)
|
|
18330
|
+
).filter((point4) => !!point4);
|
|
18331
|
+
rawRoute.push(...arcRoute.slice(1));
|
|
18332
|
+
currentPoint = { x: endX, y: endY };
|
|
18333
|
+
}
|
|
18334
|
+
}
|
|
18335
|
+
return rawRoute;
|
|
18336
|
+
};
|
|
18337
|
+
|
|
18103
18338
|
// node_modules/@tscircuit/math-utils/dist/chunk-EFLPMB4J.js
|
|
18104
18339
|
function orientation(p, q, r) {
|
|
18105
18340
|
const val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
|
|
@@ -18215,6 +18450,22 @@ var getBoardOutlinePolygons = (tracks) => {
|
|
|
18215
18450
|
return polygons;
|
|
18216
18451
|
};
|
|
18217
18452
|
|
|
18453
|
+
// lib/utils/get-easyeda-npth-slot-geometry.ts
|
|
18454
|
+
var getEasyEdaNpthSlotGeometry = (solidRegion) => {
|
|
18455
|
+
const rawRoute = expandEasyEdaPathData(solidRegion.pathData);
|
|
18456
|
+
if (rawRoute.length < 2) return null;
|
|
18457
|
+
const points = rawRoute.map((point4) => ({
|
|
18458
|
+
x: mil2mm(point4.x) * 10,
|
|
18459
|
+
y: mil2mm(point4.y) * 10
|
|
18460
|
+
}));
|
|
18461
|
+
const firstPoint = points[0];
|
|
18462
|
+
const lastPoint = points.at(-1);
|
|
18463
|
+
if (firstPoint.x !== lastPoint.x || firstPoint.y !== lastPoint.y) {
|
|
18464
|
+
points.push({ ...firstPoint });
|
|
18465
|
+
}
|
|
18466
|
+
return { points };
|
|
18467
|
+
};
|
|
18468
|
+
|
|
18218
18469
|
// lib/utils/normalize-pin-labels.ts
|
|
18219
18470
|
var normalizeActiveLowPinLabel = (label) => {
|
|
18220
18471
|
const hasActiveLowMarker = label.startsWith("#") || label.endsWith("#");
|
|
@@ -18803,40 +19054,7 @@ var handleFabricationNotePath = (track, index) => pcb_fabrication_note_path.pars
|
|
|
18803
19054
|
stroke_width: mil10ToMm(track.width)
|
|
18804
19055
|
});
|
|
18805
19056
|
var handleFabricationNoteSolidRegion = (solidRegion, index) => {
|
|
18806
|
-
const rawRoute =
|
|
18807
|
-
let currentPoint;
|
|
18808
|
-
for (const commandMatch of solidRegion.pathData.matchAll(
|
|
18809
|
-
/([MLAZ])([^MLAZ]*)/gi
|
|
18810
|
-
)) {
|
|
18811
|
-
const command = commandMatch[1]?.toUpperCase();
|
|
18812
|
-
const values = commandMatch[2]?.match(/[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g)?.map(Number) ?? [];
|
|
18813
|
-
if ((command === "M" || command === "L") && values.length >= 2) {
|
|
18814
|
-
currentPoint = { x: values[0], y: values[1] };
|
|
18815
|
-
rawRoute.push(currentPoint);
|
|
18816
|
-
} else if (command === "A" && currentPoint && values.length >= 7) {
|
|
18817
|
-
const [radiusX, , , largeArcFlag, sweepFlag, endX, endY] = values;
|
|
18818
|
-
const generatedArcRoute = generateArcFromSweep(
|
|
18819
|
-
currentPoint.x,
|
|
18820
|
-
currentPoint.y,
|
|
18821
|
-
endX,
|
|
18822
|
-
endY,
|
|
18823
|
-
radiusX,
|
|
18824
|
-
largeArcFlag === 1,
|
|
18825
|
-
sweepFlag === 1
|
|
18826
|
-
);
|
|
18827
|
-
const maxArcSegments = 16;
|
|
18828
|
-
const arcRoute = generatedArcRoute.length <= maxArcSegments + 1 ? generatedArcRoute : Array.from(
|
|
18829
|
-
{ length: maxArcSegments + 1 },
|
|
18830
|
-
(_, pointIndex) => generatedArcRoute.at(
|
|
18831
|
-
Math.round(
|
|
18832
|
-
pointIndex * (generatedArcRoute.length - 1) / maxArcSegments
|
|
18833
|
-
)
|
|
18834
|
-
)
|
|
18835
|
-
).filter((point4) => !!point4);
|
|
18836
|
-
rawRoute.push(...arcRoute.slice(1));
|
|
18837
|
-
currentPoint = { x: endX, y: endY };
|
|
18838
|
-
}
|
|
18839
|
-
}
|
|
19057
|
+
const rawRoute = expandEasyEdaPathData(solidRegion.pathData);
|
|
18840
19058
|
const route = rawRoute.map((point4) => ({
|
|
18841
19059
|
x: mil10ToMm(point4.x),
|
|
18842
19060
|
y: mil10ToMm(point4.y)
|
|
@@ -18853,9 +19071,10 @@ var handleFabricationNoteSolidRegion = (solidRegion, index) => {
|
|
|
18853
19071
|
pcb_component_id: "pcb_component_1",
|
|
18854
19072
|
layer: "top",
|
|
18855
19073
|
route,
|
|
18856
|
-
//
|
|
18857
|
-
|
|
18858
|
-
|
|
19074
|
+
// SOLIDREGION coordinates describe a filled boundary, not a stroke.
|
|
19075
|
+
is_filled: solidRegion.fillStyle !== "none",
|
|
19076
|
+
has_stroke: false,
|
|
19077
|
+
stroke_width: 0
|
|
18859
19078
|
});
|
|
18860
19079
|
};
|
|
18861
19080
|
var getSideFromLayer = (layer) => {
|
|
@@ -18967,9 +19186,11 @@ var handleCutout = (solidRegion, index) => {
|
|
|
18967
19186
|
});
|
|
18968
19187
|
};
|
|
18969
19188
|
var LEAD_SHAPE_LAYER = 100;
|
|
19189
|
+
var NPTH_FILL_STYLE = "npth";
|
|
18970
19190
|
var isPcbSolidRegionCutout = (shape) => {
|
|
18971
19191
|
return shape.fillStyle === "cutout" && shape.layermask !== LEAD_SHAPE_LAYER;
|
|
18972
19192
|
};
|
|
19193
|
+
var isPcbSolidRegionNpth = (shape) => shape.fillStyle === NPTH_FILL_STYLE && shape.layermask !== LEAD_SHAPE_LAYER;
|
|
18973
19194
|
var getCadPositionZMmFromMetadata = (easyEdaJson) => {
|
|
18974
19195
|
const svgNode = easyEdaJson.packageDetail.dataStr.shape.find(
|
|
18975
19196
|
(shape) => shape.type === "SVGNODE" && shape.svgData.attrs?.uuid
|
|
@@ -19165,6 +19386,20 @@ var convertEasyEdaJsonToCircuitJsonWithPinAttributes = (easyEdaJson, {
|
|
|
19165
19386
|
).forEach((sr, index) => {
|
|
19166
19387
|
circuitElements.push(handleCutout(sr, index));
|
|
19167
19388
|
});
|
|
19389
|
+
easyEdaJson.packageDetail.dataStr.shape.filter(
|
|
19390
|
+
(shape) => shape.type === "SOLIDREGION" && isPcbSolidRegionNpth(shape)
|
|
19391
|
+
).forEach((sr, index) => {
|
|
19392
|
+
const geometry = getEasyEdaNpthSlotGeometry(sr);
|
|
19393
|
+
if (!geometry) return;
|
|
19394
|
+
circuitElements.push(
|
|
19395
|
+
pcb_cutout.parse({
|
|
19396
|
+
type: "pcb_cutout",
|
|
19397
|
+
pcb_cutout_id: `pcb_cutout_npth_${index + 1}`,
|
|
19398
|
+
shape: "polygon",
|
|
19399
|
+
points: geometry.points
|
|
19400
|
+
})
|
|
19401
|
+
);
|
|
19402
|
+
});
|
|
19168
19403
|
const boardOutlineTracks = easyEdaJson.packageDetail.dataStr.shape.filter(
|
|
19169
19404
|
(shape) => shape.type === "TRACK" && shape.layer === 10
|
|
19170
19405
|
);
|
|
@@ -20908,8 +21143,10 @@ var generateFootprintTsx = (circuitJson, options = {}) => {
|
|
|
20908
21143
|
);
|
|
20909
21144
|
}
|
|
20910
21145
|
for (const fabricationNotePath of fabricationNotePaths) {
|
|
21146
|
+
const filledAttr = fabricationNotePath.is_filled ? " isFilled" : "";
|
|
21147
|
+
const strokeAttr = fabricationNotePath.has_stroke === false ? " hasStroke={false}" : "";
|
|
20911
21148
|
elementStrings.push(
|
|
20912
|
-
`<fabricationnotepath route={${JSON.stringify(fabricationNotePath.route)}} strokeWidth="${mmStr(fabricationNotePath.stroke_width)}"${getStringAttr("color", fabricationNotePath.color)}${getLayerAttr(fabricationNotePath.layer)} />`
|
|
21149
|
+
`<fabricationnotepath route={${JSON.stringify(fabricationNotePath.route)}} strokeWidth="${mmStr(fabricationNotePath.stroke_width)}"${filledAttr}${strokeAttr}${getStringAttr("color", fabricationNotePath.color)}${getLayerAttr(fabricationNotePath.layer)} />`
|
|
20913
21150
|
);
|
|
20914
21151
|
}
|
|
20915
21152
|
for (const fabricationNoteText of fabricationNoteTexts) {
|