-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from tscircuit/dsn-session-generation
Session Json Fixes
- Loading branch information
Showing
7 changed files
with
147 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,4 +180,6 @@ dist | |
#ignore the diff images | ||
*.diff.png | ||
*.diff.svg | ||
dsn-session.json | ||
dsn-session.json | ||
.yalc | ||
yalc.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
119 changes: 119 additions & 0 deletions
119
tests/assets/fake-freerouting-example-1/fake-freerouting-example-1.dsn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
(pcb /Users/seve/Downloads/testkicadproject.dsn | ||
(parser | ||
(string_quote ") | ||
(space_in_quoted_tokens on) | ||
(host_cad "KiCad's Pcbnew") | ||
(host_version "8.0.3") | ||
) | ||
(resolution um 10) | ||
(unit um) | ||
(structure | ||
(layer F.Cu | ||
(type signal) | ||
(property | ||
(index 0) | ||
) | ||
) | ||
(layer B.Cu | ||
(type signal) | ||
(property | ||
(index 1) | ||
) | ||
) | ||
(boundary | ||
(path pcb 0 158000 -108000 147500 -108000 147500 -102000 158000 -102000 | ||
158000 -108000) | ||
) | ||
(via "Via[0-1]_600:300_um") | ||
(rule | ||
(width 200) | ||
(clearance 200) | ||
(clearance 200 (type default_smd)) | ||
(clearance 50 (type smd_smd)) | ||
) | ||
) | ||
(placement | ||
(component Capacitor_SMD:C_0603_1608Metric | ||
(place C1 155020.000000 -105000.000000 front 0.000000 (PN 1uF)) | ||
) | ||
(component Resistor_SMD:R_0402_1005Metric | ||
(place R1 149990.000000 -105000.000000 front 0.000000 (PN 1k)) | ||
) | ||
) | ||
(library | ||
(image Capacitor_SMD:C_0603_1608Metric | ||
(outline (path signal 120 -140.58 510 140.58 510)) | ||
(outline (path signal 120 -140.58 -510 140.58 -510)) | ||
(outline (path signal 50 -1480 730 1480 730)) | ||
(outline (path signal 50 -1480 -730 -1480 730)) | ||
(outline (path signal 50 1480 730 1480 -730)) | ||
(outline (path signal 50 1480 -730 -1480 -730)) | ||
(outline (path signal 100 -800 400 800 400)) | ||
(outline (path signal 100 -800 -400 -800 400)) | ||
(outline (path signal 100 800 400 800 -400)) | ||
(outline (path signal 100 800 -400 -800 -400)) | ||
(pin RoundRect[T]Pad_900x950_225.856_um_0.000000_0 1 -775 0) | ||
(pin RoundRect[T]Pad_900x950_225.856_um_0.000000_0 2 775 0) | ||
) | ||
(image Resistor_SMD:R_0402_1005Metric | ||
(outline (path signal 120 -153.641 380 153.641 380)) | ||
(outline (path signal 120 -153.641 -380 153.641 -380)) | ||
(outline (path signal 50 -930 470 930 470)) | ||
(outline (path signal 50 -930 -470 -930 470)) | ||
(outline (path signal 50 930 470 930 -470)) | ||
(outline (path signal 50 930 -470 -930 -470)) | ||
(outline (path signal 100 -525 270 525 270)) | ||
(outline (path signal 100 -525 -270 -525 270)) | ||
(outline (path signal 100 525 270 525 -270)) | ||
(outline (path signal 100 525 -270 -525 -270)) | ||
(pin RoundRect[T]Pad_540x640_135.514_um_0.000000_0 1 -510 0) | ||
(pin RoundRect[T]Pad_540x640_135.514_um_0.000000_0 2 510 0) | ||
) | ||
(padstack RoundRect[T]Pad_540x640_135.514_um_0.000000_0 | ||
(shape (polygon F.Cu 0 -270.514 185 -260.199 236.859 -230.823 280.823 -186.859 310.199 | ||
-135 320.514 135 320.514 186.859 310.199 230.823 280.823 | ||
260.199 236.859 270.514 185 270.514 -185 260.199 -236.859 | ||
230.823 -280.823 186.859 -310.199 135 -320.514 -135 -320.514 | ||
-186.859 -310.199 -230.823 -280.823 -260.199 -236.859 -270.514 -185 | ||
-270.514 185)) | ||
(attach off) | ||
) | ||
(padstack RoundRect[T]Pad_900x950_225.856_um_0.000000_0 | ||
(shape (polygon F.Cu 0 -450.856 250 -433.664 336.431 -384.704 409.704 -311.431 458.664 | ||
-225 475.856 225 475.856 311.431 458.664 384.704 409.704 | ||
433.664 336.431 450.856 250 450.856 -250 433.664 -336.431 | ||
384.704 -409.704 311.431 -458.664 225 -475.856 -225 -475.856 | ||
-311.431 -458.664 -384.704 -409.704 -433.664 -336.431 -450.856 -250 | ||
-450.856 250)) | ||
(attach off) | ||
) | ||
(padstack "Via[0-1]_600:300_um" | ||
(shape (circle F.Cu 600)) | ||
(shape (circle B.Cu 600)) | ||
(attach off) | ||
) | ||
) | ||
(network | ||
(net "unconnected-(C1-Pad2)" | ||
(pins C1-2) | ||
) | ||
(net "Net-(C1-Pad1)" | ||
(pins C1-1 R1-2) | ||
) | ||
(net "unconnected-(R1-Pad1)" | ||
(pins R1-1) | ||
) | ||
(class kicad_default "" "Net-(C1-Pad1)" "unconnected-(C1-Pad2)" "unconnected-(R1-Pad1)" | ||
(circuit | ||
(use_via Via[0-1]_600:300_um) | ||
) | ||
(rule | ||
(width 200) | ||
(clearance 200) | ||
) | ||
) | ||
) | ||
(wiring | ||
(wire (path F.Cu 200 150500 -105000 154540 -105000)(net "Net-(C1-Pad1)")(type route)) | ||
) | ||
) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { test, expect } from "bun:test" | ||
import { parseDsnToCircuitJson } from "lib" | ||
|
||
// @ts-ignore | ||
import fakeFreeroutingExample1Dsn from "../assets/fake-freerouting-example-1/fake-freerouting-example-1.dsn" with { | ||
type: "text", | ||
} | ||
|
||
test("repro1 fake-freerouting-example-1", () => { | ||
const dsnPcb = parseDsnToCircuitJson(fakeFreeroutingExample1Dsn) | ||
}) |