Skip to content

Commit

Permalink
add fabrication notes to soup
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Jun 7, 2024
1 parent e29d9db commit d7ceb34
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/pcb/fabrication_note_path.ts
Original file line number Diff line number Diff line change
@@ -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<typeof fabrication_note_path>
export type FabricationNotePathInput = z.input<typeof fabrication_note_path>
21 changes: 21 additions & 0 deletions src/pcb/fabrication_note_text.ts
Original file line number Diff line number Diff line change
@@ -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<typeof fabrication_note_text>
export type FabricationNoteTextInput = z.input<typeof fabrication_note_text>
2 changes: 2 additions & 0 deletions src/pcb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit d7ceb34

Please sign in to comment.