Skip to content
Merged
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
45 changes: 37 additions & 8 deletions docs/elements/hole.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,24 @@ import CircuitPreview from "@site/src/components/CircuitPreview"

## Hole Shapes

Two hole shapes are supported:
Three hole shapes are supported:

- `circle` - A circular hole (default)
- `pill` - A pill-shaped hole (rounded rectangle)
- `rect` - A rectangular hole

### Circle Hole

A circular hole is the most common type used for mounting:
A circular hole is the most common type used for mounting. Provide either
`diameter` or `radius`:

<CircuitPreview
defaultView="3d"
hideSchematicTab
browser3dView={false}
code={`export default () => (
<board width="30mm" height="20mm">
<hole diameter="3mm" pcbX={0} pcbY={0} />
<hole radius="1.5mm" pcbX={0} pcbY={0} />
</board>
)`}
/>
Expand All @@ -59,9 +61,31 @@ Pill-shaped holes are useful for mounting components that need elongated holes o
)`}
/>

### Rectangular Hole

Rectangular holes are useful when you need a slot with straight edges:

<CircuitPreview
defaultView="pcb"
hideSchematicTab
browser3dView={false}
code={`export default () => (
<board width="30mm" height="20mm">
<hole
shape="rect"
width="5mm"
height="2mm"
pcbX={0}
pcbY={0}
/>
</board>
)`}
/>

### Rotated Pill Hole
Comment thread
rushabhcodes marked this conversation as resolved.

Pill-shaped holes can be rotated using the `pcbRotation` property:
Pill-shaped and rectangular holes can be rotated using the `pcbRotation`
property:

<CircuitPreview
defaultView="pcb"
Expand All @@ -76,6 +100,8 @@ Pill-shaped holes can be rotated using the `pcbRotation` property:
pcbX={0}
pcbY={0}
pcbRotation="45deg"
solderMaskMargin="0.2mm"
coveredWithSolderMask={false}
/>
</board>
)`}
Expand All @@ -85,10 +111,13 @@ Pill-shaped holes can be rotated using the `pcbRotation` property:

| Property | Shape | Type | Default | Description |
|----------|-------|------|---------|-------------|
| shape | all | `"circle"` \| `"pill"` | `"circle"` | Shape of the hole |
| shape | all | `"circle"` \| `"pill"` \| `"rect"` | `"circle"` | Shape of the hole |
| diameter | circle | number \| string | - | Diameter of the circular hole |
| width | pill | number \| string | - | Width of the pill-shaped hole |
| height | pill | number \| string | - | Height of the pill-shaped hole |
| radius | circle | number \| string | - | Radius of the circular hole |
| width | pill, rect | number \| string | - | Width of the pill-shaped or rectangular hole |
| height | pill, rect | number \| string | - | Height of the pill-shaped or rectangular hole |
| solderMaskMargin | all | number \| string | - | Solder mask opening margin around the hole |
| coveredWithSolderMask | all | boolean | - | Whether the hole should be covered by solder mask |
| pcbX | all | number | 0 | X position of the hole center on the PCB |
| pcbY | all | number | 0 | Y position of the hole center on the PCB |
| pcbRotation | pill | number \| string | 0 | Rotation angle in degrees (e.g., `"45deg"` or `45`) |
| pcbRotation | pill, rect | number \| string | 0 | Rotation angle in degrees (e.g., `"45deg"` or `45`) |
4 changes: 2 additions & 2 deletions docs/intro/quickstart-ChatGPT.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ are optional.
- `<trace from="U1.VCC" to="R1.pin1" />` - `from`, `to`
- `<transistor name="Q1" type="npn" />` - `type` (npn/pnp/nmos/pmos)
- `<mosfet name="M1" channelType="n" mosfetMode="enhancement" />` - `channelType` (n/p), `mosfetMode` (enhancement/depletion)
- `<hole name="H1" diameter="1mm" />` - `diameter`
- `<hole name="H1" diameter="1mm" />` - `diameter`, `radius`, `shape` (circle/pill/rect), `solderMaskMargin`, `coveredWithSolderMask`
- `<testpoint name="TP1" />` - `padShape` (circle/rect), `padDiameter`, `footprintVariant` (smd/through_hole), `width`, `height`
- `<via />` - `holeDiameter`, `outerDiameter`
- `<switch />` - `spdt` (bool), `dpdt` (bool), `spst` (bool), `spdt` (bool), `isNormallyClosed`
Expand Down Expand Up @@ -242,4 +242,4 @@ Selectors are used in the `connections` prop and the `from` and `to` props of th

```
can you create a 555 timer circuit in tscircuit with a square wave output?
```
```
Loading