diff --git a/docs/repro79-demo.mp4 b/docs/repro79-demo.mp4
new file mode 100644
index 00000000..724697df
Binary files /dev/null and b/docs/repro79-demo.mp4 differ
diff --git a/docs/repro79-demo.svg b/docs/repro79-demo.svg
new file mode 100644
index 00000000..31a7d4e7
--- /dev/null
+++ b/docs/repro79-demo.svg
@@ -0,0 +1,42 @@
+
diff --git a/lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts b/lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts
index 31e0df39..f4e2d62b 100644
--- a/lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts
+++ b/lib/solvers/LongDistancePairSolver/LongDistancePairSolver.ts
@@ -55,6 +55,12 @@ export class LongDistancePairSolver extends BaseSolver {
primaryConnectedPinIds.add(pair.pins[0].pinId)
primaryConnectedPinIds.add(pair.pins[1].pinId)
}
+ const directlyWiredPinIds = new Set()
+ for (const dc of inputProblem.directConnections) {
+ for (const pinId of dc.pinIds) {
+ directlyWiredPinIds.add(pinId)
+ }
+ }
const { netConnMap } = getConnectivityMapsFromInputProblem(inputProblem)
this.netConnMap = netConnMap
@@ -73,7 +79,9 @@ export class LongDistancePairSolver extends BaseSolver {
const addedPairKeys = new Set()
for (const netId of Object.keys(netConnMap.netMap)) {
- const allPinIdsInNet = netConnMap.getIdsConnectedToNet(netId)
+ const allPinIdsInNet = netConnMap
+ .getIdsConnectedToNet(netId)
+ .filter((pinId) => directlyWiredPinIds.has(pinId))
if (allPinIdsInNet.length < 2) continue
const unconnectedPinIds = allPinIdsInNet.filter(
diff --git a/lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts b/lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts
index 48b46c90..b4730089 100644
--- a/lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts
+++ b/lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts
@@ -74,7 +74,16 @@ export class MspConnectionPairSolver extends BaseSolver {
}
}
- this.queuedDcNetIds = Object.keys(netConnMap.netMap)
+ const directlyWiredPinIds = new Set()
+ for (const dc of inputProblem.directConnections) {
+ for (const pid of dc.pinIds) {
+ directlyWiredPinIds.add(pid)
+ }
+ }
+ this.queuedDcNetIds = Object.keys(netConnMap.netMap).filter((netId) => {
+ const connectedIds = netConnMap.getIdsConnectedToNet(netId) as string[]
+ return connectedIds.some((id) => directlyWiredPinIds.has(id))
+ })
}
override getConstructorParams(): ConstructorParameters<
diff --git a/tests/examples/__snapshots__/example01.snap.svg b/tests/examples/__snapshots__/example01.snap.svg
index 2614ba80..ae8c10c0 100644
--- a/tests/examples/__snapshots__/example01.snap.svg
+++ b/tests/examples/__snapshots__/example01.snap.svg
@@ -2,106 +2,121 @@
+x-" data-x="-0.8" data-y="0.2" cx="422.5742574257426" cy="289.44950495049505" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
+x-" data-x="-0.8" data-y="0" cx="422.5742574257426" cy="311.62772277227725" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
+x-" data-x="-0.8" data-y="-0.2" cx="422.5742574257426" cy="333.80594059405945" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
+x+" data-x="0.8" data-y="-0.2" cx="600" cy="333.80594059405945" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
+x+" data-x="0.8" data-y="0" cx="600" cy="311.62772277227725" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
+x+" data-x="0.8" data-y="0.2" cx="600" cy="289.44950495049505" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
+y+" data-x="-2" data-y="0.5" cx="289.50495049504957" cy="256.1821782178218" r="3" fill="hsl(121, 100%, 50%, 0.8)" />
+y-" data-x="-2" data-y="-0.5" cx="289.50495049504957" cy="367.0732673267327" r="3" fill="hsl(122, 100%, 50%, 0.8)" />
+y+" data-x="-4" data-y="0.5" cx="67.72277227722776" cy="256.1821782178218" r="3" fill="hsl(2, 100%, 50%, 0.8)" />
+y-" data-x="-4" data-y="-0.5" cx="67.72277227722776" cy="367.0732673267327" r="3" fill="hsl(3, 100%, 50%, 0.8)" />
+orientation: y+" data-x="-1.1" data-y="0.20000000000000018" cx="389.3069306930693" cy="289.44950495049505" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="-1.275" data-y="0" cx="369.90099009900996" cy="311.62772277227725" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="-0.901" data-y="-0.30100000000000005" cx="411.3742574257426" cy="345.00594059405944" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+available orientations: y+" data-x="-1.1" data-y="0.42500000000000016" x="378.21782178217825" y="239.54851485148515" width="22.178217821782198" height="49.9009900990099" fill="#ef444466" stroke="#ef4444" stroke-width="0.009017857142857143" />
+available orientations: x+, x-" data-x="-1.5" data-y="0" x="320" y="300.5386138613862" width="49.90099009900996" height="22.17821782178214" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.009017857142857143" />
+
+
+
+
+
+
+available orientations: y-" data-x="-2" data-y="-0.726" x="278.41584158415844" y="367.1841584158416" width="22.178217821782198" height="49.90099009900996" fill="#00000066" stroke="#000000" stroke-width="0.009017857142857143" />
@@ -136,7 +151,7 @@ available orientations: y-" data-x="-1.4" data-y="-0.9249999999999999" x="344.95
"e": 511.2871287128713,
"b": 0,
"d": -110.89108910891089,
- "f": 300.5940594059406
+ "f": 311.62772277227725
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example03.snap.svg b/tests/examples/__snapshots__/example03.snap.svg
index 47c75606..3ddbf7cf 100644
--- a/tests/examples/__snapshots__/example03.snap.svg
+++ b/tests/examples/__snapshots__/example03.snap.svg
@@ -2,234 +2,261 @@
+x-" data-x="-3.5005768910000006" data-y="1.4489565000000004" cx="71.9568626609827" cy="217.33014662474903" r="3" fill="hsl(328, 100%, 50%, 0.8)" />
+x-" data-x="-3.5005768910000006" data-y="1.4489565000000004" cx="71.9568626609827" cy="217.33014662474903" r="3" fill="hsl(328, 100%, 50%, 0.8)" />
+x+" data-x="-2.4994231089999994" data-y="1.4485175000000003" cx="142.8964057073185" cy="217.36125319394677" r="3" fill="hsl(328, 100%, 50%, 0.8)" />
+x+" data-x="-2.4994231089999994" data-y="1.4485175000000003" cx="142.8964057073185" cy="217.36125319394677" r="3" fill="hsl(328, 100%, 50%, 0.8)" />
+x-" data-x="-0.5005768910000006" data-y="1.4489565000000004" cx="284.5302284768321" cy="217.33014662474903" r="3" fill="hsl(208, 100%, 50%, 0.8)" />
+x-" data-x="-0.5005768910000006" data-y="1.4489565000000004" cx="284.5302284768321" cy="217.33014662474903" r="3" fill="hsl(208, 100%, 50%, 0.8)" />
+x+" data-x="0.5005768910000006" data-y="1.4485175000000003" cx="355.4697715231679" cy="217.36125319394677" r="3" fill="hsl(208, 100%, 50%, 0.8)" />
+x+" data-x="0.5005768910000006" data-y="1.4485175000000003" cx="355.4697715231679" cy="217.36125319394677" r="3" fill="hsl(208, 100%, 50%, 0.8)" />
+x-" data-x="2.4994231089999994" data-y="1.4489565000000004" cx="497.10359429268146" cy="217.33014662474903" r="3" fill="hsl(88, 100%, 50%, 0.8)" />
+x-" data-x="2.4994231089999994" data-y="1.4489565000000004" cx="497.10359429268146" cy="217.33014662474903" r="3" fill="hsl(88, 100%, 50%, 0.8)" />
+x+" data-x="3.5005768910000006" data-y="1.4485175000000003" cx="568.0431373390173" cy="217.36125319394677" r="3" fill="hsl(88, 100%, 50%, 0.8)" />
+x+" data-x="3.5005768910000006" data-y="1.4485175000000003" cx="568.0431373390173" cy="217.36125319394677" r="3" fill="hsl(88, 100%, 50%, 0.8)" />
+x-" data-x="-3.5005768910000006" data-y="-1.5510434999999996" cx="71.9568626609827" cy="429.90351244059843" r="3" fill="hsl(240, 100%, 50%, 0.8)" />
+x-" data-x="-3.5005768910000006" data-y="-1.5510434999999996" cx="71.9568626609827" cy="429.90351244059843" r="3" fill="hsl(240, 100%, 50%, 0.8)" />
+x+" data-x="-2.4994231089999994" data-y="-1.5514824999999997" cx="142.8964057073185" cy="429.93461900979617" r="3" fill="hsl(240, 100%, 50%, 0.8)" />
+x+" data-x="-2.4994231089999994" data-y="-1.5514824999999997" cx="142.8964057073185" cy="429.93461900979617" r="3" fill="hsl(240, 100%, 50%, 0.8)" />
+x-" data-x="-0.5005768910000006" data-y="-1.5510434999999996" cx="284.5302284768321" cy="429.90351244059843" r="3" fill="hsl(120, 100%, 50%, 0.8)" />
+x-" data-x="-0.5005768910000006" data-y="-1.5510434999999996" cx="284.5302284768321" cy="429.90351244059843" r="3" fill="hsl(120, 100%, 50%, 0.8)" />
+x+" data-x="0.5005768910000006" data-y="-1.5514824999999997" cx="355.4697715231679" cy="429.93461900979617" r="3" fill="hsl(120, 100%, 50%, 0.8)" />
+x+" data-x="0.5005768910000006" data-y="-1.5514824999999997" cx="355.4697715231679" cy="429.93461900979617" r="3" fill="hsl(120, 100%, 50%, 0.8)" />
+x-" data-x="2.4994231089999994" data-y="-1.5510434999999996" cx="497.10359429268146" cy="429.90351244059843" r="3" fill="hsl(152, 100%, 50%, 0.8)" />
+x-" data-x="2.4994231089999994" data-y="-1.5510434999999996" cx="497.10359429268146" cy="429.90351244059843" r="3" fill="hsl(152, 100%, 50%, 0.8)" />
+x+" data-x="3.5005768910000006" data-y="-1.5514824999999997" cx="568.0431373390173" cy="429.93461900979617" r="3" fill="hsl(152, 100%, 50%, 0.8)" />
+x+" data-x="3.5005768910000006" data-y="-1.5514824999999997" cx="568.0431373390173" cy="429.93461900979617" r="3" fill="hsl(152, 100%, 50%, 0.8)" />
+orientation: x-" data-x="-3.5005768910000006" data-y="1.4489565000000004" cx="71.9568626609827" cy="217.33014662474903" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="-0.5005768910000006" data-y="1.4489565000000004" cx="284.5302284768321" cy="217.33014662474903" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="2.4994231089999994" data-y="1.4489565000000004" cx="497.10359429268146" cy="217.33014662474903" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="-3.5005768910000006" data-y="1.4489565000000004" cx="71.9568626609827" cy="217.33014662474903" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="-3.5005768910000006" data-y="-1.5510434999999996" cx="71.9568626609827" cy="429.90351244059843" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="-0.5005768910000006" data-y="-1.5510434999999996" cx="284.5302284768321" cy="429.90351244059843" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x+" data-x="0.5005768910000006" data-y="1.4485175000000003" cx="355.4697715231679" cy="217.36125319394677" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x+" data-x="-2.4994231089999994" data-y="-1.5514824999999997" cx="142.8964057073185" cy="429.93461900979617" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x+" data-x="3.5005768910000006" data-y="-1.5514824999999997" cx="568.0431373390173" cy="429.93461900979617" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+globalConnNetId: connectivity_net0
+available orientations: any" data-x="-0.7265768910000006" data-y="1.4489565000000004" x="252.5733658158494" y="210.24436776422073" width="31.88600487237744" height="14.171557721056615" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.014112774610714288" />
+globalConnNetId: connectivity_net0
+available orientations: any" data-x="2.2734231089999994" data-y="1.4489565000000004" x="465.1467316316988" y="210.24436776422073" width="31.88600487237744" height="14.171557721056615" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.014112774610714288" />
+globalConnNetId: connectivity_net1
+available orientations: any" data-x="-3.7265768910000006" data-y="1.4489565000000004" x="40" y="210.24436776422073" width="31.88600487237744" height="14.171557721056615" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.014112774610714288" />
+globalConnNetId: connectivity_net1
+available orientations: any" data-x="-3.7265768910000006" data-y="-1.5510434999999996" x="40" y="422.8177335800701" width="31.88600487237744" height="14.171557721056615" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.014112774610714288" />
+
+
+
+globalConnNetId: connectivity_net2
+available orientations: any" data-x="0.7265768910000006" data-y="1.4485175000000003" x="355.54062931177316" y="210.27547433341846" width="31.88600487237744" height="14.171557721056615" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.014112774610714288" />
+globalConnNetId: connectivity_net2
+available orientations: any" data-x="-2.2734231089999994" data-y="-1.5514824999999997" x="142.96726349592376" y="422.84884014926786" width="31.88600487237744" height="14.171557721056615" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.014112774610714288" />
+globalConnNetId: connectivity_net2
+available orientations: any" data-x="3.7265768910000006" data-y="-1.5514824999999997" x="568.1139951276225" y="422.84884014926786" width="31.886004872377498" height="14.171557721056615" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.014112774610714288" />
+
+
+
+globalConnNetId: connectivity_net3
+available orientations: any" data-x="0.7265768910000006" data-y="-1.5514824999999997" x="355.54062931177316" y="422.84884014926786" width="31.88600487237744" height="14.171557721056615" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.014112774610714288" />
+globalConnNetId: connectivity_net3
+available orientations: any" data-x="3.7265768910000006" data-y="-1.5514824999999997" x="568.1139951276225" y="422.84884014926786" width="31.886004872377498" height="14.171557721056615" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.014112774610714288" />
@@ -264,7 +291,7 @@ globalConnNetId: connectivity_net3" data-x="0.7265768910000006" data-y="-1.55148
"e": 320,
"b": 0,
"d": -70.85778860528313,
- "f": 319.09082371440564
+ "f": 320
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example10.snap.svg b/tests/examples/__snapshots__/example10.snap.svg
index 1edb7d85..201e544b 100644
--- a/tests/examples/__snapshots__/example10.snap.svg
+++ b/tests/examples/__snapshots__/example10.snap.svg
@@ -2,80 +2,96 @@
+y-" data-x="-2.2855604555" data-y="-0.5519250999999993" cx="49.983280260645415" cy="365.6995529759246" r="3" fill="hsl(256, 100%, 50%, 0.8)" />
+y+" data-x="-2.2855604555000015" data-y="0.5519250999999993" cx="49.9832802606453" cy="274.3004470240754" r="3" fill="hsl(257, 100%, 50%, 0.8)" />
+x+" data-x="-1.5938689350000006" data-y="0.004526300000001031" cx="107.2555320282994" cy="319.6252210913492" r="3" fill="hsl(258, 100%, 50%, 0.8)" />
+y-" data-x="3.2144395445" data-y="-0.5519250999999993" cx="505.38482182413946" cy="365.6995529759246" r="3" fill="hsl(79, 100%, 50%, 0.8)" />
+y+" data-x="3.2144395444999985" data-y="0.5519250999999993" cx="505.38482182413935" cy="274.3004470240754" r="3" fill="hsl(80, 100%, 50%, 0.8)" />
+x+" data-x="3.9061310649999994" data-y="0.004526300000001031" cx="562.6570735917935" cy="319.6252210913492" r="3" fill="hsl(81, 100%, 50%, 0.8)" />
+orientation: y-" data-x="-2.2855604555" data-y="-0.5519250999999993" cx="49.983280260645415" cy="365.6995529759246" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="3.2144395445" data-y="-0.5519250999999993" cx="505.38482182413946" cy="365.6995529759246" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="-2.2855604555000015" data-y="0.5519250999999993" cx="49.9832802606453" cy="274.3004470240754" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="3.2144395444999985" data-y="0.5519250999999993" cx="505.38482182413935" cy="274.3004470240754" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
+globalConnNetId: connectivity_net0
+available orientations: any" data-x="3.2144395445" data-y="-0.7779250999999993" x="497.1047937957123" y="365.78235325620886" width="16.56005605685442" height="37.26012612792226" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.012077253803571426" />
+
+
+
+globalConnNetId: connectivity_net1
+available orientations: any" data-x="3.2144395444999985" data-y="0.7779250999999993" x="497.10479379571217" y="236.95752061586887" width="16.560056056854307" height="37.26012612792226" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.012077253803571426" />
+globalConnNetId: connectivity_net2
+available orientations: any" data-x="-1.3678689350000006" data-y="0.004526300000001031" x="107.33833230858366" y="311.345193062922" width="37.26012612792226" height="16.560056056854364" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.012077253803571426" />
+globalConnNetId: connectivity_net2
+available orientations: any" data-x="4.132131064999999" data-y="0.004526300000001031" x="562.7398738720777" y="311.345193062922" width="37.26012612792226" height="16.560056056854364" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.012077253803571426" />
@@ -105,11 +121,11 @@ globalConnNetId: connectivity_net2" data-x="4.132131064999999" data-y="0.0045263
// Calculate real coordinates using inverse transformation
const matrix = {
- "a": 78.95451231474433,
+ "a": 82.80028028427165,
"c": 0,
- "e": 255.9848416715025,
+ "e": 239.228326582693,
"b": 0,
- "d": -78.95451231474433,
+ "d": -82.80028028427165,
"f": 320
};
// Manually invert and apply the affine transform
diff --git a/tests/examples/__snapshots__/example12.snap.svg b/tests/examples/__snapshots__/example12.snap.svg
index b65b9755..722551fd 100644
--- a/tests/examples/__snapshots__/example12.snap.svg
+++ b/tests/examples/__snapshots__/example12.snap.svg
@@ -2,103 +2,133 @@
+x+" data-x="1.1" data-y="0.2" cx="301.5156017830609" cy="205.61929569093613" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
+x+" data-x="1.1" data-y="0" cx="301.5156017830609" cy="229.39344130757803" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
+x+" data-x="1.1" data-y="-0.2" cx="301.5156017830609" cy="253.16758692421993" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
+x-" data-x="0.5499999999999996" data-y="-1.7944553499999996" cx="236.13670133729568" cy="442.7016552748885" r="3" fill="hsl(226, 100%, 50%, 0.8)" />
+x+" data-x="1.6499999999999997" data-y="-1.7944553499999996" cx="366.8945022288261" cy="442.7016552748885" r="3" fill="hsl(227, 100%, 50%, 0.8)" />
+x-" data-x="2.3099999999999996" data-y="0.01999999999999985" cx="445.34918276374435" cy="227.01602674591385" r="3" fill="hsl(121, 100%, 50%, 0.8)" />
+x+" data-x="3.41" data-y="0.01999999999999985" cx="576.1069836552749" cy="227.01602674591385" r="3" fill="hsl(122, 100%, 50%, 0.8)" />
+orientation: y+" data-x="1.201" data-y="0.401" cx="313.5215453194651" cy="181.72627934621102" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="2.2089999999999996" data-y="0.4709999999999998" cx="433.3432392273402" cy="173.40532838038638" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x+" data-x="1.1" data-y="0" cx="301.5156017830609" cy="229.39344130757803" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="0.5499999999999996" data-y="-1.7944553499999996" cx="236.13670133729568" cy="442.7016552748885" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+available orientations: y+" data-x="1.201" data-y="0.626" x="301.63447251114417" y="128.23445170876676" width="23.77414561664193" height="53.49182763744426" fill="#ef444466" stroke="#ef4444" stroke-width="0.008412500000000002" />
+
+
+
+available orientations: any" data-x="1.326" data-y="0" x="301.63447251114417" y="217.50636849925706" width="53.49182763744426" height="23.77414561664193" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008412500000000002" />
+
+
+
+
+
+
+available orientations: y-" data-x="1.7509999999999997" data-y="-2.2204553499999995" x="367.0133729569093" y="466.59467161961356" width="23.77414561664193" height="53.49182763744432" fill="#00000066" stroke="#000000" stroke-width="0.008412500000000002" />
+available orientations: y-" data-x="3.511" data-y="-0.6560000000000001" x="576.2258543833581" y="280.6267251114414" width="23.77414561664193" height="53.49182763744426" fill="#00000066" stroke="#000000" stroke-width="0.008412500000000002" />
@@ -133,7 +163,7 @@ available orientations: y-" data-x="3.511" data-y="-0.6560000000000001" x="576.2
"e": 170.75780089153048,
"b": 0,
"d": -118.8707280832095,
- "f": 225.2329658246657
+ "f": 229.39344130757803
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example13.snap.svg b/tests/examples/__snapshots__/example13.snap.svg
index 3fe23640..71590e45 100644
--- a/tests/examples/__snapshots__/example13.snap.svg
+++ b/tests/examples/__snapshots__/example13.snap.svg
@@ -2,292 +2,346 @@
+x+" data-x="1.15" data-y="0.75" cx="364.9767873723306" cy="297.21912720519964" r="3" fill="hsl(159, 100%, 50%, 0.8)" />
+x+" data-x="1.15" data-y="0" cx="364.9767873723306" cy="345.96564531104923" r="3" fill="hsl(158, 100%, 50%, 0.8)" />
+x+" data-x="1.15" data-y="-0.75" cx="364.9767873723306" cy="394.7121634168988" r="3" fill="hsl(157, 100%, 50%, 0.8)" />
+x-" data-x="-1.15" data-y="-1.125" cx="215.4874651810585" cy="419.0854224698236" r="3" fill="hsl(156, 100%, 50%, 0.8)" />
+x-" data-x="-1.15" data-y="-0.375" cx="215.4874651810585" cy="370.33890436397405" r="3" fill="hsl(155, 100%, 50%, 0.8)" />
+x-" data-x="-1.15" data-y="0.375" cx="215.4874651810585" cy="321.5923862581244" r="3" fill="hsl(154, 100%, 50%, 0.8)" />
+x-" data-x="-1.15" data-y="1.125" cx="215.4874651810585" cy="272.8458681522749" r="3" fill="hsl(153, 100%, 50%, 0.8)" />
+x-" data-x="-3.55" data-y="0" cx="59.49860724233983" cy="345.96564531104923" r="3" fill="hsl(351, 100%, 50%, 0.8)" />
+x+" data-x="-2.45" data-y="0" cx="130.99350046425255" cy="345.96564531104923" r="3" fill="hsl(352, 100%, 50%, 0.8)" />
+x-" data-x="-3.55" data-y="-1.9999999999999998" cx="59.49860724233983" cy="475.95636025998147" r="3" fill="hsl(232, 100%, 50%, 0.8)" />
+x+" data-x="-2.45" data-y="-1.9999999999999998" cx="130.99350046425255" cy="475.95636025998147" r="3" fill="hsl(233, 100%, 50%, 0.8)" />
+x-" data-x="-3.55" data-y="2" cx="59.49860724233983" cy="215.974930362117" r="3" fill="hsl(113, 100%, 50%, 0.8)" />
+x+" data-x="-2.45" data-y="2" cx="130.99350046425255" cy="215.974930362117" r="3" fill="hsl(114, 100%, 50%, 0.8)" />
+x-" data-x="2.45" data-y="-1.5" cx="449.47075208913657" cy="443.4586815227484" r="3" fill="hsl(246, 100%, 50%, 0.8)" />
+x+" data-x="3.55" data-y="-1.5" cx="520.9656453110492" cy="443.4586815227484" r="3" fill="hsl(247, 100%, 50%, 0.8)" />
+x-" data-x="2.45" data-y="0" cx="449.47075208913657" cy="345.96564531104923" r="3" fill="hsl(127, 100%, 50%, 0.8)" />
+x+" data-x="3.55" data-y="0" cx="520.9656453110492" cy="345.96564531104923" r="3" fill="hsl(128, 100%, 50%, 0.8)" />
+x-" data-x="3.435" data-y="3" cx="513.4911792014857" cy="150.97957288765087" r="3" fill="hsl(57, 100%, 50%, 0.8)" />
+x+" data-x="4.5649999999999995" data-y="3" cx="586.9359331476323" cy="150.97957288765087" r="3" fill="hsl(58, 100%, 50%, 0.8)" />
+orientation: y-" data-x="1.301" data-y="0.699" cx="374.791086350975" cy="300.5338904363974" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="-1.301" data-y="-0.426" cx="205.6731662024141" cy="373.6536675951718" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="-2.349" data-y="-2.201" cx="137.5580315691736" cy="489.0204271123491" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="3.651" data-y="-1.9509999999999998" cx="527.5301764159703" cy="472.7715877437326" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="3.651" data-y="-0.45099999999999996" cx="527.5301764159703" cy="375.2785515320335" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="4.6659999999999995" data-y="2.649" cx="593.5004642525535" cy="173.7929433611885" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="1.4009999999999998" data-y="0.7010000000000001" cx="381.2906220984216" cy="300.40389972144845" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="-1.4009999999999998" data-y="-0.42400000000000004" cx="199.1736304549675" cy="373.52367688022287" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+available orientations: y-" data-x="1.301" data-y="0.474" x="368.2915506035283" y="300.5338904363974" width="12.999071494893258" height="29.24791086350973" fill="#00000066" stroke="#000000" stroke-width="0.015385714285714284" />
+available orientations: y-" data-x="-1.301" data-y="-0.651" x="199.1736304549675" y="373.6536675951718" width="12.999071494893258" height="29.247910863509787" fill="#00000066" stroke="#000000" stroke-width="0.015385714285714284" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+available orientations: y+" data-x="-1.4009999999999998" data-y="-0.19900000000000004" x="192.6740947075209" y="344.27576601671313" width="12.99907149489323" height="29.24791086350973" fill="#ef444466" stroke="#ef4444" stroke-width="0.015385714285714284" />
+available orientations: y+" data-x="2.349" data-y="-0.8240000000000002" x="436.40668523676885" y="384.89786443825443" width="12.999071494893258" height="29.247910863509787" fill="#ef444466" stroke="#ef4444" stroke-width="0.015385714285714284" />
+available orientations: any" data-x="-2.125" data-y="0.225" x="145.6174558960074" y="316.7177344475395" width="12.999071494893258" height="29.24791086350973" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.015385714285714284" />
+available orientations: y+" data-x="-3.75" data-y="2.225" x="39.99999999999997" y="186.72701949860723" width="12.999071494893258" height="29.24791086350976" fill="#ef444466" stroke="#ef4444" stroke-width="0.015385714285714284" />
+available orientations: y+" data-x="2.349" data-y="0.6759999999999999" x="436.40668523676885" y="287.40482822655525" width="12.999071494893258" height="29.24791086350973" fill="#ef444466" stroke="#ef4444" stroke-width="0.015385714285714284" />
+available orientations: any" data-x="1.96375" data-y="3.225" x="411.3672237697308" y="121.73166202414112" width="12.999071494893201" height="29.24791086350976" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.015385714285714284" />
@@ -317,12 +371,12 @@ available orientations: any" data-x="1.96375" data-y="3.225" x="411.410330818340
// Calculate real coordinates using inverse transformation
const matrix = {
- "a": 65.00290191526408,
+ "a": 64.99535747446612,
"c": 0,
- "e": 290.26117237376667,
+ "e": 290.23212627669454,
"b": 0,
- "d": -65.00290191526408,
- "f": 352.5014509576321
+ "d": -64.99535747446612,
+ "f": 345.96564531104923
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example14.snap.svg b/tests/examples/__snapshots__/example14.snap.svg
index b91ea230..5f2099e9 100644
--- a/tests/examples/__snapshots__/example14.snap.svg
+++ b/tests/examples/__snapshots__/example14.snap.svg
@@ -2,237 +2,255 @@
+x+" data-x="1.2000000000000002" data-y="-0.30000000000000004" cx="424.9671977507029" cy="326.51671352702283" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="-0.30000000000000004" cx="215.0328022492971" cy="326.51671352702283" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="424.9671977507029" cy="291.52764761012185" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="0.30000000000000004" cx="215.0328022492971" cy="274.0331146516713" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="0.10000000000000003" cx="215.0328022492971" cy="291.52764761012185" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="-0.09999999999999998" cx="215.0328022492971" cy="309.0221805685723" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="-0.10000000000000003" cx="424.9671977507029" cy="309.0221805685723" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="0.30000000000000004" cx="424.9671977507029" cy="274.0331146516713" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
+x+" data-x="3" data-y="-0.10000000000000016" cx="582.4179943767572" cy="309.0221805685723" r="3" fill="hsl(226, 100%, 50%, 0.8)" />
+x-" data-x="1.9000000000000004" data-y="-0.10000000000000002" cx="486.19806310527963" cy="309.0221805685723" r="3" fill="hsl(227, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="-1.2944553500000002" cx="424.9671977507029" cy="413.50437300843487" r="3" fill="hsl(107, 100%, 50%, 0.8)" />
+x-" data-x="0.10000000000000009" data-y="-1.2944553500000002" cx="328.74726647922523" cy="413.50437300843487" r="3" fill="hsl(108, 100%, 50%, 0.8)" />
+y+" data-x="-1.2000000000000002" data-y="-1.1500000000000001" cx="215.0328022492971" cy="400.86847860043736" r="3" fill="hsl(121, 100%, 50%, 0.8)" />
+y-" data-x="-1.2000000000000002" data-y="-2.25" cx="215.0328022492971" cy="497.088409871915" r="3" fill="hsl(122, 100%, 50%, 0.8)" />
+x+" data-x="-1.9000000000000004" data-y="0.10000000000000002" cx="153.80193689472037" cy="291.52764761012185" r="3" fill="hsl(2, 100%, 50%, 0.8)" />
+x-" data-x="-3" data-y="0.10000000000000016" cx="57.582005623242765" cy="291.52764761012185" r="3" fill="hsl(3, 100%, 50%, 0.8)" />
+y-" data-x="1.2000000000000002" data-y="1.1500000000000001" cx="424.9671977507029" cy="199.6813495782568" r="3" fill="hsl(348, 100%, 50%, 0.8)" />
+y+" data-x="1.2000000000000002" data-y="2.25" cx="424.9671977507029" cy="103.46141830677914" r="3" fill="hsl(349, 100%, 50%, 0.8)" />
+orientation: y-" data-x="1.3510000000000002" data-y="-0.35100000000000003" cx="438.17557013433304" cy="330.9778194314277" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="-1.2000000000000002" data-y="-2.25" cx="215.0328022492971" cy="497.088409871915" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="-3.101" data-y="-0.3509999999999998" cx="48.74726647922523" cy="330.97781943142763" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="-1.4000000000000001" data-y="-0.30000000000000004" cx="197.53826929084659" cy="326.51671352702283" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x+" data-x="1.4000000000000001" data-y="0.09999999999999998" cx="442.4617307091534" cy="291.52764761012185" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="-1.3010000000000002" data-y="0.5010000000000001" cx="206.19806310527957" cy="256.4511090284286" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x+" data-x="1.2000000000000002" data-y="0.30000000000000004" cx="424.9671977507029" cy="274.0331146516713" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="3.101" data-y="0.10099999999999985" cx="591.2527335207748" cy="291.4401749453296" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+available orientations: y-" data-x="-1.2000000000000002" data-y="-2.476" x="206.28553577007182" y="497.17588253670726" width="17.49453295845052" height="39.3626991565136" fill="#00000066" stroke="#000000" stroke-width="0.011432142857142858" />
+available orientations: y-" data-x="-3.101" data-y="-0.5759999999999998" x="40" y="330.9778194314277" width="17.49453295845052" height="39.36269915651354" fill="#00000066" stroke="#000000" stroke-width="0.011432142857142858" />
+available orientations: any" data-x="-1.6250000000000002" data-y="-0.30000000000000004" x="158.17557013433301" y="317.76944704779754" width="39.36269915651357" height="17.49453295845052" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011432142857142858" />
+available orientations: any" data-x="1.6250000000000002" data-y="0.09999999999999998" x="442.4617307091534" y="282.7803811308966" width="39.36269915651354" height="17.494532958450463" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011432142857142858" />
+
+
+
+available orientations: y+" data-x="1.4260000000000002" data-y="0.30000000000000004" x="425.05467041549514" y="265.2858481724461" width="39.3626991565136" height="17.49453295845052" fill="#ef444466" stroke="#ef4444" stroke-width="0.011432142857142858" />
+available orientations: y+" data-x="3.101" data-y="0.32599999999999985" x="582.5054670415495" y="252.077475788816" width="17.494532958450463" height="39.3626991565136" fill="#ef444466" stroke="#ef4444" stroke-width="0.011432142857142858" />
+available orientations: any" data-x="-1.5500000000000003" data-y="0.32500000000000007" x="175.67010309278348" y="252.16494845360825" width="17.494532958450492" height="39.3626991565136" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011432142857142858" />
+available orientations: any" data-x="1.4755000000000003" data-y="-1.0694553500000001" x="440.3186504217432" y="374.14167385192127" width="17.49453295845052" height="39.3626991565136" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011432142857142858" />
@@ -262,12 +280,12 @@ available orientations: any" data-x="1.4755000000000003" data-y="-1.069455350000
// Calculate real coordinates using inverse transformation
const matrix = {
- "a": 86.15384615384616,
+ "a": 87.47266479225242,
"c": 0,
- "e": 315.69230769230774,
+ "e": 320,
"b": 0,
- "d": -86.15384615384616,
- "f": 292
+ "d": -87.47266479225242,
+ "f": 300.2749140893471
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example15.snap.svg b/tests/examples/__snapshots__/example15.snap.svg
index 5d1b2f9d..804d57e2 100644
--- a/tests/examples/__snapshots__/example15.snap.svg
+++ b/tests/examples/__snapshots__/example15.snap.svg
@@ -342,15 +342,47 @@ orientation: x-" data-x="-2.025" data-y="2.200000000000001" cx="318.520475561426
+orientation: y-" data-x="-1.5675" data-y="5.405000000000002" cx="341.08322324966974" cy="126.30559225011007" r="3" fill="hsl(80, 100%, 50%, 0.9)" />
+orientation: y-" data-x="-0.6374999999999998" data-y="5.405000000000002" cx="386.94848084544253" cy="126.30559225011007" r="3" fill="hsl(80, 100%, 50%, 0.9)" />
+orientation: y-" data-x="-2.4975" data-y="5.405000000000002" cx="295.21796565389695" cy="126.30559225011007" r="3" fill="hsl(80, 100%, 50%, 0.9)" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -820,30 +852,6 @@ orientation: y-" data-x="-2.49" data-y="-2.9000000000000004" cx="295.58784676354
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -913,17 +921,57 @@ available orientations: any" data-x="-2.25" data-y="2.200000000000001" x="296.32
+available orientations: y-" data-x="-1.5675" data-y="5.179000000000002" x="336.15147512109206" y="126.35490973139588" width="9.863496257155418" height="22.192866578599677" fill="#00000066" stroke="#000000" stroke-width="0.020276785714285723" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+available orientations: y-" data-x="-2.025" data-y="0.674000000000001" x="313.588727432849" y="348.53016292382205" width="9.863496257155418" height="22.192866578599705" fill="#00000066" stroke="#000000" stroke-width="0.020276785714285723" />
+available orientations: y-" data-x="-2.025" data-y="-2.926" x="313.588727432849" y="526.0730955526199" width="9.863496257155418" height="22.192866578599705" fill="#00000066" stroke="#000000" stroke-width="0.020276785714285723" />
diff --git a/tests/examples/__snapshots__/example16.snap.svg b/tests/examples/__snapshots__/example16.snap.svg
index fad96b6d..11190174 100644
--- a/tests/examples/__snapshots__/example16.snap.svg
+++ b/tests/examples/__snapshots__/example16.snap.svg
@@ -2,110 +2,128 @@
+x+" data-x="1.2000000000000002" data-y="-0.30000000000000004" cx="308.80000000000007" cy="454.68000000000006" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="-0.30000000000000004" cx="40" cy="454.68000000000006" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="409.88000000000005" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="0.30000000000000004" cx="40" cy="387.48" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="0.10000000000000003" cx="40" cy="409.88000000000005" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="-0.09999999999999998" cx="40" cy="432.28000000000003" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="-0.10000000000000003" cx="308.80000000000007" cy="432.28000000000003" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="0.30000000000000004" cx="308.80000000000007" cy="387.48" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
+x-" data-x="1.6" data-y="2.105" cx="353.6" cy="185.32000000000005" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
+x-" data-x="1.6" data-y="1.9049999999999998" cx="353.6" cy="207.72000000000006" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
+x-" data-x="1.6" data-y="1.7049999999999998" cx="353.6" cy="230.12000000000006" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
+orientation: y-" data-x="1.3010000000000002" data-y="-0.5010000000000001" cx="320.1120000000001" cy="477.19200000000006" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="1.499" data-y="1.504" cx="342.288" cy="252.63200000000003" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="409.88000000000005" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="1.6" data-y="1.9049999999999998" cx="353.6" cy="207.72000000000006" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+available orientations: y-" data-x="1.3010000000000002" data-y="-0.7260000000000001" x="308.91200000000003" y="477.19200000000006" width="22.400000000000034" height="50.400000000000034" fill="#00000066" stroke="#000000" stroke-width="0.008928571428571428" />
+available orientations: y-" data-x="1.499" data-y="1.279" x="331.088" y="252.63200000000003" width="22.400000000000034" height="50.400000000000006" fill="#00000066" stroke="#000000" stroke-width="0.008928571428571428" />
+
+
+
+available orientations: x-, x+" data-x="1.374" data-y="1.9049999999999998" x="303.088" y="196.52000000000004" width="50.400000000000034" height="22.400000000000034" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008928571428571428" />
+
+
+
+available orientations: y+" data-x="1.499" data-y="2.531" x="331.088" y="112.40800000000002" width="22.400000000000034" height="50.400000000000034" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
@@ -140,7 +158,7 @@ available orientations: y+" data-x="0.749" data-y="2.33" x="247.08800000000002"
"e": 174.40000000000003,
"b": 0,
"d": -112,
- "f": 409.824
+ "f": 421.08000000000004
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example20.snap.svg b/tests/examples/__snapshots__/example20.snap.svg
index 2b09211f..dff1d5bc 100644
--- a/tests/examples/__snapshots__/example20.snap.svg
+++ b/tests/examples/__snapshots__/example20.snap.svg
@@ -2,95 +2,107 @@
+x+" data-x="1.2000000000000002" data-y="-0.30000000000000004" cx="308.80000000000007" cy="454.68000000000006" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="-0.30000000000000004" cx="40" cy="454.68000000000006" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="409.88000000000005" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="0.30000000000000004" cx="40" cy="387.48" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="0.10000000000000003" cx="40" cy="409.88000000000005" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="-0.09999999999999998" cx="40" cy="432.28000000000003" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="-0.10000000000000003" cx="308.80000000000007" cy="432.28000000000003" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="0.30000000000000004" cx="308.80000000000007" cy="387.48" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
+x-" data-x="1.6" data-y="2.105" cx="353.6" cy="185.32000000000005" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
+x-" data-x="1.6" data-y="1.9049999999999998" cx="353.6" cy="207.72000000000006" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
+x-" data-x="1.6" data-y="1.7049999999999998" cx="353.6" cy="230.12000000000006" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
+orientation: y-" data-x="1.3010000000000002" data-y="-0.5010000000000001" cx="320.1120000000001" cy="477.19200000000006" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="1.499" data-y="1.504" cx="342.288" cy="252.63200000000003" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="1.3010000000000002" data-y="0.5010000000000001" cx="320.1120000000001" cy="364.968" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
+available orientations: y-" data-x="1.3010000000000002" data-y="-0.7260000000000001" x="308.91200000000003" y="477.19200000000006" width="22.400000000000034" height="50.400000000000034" fill="#00000066" stroke="#000000" stroke-width="0.008928571428571428" />
+available orientations: y-" data-x="1.499" data-y="1.279" x="331.088" y="252.63200000000003" width="22.400000000000034" height="50.400000000000006" fill="#00000066" stroke="#000000" stroke-width="0.008928571428571428" />
+
+
+
+available orientations: y+" data-x="1.499" data-y="2.531" x="331.088" y="112.40800000000002" width="22.400000000000034" height="50.400000000000034" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
@@ -125,7 +137,7 @@ available orientations: y+" data-x="1.049" data-y="2.33" x="280.68800000000005"
"e": 174.40000000000003,
"b": 0,
"d": -112,
- "f": 409.824
+ "f": 421.08000000000004
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example21.snap.svg b/tests/examples/__snapshots__/example21.snap.svg
index 85810dff..38fb8a24 100644
--- a/tests/examples/__snapshots__/example21.snap.svg
+++ b/tests/examples/__snapshots__/example21.snap.svg
@@ -2,242 +2,263 @@
+x-" data-x="-1.4" data-y="-0.6" cx="53.140322204062585" cy="320" r="3" fill="hsl(65, 100%, 50%, 0.8)" />
+x-" data-x="-1.4" data-y="0.6" cx="53.140322204062585" cy="241.55031519962643" r="3" fill="hsl(66, 100%, 50%, 0.8)" />
+x+" data-x="1.4" data-y="0.6" cx="236.1895867382676" cy="241.55031519962643" r="3" fill="hsl(67, 100%, 50%, 0.8)" />
+x+" data-x="1.4" data-y="-0.6" cx="236.1895867382676" cy="320" r="3" fill="hsl(68, 100%, 50%, 0.8)" />
+x-" data-x="3.785" data-y="-0.29999999999999993" cx="392.1083352790101" cy="300.3875787999066" r="3" fill="hsl(175, 100%, 50%, 0.8)" />
+y-" data-x="4.785" data-y="-1.2999999999999998" cx="457.4830726126547" cy="365.7623161335512" r="3" fill="hsl(176, 100%, 50%, 0.8)" />
+x-" data-x="3.785" data-y="-0.4999999999999999" cx="392.1083352790101" cy="313.4625262666355" r="3" fill="hsl(177, 100%, 50%, 0.8)" />
+x+" data-x="5.785" data-y="-0.3999999999999999" cx="522.8578099462994" cy="306.92505253327107" r="3" fill="hsl(179, 100%, 50%, 0.8)" />
+y+" data-x="6.7" data-y="-0.39999999999999925" cx="582.6756946065842" cy="306.925052533271" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
+y-" data-x="6.7" data-y="-1.4999999999999993" cx="582.6756946065842" cy="378.83726360028015" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
+y+" data-x="2.8699999999999997" data-y="-1.2" cx="332.29045061872523" cy="359.2248424001868" r="3" fill="hsl(337, 100%, 50%, 0.8)" />
+y-" data-x="2.8699999999999997" data-y="-2.3" cx="332.29045061872523" cy="431.13705346719587" r="3" fill="hsl(338, 100%, 50%, 0.8)" />
+y+" data-x="2.9752723250000006" data-y="0.6000000000000003" cx="339.1726012141023" cy="241.5503151996264" r="3" fill="hsl(82, 100%, 50%, 0.8)" />
+y-" data-x="2.9752723250000006" data-y="-0.4999999999999998" cx="339.1726012141023" cy="313.4625262666355" r="3" fill="hsl(83, 100%, 50%, 0.8)" />
+orientation: y-" data-x="-1.501" data-y="-1.001" cx="46.53747373336448" cy="346.2152696707915" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="1.501" data-y="-1.001" cx="242.79243520896568" cy="346.2152696707915" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="4.785" data-y="-1.2999999999999998" cx="457.4830726126547" cy="365.7623161335512" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="6.7" data-y="-1.4999999999999993" cx="582.6756946065842" cy="378.83726360028015" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="2.8699999999999997" data-y="-2.3" cx="332.29045061872523" cy="431.13705346719587" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="2.8699999999999997" data-y="-1.2" cx="332.29045061872523" cy="359.2248424001868" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="2.9752723250000006" data-y="0.8000000000000005" cx="339.1726012141023" cy="228.47536773289747" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="-1.501" data-y="1.001" cx="46.53747373336448" cy="215.33504552883494" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+available orientations: y-" data-x="1.501" data-y="-1.1509999999999998" x="236.25496147560122" y="346.2152696707915" width="13.074947466728958" height="19.612421200093422" fill="#00000066" stroke="#000000" stroke-width="0.01529642857142857" />
+available orientations: y-" data-x="4.785" data-y="-1.4509999999999996" x="450.9455988792903" y="365.8276908708849" width="13.074947466728872" height="19.612421200093365" fill="#00000066" stroke="#000000" stroke-width="0.01529642857142857" />
+available orientations: y-" data-x="6.7" data-y="-1.6509999999999991" x="576.1382208732198" y="378.9026383376138" width="13.074947466728872" height="19.612421200093365" fill="#00000066" stroke="#000000" stroke-width="0.01529642857142857" />
+
+
+
+
+
+
+available orientations: y+" data-x="2.9752723250000006" data-y="0.9500000000000005" x="332.6351274807379" y="208.86294653280407" width="13.07494746672893" height="19.612421200093394" fill="#ef444466" stroke="#ef4444" stroke-width="0.01529642857142857" />
+available orientations: y+" data-x="-1.501" data-y="1.1509999999999998" x="40.000000000000014" y="195.72262432874155" width="13.074947466728943" height="19.612421200093394" fill="#ef444466" stroke="#ef4444" stroke-width="0.01529642857142857" />
+available orientations: y+" data-x="6.2425" data-y="7.771561172376096e-16" x="546.2292785430774" y="267.7002101330842" width="13.074947466728872" height="26.14989493345786" fill="#ef444466" stroke="#ef4444" stroke-width="0.01529642857142857" />
+available orientations: y+" data-x="1.501" data-y="1.2009999999999998" x="236.25496147560122" y="189.18515059537708" width="13.074947466728958" height="26.14989493345786" fill="#ef444466" stroke="#ef4444" stroke-width="0.01529642857142857" />
+available orientations: x-, x+" data-x="2.675272325000001" data-y="-0.5999999999999999" x="299.9477588139156" y="313.4625262666355" width="39.22484240018673" height="13.07494746672893" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01529642857142857" />
@@ -267,12 +288,12 @@ available orientations: x-, x+" data-x="2.675272325000001" data-y="-0.5999999999
// Calculate real coordinates using inverse transformation
const matrix = {
- "a": 63.88318503308236,
+ "a": 65.37473733364465,
"c": 0,
- "e": 155.05361624458132,
+ "e": 144.6649544711651,
"b": 0,
- "d": -63.88318503308236,
- "f": 275.31371206935887
+ "d": -65.37473733364465,
+ "f": 280.7751575998132
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example22.snap.svg b/tests/examples/__snapshots__/example22.snap.svg
index c9c7e45d..ba9d14b2 100644
--- a/tests/examples/__snapshots__/example22.snap.svg
+++ b/tests/examples/__snapshots__/example22.snap.svg
@@ -2,104 +2,116 @@
+x+" data-x="1.2000000000000002" data-y="-0.30000000000000004" cx="308.80000000000007" cy="241.88" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="-0.30000000000000004" cx="40" cy="241.88" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="0.09999999999999998" cx="308.80000000000007" cy="197.08" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="0.30000000000000004" cx="40" cy="174.68" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="0.10000000000000003" cx="40" cy="197.07999999999998" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
+x-" data-x="-1.2000000000000002" data-y="-0.09999999999999998" cx="40" cy="219.48" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="-0.10000000000000003" cx="308.80000000000007" cy="219.48000000000002" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
+x+" data-x="1.2000000000000002" data-y="0.30000000000000004" cx="308.80000000000007" cy="174.68" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
+x-" data-x="1.6" data-y="-1.895" cx="353.6" cy="420.52" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
+x-" data-x="1.6" data-y="-2.095" cx="353.6" cy="442.92" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
+x-" data-x="1.6" data-y="-2.295" cx="353.6" cy="465.31999999999994" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
+orientation: y-" data-x="1.3010000000000002" data-y="-0.5010000000000001" cx="320.1120000000001" cy="264.392" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y-" data-x="1.499" data-y="-2.496" cx="342.288" cy="487.832" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="1.3010000000000002" data-y="0.5010000000000001" cx="320.1120000000001" cy="152.168" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: y+" data-x="1.499" data-y="-1.6940000000000002" cx="342.288" cy="398.00800000000004" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+available orientations: y-" data-x="1.499" data-y="-2.721" x="331.088" y="487.832" width="22.400000000000034" height="50.39999999999998" fill="#00000066" stroke="#000000" stroke-width="0.008928571428571428" />
+available orientations: y+" data-x="1.3010000000000002" data-y="0.7260000000000001" x="308.91200000000003" y="101.768" width="22.400000000000034" height="50.400000000000006" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
+available orientations: y+" data-x="1.499" data-y="-1.469" x="331.088" y="347.608" width="22.400000000000034" height="50.400000000000034" fill="#ef444466" stroke="#ef4444" stroke-width="0.008928571428571428" />
+available orientations: x+, x-" data-x="1.374" data-y="-2.095" x="303.088" y="431.72" width="50.400000000000034" height="22.399999999999977" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008928571428571428" />
@@ -134,7 +146,7 @@ available orientations: x+, x-" data-x="1.374" data-y="-2.095" x="303.088" y="44
"e": 174.40000000000003,
"b": 0,
"d": -112,
- "f": 219.53599999999997
+ "f": 208.28
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example24.snap.svg b/tests/examples/__snapshots__/example24.snap.svg
index b8b6c15c..2393d6b7 100644
--- a/tests/examples/__snapshots__/example24.snap.svg
+++ b/tests/examples/__snapshots__/example24.snap.svg
@@ -2,108 +2,124 @@
+x+" data-x="-1.7999999999999998" data-y="-0.30000000000000004" cx="201.92771084337352" cy="373.9759036144578" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
+x-" data-x="-4.2" data-y="-0.30000000000000004" cx="40" cy="373.9759036144578" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
+x+" data-x="-1.7999999999999998" data-y="0.09999999999999998" cx="201.92771084337352" cy="346.9879518072289" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
+x-" data-x="-4.2" data-y="0.30000000000000004" cx="40" cy="333.49397590361446" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
+x-" data-x="-4.2" data-y="0.10000000000000003" cx="40" cy="346.9879518072289" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
+x-" data-x="-4.2" data-y="-0.09999999999999998" cx="40" cy="360.48192771084337" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
+x+" data-x="-1.7999999999999998" data-y="-0.10000000000000003" cx="201.92771084337352" cy="360.48192771084337" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
+x+" data-x="-1.7999999999999998" data-y="0.30000000000000004" cx="201.92771084337352" cy="333.49397590361446" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
+x-" data-x="1.9" data-y="0.2" cx="451.566265060241" cy="340.2409638554217" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
+x-" data-x="1.9" data-y="0" cx="451.566265060241" cy="353.73493975903614" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
+x-" data-x="1.9" data-y="-0.2" cx="451.566265060241" cy="367.2289156626506" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
+y-" data-x="-0.4" data-y="0.5" cx="296.3855421686747" cy="320" r="3" fill="hsl(202, 100%, 50%, 0.8)" />
+y-" data-x="0.4" data-y="0.5" cx="350.3614457831325" cy="320" r="3" fill="hsl(203, 100%, 50%, 0.8)" />
+orientation: x+" data-x="-1.7999999999999998" data-y="-0.30000000000000004" cx="201.92771084337352" cy="373.9759036144578" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="1.9" data-y="-0.2" cx="451.566265060241" cy="367.2289156626506" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="1.9" data-y="0.2" cx="451.566265060241" cy="340.2409638554217" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x+" data-x="-1.7999999999999998" data-y="0.09999999999999998" cx="201.92771084337352" cy="346.9879518072289" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
+globalConnNetId: connectivity_net2
+available orientations: any" data-x="1.674" data-y="-0.2" x="421.13734939759036" y="360.48192771084337" width="30.361445783132524" height="13.493975903614455" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01482142857142857" />
+
+
+
+globalConnNetId: connectivity_net3
+available orientations: any" data-x="-1.5739999999999998" data-y="0.09999999999999998" x="201.99518072289158" y="340.2409638554217" width="30.361445783132524" height="13.493975903614455" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01482142857142857" />
+globalConnNetId: connectivity_net0
+available orientations: any" data-x="-0.4" data-y="0.274" x="289.6385542168675" y="320.06746987951806" width="13.493975903614455" height="30.361445783132524" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01482142857142857" />
+globalConnNetId: connectivity_net1
+available orientations: any" data-x="0.4" data-y="0.274" x="343.6144578313253" y="320.06746987951806" width="13.493975903614455" height="30.361445783132524" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01482142857142857" />
@@ -138,7 +154,7 @@ globalConnNetId: connectivity_net1" data-x="0.4" data-y="0.274" x="343.614457831
"e": 323.3734939759036,
"b": 0,
"d": -67.46987951807229,
- "f": 345.30120481927713
+ "f": 353.73493975903614
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example26.snap.svg b/tests/examples/__snapshots__/example26.snap.svg
index b8b6c15c..2393d6b7 100644
--- a/tests/examples/__snapshots__/example26.snap.svg
+++ b/tests/examples/__snapshots__/example26.snap.svg
@@ -2,108 +2,124 @@
+x+" data-x="-1.7999999999999998" data-y="-0.30000000000000004" cx="201.92771084337352" cy="373.9759036144578" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
+x-" data-x="-4.2" data-y="-0.30000000000000004" cx="40" cy="373.9759036144578" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
+x+" data-x="-1.7999999999999998" data-y="0.09999999999999998" cx="201.92771084337352" cy="346.9879518072289" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
+x-" data-x="-4.2" data-y="0.30000000000000004" cx="40" cy="333.49397590361446" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
+x-" data-x="-4.2" data-y="0.10000000000000003" cx="40" cy="346.9879518072289" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
+x-" data-x="-4.2" data-y="-0.09999999999999998" cx="40" cy="360.48192771084337" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
+x+" data-x="-1.7999999999999998" data-y="-0.10000000000000003" cx="201.92771084337352" cy="360.48192771084337" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
+x+" data-x="-1.7999999999999998" data-y="0.30000000000000004" cx="201.92771084337352" cy="333.49397590361446" r="3" fill="hsl(326, 100%, 50%, 0.8)" />
+x-" data-x="1.9" data-y="0.2" cx="451.566265060241" cy="340.2409638554217" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
+x-" data-x="1.9" data-y="0" cx="451.566265060241" cy="353.73493975903614" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
+x-" data-x="1.9" data-y="-0.2" cx="451.566265060241" cy="367.2289156626506" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
+y-" data-x="-0.4" data-y="0.5" cx="296.3855421686747" cy="320" r="3" fill="hsl(202, 100%, 50%, 0.8)" />
+y-" data-x="0.4" data-y="0.5" cx="350.3614457831325" cy="320" r="3" fill="hsl(203, 100%, 50%, 0.8)" />
+orientation: x+" data-x="-1.7999999999999998" data-y="-0.30000000000000004" cx="201.92771084337352" cy="373.9759036144578" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="1.9" data-y="-0.2" cx="451.566265060241" cy="367.2289156626506" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="1.9" data-y="0.2" cx="451.566265060241" cy="340.2409638554217" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x+" data-x="-1.7999999999999998" data-y="0.09999999999999998" cx="201.92771084337352" cy="346.9879518072289" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
+globalConnNetId: connectivity_net2
+available orientations: any" data-x="1.674" data-y="-0.2" x="421.13734939759036" y="360.48192771084337" width="30.361445783132524" height="13.493975903614455" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01482142857142857" />
+
+
+
+globalConnNetId: connectivity_net3
+available orientations: any" data-x="-1.5739999999999998" data-y="0.09999999999999998" x="201.99518072289158" y="340.2409638554217" width="30.361445783132524" height="13.493975903614455" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01482142857142857" />
+globalConnNetId: connectivity_net0
+available orientations: any" data-x="-0.4" data-y="0.274" x="289.6385542168675" y="320.06746987951806" width="13.493975903614455" height="30.361445783132524" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01482142857142857" />
+globalConnNetId: connectivity_net1
+available orientations: any" data-x="0.4" data-y="0.274" x="343.6144578313253" y="320.06746987951806" width="13.493975903614455" height="30.361445783132524" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.01482142857142857" />
@@ -138,7 +154,7 @@ globalConnNetId: connectivity_net1" data-x="0.4" data-y="0.274" x="343.614457831
"e": 323.3734939759036,
"b": 0,
"d": -67.46987951807229,
- "f": 345.30120481927713
+ "f": 353.73493975903614
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example28.snap.svg b/tests/examples/__snapshots__/example28.snap.svg
index 079fc879..fe7f0841 100644
--- a/tests/examples/__snapshots__/example28.snap.svg
+++ b/tests/examples/__snapshots__/example28.snap.svg
@@ -2,56 +2,65 @@
+x-" data-x="-0.3" data-y="0.1" cx="208.14913448735018" cy="282.71637816245004" r="3" fill="hsl(181, 100%, 50%, 0.8)" />
+x-" data-x="-0.3" data-y="0" cx="208.14913448735018" cy="320" r="3" fill="hsl(157, 100%, 50%, 0.8)" />
+x-" data-x="-0.3" data-y="-0.1" cx="208.14913448735018" cy="357.28362183754996" r="3" fill="hsl(57, 100%, 50%, 0.8)" />
+x+" data-x="0.3" data-y="0.1" cx="431.8508655126498" cy="282.71637816245004" r="3" fill="hsl(158, 100%, 50%, 0.8)" />
+x+" data-x="0.3" data-y="0" cx="431.8508655126498" cy="320" r="3" fill="hsl(325, 100%, 50%, 0.8)" />
+orientation: x-" data-x="-0.3" data-y="0.1" cx="208.14913448735018" cy="282.71637816245004" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="-0.3" data-y="-0.1" cx="208.14913448735018" cy="357.28362183754996" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
+orientation: x-" data-x="-0.3" data-y="0" cx="208.14913448735018" cy="320" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
-
+
-
+
+globalConnNetId: connectivity_net0
+available orientations: any" data-x="-0.526" data-y="-0.1" x="40" y="320" width="167.77629826897467" height="74.56724367509986" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.002682142857142857" />
+globalConnNetId: connectivity_net2
+available orientations: any" data-x="-0.526" data-y="0" x="40" y="282.71637816245004" width="167.77629826897467" height="74.56724367509992" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.002682142857142857" />
+globalConnNetId: connectivity_net1
+available orientations: any" data-x="0.526" data-y="0.1" x="432.22370173102536" y="245.43275632490014" width="167.77629826897464" height="74.56724367509986" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.002682142857142857" />
@@ -81,12 +90,12 @@ globalConnNetId: connectivity_net1" data-x="0.526" data-y="0.1" x="442.696629213
// Calculate real coordinates using inverse transformation
const matrix = {
- "a": 349.5630461922597,
+ "a": 372.83621837549936,
"c": 0,
- "e": 337.478152309613,
+ "e": 320,
"b": 0,
- "d": -349.5630461922597,
- "f": 381.3483146067416
+ "d": -372.83621837549936,
+ "f": 320
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/examples/__snapshots__/example31.snap.svg b/tests/examples/__snapshots__/example31.snap.svg
index 1cfd87d2..4df7a4b8 100644
--- a/tests/examples/__snapshots__/example31.snap.svg
+++ b/tests/examples/__snapshots__/example31.snap.svg
@@ -2,32 +2,44 @@
+x+" data-x="1.2000000000000002" data-y="0.30000000000000004" cx="345.38513974096804" cy="310.52033628720744" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
+x+" data-x="3" data-y="-0.10000000000000016" cx="574.4239945466941" cy="361.4178595773688" r="3" fill="hsl(226, 100%, 50%, 0.8)" />
+orientation: y+" data-x="1.3010000000000002" data-y="0.5010000000000001" cx="358.2367643717338" cy="284.94433083390135" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
-
+
+
+
+
+
+
+
-
+
-
+
-
+
+
+
+
+available orientations: y+" data-x="3.101" data-y="0.32599999999999985" x="574.5512383549194" y="278.58214042263126" width="25.448761645080594" height="57.25971370143145" fill="#ef444466" stroke="#ef4444" stroke-width="0.00785892857142857" />
@@ -57,12 +69,12 @@ available orientations: y+" data-x="3.2" data-y="0.525" x="575.1111111111111" y=
// Calculate real coordinates using inverse transformation
const matrix = {
- "a": 124.44444444444444,
+ "a": 127.24380822540333,
"c": 0,
- "e": 189.33333333333337,
+ "e": 192.69256987048402,
"b": 0,
- "d": -124.44444444444444,
- "f": 335.55555555555554
+ "d": -127.24380822540333,
+ "f": 348.69347875482845
};
// Manually invert and apply the affine transform
// Since we only use translate and scale, we can directly compute:
diff --git a/tests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_repro1.test.ts b/tests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_repro1.test.ts
index ad0356bb..2b1f0441 100644
--- a/tests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_repro1.test.ts
+++ b/tests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_repro1.test.ts
@@ -10,5 +10,7 @@ test("MspConnectionPairSolver_repro1", () => {
solver.solve()
- expect(solver.mspConnectionPairs.length).toBe(4)
+ // GND is net-label-only (netConnections only, no directConnections) so it
+ // must not produce MSP pairs. Only VCC and EN produce pairs.
+ expect(solver.mspConnectionPairs.length).toBe(2)
})
diff --git a/tests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_repro79.test.ts b/tests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_repro79.test.ts
new file mode 100644
index 00000000..b10d2a6e
--- /dev/null
+++ b/tests/solvers/MspConnectionPairSolver/MspConnectionPairSolver_repro79.test.ts
@@ -0,0 +1,68 @@
+import { test, expect } from "bun:test"
+import { MspConnectionPairSolver } from "lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver"
+import type { InputProblem } from "lib/types/InputProblem"
+
+// Regression test for https://github.com/tscircuit/schematic-trace-solver/issues/79
+// Net-label-only nets (netConnections with no directConnections) must not produce
+// spurious MSP trace pairs.
+const inputProblem: InputProblem = {
+ chips: [
+ {
+ chipId: "U1",
+ center: { x: 0, y: 0 },
+ width: 1.6,
+ height: 0.6,
+ pins: [
+ { pinId: "U1.1", x: -0.8, y: 0.2 },
+ { pinId: "U1.2", x: -0.8, y: 0 },
+ { pinId: "U1.3", x: -0.8, y: -0.2 },
+ ],
+ },
+ {
+ chipId: "C1",
+ center: { x: -2, y: 0 },
+ width: 0.5,
+ height: 1,
+ pins: [
+ { pinId: "C1.1", x: -2, y: 0.5 },
+ { pinId: "C1.2", x: -2, y: -0.5 },
+ ],
+ },
+ {
+ chipId: "C2",
+ center: { x: -4, y: 0 },
+ width: 0.5,
+ height: 1,
+ pins: [
+ { pinId: "C2.1", x: -4, y: 0.5 },
+ { pinId: "C2.2", x: -4, y: -0.5 },
+ ],
+ },
+ ],
+ directConnections: [{ pinIds: ["U1.1", "C1.1"], netId: "VCC" }],
+ netConnections: [
+ // GND is a net-label-only connection — no physical trace should be generated
+ { pinIds: ["U1.3", "C2.2", "C1.2"], netId: "GND" },
+ ],
+ availableNetLabelOrientations: {
+ VCC: ["y+"],
+ GND: ["y-"],
+ },
+ maxMspPairDistance: 5,
+}
+
+test("MspConnectionPairSolver_repro79: net-label-only nets produce no MSP pairs", () => {
+ const solver = new MspConnectionPairSolver({ inputProblem })
+ solver.solve()
+
+ const gndPairs = solver.mspConnectionPairs.filter(
+ (p) => p.userNetId === "GND",
+ )
+ expect(gndPairs).toHaveLength(0)
+
+ // VCC has a directConnection so it should produce a pair
+ const vccPairs = solver.mspConnectionPairs.filter(
+ (p) => p.userNetId === "VCC",
+ )
+ expect(vccPairs).toHaveLength(1)
+})
diff --git a/tests/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver_repro61.test.ts b/tests/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver_repro61.test.ts
new file mode 100644
index 00000000..63cb2eb1
--- /dev/null
+++ b/tests/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver_repro61.test.ts
@@ -0,0 +1,67 @@
+import type { InputProblem } from "lib/types/InputProblem"
+import { test, expect } from "bun:test"
+import { SchematicTracePipelineSolver } from "lib/index"
+import { MspConnectionPairSolver } from "lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver"
+
+/**
+ * Repro for https://github.com/tscircuit/schematic-trace-solver/issues/79
+ *
+ * When nets are connected only via netConnections (net labels like VCC/GND),
+ * the solver was incorrectly generating physical wire traces for them.
+ *
+ * Root cause: getConnectivityMapsFromInputProblem passes directConnMap.netMap
+ * by reference to ConnectivityMap. When netConnMap.addConnections adds net-label
+ * entries, it mutates the shared object, so queuedDcNetIds in MspConnectionPairSolver
+ * includes net-label-only nets and generates spurious traces.
+ */
+
+const inputProblem: InputProblem = {
+ chips: [
+ {
+ chipId: "R1",
+ center: { x: 0, y: 0 },
+ width: 0.5,
+ height: 1,
+ pins: [
+ { pinId: "R1.1", x: 0, y: 0.5 },
+ { pinId: "R1.2", x: 0, y: -0.5 },
+ ],
+ },
+ {
+ chipId: "R2",
+ center: { x: 2, y: 0 },
+ width: 0.5,
+ height: 1,
+ pins: [
+ { pinId: "R2.1", x: 2, y: 0.5 },
+ { pinId: "R2.2", x: 2, y: -0.5 },
+ ],
+ },
+ ],
+ directConnections: [],
+ netConnections: [
+ { netId: "VCC", pinIds: ["R1.1", "R2.1"] },
+ { netId: "GND", pinIds: ["R1.2", "R2.2"] },
+ ],
+ availableNetLabelOrientations: {
+ VCC: ["y+"],
+ GND: ["y-"],
+ },
+ maxMspPairDistance: 5,
+}
+
+test("repro61: net-label-only connections should not produce MSP pairs", () => {
+ const solver = new MspConnectionPairSolver({ inputProblem })
+ solver.solve()
+
+ expect(solver.mspConnectionPairs).toHaveLength(0)
+})
+
+test("repro61: net-label-only connections should not produce traces", () => {
+ const solver = new SchematicTracePipelineSolver(inputProblem)
+ solver.solve()
+
+ expect(solver.solved).toBe(true)
+ const traces = solver.schematicTraceLinesSolver?.solvedTracePaths ?? []
+ expect(traces).toHaveLength(0)
+})
diff --git a/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView01.snap.svg b/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView01.snap.svg
index 9c846d8b..e53ce74b 100644
--- a/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView01.snap.svg
+++ b/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView01.snap.svg
@@ -45,16 +45,20 @@ x-" data-x="1.6" data-y="-2.095" cx="179.3777777777778" cy="375.4088888888889" r
x-" data-x="1.6" data-y="-2.295" cx="179.3777777777778" cy="385.3644444444445" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -155,13 +163,13 @@ x-" data-x="7.850000000000001" data-y="-2.295" cx="490.488888888889" cy="385.364
-
+
-
+
NetLabelPlacementSolverMergedNetLabelObstacles
diff --git a/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView02.snap.svg b/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView02.snap.svg
index 2d6b49bd..5a8b5afd 100644
--- a/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView02.snap.svg
+++ b/tests/solvers/TraceLabelOverlapAvoidanceSolver/renderComparisonView/__snapshots__/renderComparisonView02.snap.svg
@@ -128,13 +128,13 @@ x-" data-x="7.850000000000001" data-y="-2.545" cx="490.488888888889" cy="397.808
-
+
-
+