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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"circuit-json-to-bpc": "^0.0.13",
"circuit-json-to-connectivity-map": "^0.0.22",
"circuit-json-to-simple-3d": "^0.0.8",
"circuit-to-svg": "^0.0.189",
"circuit-to-svg": "^0.0.191",
"concurrently": "^9.1.2",
"connectivity-map": "^1.0.0",
"debug": "^4.3.6",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions tests/examples/example30-board-with-polygon-shape-smtpad.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { test, expect } from "bun:test"
import { getTestFixture } from "../fixtures/get-test-fixture"
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"

test("example30: Board with polygon shape smtpad", async () => {
const { circuit } = getTestFixture()

circuit.add(
<board width={16}>
<PolygonSmtpads name="U1" />
</board>,
)

await circuit.renderUntilSettled()
expect(circuit).toMatchPcbSnapshot(import.meta.path)
})

const PolygonSmtpads = (props: {
name: string
}) => {
return (
<chip
{...props}
footprint={
<footprint>
<smtpad
shape="polygon"
layer="top"
portHints={["pin1"]}
points={[
{ x: -4.5, y: 2 },
{ x: -2.2, y: 2 },
{ x: -0.4, y: 0 },
{ x: -2.2, y: -2 },
{ x: -4.5, y: -2 },
]}
/>

<smtpad
shape="polygon"
layer="top"
portHints={["pin2"]}
points={[
{ x: -1.8, y: 2 },
{ x: 1.8, y: 2 },
{ x: 3.6, y: 0 },
{ x: 1.8, y: -2 },
{ x: -1.8, y: -2 },
{ x: 0, y: 0 },
]}
/>

<smtpad
shape="polygon"
layer="top"
portHints={["pin3"]}
points={[
{ x: 2.2, y: 2 },
{ x: 6, y: 2 },
{ x: 6, y: -2 },
{ x: 2.2, y: -2 },
{ x: 4, y: 0 },
]}
/>
</footprint>
}
/>
)
}