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
6 changes: 6 additions & 0 deletions generated/COMPONENT_TYPES.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface CadModelBase {
pcbRotationOffset?: number
zOffsetFromSurface?: Distance
showAsTranslucentModel?: boolean
stepUrl?: string
}
export const cadModelBase = z.object({
rotationOffset: z.number().or(rotationPoint3).optional(),
Expand All @@ -49,6 +50,7 @@ export const cadModelBase = z.object({
pcbRotationOffset: z.number().optional(),
zOffsetFromSurface: distance.optional(),
showAsTranslucentModel: z.boolean().optional(),
stepUrl: url.optional(),
})
export interface CadModelStl extends CadModelBase {
stlUrl: string
Expand Down Expand Up @@ -1325,6 +1327,7 @@ export const courtyardCircleProps = pcbLayoutProps
.omit({ pcbRotation: true })
.extend({
radius: distance,
anchorAlignment: ninePointAnchor.optional(),
})
```

Expand All @@ -1349,6 +1352,7 @@ export const courtyardOutlineProps = pcbLayoutProps
isClosed: z.boolean().optional(),
isStrokeDashed: z.boolean().optional(),
color: z.string().optional(),
anchorAlignment: ninePointAnchor.optional(),
})
```

Expand All @@ -1361,6 +1365,7 @@ export const courtyardPillProps = pcbLayoutProps
width: distance,
height: distance,
radius: distance,
anchorAlignment: ninePointAnchor.optional(),
})
```

Expand All @@ -1377,6 +1382,7 @@ export const courtyardRectProps = pcbLayoutProps
hasStroke: z.boolean().optional(),
isStrokeDashed: z.boolean().optional(),
color: z.string().optional(),
anchorAlignment: ninePointAnchor.optional(),
})
```

Expand Down
1 change: 1 addition & 0 deletions generated/PROPS_OVERVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ export interface CadModelBase {
pcbRotationOffset?: number
zOffsetFromSurface?: Distance
showAsTranslucentModel?: boolean
stepUrl?: string
}


Expand Down
2 changes: 2 additions & 0 deletions lib/components/courtyard-circle.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { distance } from "circuit-json"
import { pcbLayoutProps } from "lib/common/layout"
import { ninePointAnchor } from "lib/common/ninePointAnchor"
import { z } from "zod"
export const courtyardCircleProps = pcbLayoutProps
.omit({ pcbRotation: true })
.extend({
radius: distance,
anchorAlignment: ninePointAnchor.optional(),
})
export type CourtyardCircleProps = z.input<typeof courtyardCircleProps>
2 changes: 2 additions & 0 deletions lib/components/courtyard-outline.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { length } from "circuit-json"
import { pcbLayoutProps } from "lib/common/layout"
import { ninePointAnchor } from "lib/common/ninePointAnchor"
import { point } from "lib/common/point"
import { z } from "zod"

Expand All @@ -21,5 +22,6 @@ export const courtyardOutlineProps = pcbLayoutProps
isClosed: z.boolean().optional(),
isStrokeDashed: z.boolean().optional(),
color: z.string().optional(),
anchorAlignment: ninePointAnchor.optional(),
})
export type CourtyardOutlineProps = z.input<typeof courtyardOutlineProps>
2 changes: 2 additions & 0 deletions lib/components/courtyard-pill.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { distance } from "circuit-json"
import { pcbLayoutProps } from "lib/common/layout"
import { ninePointAnchor } from "lib/common/ninePointAnchor"
import { z } from "zod"
export const courtyardPillProps = pcbLayoutProps
.omit({ pcbRotation: true })
.extend({
width: distance,
height: distance,
radius: distance,
anchorAlignment: ninePointAnchor.optional(),
})
export type CourtyardPillProps = z.input<typeof courtyardPillProps>
2 changes: 2 additions & 0 deletions lib/components/courtyard-rect.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { distance } from "circuit-json"
import { pcbLayoutProps } from "lib/common/layout"
import { ninePointAnchor } from "lib/common/ninePointAnchor"
import { z } from "zod"

export const courtyardRectProps = pcbLayoutProps
Expand All @@ -12,5 +13,6 @@ export const courtyardRectProps = pcbLayoutProps
hasStroke: z.boolean().optional(),
isStrokeDashed: z.boolean().optional(),
color: z.string().optional(),
anchorAlignment: ninePointAnchor.optional(),
})
export type CourtyardRectProps = z.input<typeof courtyardRectProps>
2 changes: 2 additions & 0 deletions tests/courtyard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ test("courtyard outline parses outline points", () => {
isClosed: true,
isStrokeDashed: true,
color: "#123456",
anchorAlignment: "bottom_left",
}

const parsed = courtyardOutlineProps.parse(outline)
Expand All @@ -74,6 +75,7 @@ test("courtyard outline parses outline points", () => {
expect(parsed.isClosed).toBe(true)
expect(parsed.isStrokeDashed).toBe(true)
expect(parsed.color).toBe("#123456")
expect(parsed.anchorAlignment).toBe("bottom_left")
})

test("courtyard circle parses radius", () => {
Expand Down
Loading