circuit-json 0.0.240 → 0.0.242

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/index.mjs CHANGED
@@ -2024,31 +2024,68 @@ 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/cad/cad_component.ts
2027
+ // src/pcb/pcb_copper_pour.ts
2028
2028
  import { z as z97 } from "zod";
2029
- var cad_component = z97.object({
2030
- type: z97.literal("cad_component"),
2031
- cad_component_id: z97.string(),
2032
- pcb_component_id: z97.string(),
2033
- source_component_id: z97.string(),
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: z97.string().optional(),
2074
+ subcircuit_id: z98.string().optional(),
2039
2075
  // These are all ways to generate/load the 3d model
2040
- footprinter_string: z97.string().optional(),
2041
- model_obj_url: z97.string().optional(),
2042
- model_stl_url: z97.string().optional(),
2043
- model_3mf_url: z97.string().optional(),
2044
- model_jscad: z97.any().optional()
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_gltf_url: z98.string().optional(),
2081
+ model_jscad: z98.any().optional()
2045
2082
  }).describe("Defines a component on the PCB");
2046
2083
  expectTypesMatch(true);
2047
2084
 
2048
2085
  // src/simulation/simulation_voltage_source.ts
2049
- import { z as z98 } from "zod";
2050
- var wave_shape = z98.enum(["sinewave", "square", "triangle", "sawtooth"]);
2051
- var percentage = z98.union([z98.string(), z98.number()]).transform((val) => {
2086
+ import { z as z99 } from "zod";
2087
+ var wave_shape = z99.enum(["sinewave", "square", "triangle", "sawtooth"]);
2088
+ var percentage = z99.union([z99.string(), z99.number()]).transform((val) => {
2052
2089
  if (typeof val === "string") {
2053
2090
  if (val.endsWith("%")) {
2054
2091
  return parseFloat(val.slice(0, -1)) / 100;
@@ -2057,30 +2094,30 @@ var percentage = z98.union([z98.string(), z98.number()]).transform((val) => {
2057
2094
  }
2058
2095
  return val;
2059
2096
  }).pipe(
2060
- z98.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
2097
+ z99.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
2061
2098
  );
2062
- var simulation_dc_voltage_source = z98.object({
2063
- type: z98.literal("simulation_voltage_source"),
2099
+ var simulation_dc_voltage_source = z99.object({
2100
+ type: z99.literal("simulation_voltage_source"),
2064
2101
  simulation_voltage_source_id: getZodPrefixedIdWithDefault(
2065
2102
  "simulation_voltage_source"
2066
2103
  ),
2067
- is_dc_source: z98.literal(true).optional().default(true),
2068
- positive_source_port_id: z98.string().optional(),
2069
- negative_source_port_id: z98.string().optional(),
2070
- positive_source_net_id: z98.string().optional(),
2071
- negative_source_net_id: z98.string().optional(),
2104
+ is_dc_source: z99.literal(true).optional().default(true),
2105
+ positive_source_port_id: z99.string().optional(),
2106
+ negative_source_port_id: z99.string().optional(),
2107
+ positive_source_net_id: z99.string().optional(),
2108
+ negative_source_net_id: z99.string().optional(),
2072
2109
  voltage
2073
2110
  }).describe("Defines a DC voltage source for simulation");
2074
- var simulation_ac_voltage_source = z98.object({
2075
- type: z98.literal("simulation_voltage_source"),
2111
+ var simulation_ac_voltage_source = z99.object({
2112
+ type: z99.literal("simulation_voltage_source"),
2076
2113
  simulation_voltage_source_id: getZodPrefixedIdWithDefault(
2077
2114
  "simulation_voltage_source"
2078
2115
  ),
2079
- is_dc_source: z98.literal(false),
2080
- terminal1_source_port_id: z98.string().optional(),
2081
- terminal2_source_port_id: z98.string().optional(),
2082
- terminal1_source_net_id: z98.string().optional(),
2083
- terminal2_source_net_id: z98.string().optional(),
2116
+ is_dc_source: z99.literal(false),
2117
+ terminal1_source_port_id: z99.string().optional(),
2118
+ terminal2_source_port_id: z99.string().optional(),
2119
+ terminal1_source_net_id: z99.string().optional(),
2120
+ terminal2_source_net_id: z99.string().optional(),
2084
2121
  voltage: voltage.optional(),
2085
2122
  frequency: frequency.optional(),
2086
2123
  peak_to_peak_voltage: voltage.optional(),
@@ -2088,14 +2125,14 @@ var simulation_ac_voltage_source = z98.object({
2088
2125
  phase: rotation.optional(),
2089
2126
  duty_cycle: percentage.optional()
2090
2127
  }).describe("Defines an AC voltage source for simulation");
2091
- var simulation_voltage_source = z98.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
2128
+ var simulation_voltage_source = z99.union([simulation_dc_voltage_source, simulation_ac_voltage_source]).describe("Defines a voltage source for simulation");
2092
2129
  expectTypesMatch(true);
2093
2130
  expectTypesMatch(true);
2094
2131
  expectTypesMatch(true);
2095
2132
 
2096
2133
  // src/any_circuit_element.ts
2097
- import { z as z99 } from "zod";
2098
- var any_circuit_element = z99.union([
2134
+ import { z as z100 } from "zod";
2135
+ var any_circuit_element = z100.union([
2099
2136
  source_trace,
2100
2137
  source_port,
2101
2138
  any_source_component,
@@ -2158,6 +2195,7 @@ var any_circuit_element = z99.union([
2158
2195
  pcb_ground_plane,
2159
2196
  pcb_ground_plane_region,
2160
2197
  pcb_thermal_spoke,
2198
+ pcb_copper_pour,
2161
2199
  schematic_box,
2162
2200
  schematic_text,
2163
2201
  schematic_line,
@@ -2201,6 +2239,10 @@ export {
2201
2239
  pcb_board,
2202
2240
  pcb_breakout_point,
2203
2241
  pcb_component,
2242
+ pcb_copper_pour,
2243
+ pcb_copper_pour_circle,
2244
+ pcb_copper_pour_polygon,
2245
+ pcb_copper_pour_rect,
2204
2246
  pcb_cutout,
2205
2247
  pcb_cutout_circle,
2206
2248
  pcb_cutout_polygon,