@tscircuit/schematic-trace-solver 0.0.108 → 0.0.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/index.d.ts +29 -1
  2. package/dist/index.js +502 -38
  3. package/lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts +3 -1
  4. package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +18 -3
  5. package/lib/solvers/UnroutedTraceRecoverySolver/UnroutedTraceRecoverySolver.ts +592 -0
  6. package/package.json +1 -1
  7. package/site/bug-reports/bug-report-20260724T175257Z.page.tsx +4 -0
  8. package/tests/bug-reports/bug-report-20260707T092615Z/__snapshots__/bug-report-20260707T092615Z.snap.svg +5 -9
  9. package/tests/bug-reports/bug-report-20260724T175257Z/__snapshots__/bug-report-20260724T175257Z.snap.svg +58 -0
  10. package/tests/bug-reports/bug-report-20260724T175257Z/bug-report-20260724T175257Z.json +138 -0
  11. package/tests/bug-reports/bug-report-20260724T175257Z/bug-report-20260724T175257Z.test.ts +12 -0
  12. package/tests/examples/__snapshots__/example04.snap.svg +7 -9
  13. package/tests/examples/__snapshots__/example08.snap.svg +16 -20
  14. package/tests/examples/__snapshots__/example13.snap.svg +2 -4
  15. package/tests/examples/__snapshots__/example32.snap.svg +64 -66
  16. package/tests/examples/__snapshots__/example46.snap.svg +1 -1
  17. package/tests/repros/__snapshots__/repro-netlabel-collision-687.snap.svg +81 -0
  18. package/tests/repros/__snapshots__/repro-netlabel-overlap-trace.snap.svg +16 -18
  19. package/tests/repros/assets/repro-netlabel-collision-687.input.json +212 -0
  20. package/tests/repros/repro-netlabel-collision-687.test.ts +59 -0
  21. package/tests/solvers/UnroutedTraceRecoverySolver/paired-junction-recovery.test.ts +49 -0
  22. package/tests/solvers/UnroutedTraceRecoverySolver/skip-ground.test.ts +30 -0
  23. package/tests/solvers/UnroutedTraceRecoverySolver/skip-long-connection.test.ts +24 -0
@@ -1,4 +1,4 @@
1
- <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="-2.87,2.485 -2.87,1.2399999999999998" data-type="line" data-label="" points="181.61383285302594,143.82324687800187 181.61383285302594,210.79731027857824" fill="none" stroke="hsl(32, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-2.87,1.2399999999999998 -2.87,3.6149999999999998" data-type="line" data-label="" points="181.61383285302594,210.79731027857824 181.61383285302594,83.03554274735825" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,1.2399999999999998 -2.87,2.485" data-type="line" data-label="" points="181.61383285302594,210.79731027857824 181.61383285302594,143.82324687800187" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,3.6149999999999998 -2.87,2.485" data-type="line" data-label="" points="181.61383285302594,83.03554274735825 181.61383285302594,143.82324687800187" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,0.19999999999999973 -1.2850000000000001,0.2" data-type="line" data-label="" points="181.61383285302594,266.74351585014404 266.8780019212296,266.74351585014404" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,0.19999999999999973 -1.2850000000000001,-0.2" data-type="line" data-label="" points="181.61383285302594,266.74351585014404 266.8780019212296,288.26128722382316" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,0.19999999999999973 -2.97,-1.0099999999999998" data-type="line" data-label="" points="181.61383285302594,266.74351585014404 176.23439000960616,331.8347742555234" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0.2 -1.2850000000000001,-0.2" data-type="line" data-label="" points="266.8780019212296,266.74351585014404 266.8780019212296,288.26128722382316" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0.2 -2.97,-1.0099999999999998" data-type="line" data-label="" points="266.8780019212296,266.74351585014404 176.23439000960616,331.8347742555234" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,-0.2 -2.97,-1.0099999999999998" data-type="line" data-label="" points="266.8780019212296,288.26128722382316 176.23439000960616,331.8347742555234" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 -2.97,-2.1100000000000003" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 176.23439000960616,391.00864553314113" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 -0.8100000000000003,-3.005000000000001" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 292.43035542747356,439.1546589817483" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 1.2594553499999992,-4.739999999999999" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 403.7555231508165,532.4879923150816" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 -0.75,-5.315" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 295.6580211335255,563.4197886647453" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.97,-2.1100000000000003 -0.8100000000000003,-3.005000000000001" data-type="line" data-label="" points="176.23439000960616,391.00864553314113 292.43035542747356,439.1546589817483" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.97,-2.1100000000000003 1.2594553499999992,-4.739999999999999" data-type="line" data-label="" points="176.23439000960616,391.00864553314113 403.7555231508165,532.4879923150816" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.97,-2.1100000000000003 -0.75,-5.315" data-type="line" data-label="" points="176.23439000960616,391.00864553314113 295.6580211335255,563.4197886647453" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.8100000000000003,-3.005000000000001 1.2594553499999992,-4.739999999999999" data-type="line" data-label="" points="292.43035542747356,439.1546589817483 403.7555231508165,532.4879923150816" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.8100000000000003,-3.005000000000001 -0.75,-5.315" data-type="line" data-label="" points="292.43035542747356,439.1546589817483 295.6580211335255,563.4197886647453" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2594553499999992,-4.739999999999999 -0.75,-5.315" data-type="line" data-label="" points="403.7555231508165,532.4879923150816 295.6580211335255,563.4197886647453" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 -0.8100000000000003,-1.9050000000000002" data-type="line" data-label="" points="405.12968299711815,272.1229586935638 292.43035542747356,379.9807877041306" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 2.675,-1.3049999999999997" data-type="line" data-label="" points="405.12968299711815,272.1229586935638 479.90393852065324,347.70413064361185" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 -0.75,-4.215000000000001" data-type="line" data-label="" points="405.12968299711815,272.1229586935638 295.6580211335255,504.24591738712775" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.8100000000000003,-1.9050000000000002 2.675,-1.3049999999999997" data-type="line" data-label="" points="292.43035542747356,379.9807877041306 479.90393852065324,347.70413064361185" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.8100000000000003,-1.9050000000000002 -0.75,-4.215000000000001" data-type="line" data-label="" points="292.43035542747356,379.9807877041306 295.6580211335255,504.24591738712775" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.675,-1.3049999999999997 -0.75,-4.215000000000001" data-type="line" data-label="" points="479.90393852065324,347.70413064361185 295.6580211335255,504.24591738712775" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.675,-2.4349999999999996 1.2594553499999992,-3.6399999999999997" data-type="line" data-label="" points="479.90393852065324,408.4918347742554 403.7555231508165,473.3141210374639" fill="none" stroke="hsl(187, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,2.485 -2.87,1.2399999999999998" data-type="line" data-label="" points="181.61383285302594,143.82324687800187 181.61383285302594,210.79731027857824" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.87,3.6149999999999998 -2.87,3.815 -2.1099999999999994,3.815 -2.1099999999999994,2.2849999999999997 -2.87,2.2849999999999997 -2.87,2.485" data-type="line" data-label="" points="181.61383285302594,83.03554274735825 181.61383285302594,72.27665706051869 222.49759846301637,72.27665706051869 222.49759846301637,154.58213256484146 181.61383285302594,154.58213256484146 181.61383285302594,143.82324687800187" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.87,0.19999999999999973 -2.87,-4.440892098500626e-16 -2.97,-4.440892098500626e-16 -2.97,-1.0099999999999998" data-type="line" data-label="" points="181.61383285302594,266.74351585014404 181.61383285302594,277.5024015369836 176.23439000960616,277.5024015369836 176.23439000960616,331.8347742555234" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.97,-2.1100000000000003 -2.97,-3.205000000000001 -0.81,-3.205000000000001 -0.81,-3.005000000000001" data-type="line" data-label="" points="176.23439000960616,391.00864553314113 176.23439000960616,449.91354466858786 292.4303554274736,449.91354466858786 292.4303554274736,439.1546589817483" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.2594553499999988,-4.739999999999999 1.2594553499999988,-5.515000000000001 -0.75,-5.515000000000001 -0.75,-5.315" data-type="line" data-label="" points="403.75552315081643,532.4879923150816 403.75552315081643,574.178674351585 295.6580211335255,574.178674351585 295.6580211335255,563.4197886647453" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.2850000000000001,0.1 2.675,0.1 2.675,-1.3049999999999997" data-type="line" data-label="" points="405.12968299711815,272.1229586935638 479.90393852065324,272.1229586935638 479.90393852065324,347.70413064361185" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="2.6749999999999994,-2.4349999999999996 2.6749999999999994,-3.0374999999999996 1.2594553499999992,-3.0374999999999996 1.2594553499999992,-3.6399999999999997" data-type="line" data-label="" points="479.9039385206532,408.4918347742554 479.9039385206532,440.90297790585964 403.7555231508165,440.90297790585964 403.7555231508165,473.3141210374639" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.2850000000000001,0.20000000000000018 -1.485,0.20000000000000018 -1.485,-4.440892098500626e-16 -2.87,-4.440892098500626e-16 -2.87,0.19999999999999973" data-type="line" data-label="" points="266.8780019212296,266.74351585014404 256.11911623439005,266.74351585014404 256.11911623439005,277.5024015369836 181.61383285302594,277.5024015369836 181.61383285302594,266.74351585014404" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.2850000000000001,-0.2 -1.485,-0.2 -1.485,0.2 -1.2850000000000001,0.2" data-type="line" data-label="" points="266.8780019212296,288.26128722382316 256.11911623439005,288.26128722382316 256.11911623439005,266.74351585014404 266.8780019212296,266.74351585014404" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.2850000000000001,0 -1.3860000000000001,0 -1.3860000000000001,-0.601" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 261.4447646493756,277.5024015369836 261.4447646493756,309.8328530259365" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-2.71" data-y="0.7199999999999998" x="167.08933717579254" y="210.79731027857827" width="46.26320845341016" height="55.9462055715658" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="-3.25" data-y="3.05" x="110.60518731988473" y="83.03554274735826" width="101.13352545629206" height="60.78770413064362" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="0" data-y="0" x="266.8780019212296" y="261.36407300672425" width="138.25168107588854" height="32.27665706051869" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_3" data-x="-2.755" data-y="-1.56" x="161.9788664745437" y="331.8347742555235" width="51.642651296830024" height="59.17387127761771" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_4" data-x="-0.5950000000000002" data-y="-2.4550000000000005" x="278.17483189241113" y="379.98078770413053" width="51.64265129682997" height="59.17387127761771" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_5" data-x="2.9724999999999997" data-y="-1.8699999999999997" x="462.4207492795389" y="347.70413064361185" width="66.97406340057637" height="60.78770413064353" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_6" data-x="1.5519553499999992" data-y="-4.1899999999999995" x="393.29490874159455" y="473.31412103746385" width="52.3909694524495" height="59.17387127761765" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_7" data-x="-0.5950000000000001" data-y="-4.765000000000001" x="281.402497598463" y="504.24591738712775" width="45.18731988472621" height="59.173871277617536" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="netId: VBUS
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="-2.87,2.485 -2.87,1.2399999999999998" data-type="line" data-label="" points="181.61383285302594,143.82324687800187 181.61383285302594,210.79731027857824" fill="none" stroke="hsl(32, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-2.87,1.2399999999999998 -2.87,3.6149999999999998" data-type="line" data-label="" points="181.61383285302594,210.79731027857824 181.61383285302594,83.03554274735825" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,1.2399999999999998 -2.87,2.485" data-type="line" data-label="" points="181.61383285302594,210.79731027857824 181.61383285302594,143.82324687800187" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,3.6149999999999998 -2.87,2.485" data-type="line" data-label="" points="181.61383285302594,83.03554274735825 181.61383285302594,143.82324687800187" fill="none" stroke="hsl(170, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,0.19999999999999973 -1.2850000000000001,0.2" data-type="line" data-label="" points="181.61383285302594,266.74351585014404 266.8780019212296,266.74351585014404" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,0.19999999999999973 -1.2850000000000001,-0.2" data-type="line" data-label="" points="181.61383285302594,266.74351585014404 266.8780019212296,288.26128722382316" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,0.19999999999999973 -2.97,-1.0099999999999998" data-type="line" data-label="" points="181.61383285302594,266.74351585014404 176.23439000960616,331.8347742555234" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0.2 -1.2850000000000001,-0.2" data-type="line" data-label="" points="266.8780019212296,266.74351585014404 266.8780019212296,288.26128722382316" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0.2 -2.97,-1.0099999999999998" data-type="line" data-label="" points="266.8780019212296,266.74351585014404 176.23439000960616,331.8347742555234" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,-0.2 -2.97,-1.0099999999999998" data-type="line" data-label="" points="266.8780019212296,288.26128722382316 176.23439000960616,331.8347742555234" fill="none" stroke="hsl(264, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 -2.97,-2.1100000000000003" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 176.23439000960616,391.00864553314113" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 -0.8100000000000003,-3.005000000000001" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 292.43035542747356,439.1546589817483" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 1.2594553499999992,-4.739999999999999" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 403.7555231508165,532.4879923150816" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.2850000000000001,0 -0.75,-5.315" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 295.6580211335255,563.4197886647453" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.97,-2.1100000000000003 -0.8100000000000003,-3.005000000000001" data-type="line" data-label="" points="176.23439000960616,391.00864553314113 292.43035542747356,439.1546589817483" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.97,-2.1100000000000003 1.2594553499999992,-4.739999999999999" data-type="line" data-label="" points="176.23439000960616,391.00864553314113 403.7555231508165,532.4879923150816" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.97,-2.1100000000000003 -0.75,-5.315" data-type="line" data-label="" points="176.23439000960616,391.00864553314113 295.6580211335255,563.4197886647453" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.8100000000000003,-3.005000000000001 1.2594553499999992,-4.739999999999999" data-type="line" data-label="" points="292.43035542747356,439.1546589817483 403.7555231508165,532.4879923150816" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.8100000000000003,-3.005000000000001 -0.75,-5.315" data-type="line" data-label="" points="292.43035542747356,439.1546589817483 295.6580211335255,563.4197886647453" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2594553499999992,-4.739999999999999 -0.75,-5.315" data-type="line" data-label="" points="403.7555231508165,532.4879923150816 295.6580211335255,563.4197886647453" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 -0.8100000000000003,-1.9050000000000002" data-type="line" data-label="" points="405.12968299711815,272.1229586935638 292.43035542747356,379.9807877041306" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 2.675,-1.3049999999999997" data-type="line" data-label="" points="405.12968299711815,272.1229586935638 479.90393852065324,347.70413064361185" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="1.2850000000000001,0.1 -0.75,-4.215000000000001" data-type="line" data-label="" points="405.12968299711815,272.1229586935638 295.6580211335255,504.24591738712775" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.8100000000000003,-1.9050000000000002 2.675,-1.3049999999999997" data-type="line" data-label="" points="292.43035542747356,379.9807877041306 479.90393852065324,347.70413064361185" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.8100000000000003,-1.9050000000000002 -0.75,-4.215000000000001" data-type="line" data-label="" points="292.43035542747356,379.9807877041306 295.6580211335255,504.24591738712775" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.675,-1.3049999999999997 -0.75,-4.215000000000001" data-type="line" data-label="" points="479.90393852065324,347.70413064361185 295.6580211335255,504.24591738712775" fill="none" stroke="hsl(154, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="2.675,-2.4349999999999996 1.2594553499999992,-3.6399999999999997" data-type="line" data-label="" points="479.90393852065324,408.4918347742554 403.7555231508165,473.3141210374639" fill="none" stroke="hsl(187, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.87,2.485 -2.87,1.2399999999999998" data-type="line" data-label="" points="181.61383285302594,143.82324687800187 181.61383285302594,210.79731027857824" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.87,3.6149999999999998 -2.87,3.815 -2.1099999999999994,3.815 -2.1099999999999994,2.2849999999999997 -2.87,2.2849999999999997 -2.87,2.485" data-type="line" data-label="" points="181.61383285302594,83.03554274735825 181.61383285302594,72.27665706051869 222.49759846301637,72.27665706051869 222.49759846301637,154.58213256484146 181.61383285302594,154.58213256484146 181.61383285302594,143.82324687800187" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.87,0.19999999999999973 -2.87,-2.220446049250313e-16 -2.97,-2.220446049250313e-16 -2.97,-1.0099999999999998" data-type="line" data-label="" points="181.61383285302594,266.74351585014404 181.61383285302594,277.5024015369836 176.23439000960616,277.5024015369836 176.23439000960616,331.8347742555234" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.97,-2.1100000000000003 -2.97,-3.205000000000001 -0.81,-3.205000000000001 -0.81,-3.005000000000001" data-type="line" data-label="" points="176.23439000960616,391.00864553314113 176.23439000960616,449.91354466858786 292.4303554274736,449.91354466858786 292.4303554274736,439.1546589817483" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.2594553499999988,-4.739999999999999 1.2594553499999988,-5.515000000000001 -0.75,-5.515000000000001 -0.75,-5.315" data-type="line" data-label="" points="403.75552315081643,532.4879923150816 403.75552315081643,574.178674351585 295.6580211335255,574.178674351585 295.6580211335255,563.4197886647453" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.2850000000000001,0.1 2.675,0.1 2.675,-1.3049999999999997" data-type="line" data-label="" points="405.12968299711815,272.1229586935638 479.90393852065324,272.1229586935638 479.90393852065324,347.70413064361185" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="2.6749999999999994,-2.4349999999999996 2.6749999999999994,-3.0374999999999996 1.2594553499999992,-3.0374999999999996 1.2594553499999992,-3.6399999999999997" data-type="line" data-label="" points="479.9039385206532,408.4918347742554 479.9039385206532,440.90297790585964 403.7555231508165,440.90297790585964 403.7555231508165,473.3141210374639" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.2850000000000001,0.20000000000000018 -1.485,0.20000000000000018 -1.485,-4.440892098500626e-16 -2.87,-4.440892098500626e-16 -2.87,0.19999999999999973" data-type="line" data-label="" points="266.8780019212296,266.74351585014404 256.11911623439005,266.74351585014404 256.11911623439005,277.5024015369836 181.61383285302594,277.5024015369836 181.61383285302594,266.74351585014404" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.2850000000000001,-0.2 -1.485,-0.2 -1.485,0.2 -1.2850000000000001,0.2" data-type="line" data-label="" points="266.8780019212296,288.26128722382316 256.11911623439005,288.26128722382316 256.11911623439005,266.74351585014404 266.8780019212296,266.74351585014404" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.2850000000000001,0 -1.3860000000000001,0 -1.3860000000000001,-0.601" data-type="line" data-label="" points="266.8780019212296,277.5024015369836 261.4447646493756,277.5024015369836 261.4447646493756,309.8328530259365" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-2.71" data-y="0.7199999999999998" x="167.08933717579254" y="210.79731027857827" width="46.26320845341016" height="55.9462055715658" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="-3.25" data-y="3.05" x="110.60518731988473" y="83.03554274735826" width="101.13352545629206" height="60.78770413064362" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="0" data-y="0" x="266.8780019212296" y="261.36407300672425" width="138.25168107588854" height="32.27665706051869" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_3" data-x="-2.755" data-y="-1.56" x="161.9788664745437" y="331.8347742555235" width="51.642651296830024" height="59.17387127761771" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_4" data-x="-0.5950000000000002" data-y="-2.4550000000000005" x="278.17483189241113" y="379.98078770413053" width="51.64265129682997" height="59.17387127761771" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_5" data-x="2.9724999999999997" data-y="-1.8699999999999997" x="462.4207492795389" y="347.70413064361185" width="66.97406340057637" height="60.78770413064353" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_6" data-x="1.5519553499999992" data-y="-4.1899999999999995" x="393.29490874159455" y="473.31412103746385" width="52.3909694524495" height="59.17387127761765" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="schematic_component_7" data-x="-0.5950000000000001" data-y="-4.765000000000001" x="281.402497598463" y="504.24591738712775" width="45.18731988472621" height="59.173871277617536" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="netId: VBUS
2
2
  globalConnNetId: connectivity_net0" data-x="-2.87" data-y="4.115" x="176.23439000960616" y="39.99999999999993" width="10.75888568683959" height="32.276657060518716" fill="#ef444466" stroke="#ef4444" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="netId: RAW
3
3
  globalConnNetId: connectivity_net1" data-x="-1.725" data-y="-0.2" x="230.297790585975" y="282.8818443804034" width="25.821325648415012" height="10.758885686839562" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="netId: GND
4
4
  globalConnNetId: connectivity_net2" data-x="-1.3860000000000001" data-y="-0.841" x="256.0653218059558" y="309.8328530259365" width="10.758885686839562" height="25.821325648414984" fill="#00000066" stroke="#000000" stroke-width="0.018589285714285714"/></g><g><rect data-type="rect" data-label="netId: GND
@@ -0,0 +1,81 @@
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="0.5,0.4 5.5,0.4" data-type="line" data-label="" points="120,288 520,288" fill="none" stroke="hsl(77, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="0.5,0.2 5.5,0.2" data-type="line" data-label="" points="120,304 520,304" fill="none" stroke="hsl(78, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="0.5,0 5.5,0" data-type="line" data-label="" points="120,320 520,320" fill="none" stroke="hsl(79, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="0.5,-0.2 5.5,-0.2" data-type="line" data-label="" points="120,336 520,336" fill="none" stroke="hsl(80, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="0.5,-0.4 5.5,-0.4" data-type="line" data-label="" points="120,352 520,352" fill="none" stroke="hsl(209, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="0.5,0.6 0.5,-0.6" data-type="line" data-label="" points="120,272 120,368" fill="none" stroke="hsl(30, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="0.5,0.6 1.201,0.6 1.201,-0.6 0.5,-0.6" data-type="line" data-label="" points="120,272 176.08,272 176.08,368 120,368" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="U1" data-x="0" data-y="0" x="40" y="240" width="80" height="160" fill="hsl(164, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="U2" data-x="6" data-y="0" x="520" y="240" width="80" height="160" fill="hsl(165, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="U3" data-x="1.8" data-y="0" x="204" y="200" width="40" height="240" fill="hsl(166, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="C1" data-x="0.8" data-y="1.2" x="88" y="188" width="112" height="72" fill="hsl(326, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="C2" data-x="0.8" data-y="-1.2" x="88" y="380" width="112" height="72" fill="hsl(327, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: V1V1
2
+ globalConnNetId: connectivity_net5" data-x="0.8505" data-y="-0.39" x="124.04" y="334.4" width="48.00000000000003" height="33.60000000000002" fill="#ef444466" stroke="#ef4444" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QD0
3
+ globalConnNetId: connectivity_net0" data-x="0.741" data-y="0.4" x="120.07999999999998" y="280" width="38.40000000000002" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QD0
4
+ globalConnNetId: connectivity_net0" data-x="5.2589999999999995" data-y="0.4" x="481.52" y="280" width="38.400000000000034" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QD1
5
+ globalConnNetId: connectivity_net1" data-x="0.741" data-y="0.2" x="120.07999999999998" y="296" width="38.40000000000002" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QD1
6
+ globalConnNetId: connectivity_net1" data-x="5.2589999999999995" data-y="0.2" x="481.52" y="296" width="38.400000000000034" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QD2
7
+ globalConnNetId: connectivity_net2" data-x="0.741" data-y="0" x="120.07999999999998" y="312" width="38.40000000000002" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QD2
8
+ globalConnNetId: connectivity_net2" data-x="5.2589999999999995" data-y="0" x="481.52" y="312" width="38.400000000000034" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QD3
9
+ globalConnNetId: connectivity_net3" data-x="0.741" data-y="-0.2" x="120.07999999999998" y="328" width="38.40000000000002" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QD3
10
+ globalConnNetId: connectivity_net3" data-x="5.2589999999999995" data-y="-0.2" x="481.52" y="328" width="38.400000000000034" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QCLK
11
+ globalConnNetId: connectivity_net4" data-x="0.801" data-y="-0.4" x="120.08" y="344" width="47.99999999999997" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><rect data-type="rect" data-label="netId: QCLK
12
+ globalConnNetId: connectivity_net4" data-x="5.199" data-y="-0.4" x="471.91999999999996" y="344" width="47.99999999999994" height="16" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0125"/></g><g><circle data-type="point" data-label="U1.1
13
+ x+" data-x="0.5" data-y="0.6" cx="120" cy="272" r="3" fill="hsl(319, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.2
14
+ x+" data-x="0.5" data-y="0.4" cx="120" cy="288" r="3" fill="hsl(320, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.3
15
+ x+" data-x="0.5" data-y="0.2" cx="120" cy="304" r="3" fill="hsl(321, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.4
16
+ x+" data-x="0.5" data-y="0" cx="120" cy="320" r="3" fill="hsl(322, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.5
17
+ x+" data-x="0.5" data-y="-0.2" cx="120" cy="336" r="3" fill="hsl(323, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.6
18
+ x+" data-x="0.5" data-y="-0.4" cx="120" cy="352" r="3" fill="hsl(324, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U1.7
19
+ x+" data-x="0.5" data-y="-0.6" cx="120" cy="368" r="3" fill="hsl(325, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.1
20
+ x-" data-x="5.5" data-y="0.4" cx="520" cy="288" r="3" fill="hsl(200, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.2
21
+ x-" data-x="5.5" data-y="0.2" cx="520" cy="304" r="3" fill="hsl(201, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.3
22
+ x-" data-x="5.5" data-y="0" cx="520" cy="320" r="3" fill="hsl(202, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.4
23
+ x-" data-x="5.5" data-y="-0.2" cx="520" cy="336" r="3" fill="hsl(203, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U2.5
24
+ x-" data-x="5.5" data-y="-0.4" cx="520" cy="352" r="3" fill="hsl(204, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="U3.1
25
+ y+" data-x="1.8" data-y="1.5" cx="224" cy="200" r="3" fill="hsl(81, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C1.1
26
+ y-" data-x="0.8" data-y="0.75" cx="144" cy="260" r="3" fill="hsl(121, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C2.1
27
+ y+" data-x="0.8" data-y="-0.75" cx="144" cy="380" r="3" fill="hsl(2, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
28
+ orientation: y+" data-x="0.8505" data-y="-0.6" cx="148.04000000000002" cy="368" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
29
+ orientation: x+" data-x="0.5" data-y="0.4" cx="120" cy="288" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
30
+ orientation: x-" data-x="5.5" data-y="0.4" cx="520" cy="288" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
31
+ orientation: x+" data-x="0.5" data-y="0.2" cx="120" cy="304" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
32
+ orientation: x-" data-x="5.5" data-y="0.2" cx="520" cy="304" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
33
+ orientation: x+" data-x="0.5" data-y="0" cx="120" cy="320" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
34
+ orientation: x-" data-x="5.5" data-y="0" cx="520" cy="320" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
35
+ orientation: x+" data-x="0.5" data-y="-0.2" cx="120" cy="336" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
36
+ orientation: x-" data-x="5.5" data-y="-0.2" cx="520" cy="336" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
37
+ orientation: x+" data-x="0.5" data-y="-0.4" cx="120" cy="352" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
38
+ orientation: x-" data-x="5.5" data-y="-0.4" cx="520" cy="352" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g id="crosshair" style="display: none"><line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5"/><line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5"/><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text></g><script><![CDATA[
39
+ document.currentScript.parentElement.addEventListener('mousemove', (e) => {
40
+ const svg = e.currentTarget;
41
+ const rect = svg.getBoundingClientRect();
42
+ const x = e.clientX - rect.left;
43
+ const y = e.clientY - rect.top;
44
+ const crosshair = svg.getElementById('crosshair');
45
+ const h = svg.getElementById('crosshair-h');
46
+ const v = svg.getElementById('crosshair-v');
47
+ const coords = svg.getElementById('coordinates');
48
+
49
+ crosshair.style.display = 'block';
50
+ h.setAttribute('x1', '0');
51
+ h.setAttribute('x2', '640');
52
+ h.setAttribute('y1', y);
53
+ h.setAttribute('y2', y);
54
+ v.setAttribute('x1', x);
55
+ v.setAttribute('x2', x);
56
+ v.setAttribute('y1', '0');
57
+ v.setAttribute('y2', '640');
58
+
59
+ // Calculate real coordinates using inverse transformation
60
+ const matrix = {"a":80,"c":0,"e":80,"b":0,"d":-80,"f":320};
61
+ // Manually invert and apply the affine transform
62
+ // Since we only use translate and scale, we can directly compute:
63
+ // x' = (x - tx) / sx
64
+ // y' = (y - ty) / sy
65
+ const sx = matrix.a;
66
+ const sy = matrix.d;
67
+ const tx = matrix.e;
68
+ const ty = matrix.f;
69
+ const realPoint = {
70
+ x: (x - tx) / sx,
71
+ y: (y - ty) / sy // Flip y back since we used negative scale
72
+ }
73
+
74
+ coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
75
+ coords.setAttribute('x', (x + 5).toString());
76
+ coords.setAttribute('y', (y - 5).toString());
77
+ });
78
+ document.currentScript.parentElement.addEventListener('mouseleave', () => {
79
+ document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
80
+ });
81
+ ]]></script></svg>
@@ -1,20 +1,18 @@
1
- <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="-4.475,2.9699999999999998 -2.38,3" data-type="line" data-label="" points="106.69131238447312,232.0887245841036 416.4879852125693,227.65249537892794" fill="none" stroke="hsl(192, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-3.5250000000000004,2.9699999999999998 -2.7,1.5" data-type="line" data-label="" points="247.17190388170047,232.0887245841036 369.1682070240295,449.463955637708" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.62,3 -3.3,1.5" data-type="line" data-label="" points="528.8724584103511,227.65249537892794 280.4436229205175,449.463955637708" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.5250000000000004,2.9699999999999998 -3.5250000000000004,2.8 -2.5,2.8 -2.5,1.5 -2.7,1.5" data-type="line" data-label="" points="247.17190388170047,232.0887245841036 247.17190388170047,257.2273567467653 398.74306839186687,257.2273567467653 398.74306839186687,449.463955637708 369.1682070240295,449.463955637708" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.62,3 -1.3790000000000002,3 -1.3790000000000002,3.251" data-type="line" data-label="" points="528.8724584103511,227.65249537892794 564.5101663585951,227.65249537892794 564.5101663585951,190.5360443622921" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-3.3,1.5 -3.541,1.5 -3.541,1.9509999999999998" data-type="line" data-label="" points="280.4436229205175,449.463955637708 244.8059149722735,449.463955637708 244.8059149722735,382.77264325323483" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-4" data-y="3" x="106.69131238447312" y="206.21072088724588" width="140.48059149722735" height="42.88354898336411" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0067624999999999985"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="-2" data-y="3" x="416.48798521256936" y="190.68391866913123" width="112.3844731977818" height="73.93715341959341" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0067624999999999985"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="-3" data-y="1.5" x="280.4436229205175" y="387.35674676524957" width="88.72458410351203" height="124.21441774491683" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0067624999999999985"/></g><g><rect data-type="rect" data-label="netId: .B1 &gt; .pin1 to .SW1 &gt; .pin1
2
- globalConnNetId: connectivity_net0" data-x="-4.701" data-y="2.9699999999999998" x="40" y="217.3012939001849" width="66.54343807763394" height="29.5748613678374" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0067624999999999985"/></g><g><rect data-type="rect" data-label="netId: .B1 &gt; .pin1 to .SW1 &gt; .pin1
3
- globalConnNetId: connectivity_net0" data-x="-2.606" data-y="3" x="349.79667282809606" y="212.86506469500927" width="66.54343807763405" height="29.574861367837343" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0067624999999999985"/></g><g><rect data-type="rect" data-label="netId: GND
4
- globalConnNetId: connectivity_net1" data-x="-3.5250000000000004" data-y="2.59" x="211.68207024029564" y="257.2273567467653" width="70.97966728280966" height="62.10720887245844" fill="#00000066" stroke="#000000" stroke-width="0.0067624999999999985"/></g><g><rect data-type="rect" data-label="netId: VCC
5
- globalConnNetId: connectivity_net2" data-x="-1.3790000000000002" data-y="3.461" x="529.0203327171903" y="128.4288354898337" width="70.97966728280971" height="62.10720887245844" fill="#ef444466" stroke="#ef4444" stroke-width="0.0067624999999999985"/></g><g><rect data-type="rect" data-label="netId: VCC
6
- globalConnNetId: connectivity_net2" data-x="-3.541" data-y="2.161" x="209.31608133086874" y="320.6654343807764" width="70.97966728280954" height="62.107208872458386" fill="#ef444466" stroke="#ef4444" stroke-width="0.0067624999999999985"/></g><g><circle data-type="point" data-label="B1.1
7
- x-" data-x="-4.475" data-y="2.9699999999999998" cx="106.69131238447312" cy="232.0887245841036" r="3" fill="hsl(210, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="B1.2
8
- x+" data-x="-3.5250000000000004" data-y="2.9699999999999998" cx="247.17190388170047" cy="232.0887245841036" r="3" fill="hsl(211, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="SW1.1
9
- x-" data-x="-2.38" data-y="3" cx="416.4879852125693" cy="227.65249537892794" r="3" fill="hsl(104, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="SW1.2
10
- x+" data-x="-1.62" data-y="3" cx="528.8724584103511" cy="227.65249537892794" r="3" fill="hsl(105, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C3.1
11
- x-" data-x="-3.3" data-y="1.5" cx="280.4436229205175" cy="449.463955637708" r="3" fill="hsl(243, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C3.2
12
- x+" data-x="-2.7" data-y="1.5" cx="369.1682070240295" cy="449.463955637708" r="3" fill="hsl(244, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
13
- orientation: x-" data-x="-4.475" data-y="2.9699999999999998" cx="106.69131238447312" cy="232.0887245841036" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
14
- orientation: x-" data-x="-2.38" data-y="3" cx="416.4879852125693" cy="227.65249537892794" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
15
- orientation: y-" data-x="-3.5250000000000004" data-y="2.8" cx="247.17190388170047" cy="257.2273567467653" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
16
- orientation: y+" data-x="-1.3790000000000002" data-y="3.251" cx="564.5101663585951" cy="190.5360443622921" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
17
- orientation: y+" data-x="-3.541" data-y="1.9509999999999998" cx="244.8059149722735" cy="382.77264325323483" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g id="crosshair" style="display: none"><line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5"/><line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5"/><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text></g><script><![CDATA[
1
+ <svg width="640" height="640" viewBox="0 0 640 640" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="white"/><g><polyline data-points="-4.475,2.9699999999999998 -2.38,3" data-type="line" data-label="" points="86.20462046204614,228.4378437843784 408.86688668866884,223.8173817381737" fill="none" stroke="hsl(192, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-3.5250000000000004,2.9699999999999998 -2.7,1.5" data-type="line" data-label="" points="232.5192519251924,228.4378437843784 359.5819581958195,454.8404840484048" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-1.62,3 -3.3,1.5" data-type="line" data-label="" points="525.9185918591859,223.8173817381737 267.17271727172715,454.8404840484048" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.5250000000000004,2.9699999999999998 -2.5,2.9699999999999998 -2.5,1.5 -2.7,1.5" data-type="line" data-label="" points="232.5192519251924,228.4378437843784 390.38503850385035,228.4378437843784 390.38503850385035,454.8404840484048 359.5819581958195,454.8404840484048" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-4.475,2.9699999999999998 -4.675,2.9699999999999998 -4.675,3.45 -2.58,3.45 -2.58,3 -2.38,3" data-type="line" data-label="" points="86.20462046204614,228.4378437843784 55.401540154015265,228.4378437843784 55.401540154015265,154.51045104510433 378.063806380638,154.51045104510433 378.063806380638,223.8173817381737 408.86688668866884,223.8173817381737" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-1.62,3 -1.3790000000000002,3 -1.3790000000000002,3.251" data-type="line" data-label="" points="525.9185918591859,223.8173817381737 563.036303630363,223.8173817381737 563.036303630363,185.1595159515951" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-3.3,1.5 -3.541,1.5 -3.541,1.9509999999999998" data-type="line" data-label="" points="267.17271727172715,454.8404840484048 230.05500550055,454.8404840484048 230.05500550055,385.37953795379536" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-4" data-y="3" x="86.20462046204614" y="201.48514851485137" width="146.31463146314627" height="44.66446644664467" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006492857142857141"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="-2" data-y="3" x="408.86688668866884" y="185.31353135313518" width="117.05170517051704" height="77.00770077007707" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006492857142857141"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="-3" data-y="1.5" x="267.17271727172715" y="390.15401540154005" width="92.40924092409233" height="129.37293729372942" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.006492857142857141"/></g><g><rect data-type="rect" data-label="netId: .B1 &gt; .pin1 to .SW1 &gt; .pin1
2
+ globalConnNetId: connectivity_net0" data-x="-4.675" data-y="2.7449999999999997" x="39.99999999999994" y="228.43784378437843" width="30.803080308030644" height="69.30693069306932" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.006492857142857141"/></g><g><rect data-type="rect" data-label="netId: GND
3
+ globalConnNetId: connectivity_net1" data-x="-3.0125" data-y="2.76" x="274.4884488448844" y="228.4378437843784" width="73.92739273927401" height="64.68646864686468" fill="#00000066" stroke="#000000" stroke-width="0.006492857142857141"/></g><g><rect data-type="rect" data-label="netId: VCC
4
+ globalConnNetId: connectivity_net2" data-x="-1.3790000000000002" data-y="3.461" x="526.072607260726" y="120.47304730473039" width="73.92739273927396" height="64.68646864686474" fill="#ef444466" stroke="#ef4444" stroke-width="0.006492857142857141"/></g><g><rect data-type="rect" data-label="netId: VCC
5
+ globalConnNetId: connectivity_net2" data-x="-3.541" data-y="2.161" x="193.09130913091306" y="320.6930693069306" width="73.9273927392739" height="64.68646864686468" fill="#ef444466" stroke="#ef4444" stroke-width="0.006492857142857141"/></g><g><circle data-type="point" data-label="B1.1
6
+ x-" data-x="-4.475" data-y="2.9699999999999998" cx="86.20462046204614" cy="228.4378437843784" r="3" fill="hsl(210, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="B1.2
7
+ x+" data-x="-3.5250000000000004" data-y="2.9699999999999998" cx="232.5192519251924" cy="228.4378437843784" r="3" fill="hsl(211, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="SW1.1
8
+ x-" data-x="-2.38" data-y="3" cx="408.86688668866884" cy="223.8173817381737" r="3" fill="hsl(104, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="SW1.2
9
+ x+" data-x="-1.62" data-y="3" cx="525.9185918591859" cy="223.8173817381737" r="3" fill="hsl(105, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C3.1
10
+ x-" data-x="-3.3" data-y="1.5" cx="267.17271727172715" cy="454.8404840484048" r="3" fill="hsl(243, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="C3.2
11
+ x+" data-x="-2.7" data-y="1.5" cx="359.5819581958195" cy="454.8404840484048" r="3" fill="hsl(244, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
12
+ orientation: y-" data-x="-4.675" data-y="2.9699999999999998" cx="55.401540154015265" cy="228.4378437843784" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
13
+ orientation: y-" data-x="-3.0125" data-y="2.9699999999999998" cx="311.45214521452135" cy="228.4378437843784" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
14
+ orientation: y+" data-x="-1.3790000000000002" data-y="3.251" cx="563.036303630363" cy="185.1595159515951" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
15
+ orientation: y+" data-x="-3.541" data-y="1.9509999999999998" cx="230.05500550055" cy="385.37953795379536" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g id="crosshair" style="display: none"><line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5"/><line id="crosshair-v" x1="0" x2="640" stroke="#666" stroke-width="0.5"/><text id="coordinates" font-family="monospace" font-size="12" fill="#666"></text></g><script><![CDATA[
18
16
  document.currentScript.parentElement.addEventListener('mousemove', (e) => {
19
17
  const svg = e.currentTarget;
20
18
  const rect = svg.getBoundingClientRect();
@@ -36,7 +34,7 @@ orientation: y+" data-x="-3.541" data-y="1.9509999999999998" cx="244.80591497227
36
34
  v.setAttribute('y2', '640');
37
35
 
38
36
  // Calculate real coordinates using inverse transformation
39
- const matrix = {"a":147.87430683918672,"c":0,"e":768.4288354898337,"b":0,"d":-147.87430683918672,"f":671.2754158964881};
37
+ const matrix = {"a":154.01540154015404,"c":0,"e":775.4235423542355,"b":0,"d":-154.01540154015404,"f":685.8635863586359};
40
38
  // Manually invert and apply the affine transform
41
39
  // Since we only use translate and scale, we can directly compute:
42
40
  // x' = (x - tx) / sx
@@ -0,0 +1,212 @@
1
+ {
2
+ "chips": [
3
+ {
4
+ "chipId": "U1",
5
+ "center": {
6
+ "x": 0,
7
+ "y": 0
8
+ },
9
+ "width": 1,
10
+ "height": 2,
11
+ "pins": [
12
+ {
13
+ "pinId": "U1.1",
14
+ "x": 0.5,
15
+ "y": 0.6
16
+ },
17
+ {
18
+ "pinId": "U1.2",
19
+ "x": 0.5,
20
+ "y": 0.4
21
+ },
22
+ {
23
+ "pinId": "U1.3",
24
+ "x": 0.5,
25
+ "y": 0.2
26
+ },
27
+ {
28
+ "pinId": "U1.4",
29
+ "x": 0.5,
30
+ "y": 0
31
+ },
32
+ {
33
+ "pinId": "U1.5",
34
+ "x": 0.5,
35
+ "y": -0.2
36
+ },
37
+ {
38
+ "pinId": "U1.6",
39
+ "x": 0.5,
40
+ "y": -0.4
41
+ },
42
+ {
43
+ "pinId": "U1.7",
44
+ "x": 0.5,
45
+ "y": -0.6
46
+ }
47
+ ]
48
+ },
49
+ {
50
+ "chipId": "U2",
51
+ "center": {
52
+ "x": 6,
53
+ "y": 0
54
+ },
55
+ "width": 1,
56
+ "height": 2,
57
+ "pins": [
58
+ {
59
+ "pinId": "U2.1",
60
+ "x": 5.5,
61
+ "y": 0.4
62
+ },
63
+ {
64
+ "pinId": "U2.2",
65
+ "x": 5.5,
66
+ "y": 0.2
67
+ },
68
+ {
69
+ "pinId": "U2.3",
70
+ "x": 5.5,
71
+ "y": 0
72
+ },
73
+ {
74
+ "pinId": "U2.4",
75
+ "x": 5.5,
76
+ "y": -0.2
77
+ },
78
+ {
79
+ "pinId": "U2.5",
80
+ "x": 5.5,
81
+ "y": -0.4
82
+ }
83
+ ]
84
+ },
85
+ {
86
+ "chipId": "U3",
87
+ "center": {
88
+ "x": 1.8,
89
+ "y": 0
90
+ },
91
+ "width": 0.5,
92
+ "height": 3,
93
+ "pins": [
94
+ {
95
+ "pinId": "U3.1",
96
+ "x": 1.8,
97
+ "y": 1.5
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "chipId": "C1",
103
+ "center": {
104
+ "x": 0.8,
105
+ "y": 1.2
106
+ },
107
+ "width": 1.4,
108
+ "height": 0.9,
109
+ "pins": [
110
+ {
111
+ "pinId": "C1.1",
112
+ "x": 0.8,
113
+ "y": 0.75
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "chipId": "C2",
119
+ "center": {
120
+ "x": 0.8,
121
+ "y": -1.2
122
+ },
123
+ "width": 1.4,
124
+ "height": 0.9,
125
+ "pins": [
126
+ {
127
+ "pinId": "C2.1",
128
+ "x": 0.8,
129
+ "y": -0.75
130
+ }
131
+ ]
132
+ }
133
+ ],
134
+ "directConnections": [],
135
+ "netConnections": [
136
+ {
137
+ "netId": "QD0",
138
+ "pinIds": [
139
+ "U1.2",
140
+ "U2.1"
141
+ ],
142
+ "netLabelWidth": 0.48
143
+ },
144
+ {
145
+ "netId": "QD1",
146
+ "pinIds": [
147
+ "U1.3",
148
+ "U2.2"
149
+ ],
150
+ "netLabelWidth": 0.48
151
+ },
152
+ {
153
+ "netId": "QD2",
154
+ "pinIds": [
155
+ "U1.4",
156
+ "U2.3"
157
+ ],
158
+ "netLabelWidth": 0.48
159
+ },
160
+ {
161
+ "netId": "QD3",
162
+ "pinIds": [
163
+ "U1.5",
164
+ "U2.4"
165
+ ],
166
+ "netLabelWidth": 0.48
167
+ },
168
+ {
169
+ "netId": "QCLK",
170
+ "pinIds": [
171
+ "U1.6",
172
+ "U2.5"
173
+ ],
174
+ "netLabelWidth": 0.6
175
+ },
176
+ {
177
+ "netId": "V1V1",
178
+ "pinIds": [
179
+ "U1.1",
180
+ "U1.7"
181
+ ],
182
+ "netLabelWidth": 0.42,
183
+ "netLabelHeight": 0.6
184
+ }
185
+ ],
186
+ "availableNetLabelOrientations": {
187
+ "QD0": [
188
+ "x-",
189
+ "x+"
190
+ ],
191
+ "QD1": [
192
+ "x-",
193
+ "x+"
194
+ ],
195
+ "QD2": [
196
+ "x-",
197
+ "x+"
198
+ ],
199
+ "QD3": [
200
+ "x-",
201
+ "x+"
202
+ ],
203
+ "QCLK": [
204
+ "x-",
205
+ "x+"
206
+ ],
207
+ "V1V1": [
208
+ "y+"
209
+ ]
210
+ },
211
+ "maxMspPairDistance": 2.4
212
+ }
@@ -0,0 +1,59 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import inputProblem from "./assets/repro-netlabel-collision-687.input.json"
4
+ import "tests/fixtures/matcher"
5
+
6
+ const boundsOf = (label: {
7
+ center: { x: number; y: number }
8
+ width: number
9
+ height: number
10
+ }) => ({
11
+ minX: label.center.x - label.width / 2,
12
+ maxX: label.center.x + label.width / 2,
13
+ minY: label.center.y - label.height / 2,
14
+ maxY: label.center.y + label.height / 2,
15
+ })
16
+
17
+ const overlapArea = (
18
+ a: ReturnType<typeof boundsOf>,
19
+ b: ReturnType<typeof boundsOf>,
20
+ ) => {
21
+ const w = Math.min(a.maxX, b.maxX) - Math.max(a.minX, b.minX)
22
+ const h = Math.min(a.maxY, b.maxY) - Math.max(a.minY, b.minY)
23
+ return w > 0 && h > 0 ? w * h : 0
24
+ }
25
+
26
+ // Reproduction for #687, minimized from bug-report-20260721T221026Z.
27
+ //
28
+ // U1's right-edge pin column is fully walled in: a solid column of port
29
+ // labels (QD0..QD3, QCLK) to the east, chips C1/C2 above and below, and
30
+ // chip U3 closing off the corridor. The V1V1 trace (U1.1 -> U1.7) wraps
31
+ // around the label column, and its net label has NO strictly collision-free
32
+ // candidate anywhere along the trace. NetLabelNetLabelCollisionSolver gives
33
+ // up and leaves the V1V1 label stacked directly on top of the QD3 and QCLK
34
+ // port labels — the same pile-up as the original board.
35
+ //
36
+ // This test asserts the CURRENT (buggy) behavior so the bug is pinned by CI.
37
+ // A fix should flip the two non-zero overlap assertions to .toBe(0).
38
+ test("repro #687: V1V1 net label left stacked on QD3/QCLK port labels", () => {
39
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
40
+ solver.solve()
41
+
42
+ const labels =
43
+ solver.netLabelNetLabelCollisionSolver!.outputNetLabelPlacements
44
+
45
+ const v1v1 = labels.find((l) => l.netId === "V1V1")!
46
+ const qd3 = labels.find((l) => l.netId === "QD3" && l.center.x < 3)!
47
+ const qclk = labels.find((l) => l.netId === "QCLK" && l.center.x < 3)!
48
+ expect(v1v1).toBeDefined()
49
+ expect(qd3).toBeDefined()
50
+ expect(qclk).toBeDefined()
51
+
52
+ // BUG: the V1V1 label still overlaps both port labels after the collision
53
+ // solver has run (total stacked overlap ≈ 0.16)
54
+ expect(overlapArea(boundsOf(v1v1), boundsOf(qd3))).toBeGreaterThan(0)
55
+ expect(overlapArea(boundsOf(v1v1), boundsOf(qclk))).toBeGreaterThan(0)
56
+
57
+ // visual snapshot: the V1V1 label sits on the QD3/QCLK pile-up
58
+ expect(solver).toMatchSolverSnapshot(import.meta.path)
59
+ })
@@ -0,0 +1,49 @@
1
+ import { expect, test } from "bun:test"
2
+ import { countPathIntersections } from "lib/solvers/Example28Solver/geometry"
3
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
4
+ import { segmentOverlapsRectBoundary } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/collisions"
5
+ import { chipToRect } from "lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/rect"
6
+ import inputProblem from "tests/bug-reports/bug-report-20260724T175257Z/bug-report-20260724T175257Z.json"
7
+
8
+ test("recovers paired connections through clear same-net junctions", () => {
9
+ const solver = new SchematicTracePipelineSolver(inputProblem as any)
10
+
11
+ solver.solve()
12
+
13
+ const recoveredTraces =
14
+ solver.unroutedTraceRecoverySolver!.solvedUnroutedTraces
15
+ const alreadySolvedTraces =
16
+ solver.longDistancePairSolver!.getOutput().allTracesMerged
17
+
18
+ expect(recoveredTraces.map((trace) => trace.mspPairId)).toEqual([
19
+ "R1.1-C1.1",
20
+ "R1.2-C1.2",
21
+ ])
22
+
23
+ for (const recoveredTrace of recoveredTraces) {
24
+ for (
25
+ let pointIndex = 0;
26
+ pointIndex < recoveredTrace.tracePath.length - 1;
27
+ pointIndex++
28
+ ) {
29
+ const startPoint = recoveredTrace.tracePath[pointIndex]!
30
+ const endPoint = recoveredTrace.tracePath[pointIndex + 1]!
31
+ for (const chip of solver.inputProblem.chips) {
32
+ expect(
33
+ segmentOverlapsRectBoundary(startPoint, endPoint, chipToRect(chip)),
34
+ ).toBe(false)
35
+ }
36
+ }
37
+ for (const existingTrace of alreadySolvedTraces) {
38
+ const intersectionCount = countPathIntersections(
39
+ recoveredTrace.tracePath,
40
+ existingTrace.tracePath,
41
+ )
42
+ if (recoveredTrace.globalConnNetId === existingTrace.globalConnNetId) {
43
+ expect(intersectionCount).toBeGreaterThan(0)
44
+ continue
45
+ }
46
+ expect(intersectionCount).toBe(0)
47
+ }
48
+ }
49
+ })
@@ -0,0 +1,30 @@
1
+ import { expect, test } from "bun:test"
2
+ import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
3
+ import { UnroutedTraceRecoverySolver } from "lib/solvers/UnroutedTraceRecoverySolver/UnroutedTraceRecoverySolver"
4
+ import inputProblem from "tests/assets/example12.json"
5
+
6
+ test("does not recover the canonical ground connectivity net", () => {
7
+ const pipelineSolver = new SchematicTracePipelineSolver(inputProblem as any)
8
+ pipelineSolver.solveUntilPhase("unroutedTraceRecoverySolver")
9
+
10
+ const failedConnectionPairs =
11
+ pipelineSolver.schematicTraceLinesSolver!.failedConnectionPairs.map(
12
+ (connectionPair) => {
13
+ return {
14
+ ...connectionPair,
15
+ userNetId: undefined,
16
+ }
17
+ },
18
+ )
19
+ const recoverySolver = new UnroutedTraceRecoverySolver({
20
+ inputProblem: pipelineSolver.inputProblem,
21
+ failedConnectionPairs,
22
+ alreadySolvedTraces:
23
+ pipelineSolver.longDistancePairSolver!.getOutput().allTracesMerged,
24
+ })
25
+
26
+ recoverySolver.solve()
27
+
28
+ expect(failedConnectionPairs).not.toHaveLength(0)
29
+ expect(recoverySolver.solvedUnroutedTraces).toHaveLength(0)
30
+ })