Skip to content

Commit

Permalink
fix: Merge pull request #7 from imrishabh18/feat--support-for-oval
Browse files Browse the repository at this point in the history
support for oval type added
  • Loading branch information
seveibar authored Jun 29, 2024
2 parents 8ca960f + d54947c commit 029dcab
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/any_soup_element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const any_soup_element = z.union([
pcb.pcb_silkscreen_text,
pcb.pcb_silkscreen_rect,
pcb.pcb_silkscreen_circle,
pcb.pcb_silkscreen_oval,
pcb.pcb_trace_error,
pcb.pcb_placement_error,
pcb.pcb_port_not_matched_error,
Expand Down
1 change: 1 addition & 0 deletions src/pcb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ export * from "./pcb_silkscreen_path"
export * from "./pcb_silkscreen_text"
export * from "./pcb_silkscreen_rect"
export * from "./pcb_silkscreen_circle"
export * from "./pcb_silkscreen_oval"
export * from "./pcb_fabrication_note_text"
export * from "./pcb_fabrication_note_path"
19 changes: 19 additions & 0 deletions src/pcb/pcb_silkscreen_oval.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { z } from "zod"
import { distance } from "../units"
import { layer_ref, visible_layer } from "./properties/layer_ref"
import { point } from "src/common/point"

export const pcb_silkscreen_oval = z
.object({
type: z.literal("pcb_silkscreen_oval"),
pcb_silkscreen_oval_id: z.string(),
pcb_component_id: z.string(),
center: point,
radius_x: distance,
radius_y: distance,
layer: visible_layer,
})
.describe("Defines a silkscreen oval on the PCB");

export type PcbSilkscreenOval = z.infer<typeof pcb_silkscreen_oval>
export type PcbSilkscreenOvalInput = z.input<typeof pcb_silkscreen_oval>

0 comments on commit 029dcab

Please sign in to comment.