From d7ceb3454a5cead46c1b295f2028bc96d2026b11 Mon Sep 17 00:00:00 2001 From: seveibar Date: Thu, 6 Jun 2024 20:55:06 -0700 Subject: [PATCH] add fabrication notes to soup --- src/pcb/fabrication_note_path.ts | 18 ++++++++++++++++++ src/pcb/fabrication_note_text.ts | 21 +++++++++++++++++++++ src/pcb/index.ts | 2 ++ 3 files changed, 41 insertions(+) create mode 100644 src/pcb/fabrication_note_path.ts create mode 100644 src/pcb/fabrication_note_text.ts diff --git a/src/pcb/fabrication_note_path.ts b/src/pcb/fabrication_note_path.ts new file mode 100644 index 0000000..3ce6481 --- /dev/null +++ b/src/pcb/fabrication_note_path.ts @@ -0,0 +1,18 @@ +import { z } from "zod" +import { visible_layer } from "./properties/layer_ref" +import { point } from "src/common" + +export const fabrication_note_path = z + .object({ + type: z.literal("fabrication_note_path"), + pcb_silkscreen_path_id: z.string(), + pcb_component_id: z.string(), + layer: visible_layer, + route: z.array(point), + }) + .describe( + "Defines a fabrication path on the PCB for fabricators or assemblers" + ) + +export type FabricationNotePath = z.infer +export type FabricationNotePathInput = z.input diff --git a/src/pcb/fabrication_note_text.ts b/src/pcb/fabrication_note_text.ts new file mode 100644 index 0000000..1e59d00 --- /dev/null +++ b/src/pcb/fabrication_note_text.ts @@ -0,0 +1,21 @@ +import { z } from "zod" +import { visible_layer } from "./properties/layer_ref" +import { point } from "src/common" +import { distance } from "src/units" + +export const fabrication_note_text = z + .object({ + type: z.literal("fabrication_note_text"), + font: z.literal("tscircuit2024").default("tscircuit2024"), + font_size: distance.default("1mm"), + pcb_component_id: z.string(), + text: z.string(), + layer: visible_layer, + center: point, + }) + .describe( + "Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators" + ) + +export type FabricationNoteText = z.infer +export type FabricationNoteTextInput = z.input diff --git a/src/pcb/index.ts b/src/pcb/index.ts index 8e5fea4..a6385a3 100644 --- a/src/pcb/index.ts +++ b/src/pcb/index.ts @@ -21,3 +21,5 @@ export * from "./pcb_silkscreen_path" export * from "./pcb_silkscreen_text" export * from "./pcb_silkscreen_rect" export * from "./pcb_silkscreen_circle" +export * from "./fabrication_note_text" +export * from "./fabrication_note_path"