circuit-json 0.0.240 → 0.0.241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/index.d.mts +817 -79
- package/dist/index.mjs +74 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2024,31 +2024,67 @@ var pcb_thermal_spoke = z96.object({
|
|
|
2024
2024
|
}).describe("Pattern for connecting a ground plane to a plated hole");
|
|
2025
2025
|
expectTypesMatch(true);
|
|
2026
2026
|
|
|
2027
|
-
// src/
|
|
2027
|
+
// src/pcb/pcb_copper_pour.ts
|
|
2028
2028
|
import { z as z97 } from "zod";
|
|
2029
|
-
var
|
|
2030
|
-
type: z97.literal("
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2029
|
+
var pcb_copper_pour_base = z97.object({
|
|
2030
|
+
type: z97.literal("pcb_copper_pour"),
|
|
2031
|
+
pcb_copper_pour_id: getZodPrefixedIdWithDefault("pcb_copper_pour"),
|
|
2032
|
+
pcb_group_id: z97.string().optional(),
|
|
2033
|
+
subcircuit_id: z97.string().optional(),
|
|
2034
|
+
layer: layer_ref,
|
|
2035
|
+
source_net_id: z97.string().optional()
|
|
2036
|
+
});
|
|
2037
|
+
var pcb_copper_pour_rect = pcb_copper_pour_base.extend({
|
|
2038
|
+
shape: z97.literal("rect"),
|
|
2039
|
+
center: point,
|
|
2040
|
+
width: length,
|
|
2041
|
+
height: length,
|
|
2042
|
+
rotation: rotation.optional()
|
|
2043
|
+
});
|
|
2044
|
+
expectTypesMatch(true);
|
|
2045
|
+
var pcb_copper_pour_circle = pcb_copper_pour_base.extend({
|
|
2046
|
+
shape: z97.literal("circle"),
|
|
2047
|
+
center: point,
|
|
2048
|
+
radius: length
|
|
2049
|
+
});
|
|
2050
|
+
expectTypesMatch(true);
|
|
2051
|
+
var pcb_copper_pour_polygon = pcb_copper_pour_base.extend({
|
|
2052
|
+
shape: z97.literal("polygon"),
|
|
2053
|
+
points: z97.array(point)
|
|
2054
|
+
});
|
|
2055
|
+
expectTypesMatch(true);
|
|
2056
|
+
var pcb_copper_pour = z97.discriminatedUnion("shape", [
|
|
2057
|
+
pcb_copper_pour_rect,
|
|
2058
|
+
pcb_copper_pour_circle,
|
|
2059
|
+
pcb_copper_pour_polygon
|
|
2060
|
+
]).describe("Defines a copper pour on the PCB.");
|
|
2061
|
+
expectTypesMatch(true);
|
|
2062
|
+
|
|
2063
|
+
// src/cad/cad_component.ts
|
|
2064
|
+
import { z as z98 } from "zod";
|
|
2065
|
+
var cad_component = z98.object({
|
|
2066
|
+
type: z98.literal("cad_component"),
|
|
2067
|
+
cad_component_id: z98.string(),
|
|
2068
|
+
pcb_component_id: z98.string(),
|
|
2069
|
+
source_component_id: z98.string(),
|
|
2034
2070
|
position: point3,
|
|
2035
2071
|
rotation: point3.optional(),
|
|
2036
2072
|
size: point3.optional(),
|
|
2037
2073
|
layer: layer_ref.optional(),
|
|
2038
|
-
subcircuit_id:
|
|
2074
|
+
subcircuit_id: z98.string().optional(),
|
|
2039
2075
|
// These are all ways to generate/load the 3d model
|
|
2040
|
-
footprinter_string:
|
|
2041
|
-
model_obj_url:
|
|
2042
|
-
model_stl_url:
|
|
2043
|
-
model_3mf_url:
|
|
2044
|
-
model_jscad:
|
|
2076
|
+
footprinter_string: z98.string().optional(),
|
|
2077
|
+
model_obj_url: z98.string().optional(),
|
|
2078
|
+
model_stl_url: z98.string().optional(),
|
|
2079
|
+
model_3mf_url: z98.string().optional(),
|
|
2080
|
+
model_jscad: z98.any().optional()
|
|
2045
2081
|
}).describe("Defines a component on the PCB");
|
|
2046
2082
|
expectTypesMatch(true);
|
|
2047
2083
|
|
|
2048
2084
|
// src/simulation/simulation_voltage_source.ts
|
|
2049
|
-
import { z as
|
|
2050
|
-
var wave_shape =
|
|
2051
|
-
var percentage =
|
|
2085
|
+
import { z as z99 } from "zod";
|
|
2086
|
+
var wave_shape = z99.enum(["sinewave", "square", "triangle", "sawtooth"]);
|
|
2087
|
+
var percentage = z99.union([z99.string(), z99.number()]).transform((val) => {
|
|
2052
2088
|
if (typeof val === "string") {
|
|
2053
2089
|
if (val.endsWith("%")) {
|
|
2054
2090
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2057,30 +2093,30 @@ var percentage = z98.union([z98.string(), z98.number()]).transform((val) => {
|
|
|
2057
2093
|
}
|
|
2058
2094
|
return val;
|
|
2059
2095
|
}).pipe(
|
|
2060
|
-
|
|
2096
|
+
z99.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2061
2097
|
);
|
|
2062
|
-
var simulation_dc_voltage_source =
|
|
2063
|
-
type:
|
|
2098
|
+
var simulation_dc_voltage_source = z99.object({
|
|
2099
|
+
type: z99.literal("simulation_voltage_source"),
|
|
2064
2100
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
2065
2101
|
"simulation_voltage_source"
|
|
2066
2102
|
),
|
|
2067
|
-
is_dc_source:
|
|
2068
|
-
positive_source_port_id:
|
|
2069
|
-
negative_source_port_id:
|
|
2070
|
-
positive_source_net_id:
|
|
2071
|
-
negative_source_net_id:
|
|
2103
|
+
is_dc_source: z99.literal(true).optional().default(true),
|
|
2104
|
+
positive_source_port_id: z99.string().optional(),
|
|
2105
|
+
negative_source_port_id: z99.string().optional(),
|
|
2106
|
+
positive_source_net_id: z99.string().optional(),
|
|
2107
|
+
negative_source_net_id: z99.string().optional(),
|
|
2072
2108
|
voltage
|
|
2073
2109
|
}).describe("Defines a DC voltage source for simulation");
|
|
2074
|
-
var simulation_ac_voltage_source =
|
|
2075
|
-
type:
|
|
2110
|
+
var simulation_ac_voltage_source = z99.object({
|
|
2111
|
+
type: z99.literal("simulation_voltage_source"),
|
|
2076
2112
|
simulation_voltage_source_id: getZodPrefixedIdWithDefault(
|
|
2077
2113
|
"simulation_voltage_source"
|
|
2078
2114
|
),
|
|
2079
|
-
is_dc_source:
|
|
2080
|
-
terminal1_source_port_id:
|
|
2081
|
-
terminal2_source_port_id:
|
|
2082
|
-
terminal1_source_net_id:
|
|
2083
|
-
terminal2_source_net_id:
|
|
2115
|
+
is_dc_source: z99.literal(false),
|
|
2116
|
+
terminal1_source_port_id: z99.string().optional(),
|
|
2117
|
+
terminal2_source_port_id: z99.string().optional(),
|
|
2118
|
+
terminal1_source_net_id: z99.string().optional(),
|
|
2119
|
+
terminal2_source_net_id: z99.string().optional(),
|
|
2084
2120
|
voltage: voltage.optional(),
|
|
2085
2121
|
frequency: frequency.optional(),
|
|
2086
2122
|
peak_to_peak_voltage: voltage.optional(),
|
|
@@ -2088,14 +2124,14 @@ var simulation_ac_voltage_source = z98.object({
|
|
|
2088
2124
|
phase: rotation.optional(),
|
|
2089
2125
|
duty_cycle: percentage.optional()
|
|
2090
2126
|
}).describe("Defines an AC voltage source for simulation");
|
|
2091
|
-
var simulation_voltage_source =
|
|
2127
|
+
var simulation_voltage_source = z99.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
|
|
2092
2128
|
expectTypesMatch(true);
|
|
2093
2129
|
expectTypesMatch(true);
|
|
2094
2130
|
expectTypesMatch(true);
|
|
2095
2131
|
|
|
2096
2132
|
// src/any_circuit_element.ts
|
|
2097
|
-
import { z as
|
|
2098
|
-
var any_circuit_element =
|
|
2133
|
+
import { z as z100 } from "zod";
|
|
2134
|
+
var any_circuit_element = z100.union([
|
|
2099
2135
|
source_trace,
|
|
2100
2136
|
source_port,
|
|
2101
2137
|
any_source_component,
|
|
@@ -2158,6 +2194,7 @@ var any_circuit_element = z99.union([
|
|
|
2158
2194
|
pcb_ground_plane,
|
|
2159
2195
|
pcb_ground_plane_region,
|
|
2160
2196
|
pcb_thermal_spoke,
|
|
2197
|
+
pcb_copper_pour,
|
|
2161
2198
|
schematic_box,
|
|
2162
2199
|
schematic_text,
|
|
2163
2200
|
schematic_line,
|
|
@@ -2201,6 +2238,10 @@ export {
|
|
|
2201
2238
|
pcb_board,
|
|
2202
2239
|
pcb_breakout_point,
|
|
2203
2240
|
pcb_component,
|
|
2241
|
+
pcb_copper_pour,
|
|
2242
|
+
pcb_copper_pour_circle,
|
|
2243
|
+
pcb_copper_pour_polygon,
|
|
2244
|
+
pcb_copper_pour_rect,
|
|
2204
2245
|
pcb_cutout,
|
|
2205
2246
|
pcb_cutout_circle,
|
|
2206
2247
|
pcb_cutout_polygon,
|