diff --git a/tests/repros/__snapshots__/repro04.snap.svg b/tests/repros/__snapshots__/repro04.snap.svg new file mode 100644 index 0000000..5e7ff05 --- /dev/null +++ b/tests/repros/__snapshots__/repro04.snap.svg @@ -0,0 +1 @@ +J1pcb_courtyard_outline [pcb_courtyard_outline_0] overlaps with pcb_hole [pcb_hole_0]pcb_courtyard_outline [pcb_courtyard_outline_0] overlaps with pcb_hole [pcb_hole_1] \ No newline at end of file diff --git a/tests/repros/repro04.test.tsx b/tests/repros/repro04.test.tsx new file mode 100644 index 0000000..78e29a1 --- /dev/null +++ b/tests/repros/repro04.test.tsx @@ -0,0 +1,256 @@ +import { expect, test } from "bun:test" +import type { ChipProps } from "@tscircuit/props" +import { convertCircuitJsonToPcbSvg } from "circuit-to-svg" +import { Circuit } from "tscircuit" +import { runAllPlacementChecks } from "lib/run-all-checks" + +const pinLabels = { + pin13: ["EH1"], + pin14: ["EH2"], + pin15: ["pin13_alt1"], + pin16: ["pin14_alt1"], + pin17: ["A1B12"], + pin18: ["A4B9"], + pin19: ["B8"], + pin20: ["A5"], + pin21: ["B7"], + pin22: ["A6"], + pin23: ["A7"], + pin24: ["B6"], + pin25: ["A8"], + pin26: ["B5"], + pin27: ["B4A9"], + pin28: ["B1A12"], +} as const + +const TYPE_C_16PIN_2MD_073_ = (props: ChipProps) => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + cadModel={{ + objUrl: + "https://modelcdn.tscircuit.com/easyeda_models/assets/C2765186.obj?uuid=4ee8413127e64716b804db03d4b340ae", + stepUrl: + "https://modelcdn.tscircuit.com/easyeda_models/assets/C2765186.step?uuid=4ee8413127e64716b804db03d4b340ae", + pcbRotationOffset: 0, + modelOriginPosition: { x: 0, y: 1.3249976000000152, z: -1.6800018 }, + }} + {...props} + /> + ) +} + +test("type-c footprint mounting holes inside own courtyard do not cause placement errors", async () => { + const circuit = new Circuit() + + circuit.add( + + + , + ) + + await circuit.renderUntilSettled() + + const circuitJson = circuit.getCircuitJson() + const placementErrors = await runAllPlacementChecks(circuitJson) + // expect(placementErrors).toHaveLength(0) + + expect( + convertCircuitJsonToPcbSvg([...circuitJson, ...placementErrors], { + shouldDrawErrors: true, + showCourtyards: true, + }), + ).toMatchSvgSnapshot(import.meta.path) +})