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
44 changes: 44 additions & 0 deletions docs/elements/courtyardoutline.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,47 @@ export default () => (
)
`}
/>

## Anchored Courtyard Example

When the same courtyard needs to be placed from a different reference point,
combine `boardAnchorPosition` with `anchorAlignment`.

<CircuitPreview
showCourtyards
defaultView="pcb"
hideSchematicTab
hide3DTab
code={`
export default () => (
<board
width="30mm"
height="24mm"
boardAnchorPosition={{ x: 0, y: 0 }}
anchorAlignment="bottom_left"
>
<chip
name="U2"
footprint={
<footprint>
<platedhole shape="circle" pcbX={-4} pcbY={-2.5} outerDiameter={2.2} holeDiameter={1.1} />
<platedhole shape="circle" pcbX={-4} pcbY={2.5} outerDiameter={2.2} holeDiameter={1.1} />
<platedhole shape="circle" pcbX={4} pcbY={-2.5} outerDiameter={2.2} holeDiameter={1.1} />
<platedhole shape="circle" pcbX={4} pcbY={2.5} outerDiameter={2.2} holeDiameter={1.1} />
<courtyardoutline
outline={[
{ x: -6, y: -5 },
{ x: 6, y: -5 },
{ x: 6, y: 5 },
{ x: 0, y: 7 },
{ x: -6, y: 5 },
]}
/>
</footprint>
}
/>
<fabricationnotetext text="anchor: bottom_left" anchorAlignment="bottom_left" fontSize="0.5mm" pcbX={-5} pcbY={-9} />
</board>
)
`}
/>
39 changes: 39 additions & 0 deletions docs/elements/courtyardrect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,42 @@ export default () => (
)
`}
/>

## Anchored Rectangle Example

The rectangle can use the same anchor controls as the board itself. This is
useful when you want the courtyard to stay aligned to a specific corner.

<CircuitPreview
showCourtyards
defaultView="pcb"
hideSchematicTab
hide3DTab
code={`
export default () => (
<board
width="30mm"
height="24mm"
boardAnchorPosition={{ x: 0, y: 0 }}
anchorAlignment="top_right"
>
<chip
name="J2"
footprint={
<footprint>
<platedhole shape="circle" pcbX={-3} pcbY={0} outerDiameter={2.2} holeDiameter={1.1} />
<platedhole shape="circle" pcbX={3} pcbY={0} outerDiameter={2.2} holeDiameter={1.1} />
<courtyardrect
pcbX={0}
pcbY={0}
width={14}
height={10}
strokeWidth={0.1}
/>
</footprint>
}
/>
</board>
)
`}
/>
Loading