From e9c72c3ec735e73044cbae3191d5fc23d1f4364c Mon Sep 17 00:00:00 2001 From: Severin Ibarluzea Date: Tue, 28 Oct 2025 15:59:46 -0700 Subject: [PATCH] Add circular board outline example --- docs/elements/board.mdx | 49 ++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 11 deletions(-) diff --git a/docs/elements/board.mdx b/docs/elements/board.mdx index de1825a..6d0f70b 100644 --- a/docs/elements/board.mdx +++ b/docs/elements/board.mdx @@ -123,11 +123,11 @@ Learn more about [the Autorouting API here](../web-apis/autorouting-api.mdx) ### Custom Board Outlines -You can specify a custom outline for your board by passing an `outline` prop. -The PCB you get will have this outline cut out, this is great when you want a -board that's not a rectangle! - - ( ( // https://github.com/tscircuit/core/issues/564 width="50mm" height="50mm" - /> -) - -`} /> - -### Offseting the board origin + /> +) + +`} /> + +If you'd like a circular PCB, you can generate evenly spaced points around a +circle and pass them as the outline. In the example below a `radiusMm` variable +controls the size of the board—changing it automatically updates both the +outline points and the board's bounding box: + + ( + { + const angle = (step / steps) * Math.PI * 2 + + return { + x: Math.cos(angle) * radiusMm, + y: Math.sin(angle) * radiusMm, + } + })} + /> +) +`} /> + +### Offseting the board origin `width` and `height` set the board's bounding box (and thus the `pcbX`/`pcbY` coordinate system) even when you're using a custom outline. Add