Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/fn/sod110.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -51,10 +55,29 @@ export const sod110 = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.p)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sodWithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
25 changes: 24 additions & 1 deletion src/fn/sod128.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -54,10 +58,29 @@ export const sod128 = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.p)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sodWithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
25 changes: 24 additions & 1 deletion src/fn/sod323.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -53,10 +57,29 @@ export const sod323 = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.p)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sodWithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
25 changes: 24 additions & 1 deletion src/fn/sod323f.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -54,10 +58,29 @@ export const sod323f = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.pad_spacing)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sodWithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
25 changes: 24 additions & 1 deletion src/fn/sod323fl.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -54,10 +58,29 @@ export const sod323fl = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.pad_spacing)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sodWithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
25 changes: 24 additions & 1 deletion src/fn/sod323w.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -54,10 +58,29 @@ export const sod323w = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.pad_spacing)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sodWithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
25 changes: 24 additions & 1 deletion src/fn/sod523.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -54,10 +58,29 @@ export const sod523 = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.p)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sodWithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
25 changes: 24 additions & 1 deletion src/fn/sod723.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -53,10 +57,29 @@ export const sod723 = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.p)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sodWithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
25 changes: 24 additions & 1 deletion src/fn/sod80.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -53,10 +57,29 @@ export const sod80 = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.p)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sod80WithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
25 changes: 24 additions & 1 deletion src/fn/sod882.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AnySoupElement, PcbSilkscreenPath } from "circuit-json"
import type {
AnySoupElement,
PcbCourtyardRect,
PcbSilkscreenPath,
} from "circuit-json"
import { z } from "zod"
import { rectpad } from "../helpers/rectpad"
import { silkscreenRef, type SilkscreenRef } from "src/helpers/silkscreenRef"
Expand Down Expand Up @@ -54,10 +58,29 @@ export const sod882 = (
pcb_silkscreen_path_id: "",
}

const h = length.parse(parameters.h)
const pl = length.parse(parameters.pl)
const p = length.parse(parameters.p)
const courtyardPadding = 0.25
const crtMinX = -(p / 2 + pl / 2) - courtyardPadding
const crtMaxX = p / 2 + pl / 2 + courtyardPadding
const crtMinY = -h / 2 - courtyardPadding
const crtMaxY = h / 2 + courtyardPadding
const courtyard: PcbCourtyardRect = {
type: "pcb_courtyard_rect",
pcb_courtyard_rect_id: "",
pcb_component_id: "",
center: { x: (crtMinX + crtMaxX) / 2, y: (crtMinY + crtMaxY) / 2 },
width: crtMaxX - crtMinX,
height: crtMaxY - crtMinY,
layer: "top",
}

return {
circuitJson: sodWithoutParsing(parameters).concat(
silkscreenLine as AnySoupElement,
silkscreenRefText as AnySoupElement,
courtyard as AnySoupElement,
),
parameters,
}
Expand Down
Loading
Loading