@tscircuit/schematic-trace-solver 0.0.146 → 0.0.148
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.
- package/dist/index.d.ts +7 -2
- package/dist/index.js +191 -76
- package/lib/solvers/AvailableNetOrientationSolver/AvailableNetOrientationSolver.ts +38 -30
- package/lib/solvers/NetLabelPlacementSolver/NetLabelPlacementSolver.ts +6 -21
- package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2.ts +7 -23
- package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +57 -0
- package/lib/solvers/TraceAnchoredNetLabelOverlapSolver/candidates.ts +7 -14
- package/lib/solvers/TraceCleanupSolver/sub-solver/UntangleTraceSubsolver.ts +17 -1
- package/lib/solvers/TraceCleanupSolver/sub-solver/generateLShapeRerouteCandidates.ts +52 -0
- package/lib/types/InputProblem.ts +8 -0
- package/lib/utils/getNetLabelWidthForConnection.ts +63 -0
- package/package.json +1 -1
- package/tests/repros/__snapshots__/board1096-usb-label-overlap-iteration.snap.svg +3 -3
- package/tests/repros/__snapshots__/repro-core-555-power-cross-net-overlap.snap.svg +59 -0
- package/tests/repros/__snapshots__/repro-ti-power-output-section.snap.svg +80 -0
- package/tests/repros/repro-core-555-power-cross-net-overlap.test.ts +136 -0
- package/tests/repros/repro-ti-power-output-section.input.ts +341 -0
- package/tests/repros/repro-ti-power-output-section.test.ts +13 -0
- package/tests/solvers/InlineNetLabelSolver/__snapshots__/fallback-net-label-width.snap.svg +69 -0
- package/tests/solvers/InlineNetLabelSolver/fallback-net-label-width.test.ts +152 -0
|
@@ -0,0 +1,80 @@
|
|
|
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="-3.35,1.2 1.016,0.2" data-type="line" data-label="" points="190.50192759334345,279.20485629325884 389.62053846380934,324.81150101851443" fill="none" stroke="hsl(29, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-3.35,1.2 -2.7,1.6" data-type="line" data-label="" points="190.50192759334345,279.20485629325884 220.1462466647596,260.9621984031566" fill="none" stroke="hsl(228, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-3.8,0.7200000000000001 -3.35,1.2" data-type="line" data-label="" points="169.97893746697844,301.0960457613815 190.50192759334345,279.20485629325884" fill="none" stroke="hsl(40, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-2.2,0.7200000000000001 -3.35,1.2" data-type="line" data-label="" points="242.94956902738738,301.0960457613815 190.50192759334345,279.20485629325884" fill="none" stroke="hsl(32, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-0.9,1 -3.35,1.2" data-type="line" data-label="" points="302.23820717021965,288.32618523830996 190.50192759334345,279.20485629325884" fill="none" stroke="hsl(344, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-0.9,0.3999999999999999 -0.9,0.040000000000000036" data-type="line" data-label="" points="302.23820717021965,315.6901720734633 302.23820717021965,332.10856417455534" fill="none" stroke="hsl(216, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="0.3,0.4800000000000001 -3.35,1.2" data-type="line" data-label="" points="356.96618084052636,312.04164049544283 190.50192759334345,279.20485629325884" fill="none" stroke="hsl(256, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="2.684,0.2 2.7720874999999996,1.401" data-type="line" data-label="" points="465.6924218655357,324.81150101851443 469.70979718277164,270.0379207034825" fill="none" stroke="hsl(16, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="2.684,0 2.7220874999999998,-0.535" data-type="line" data-label="" points="465.6924218655357,333.93282996356555 467.42946494650886,358.3323848915773" fill="none" stroke="hsl(16, 100%, 50%, 0.8)" stroke-width="1px"/></g><g><polyline data-points="-3.35,1.2 -2.7,1.6" data-type="line" data-label="" points="190.50192759334345,279.20485629325884 220.1462466647596,260.9621984031566" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.35,1.2 -3.8,0.7200000000000001" data-type="line" data-label="" points="190.50192759334345,279.20485629325884 169.97893746697844,301.0960457613815" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.35,1.2 -2.2,0.7200000000000001" data-type="line" data-label="" points="190.50192759334345,279.20485629325884 242.94956902738738,301.0960457613815" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.35,1.2 -0.9,1" data-type="line" data-label="" points="190.50192759334345,279.20485629325884 302.23820717021965,288.32618523830996" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.35,1.2 0.3,0.4800000000000001" data-type="line" data-label="" points="190.50192759334345,279.20485629325884 356.96618084052636,312.04164049544283" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.35,1.2 1.016,0.2" data-type="line" data-label="" points="190.50192759334345,279.20485629325884 389.62053846380934,324.81150101851443" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.7,1.6 -3.8,0.7200000000000001" data-type="line" data-label="" points="220.1462466647596,260.9621984031566 169.97893746697844,301.0960457613815" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.7,1.6 -2.2,0.7200000000000001" data-type="line" data-label="" points="220.1462466647596,260.9621984031566 242.94956902738738,301.0960457613815" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.7,1.6 -0.9,1" data-type="line" data-label="" points="220.1462466647596,260.9621984031566 302.23820717021965,288.32618523830996" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.7,1.6 0.3,0.4800000000000001" data-type="line" data-label="" points="220.1462466647596,260.9621984031566 356.96618084052636,312.04164049544283" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.7,1.6 1.016,0.2" data-type="line" data-label="" points="220.1462466647596,260.9621984031566 389.62053846380934,324.81150101851443" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.8,0.7200000000000001 -2.2,0.7200000000000001" data-type="line" data-label="" points="169.97893746697844,301.0960457613815 242.94956902738738,301.0960457613815" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.8,0.7200000000000001 -0.9,1" data-type="line" data-label="" points="169.97893746697844,301.0960457613815 302.23820717021965,288.32618523830996" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.8,0.7200000000000001 0.3,0.4800000000000001" data-type="line" data-label="" points="169.97893746697844,301.0960457613815 356.96618084052636,312.04164049544283" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.8,0.7200000000000001 1.016,0.2" data-type="line" data-label="" points="169.97893746697844,301.0960457613815 389.62053846380934,324.81150101851443" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.2,0.7200000000000001 -0.9,1" data-type="line" data-label="" points="242.94956902738738,301.0960457613815 302.23820717021965,288.32618523830996" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.2,0.7200000000000001 0.3,0.4800000000000001" data-type="line" data-label="" points="242.94956902738738,301.0960457613815 356.96618084052636,312.04164049544283" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.2,0.7200000000000001 1.016,0.2" data-type="line" data-label="" points="242.94956902738738,301.0960457613815 389.62053846380934,324.81150101851443" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.9,1 0.3,0.4800000000000001" data-type="line" data-label="" points="302.23820717021965,288.32618523830996 356.96618084052636,312.04164049544283" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.9,1 1.016,0.2" data-type="line" data-label="" points="302.23820717021965,288.32618523830996 389.62053846380934,324.81150101851443" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="0.3,0.4800000000000001 1.016,0.2" data-type="line" data-label="" points="356.96618084052636,312.04164049544283 389.62053846380934,324.81150101851443" fill="none" stroke="hsl(349, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.8,-0.3200000000000002 -2.2,-0.3200000000000002" data-type="line" data-label="" points="169.97893746697844,348.52695627564736 242.94956902738738,348.52695627564736" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.8,-0.3200000000000002 -0.9,-1.04" data-type="line" data-label="" points="169.97893746697844,348.52695627564736 302.23820717021965,381.36374047783136" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.8,-0.3200000000000002 0.3,-0.28" data-type="line" data-label="" points="169.97893746697844,348.52695627564736 356.96618084052636,346.7026904866371" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.8,-0.3200000000000002 1.016,0" data-type="line" data-label="" points="169.97893746697844,348.52695627564736 389.62053846380934,333.93282996356555" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.2,-0.3200000000000002 -0.9,-1.04" data-type="line" data-label="" points="242.94956902738738,348.52695627564736 302.23820717021965,381.36374047783136" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.2,-0.3200000000000002 0.3,-0.28" data-type="line" data-label="" points="242.94956902738738,348.52695627564736 356.96618084052636,346.7026904866371" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-2.2,-0.3200000000000002 1.016,0" data-type="line" data-label="" points="242.94956902738738,348.52695627564736 389.62053846380934,333.93282996356555" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.9,-1.04 0.3,-0.28" data-type="line" data-label="" points="302.23820717021965,381.36374047783136 356.96618084052636,346.7026904866371" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-0.9,-1.04 1.016,0" data-type="line" data-label="" points="302.23820717021965,381.36374047783136 389.62053846380934,333.93282996356555" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="0.3,-0.28 1.016,0" data-type="line" data-label="" points="356.96618084052636,346.7026904866371 389.62053846380934,333.93282996356555" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1px" stroke-dasharray="4 2"/></g><g><polyline data-points="-3.8,0.7200000000000001 -3.8,0.76 -2.0300000000000002,0.76 -2.0300000000000002,1.2000000000000002 -3.35,1.2000000000000002" data-type="line" data-label="" points="169.97893746697844,301.0960457613815 169.97893746697844,299.2717799723713 250.70269863068083,299.2717799723713 250.70269863068083,279.20485629325884 190.50192759334345,279.20485629325884" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-0.8999999999999999,0.9999999999999999 -0.8999999999999999,1.1999999999999997 -2.2,1.1999999999999997 -2.2,0.7200000000000001" data-type="line" data-label="" points="302.23820717021965,288.32618523830996 302.23820717021965,279.20485629325884 242.94956902738738,279.20485629325884 242.94956902738738,301.0960457613815" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="0.29999999999999993,0.4800000000000001 0.29999999999999993,1.2000000000000002 -0.9,1.2000000000000002 -0.9,1" data-type="line" data-label="" points="356.96618084052636,312.04164049544283 356.96618084052636,279.20485629325884 302.23820717021965,279.20485629325884 302.23820717021965,288.32618523830996" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.016,0.2 0.9555,0.2 0.9555,0.5710000000000002 0.3,0.5710000000000002 0.3,0.4800000000000001" data-type="line" data-label="" points="389.62053846380934,324.81150101851443 386.86133645793143,324.81150101851443 386.86133645793143,307.8914358254446 356.96618084052636,307.8914358254446 356.96618084052636,312.04164049544283" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-0.9,0.3999999999999999 -0.9,0.040000000000000036" data-type="line" data-label="" points="302.23820717021965,315.6901720734633 302.23820717021965,332.10856417455534" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="2.684,0.2 2.72804375,0.2 2.72804375,1.401 2.7720874999999996,1.401" data-type="line" data-label="" points="465.6924218655357,324.81150101851443 467.70110952415365,324.81150101851443 467.70110952415365,270.0379207034825 469.70979718277164,270.0379207034825" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="2.684,0 2.70304375,0 2.70304375,-0.535 2.7220874999999998,-0.535" data-type="line" data-label="" points="465.6924218655357,333.93282996356555 466.56094340602226,333.93282996356555 466.56094340602226,358.3323848915773 467.42946494650886,358.3323848915773" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="1.016,0 0.9555,0 0.9555,-0.48000000000000004 0.3,-0.48000000000000004 0.3,-0.28" data-type="line" data-label="" points="389.62053846380934,333.93282996356555 386.86133645793143,333.93282996356555 386.86133645793143,355.8240194316882 356.96618084052636,355.8240194316882 356.96618084052636,346.7026904866371" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-0.9,-1.04 -0.9,-1.2400000000000002 0.30000000000000016,-1.2400000000000002 0.30000000000000016,-0.2799999999999998" data-type="line" data-label="" points="302.23820717021965,381.36374047783136 302.23820717021965,390.4850694228825 356.96618084052636,390.4850694228825 356.96618084052636,346.7026904866371" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.2,-0.3200000000000002 -2.2,-1.2399999999999998 -0.8999999999999999,-1.2399999999999998 -0.8999999999999999,-1.04" data-type="line" data-label="" points="242.94956902738738,348.52695627564736 242.94956902738738,390.4850694228825 302.23820717021965,390.4850694228825 302.23820717021965,381.36374047783136" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-3.8,-0.3200000000000002 -3.8,-0.5200000000000004 -2.2,-0.5200000000000004 -2.2,-0.3200000000000002" data-type="line" data-label="" points="169.97893746697844,348.52695627564736 169.97893746697844,357.6482852206985 242.94956902738738,357.6482852206985 242.94956902738738,348.52695627564736" fill="none" stroke="purple" stroke-width="1px"/></g><g><polyline data-points="-2.7,1.6 -3.301,1.6 -3.301,1.851" data-type="line" data-label="" points="220.1462466647596,260.9621984031566 192.73665318488096,260.9621984031566 192.73665318488096,249.51493057711747" fill="none" stroke="purple" stroke-width="1px"/></g><g><rect data-type="rect" data-label="schematic_component_0" data-x="-5" data-y="1.2" x="40" y="260.9621984031566" width="150.50192759334345" height="36.48531578020447" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="schematic_component_1" data-x="-2.33875" data-y="1.6" x="220.1462466647596" y="256.40153393063105" width="32.95080081399715" height="9.121328945051118" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="schematic_component_2" data-x="-3.7" data-y="0.19999999999999998" x="157.6651433911594" y="301.0960457613815" width="33.748917096689155" height="47.43091051426586" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="schematic_component_3" data-x="-2.1" data-y="0.19999999999999998" x="230.63577495156835" y="301.0960457613815" width="33.74891709668918" height="47.43091051426586" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="schematic_component_4" data-x="-0.685" data-y="0.7" x="281.71521704385464" y="288.32618523830996" width="60.656837484589914" height="27.363986835153355" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="schematic_component_5" data-x="-0.715" data-y="-0.5" x="288.10014730539046" y="332.10856417455534" width="45.150578278003024" height="49.255176303276016" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="schematic_component_6" data-x="0.3725" data-y="0.10000000000000003" x="336.44319071416135" y="312.04164049544283" width="47.658943737892116" height="34.66104999119426" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="schematic_component_7" data-x="1.85" data-y="0.10000000000000003" x="389.62053846380934" y="284.13037392358643" width="76.07188340172638" height="90.48358313490712" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="L1" data-x="3.3" data-y="1.401" x="469.7097971827716" y="250.2505497942102" width="48.15263566704306" height="39.574741818544595" fill="hsl(245, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="L5" data-x="3.25" data-y="-0.535" x="467.4294649465089" y="338.545013982305" width="48.152635667042944" height="39.57474181854457" fill="hsl(249, 100%, 50%, 0.8)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="REPEAT(F,1,2) TPS2663.SchDoc" data-x="-4.57" data-y="1.7150000000000003" x="55.50625920658689" y="250.01660366909522" width="158.71112364388944" height="11.401661181313926" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="6.8uH coupled inductor" data-x="2.736" data-y="-1.022" x="407.8631963539116" y="376.43822284750377" width="120.40154207467475" height="8.209196050545984" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="L3" data-x="1.536" data-y="1.2070000000000003" x="405.1267976703963" y="273.1847791895251" width="16.418392101092024" height="11.401661181313898" fill="rgba(160, 0, 220, 0.14)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="netId: V48_Vout2
|
|
2
|
+
globalConnNetId: connectivity_net0" data-x="-0.8999999999999999" data-y="1.4099999999999997" x="274.8742203350663" y="260.0500655086515" width="54.72797367030671" height="19.154790784607314" fill="#ef444466" stroke="#ef4444" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="netId: V48_Vout2
|
|
3
|
+
globalConnNetId: connectivity_net0" data-x="-3.301" data-y="2.061" x="165.37266634972758" y="230.3601397925101" width="54.72797367030674" height="19.15479078460737" fill="#ef444466" stroke="#ef4444" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="netId: GND
|
|
4
|
+
globalConnNetId: connectivity_net4" data-x="-0.9" data-y="-1.4500000000000002" x="291.2926124361583" y="390.4850694228825" width="21.89118946812266" height="19.15479078460737" fill="#00000066" stroke="#000000" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="netId: .R109 > .pin2 to .D27 > .pin1
|
|
5
|
+
globalConnNetId: connectivity_net1" data-x="-0.675" data-y="0.21999999999999997" x="302.23820717021965" y="319.33870365148374" width="20.522990126365016" height="9.121328945051118" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="netId: .L3 > .pin2 to .L1 > .pin1
|
|
6
|
+
globalConnNetId: connectivity_net2" data-x="2.95304375" data-y="0.2" x="467.7011095241536" y="320.2508365459889" width="20.522990126365073" height="9.121328945051118" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="netId: .L3 > .pin4 to .L5 > .pin1
|
|
7
|
+
globalConnNetId: connectivity_net3" data-x="2.92804375" data-y="0" x="466.5609434060223" y="329.37216549104" width="20.522990126365016" height="9.121328945051118" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="netId: Power_OUTPUT_P
|
|
8
|
+
globalConnNetId: connectivity_net5" data-x="4.728912500000001" data-y="1.401" x="517.9080394945399" y="265.4772562309569" width="82.09196050546007" height="9.121328945051118" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.021926629464285717"/></g><g><rect data-type="rect" data-label="netId: Power_OUTPUT_N
|
|
9
|
+
globalConnNetId: connectivity_net6" data-x="4.678912500000001" data-y="-0.535" x="515.6277072582772" y="353.77172041905175" width="82.09196050546007" height="9.121328945051118" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.021926629464285717"/></g><g><circle data-type="point" data-label="schematic_port_0
|
|
10
|
+
x+" data-x="-3.35" data-y="1.2" cx="190.50192759334345" cy="279.20485629325884" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_1
|
|
11
|
+
x-" data-x="-2.7" data-y="1.6" cx="220.1462466647596" cy="260.9621984031566" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_2
|
|
12
|
+
y+" data-x="-3.8" data-y="0.7200000000000001" cx="169.97893746697844" cy="301.0960457613815" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_3
|
|
13
|
+
y-" data-x="-3.8" data-y="-0.3200000000000002" cx="169.97893746697844" cy="348.52695627564736" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_4
|
|
14
|
+
y+" data-x="-2.2" data-y="0.7200000000000001" cx="242.94956902738738" cy="301.0960457613815" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_5
|
|
15
|
+
y-" data-x="-2.2" data-y="-0.3200000000000002" cx="242.94956902738738" cy="348.52695627564736" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_6
|
|
16
|
+
y+" data-x="-0.9" data-y="1" cx="302.23820717021965" cy="288.32618523830996" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_7
|
|
17
|
+
y-" data-x="-0.9" data-y="0.3999999999999999" cx="302.23820717021965" cy="315.6901720734633" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_8
|
|
18
|
+
y+" data-x="-0.9" data-y="0.040000000000000036" cx="302.23820717021965" cy="332.10856417455534" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_9
|
|
19
|
+
y-" data-x="-0.9" data-y="-1.04" cx="302.23820717021965" cy="381.36374047783136" r="3" fill="hsl(248, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_10
|
|
20
|
+
y+" data-x="0.3" data-y="0.4800000000000001" cx="356.96618084052636" cy="312.04164049544283" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_11
|
|
21
|
+
y-" data-x="0.3" data-y="-0.28" cx="356.96618084052636" cy="346.7026904866371" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_12
|
|
22
|
+
x-" data-x="1.016" data-y="0.2" cx="389.62053846380934" cy="324.81150101851443" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_13
|
|
23
|
+
x+" data-x="2.684" data-y="0.2" cx="465.6924218655357" cy="324.81150101851443" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_14
|
|
24
|
+
x-" data-x="1.016" data-y="0" cx="389.62053846380934" cy="333.93282996356555" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_15
|
|
25
|
+
x+" data-x="2.684" data-y="0" cx="465.6924218655357" cy="333.93282996356555" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_16
|
|
26
|
+
x-" data-x="2.7720874999999996" data-y="1.401" cx="469.70979718277164" cy="270.0379207034825" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_17
|
|
27
|
+
x+" data-x="3.8279125" data-y="1.401" cx="517.8624328498147" cy="270.0379207034825" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_18
|
|
28
|
+
x-" data-x="2.7220874999999998" data-y="-0.535" cx="467.42946494650886" cy="358.3323848915773" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="schematic_port_19
|
|
29
|
+
x+" data-x="3.7779125000000002" data-y="-0.535" cx="515.5821006135518" cy="358.3323848915773" r="3" fill="hsl(184, 100%, 50%, 0.8)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
30
|
+
orientation: y+" data-x="-0.8999999999999999" data-y="1.1999999999999997" cx="302.23820717021965" cy="279.20485629325884" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
31
|
+
orientation: y+" data-x="-3.301" data-y="1.851" cx="192.73665318488096" cy="249.51493057711747" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
32
|
+
orientation: y-" data-x="-0.9" data-y="-1.2400000000000002" cx="302.23820717021965" cy="390.4850694228825" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
33
|
+
orientation: x+" data-x="-0.9" data-y="0.21999999999999997" cx="302.23820717021965" cy="323.8993681240093" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
34
|
+
orientation: x+" data-x="2.72804375" data-y="0.2" cx="467.70110952415365" cy="324.81150101851443" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
35
|
+
orientation: x+" data-x="2.70304375" data-y="0" cx="466.56094340602226" cy="333.93282996356555" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
36
|
+
orientation: x+" data-x="3.8279125" data-y="1.401" cx="517.8624328498147" cy="270.0379207034825" r="3" fill="hsl(40, 100%, 50%, 0.9)"/></g><g><circle data-type="point" data-label="anchorPoint
|
|
37
|
+
orientation: x+" data-x="3.7779125000000002" data-y="-0.535" cx="515.5821006135518" cy="358.3323848915773" 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[
|
|
38
|
+
document.currentScript.parentElement.addEventListener('mousemove', (e) => {
|
|
39
|
+
const svg = e.currentTarget;
|
|
40
|
+
const rect = svg.getBoundingClientRect();
|
|
41
|
+
const x = e.clientX - rect.left;
|
|
42
|
+
const y = e.clientY - rect.top;
|
|
43
|
+
const crosshair = svg.getElementById('crosshair');
|
|
44
|
+
const h = svg.getElementById('crosshair-h');
|
|
45
|
+
const v = svg.getElementById('crosshair-v');
|
|
46
|
+
const coords = svg.getElementById('coordinates');
|
|
47
|
+
|
|
48
|
+
crosshair.style.display = 'block';
|
|
49
|
+
h.setAttribute('x1', '0');
|
|
50
|
+
h.setAttribute('x2', '640');
|
|
51
|
+
h.setAttribute('y1', y);
|
|
52
|
+
h.setAttribute('y2', y);
|
|
53
|
+
v.setAttribute('x1', x);
|
|
54
|
+
v.setAttribute('x2', x);
|
|
55
|
+
v.setAttribute('y1', '0');
|
|
56
|
+
v.setAttribute('y2', '640');
|
|
57
|
+
|
|
58
|
+
// Calculate real coordinates using inverse transformation
|
|
59
|
+
const matrix = {"a":45.60664472525559,"c":0,"e":343.2841874229497,"b":0,"d":-45.60664472525559,"f":333.93282996356555};
|
|
60
|
+
// Manually invert and apply the affine transform
|
|
61
|
+
// Since we only use translate and scale, we can directly compute:
|
|
62
|
+
// x' = (x - tx) / sx
|
|
63
|
+
// y' = (y - ty) / sy
|
|
64
|
+
const sx = matrix.a;
|
|
65
|
+
const sy = matrix.d;
|
|
66
|
+
const tx = matrix.e;
|
|
67
|
+
const ty = matrix.f;
|
|
68
|
+
const realPoint = {
|
|
69
|
+
x: (x - tx) / sx,
|
|
70
|
+
y: (y - ty) / sy // Flip y back since we used negative scale
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
coords.textContent = `(${realPoint.x.toFixed(2)}, ${realPoint.y.toFixed(2)})`;
|
|
74
|
+
coords.setAttribute('x', (x + 5).toString());
|
|
75
|
+
coords.setAttribute('y', (y - 5).toString());
|
|
76
|
+
});
|
|
77
|
+
document.currentScript.parentElement.addEventListener('mouseleave', () => {
|
|
78
|
+
document.currentScript.parentElement.getElementById('crosshair').style.display = 'none';
|
|
79
|
+
});
|
|
80
|
+
]]></script></svg>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { expect, test } from "bun:test"
|
|
2
|
+
import { doSegmentsIntersect } from "@tscircuit/math-utils"
|
|
3
|
+
import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
|
|
4
|
+
import type { InputProblem } from "lib/types/InputProblem"
|
|
5
|
+
import "tests/fixtures/matcher"
|
|
6
|
+
|
|
7
|
+
// Reduced from @tscircuit/core's schematic-section-2 fixture. The BTN_IN trace
|
|
8
|
+
// crosses the GND trace immediately below SW1.
|
|
9
|
+
const inputProblem: InputProblem = {
|
|
10
|
+
chips: [
|
|
11
|
+
{
|
|
12
|
+
chipId: "schematic_component_0",
|
|
13
|
+
center: { x: -4, y: 3 },
|
|
14
|
+
width: 1,
|
|
15
|
+
height: 0.65,
|
|
16
|
+
pins: [
|
|
17
|
+
{
|
|
18
|
+
pinId: "schematic_port_0",
|
|
19
|
+
x: -4.5,
|
|
20
|
+
y: 3,
|
|
21
|
+
_facingDirection: "x-",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
pinId: "schematic_port_1",
|
|
25
|
+
x: -3.5,
|
|
26
|
+
y: 3,
|
|
27
|
+
_facingDirection: "x+",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
sectionId: "power",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
chipId: "schematic_component_1",
|
|
34
|
+
center: { x: -2, y: 3 },
|
|
35
|
+
width: 0.76,
|
|
36
|
+
height: 0.5,
|
|
37
|
+
pins: [
|
|
38
|
+
{
|
|
39
|
+
pinId: "schematic_port_2",
|
|
40
|
+
x: -2.38,
|
|
41
|
+
y: 3,
|
|
42
|
+
_facingDirection: "x-",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
pinId: "schematic_port_3",
|
|
46
|
+
x: -1.62,
|
|
47
|
+
y: 3,
|
|
48
|
+
_facingDirection: "x+",
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
sectionId: "power",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
chipId: "schematic_component_2",
|
|
55
|
+
center: { x: -3, y: 1.5 },
|
|
56
|
+
width: 0.6,
|
|
57
|
+
height: 0.84,
|
|
58
|
+
pins: [
|
|
59
|
+
{
|
|
60
|
+
pinId: "schematic_port_4",
|
|
61
|
+
x: -3.3,
|
|
62
|
+
y: 1.5,
|
|
63
|
+
_facingDirection: "x-",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
pinId: "schematic_port_5",
|
|
67
|
+
x: -2.7,
|
|
68
|
+
y: 1.5,
|
|
69
|
+
_facingDirection: "x+",
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
sectionId: "power",
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
directConnections: [
|
|
76
|
+
{
|
|
77
|
+
netId: ".B1 > .pin1 to .SW1 > .pin1",
|
|
78
|
+
allowInlineNetLabel: true,
|
|
79
|
+
inlineNetLabelHeight: 0.12,
|
|
80
|
+
inlineNetLabelWidth: 0.56,
|
|
81
|
+
pinIds: ["schematic_port_0", "schematic_port_2"],
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
netConnections: [
|
|
85
|
+
{
|
|
86
|
+
netId: "GND",
|
|
87
|
+
netLabelWidth: 0.42,
|
|
88
|
+
netLabelHeight: 0.48,
|
|
89
|
+
pinIds: ["schematic_port_1", "schematic_port_5"],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
netId: "VCC",
|
|
93
|
+
netLabelWidth: 0.42,
|
|
94
|
+
netLabelHeight: 0.48,
|
|
95
|
+
pinIds: ["schematic_port_3", "schematic_port_4"],
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
textBoxes: [],
|
|
99
|
+
availableNetLabelOrientations: {
|
|
100
|
+
VCC: ["y+"],
|
|
101
|
+
GND: ["y-"],
|
|
102
|
+
},
|
|
103
|
+
maxMspPairDistance: 2.4,
|
|
104
|
+
_hideRatsNet: false,
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
test("core 555 power section avoids a cross-net overlap below SW1", () => {
|
|
108
|
+
const solver = new SchematicTracePipelineSolver(inputProblem)
|
|
109
|
+
|
|
110
|
+
solver.solve()
|
|
111
|
+
|
|
112
|
+
const traces = solver.sameNetJunctionAlignmentSolver!.outputTraces
|
|
113
|
+
const btnTrace = traces.find(
|
|
114
|
+
(trace) => trace.mspPairId === "schematic_port_0-schematic_port_2",
|
|
115
|
+
)!
|
|
116
|
+
const groundTrace = traces.find(
|
|
117
|
+
(trace) => trace.mspPairId === "schematic_port_1-schematic_port_5",
|
|
118
|
+
)!
|
|
119
|
+
const hasIntersection = btnTrace.tracePath
|
|
120
|
+
.slice(0, -1)
|
|
121
|
+
.some((start, index) =>
|
|
122
|
+
groundTrace.tracePath
|
|
123
|
+
.slice(0, -1)
|
|
124
|
+
.some((otherStart, otherIndex) =>
|
|
125
|
+
doSegmentsIntersect(
|
|
126
|
+
start,
|
|
127
|
+
btnTrace.tracePath[index + 1]!,
|
|
128
|
+
otherStart,
|
|
129
|
+
groundTrace.tracePath[otherIndex + 1]!,
|
|
130
|
+
),
|
|
131
|
+
),
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
expect(hasIntersection).toBeFalse()
|
|
135
|
+
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
136
|
+
})
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import type { InputProblem } from "lib/types/InputProblem"
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
chips: [
|
|
5
|
+
{
|
|
6
|
+
chipId: "schematic_component_0",
|
|
7
|
+
center: {
|
|
8
|
+
x: -5,
|
|
9
|
+
y: 1.2,
|
|
10
|
+
},
|
|
11
|
+
width: 3.3,
|
|
12
|
+
height: 0.8000000000000002,
|
|
13
|
+
pins: [
|
|
14
|
+
{
|
|
15
|
+
pinId: "schematic_port_0",
|
|
16
|
+
x: -3.35,
|
|
17
|
+
y: 1.2,
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
chipId: "schematic_component_1",
|
|
23
|
+
center: {
|
|
24
|
+
x: -2.33875,
|
|
25
|
+
y: 1.6,
|
|
26
|
+
},
|
|
27
|
+
width: 0.7225000000000001,
|
|
28
|
+
height: 0.20000000000000018,
|
|
29
|
+
pins: [
|
|
30
|
+
{
|
|
31
|
+
pinId: "schematic_port_1",
|
|
32
|
+
x: -2.7,
|
|
33
|
+
y: 1.6,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
chipId: "schematic_component_2",
|
|
39
|
+
center: {
|
|
40
|
+
x: -3.7,
|
|
41
|
+
y: 0.19999999999999998,
|
|
42
|
+
},
|
|
43
|
+
width: 0.7400000000000002,
|
|
44
|
+
height: 1.0400000000000003,
|
|
45
|
+
pins: [
|
|
46
|
+
{
|
|
47
|
+
pinId: "schematic_port_2",
|
|
48
|
+
x: -3.8,
|
|
49
|
+
y: 0.7200000000000001,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
pinId: "schematic_port_3",
|
|
53
|
+
x: -3.8,
|
|
54
|
+
y: -0.3200000000000002,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
chipId: "schematic_component_3",
|
|
60
|
+
center: {
|
|
61
|
+
x: -2.1,
|
|
62
|
+
y: 0.19999999999999998,
|
|
63
|
+
},
|
|
64
|
+
width: 0.74,
|
|
65
|
+
height: 1.0400000000000003,
|
|
66
|
+
pins: [
|
|
67
|
+
{
|
|
68
|
+
pinId: "schematic_port_4",
|
|
69
|
+
x: -2.2,
|
|
70
|
+
y: 0.7200000000000001,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
pinId: "schematic_port_5",
|
|
74
|
+
x: -2.2,
|
|
75
|
+
y: -0.3200000000000002,
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
chipId: "schematic_component_4",
|
|
81
|
+
center: {
|
|
82
|
+
x: -0.685,
|
|
83
|
+
y: 0.7,
|
|
84
|
+
},
|
|
85
|
+
width: 1.33,
|
|
86
|
+
height: 0.6000000000000001,
|
|
87
|
+
pins: [
|
|
88
|
+
{
|
|
89
|
+
pinId: "schematic_port_6",
|
|
90
|
+
x: -0.9,
|
|
91
|
+
y: 1,
|
|
92
|
+
_facingDirection: "y+",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
pinId: "schematic_port_7",
|
|
96
|
+
x: -0.9,
|
|
97
|
+
y: 0.3999999999999999,
|
|
98
|
+
_facingDirection: "y-",
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
chipId: "schematic_component_5",
|
|
104
|
+
center: {
|
|
105
|
+
x: -0.715,
|
|
106
|
+
y: -0.5,
|
|
107
|
+
},
|
|
108
|
+
width: 0.99,
|
|
109
|
+
height: 1.08,
|
|
110
|
+
pins: [
|
|
111
|
+
{
|
|
112
|
+
pinId: "schematic_port_8",
|
|
113
|
+
x: -0.9,
|
|
114
|
+
y: 0.040000000000000036,
|
|
115
|
+
_facingDirection: "y+",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
pinId: "schematic_port_9",
|
|
119
|
+
x: -0.9,
|
|
120
|
+
y: -1.04,
|
|
121
|
+
_facingDirection: "y-",
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
chipId: "schematic_component_6",
|
|
127
|
+
center: {
|
|
128
|
+
x: 0.3725,
|
|
129
|
+
y: 0.10000000000000003,
|
|
130
|
+
},
|
|
131
|
+
width: 1.045,
|
|
132
|
+
height: 0.7600000000000001,
|
|
133
|
+
pins: [
|
|
134
|
+
{
|
|
135
|
+
pinId: "schematic_port_10",
|
|
136
|
+
x: 0.3,
|
|
137
|
+
y: 0.4800000000000001,
|
|
138
|
+
_facingDirection: "y+",
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
pinId: "schematic_port_11",
|
|
142
|
+
x: 0.3,
|
|
143
|
+
y: -0.28,
|
|
144
|
+
_facingDirection: "y-",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
chipId: "schematic_component_7",
|
|
150
|
+
center: {
|
|
151
|
+
x: 1.85,
|
|
152
|
+
y: 0.10000000000000003,
|
|
153
|
+
},
|
|
154
|
+
width: 1.6680000000000001,
|
|
155
|
+
height: 1.984,
|
|
156
|
+
pins: [
|
|
157
|
+
{
|
|
158
|
+
pinId: "schematic_port_12",
|
|
159
|
+
x: 1.016,
|
|
160
|
+
y: 0.2,
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
pinId: "schematic_port_13",
|
|
164
|
+
x: 2.684,
|
|
165
|
+
y: 0.2,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
pinId: "schematic_port_14",
|
|
169
|
+
x: 1.016,
|
|
170
|
+
y: 0,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
pinId: "schematic_port_15",
|
|
174
|
+
x: 2.684,
|
|
175
|
+
y: 0,
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
chipId: "L1",
|
|
181
|
+
center: {
|
|
182
|
+
x: 3.3,
|
|
183
|
+
y: 1.401,
|
|
184
|
+
},
|
|
185
|
+
width: 1.0558250000000005,
|
|
186
|
+
height: 0.8677407000000001,
|
|
187
|
+
pins: [
|
|
188
|
+
{
|
|
189
|
+
pinId: "schematic_port_16",
|
|
190
|
+
x: 2.7720874999999997,
|
|
191
|
+
y: 1.401,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
pinId: "schematic_port_17",
|
|
195
|
+
x: 3.8279125,
|
|
196
|
+
y: 1.401,
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
chipId: "L5",
|
|
202
|
+
center: {
|
|
203
|
+
x: 3.25,
|
|
204
|
+
y: -0.535,
|
|
205
|
+
},
|
|
206
|
+
width: 1.0558250000000005,
|
|
207
|
+
height: 0.8677407000000001,
|
|
208
|
+
pins: [
|
|
209
|
+
{
|
|
210
|
+
pinId: "schematic_port_18",
|
|
211
|
+
x: 2.7220874999999998,
|
|
212
|
+
y: -0.535,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
pinId: "schematic_port_19",
|
|
216
|
+
x: 3.7779125,
|
|
217
|
+
y: -0.535,
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
directConnections: [
|
|
223
|
+
{
|
|
224
|
+
netId: "48V_Vout",
|
|
225
|
+
netLabelWidth: 1.2,
|
|
226
|
+
pinIds: ["schematic_port_0", "schematic_port_12"],
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
netId: "48V_Vout1",
|
|
230
|
+
pinIds: ["schematic_port_0", "schematic_port_1"],
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
netId: ".D2 > .pin1 to .U_REPEAT > .pin1",
|
|
234
|
+
pinIds: ["schematic_port_2", "schematic_port_0"],
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
netId: ".D3 > .pin1 to .U_REPEAT > .pin1",
|
|
238
|
+
pinIds: ["schematic_port_4", "schematic_port_0"],
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
netId: ".R109 > .pin1 to .U_REPEAT > .pin1",
|
|
242
|
+
netLabelWidth: 1.2,
|
|
243
|
+
pinIds: ["schematic_port_6", "schematic_port_0"],
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
netId: ".R109 > .pin2 to .D27 > .pin1",
|
|
247
|
+
pinIds: ["schematic_port_7", "schematic_port_8"],
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
netId: ".C2 > .pin1 to .U_REPEAT > .pin1",
|
|
251
|
+
netLabelWidth: 1.2,
|
|
252
|
+
pinIds: ["schematic_port_10", "schematic_port_0"],
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
netId: ".L3 > .pin2 to .L1 > .pin1",
|
|
256
|
+
pinIds: ["schematic_port_13", "schematic_port_16"],
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
netId: ".L3 > .pin4 to .L5 > .pin1",
|
|
260
|
+
pinIds: ["schematic_port_15", "schematic_port_18"],
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
netConnections: [
|
|
264
|
+
{
|
|
265
|
+
netId: "V48_Vout2",
|
|
266
|
+
netLabelWidth: 0.42,
|
|
267
|
+
netLabelHeight: 1.2,
|
|
268
|
+
pinIds: [
|
|
269
|
+
"schematic_port_0",
|
|
270
|
+
"schematic_port_1",
|
|
271
|
+
"schematic_port_2",
|
|
272
|
+
"schematic_port_4",
|
|
273
|
+
"schematic_port_6",
|
|
274
|
+
"schematic_port_10",
|
|
275
|
+
"schematic_port_12",
|
|
276
|
+
],
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
netId: "GND",
|
|
280
|
+
netLabelWidth: 0.42,
|
|
281
|
+
netLabelHeight: 0.48,
|
|
282
|
+
pinIds: [
|
|
283
|
+
"schematic_port_3",
|
|
284
|
+
"schematic_port_5",
|
|
285
|
+
"schematic_port_9",
|
|
286
|
+
"schematic_port_11",
|
|
287
|
+
"schematic_port_14",
|
|
288
|
+
],
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
netId: "Power_OUTPUT_P",
|
|
292
|
+
netLabelWidth: 1.8,
|
|
293
|
+
pinIds: ["schematic_port_17"],
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
netId: "Power_OUTPUT_N",
|
|
297
|
+
netLabelWidth: 1.8,
|
|
298
|
+
pinIds: ["schematic_port_19"],
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
textBoxes: [
|
|
302
|
+
{
|
|
303
|
+
chipId: "schematic_component_0",
|
|
304
|
+
center: {
|
|
305
|
+
x: -4.57,
|
|
306
|
+
y: 1.7150000000000003,
|
|
307
|
+
},
|
|
308
|
+
width: 3.4799999999999995,
|
|
309
|
+
height: 0.2500000000000002,
|
|
310
|
+
text: "REPEAT(F,1,2) TPS2663.SchDoc",
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
chipId: "schematic_component_7",
|
|
314
|
+
center: {
|
|
315
|
+
x: 2.736,
|
|
316
|
+
y: -1.022,
|
|
317
|
+
},
|
|
318
|
+
width: 2.6399999999999997,
|
|
319
|
+
height: 0.18000000000000005,
|
|
320
|
+
text: "6.8uH coupled inductor",
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
chipId: "schematic_component_7",
|
|
324
|
+
center: {
|
|
325
|
+
x: 1.536,
|
|
326
|
+
y: 1.2070000000000003,
|
|
327
|
+
},
|
|
328
|
+
width: 0.3600000000000001,
|
|
329
|
+
height: 0.2500000000000002,
|
|
330
|
+
text: "L3",
|
|
331
|
+
},
|
|
332
|
+
],
|
|
333
|
+
availableNetLabelOrientations: {
|
|
334
|
+
V48_Vout2: ["y+"],
|
|
335
|
+
GND: ["y-"],
|
|
336
|
+
Power_OUTPUT_P: ["x-", "x+"],
|
|
337
|
+
Power_OUTPUT_N: ["x-", "x+"],
|
|
338
|
+
},
|
|
339
|
+
maxMspPairDistance: 2.4,
|
|
340
|
+
_hideRatsNet: false,
|
|
341
|
+
} satisfies InputProblem
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { expect, test } from "bun:test"
|
|
2
|
+
import { SchematicTracePipelineSolver } from "lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver"
|
|
3
|
+
import "tests/fixtures/matcher"
|
|
4
|
+
import inputProblem from "./repro-ti-power-output-section.input"
|
|
5
|
+
|
|
6
|
+
test("repro ti power output section", () => {
|
|
7
|
+
const solver = new SchematicTracePipelineSolver(inputProblem)
|
|
8
|
+
|
|
9
|
+
solver.solve()
|
|
10
|
+
|
|
11
|
+
expect(solver.solved).toBe(true)
|
|
12
|
+
expect(solver).toMatchSolverSnapshot(import.meta.path)
|
|
13
|
+
})
|