circuit-json 0.0.531 → 0.0.532
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 +467 -289
- package/dist/index.d.mts +691 -3
- package/dist/index.mjs +144 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/index.mjs
CHANGED
|
@@ -5787,8 +5787,143 @@ var simulation_pcb_return_current_marker = z238.discriminatedUnion("target_type"
|
|
|
5787
5787
|
expectTypesMatch(true);
|
|
5788
5788
|
|
|
5789
5789
|
// src/any_circuit_element.ts
|
|
5790
|
+
import { z as z243 } from "zod";
|
|
5791
|
+
|
|
5792
|
+
// src/drawing/drawing_page.ts
|
|
5793
|
+
import { z as z240 } from "zod";
|
|
5794
|
+
|
|
5795
|
+
// src/drawing/drawing_page_size.ts
|
|
5790
5796
|
import { z as z239 } from "zod";
|
|
5791
|
-
var
|
|
5797
|
+
var drawingPageSizes = {
|
|
5798
|
+
iso_a0: [1189, 841],
|
|
5799
|
+
iso_a1: [841, 594],
|
|
5800
|
+
iso_a2: [594, 420],
|
|
5801
|
+
iso_a3: [420, 297],
|
|
5802
|
+
iso_a4: [297, 210],
|
|
5803
|
+
ansi_a: [279.4, 215.9],
|
|
5804
|
+
ansi_b: [431.8, 279.4],
|
|
5805
|
+
ansi_c: [558.8, 431.8],
|
|
5806
|
+
ansi_d: [863.6, 558.8],
|
|
5807
|
+
ansi_e: [1117.6, 863.6]
|
|
5808
|
+
};
|
|
5809
|
+
var drawing_page_size = z239.enum([
|
|
5810
|
+
"iso_a0",
|
|
5811
|
+
"iso_a1",
|
|
5812
|
+
"iso_a2",
|
|
5813
|
+
"iso_a3",
|
|
5814
|
+
"iso_a4",
|
|
5815
|
+
"ansi_a",
|
|
5816
|
+
"ansi_b",
|
|
5817
|
+
"ansi_c",
|
|
5818
|
+
"ansi_d",
|
|
5819
|
+
"ansi_e"
|
|
5820
|
+
]);
|
|
5821
|
+
function getDrawingPageDimensions(size2, orientation = "landscape") {
|
|
5822
|
+
const [width, height] = drawingPageSizes[size2];
|
|
5823
|
+
return orientation === "portrait" ? { width: height, height: width } : { width, height };
|
|
5824
|
+
}
|
|
5825
|
+
|
|
5826
|
+
// src/drawing/drawing_page.ts
|
|
5827
|
+
var drawing_page = z240.object({
|
|
5828
|
+
type: z240.literal("drawing_page"),
|
|
5829
|
+
drawing_page_id: z240.string().min(1),
|
|
5830
|
+
name: z240.string().optional(),
|
|
5831
|
+
display_name: z240.string().optional(),
|
|
5832
|
+
page_size: drawing_page_size.optional(),
|
|
5833
|
+
orientation: z240.enum(["landscape", "portrait"]).optional(),
|
|
5834
|
+
width: z240.number().finite().positive(),
|
|
5835
|
+
height: z240.number().finite().positive()
|
|
5836
|
+
}).superRefine((page, ctx) => {
|
|
5837
|
+
if (!page.page_size) {
|
|
5838
|
+
if (page.orientation)
|
|
5839
|
+
ctx.addIssue({
|
|
5840
|
+
code: "custom",
|
|
5841
|
+
path: ["orientation"],
|
|
5842
|
+
message: "Orientation requires page_size; custom pages use explicit dimensions"
|
|
5843
|
+
});
|
|
5844
|
+
return;
|
|
5845
|
+
}
|
|
5846
|
+
const expected = getDrawingPageDimensions(page.page_size, page.orientation);
|
|
5847
|
+
if (Math.abs(page.width - expected.width) > 1e-6 || Math.abs(page.height - expected.height) > 1e-6)
|
|
5848
|
+
ctx.addIssue({
|
|
5849
|
+
code: "custom",
|
|
5850
|
+
path: ["page_size"],
|
|
5851
|
+
message: "Dimensions must match the named sheet size and orientation"
|
|
5852
|
+
});
|
|
5853
|
+
}).describe(
|
|
5854
|
+
"A paper-space drawing page containing configured part views. Dimensions are mm."
|
|
5855
|
+
);
|
|
5856
|
+
expectTypesMatch(true);
|
|
5857
|
+
|
|
5858
|
+
// src/drawing/drawing_part_view.ts
|
|
5859
|
+
import { z as z241 } from "zod";
|
|
5860
|
+
var drawing_part_view_direction = z241.enum([
|
|
5861
|
+
"x_positive",
|
|
5862
|
+
"x_negative",
|
|
5863
|
+
"y_positive",
|
|
5864
|
+
"y_negative",
|
|
5865
|
+
"z_positive",
|
|
5866
|
+
"z_negative",
|
|
5867
|
+
"isometric"
|
|
5868
|
+
]);
|
|
5869
|
+
var drawing_section_plane = z241.object({
|
|
5870
|
+
axis: z241.enum(["x", "y", "z"]),
|
|
5871
|
+
offset: z241.number().finite(),
|
|
5872
|
+
keep_side: z241.enum(["less", "greater"]),
|
|
5873
|
+
hatch_spacing: z241.number().finite().positive().optional()
|
|
5874
|
+
});
|
|
5875
|
+
var drawing_part_view = z241.object({
|
|
5876
|
+
type: z241.literal("drawing_part_view"),
|
|
5877
|
+
drawing_part_view_id: z241.string().min(1),
|
|
5878
|
+
drawing_page_id: z241.string().min(1),
|
|
5879
|
+
source_group_id: z241.string().min(1).optional(),
|
|
5880
|
+
source_component_ids: z241.array(z241.string().min(1)).optional(),
|
|
5881
|
+
name: z241.string().optional(),
|
|
5882
|
+
display_name: z241.string().optional(),
|
|
5883
|
+
direction: drawing_part_view_direction,
|
|
5884
|
+
center: z241.object({ x: z241.number().finite(), y: z241.number().finite() }),
|
|
5885
|
+
width: z241.number().finite().positive(),
|
|
5886
|
+
height: z241.number().finite().positive(),
|
|
5887
|
+
scale: z241.number().finite().positive().optional(),
|
|
5888
|
+
show_hidden_edges: z241.boolean().optional(),
|
|
5889
|
+
section: drawing_section_plane.optional()
|
|
5890
|
+
}).describe(
|
|
5891
|
+
"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."
|
|
5892
|
+
);
|
|
5893
|
+
expectTypesMatch(
|
|
5894
|
+
true
|
|
5895
|
+
);
|
|
5896
|
+
expectTypesMatch(true);
|
|
5897
|
+
|
|
5898
|
+
// src/drawing/drawing_page_title_block.ts
|
|
5899
|
+
import { z as z242 } from "zod";
|
|
5900
|
+
var drawing_page_title_block = z242.object({
|
|
5901
|
+
type: z242.literal("drawing_page_title_block"),
|
|
5902
|
+
drawing_page_title_block_id: z242.string().min(1),
|
|
5903
|
+
drawing_page_id: z242.string().min(1),
|
|
5904
|
+
title: z242.string().min(1),
|
|
5905
|
+
legal_owner: z242.string().optional(),
|
|
5906
|
+
identification_number: z242.string().optional(),
|
|
5907
|
+
revision_index: z242.string().optional(),
|
|
5908
|
+
date_of_issue: z242.string().optional(),
|
|
5909
|
+
creator: z242.string().optional(),
|
|
5910
|
+
approval_person: z242.string().optional(),
|
|
5911
|
+
sheet_number: z242.number().int().positive().optional(),
|
|
5912
|
+
number_of_sheets: z242.number().int().positive().optional()
|
|
5913
|
+
}).refine(
|
|
5914
|
+
(block) => block.sheet_number == null || block.number_of_sheets == null || block.sheet_number <= block.number_of_sheets,
|
|
5915
|
+
{
|
|
5916
|
+
message: "sheet_number must not exceed number_of_sheets",
|
|
5917
|
+
path: ["sheet_number"]
|
|
5918
|
+
}
|
|
5919
|
+
);
|
|
5920
|
+
expectTypesMatch(true);
|
|
5921
|
+
|
|
5922
|
+
// src/any_circuit_element.ts
|
|
5923
|
+
var any_circuit_element = z243.union([
|
|
5924
|
+
drawing_page,
|
|
5925
|
+
drawing_page_title_block,
|
|
5926
|
+
drawing_part_view,
|
|
5792
5927
|
source_runtime_error,
|
|
5793
5928
|
source_datasheet,
|
|
5794
5929
|
source_trace,
|
|
@@ -6005,10 +6140,18 @@ export {
|
|
|
6005
6140
|
circuit_json_footprint_load_error,
|
|
6006
6141
|
current,
|
|
6007
6142
|
distance,
|
|
6143
|
+
drawingPageSizes,
|
|
6144
|
+
drawing_page,
|
|
6145
|
+
drawing_page_size,
|
|
6146
|
+
drawing_page_title_block,
|
|
6147
|
+
drawing_part_view,
|
|
6148
|
+
drawing_part_view_direction,
|
|
6149
|
+
drawing_section_plane,
|
|
6008
6150
|
duration_ms,
|
|
6009
6151
|
experiment_type,
|
|
6010
6152
|
external_footprint_load_error,
|
|
6011
6153
|
frequency,
|
|
6154
|
+
getDrawingPageDimensions,
|
|
6012
6155
|
getRotationBetweenPcbPin1Locations,
|
|
6013
6156
|
getSimulationReturnCurrentGridJsonSchema,
|
|
6014
6157
|
getZodPrefixedIdWithDefault,
|