@tscircuit/schematic-trace-solver 0.0.32 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/index.d.ts +24 -53
  2. package/dist/index.js +492 -831
  3. package/lib/index.ts +1 -0
  4. package/lib/solvers/MspConnectionPairSolver/MspConnectionPairSolver.ts +54 -3
  5. package/lib/solvers/MspConnectionPairSolver/doesPairCrossRestrictedCenterLines.ts +62 -0
  6. package/lib/solvers/MspConnectionPairSolver/getMspConnectionPairsFromPins.ts +7 -2
  7. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceLinesSolver.ts +3 -10
  8. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/SchematicTraceSingleLineSolver2.ts +239 -0
  9. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/collisions.ts +57 -0
  10. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/mid.ts +97 -0
  11. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/pathOps.ts +65 -0
  12. package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver2/rect.ts +19 -0
  13. package/lib/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver.ts +14 -14
  14. package/package.json +1 -1
  15. package/site/examples/example09.page.tsx +1 -1
  16. package/tests/examples/__snapshots__/example01.snap.svg +29 -29
  17. package/tests/examples/__snapshots__/example02.snap.svg +13 -10
  18. package/tests/examples/__snapshots__/example04.snap.svg +12 -12
  19. package/tests/examples/__snapshots__/example05.snap.svg +38 -38
  20. package/tests/examples/__snapshots__/example06.snap.svg +14 -14
  21. package/tests/examples/__snapshots__/example08.snap.svg +29 -23
  22. package/tests/examples/__snapshots__/example09.snap.svg +119 -149
  23. package/tests/examples/__snapshots__/example11.snap.svg +39 -33
  24. package/tests/examples/__snapshots__/example12.snap.svg +32 -29
  25. package/tests/examples/__snapshots__/example13.snap.svg +87 -84
  26. package/tests/examples/__snapshots__/example15.snap.svg +57 -57
  27. package/tests/examples/__snapshots__/example16.snap.svg +3 -3
  28. package/tests/solvers/SchematicTracePipelineSolver/SchematicTracePipelineSolver_repro03.test.ts +1 -0
@@ -0,0 +1,65 @@
1
+ import type { Point } from "@tscircuit/math-utils"
2
+ import { isHorizontal, isVertical } from "./collisions"
3
+
4
+ const EPS = 1e-9
5
+
6
+ export type Axis = "x" | "y"
7
+
8
+ export const shiftSegmentOrth = (
9
+ pts: Point[],
10
+ segIndex: number,
11
+ axis: Axis,
12
+ newCoord: number,
13
+ eps = EPS,
14
+ ): Point[] | null => {
15
+ if (segIndex < 0 || segIndex >= pts.length - 1) return null
16
+ const a = pts[segIndex]!
17
+ const b = pts[segIndex + 1]!
18
+ const vert = isVertical(a, b, eps)
19
+ const horz = isHorizontal(a, b, eps)
20
+ if (!vert && !horz) return null
21
+
22
+ // Ensure axis matches orthogonal shift
23
+ if (vert && axis !== "x") return null
24
+ if (horz && axis !== "y") return null
25
+
26
+ const out = pts.map((p) => ({ ...p }))
27
+
28
+ if (axis === "x") {
29
+ if (Math.abs(a.x - newCoord) < eps && Math.abs(b.x - newCoord) < eps)
30
+ return null
31
+ out[segIndex] = { ...out[segIndex], x: newCoord }
32
+ out[segIndex + 1] = { ...out[segIndex + 1], x: newCoord }
33
+ } else {
34
+ if (Math.abs(a.y - newCoord) < eps && Math.abs(b.y - newCoord) < eps)
35
+ return null
36
+ out[segIndex] = { ...out[segIndex], y: newCoord }
37
+ out[segIndex + 1] = { ...out[segIndex + 1], y: newCoord }
38
+ }
39
+
40
+ // Prevent collapsing adjacent segments
41
+ if (segIndex - 1 >= 0) {
42
+ const p = out[segIndex - 1]!
43
+ const q = out[segIndex]!
44
+ const manhattan = Math.abs(p.x - q.x) + Math.abs(p.y - q.y)
45
+ if (manhattan < eps) return null
46
+ }
47
+ if (segIndex + 2 <= out.length - 1) {
48
+ const p = out[segIndex + 1]!
49
+ const q = out[segIndex + 2]!
50
+ const manhattan = Math.abs(p.x - q.x) + Math.abs(p.y - q.y)
51
+ if (manhattan < eps) return null
52
+ }
53
+
54
+ // Sanity: still orthogonal
55
+ for (let i = 0; i < out.length - 1; i++) {
56
+ const u = out[i]!
57
+ const v = out[i + 1]!
58
+ if (!isHorizontal(u, v, eps) && !isVertical(u, v, eps)) return null
59
+ }
60
+
61
+ return out
62
+ }
63
+
64
+ export const pathKey = (pts: Point[], decimals = 6) =>
65
+ pts.map((p) => `${p.x.toFixed(decimals)},${p.y.toFixed(decimals)}`).join("|")
@@ -0,0 +1,19 @@
1
+ import type { InputChip, InputProblem } from "lib/types/InputProblem"
2
+ import { getInputChipBounds } from "lib/solvers/GuidelinesSolver/getInputChipBounds"
3
+
4
+ export type ChipWithBounds = {
5
+ chipId: string
6
+ minX: number
7
+ minY: number
8
+ maxX: number
9
+ maxY: number
10
+ }
11
+
12
+ export const chipToRect = (chip: InputChip): ChipWithBounds => {
13
+ const b = getInputChipBounds(chip)
14
+ return { chipId: chip.chipId, ...b }
15
+ }
16
+
17
+ export const getObstacleRects = (problem: InputProblem): ChipWithBounds[] => {
18
+ return problem.chips.map(chipToRect)
19
+ }
@@ -48,7 +48,7 @@ function definePipelineStep<
48
48
 
49
49
  export class SchematicTracePipelineSolver extends BaseSolver {
50
50
  mspConnectionPairSolver?: MspConnectionPairSolver
51
- guidelinesSolver?: GuidelinesSolver
51
+ // guidelinesSolver?: GuidelinesSolver
52
52
  schematicTraceLinesSolver?: SchematicTraceLinesSolver
53
53
  traceOverlapShiftSolver?: TraceOverlapShiftSolver
54
54
  netLabelPlacementSolver?: NetLabelPlacementSolver
@@ -69,18 +69,18 @@ export class SchematicTracePipelineSolver extends BaseSolver {
69
69
  onSolved: (mspSolver) => {},
70
70
  },
71
71
  ),
72
- definePipelineStep(
73
- "guidelinesSolver",
74
- GuidelinesSolver,
75
- () => [
76
- {
77
- inputProblem: this.inputProblem,
78
- },
79
- ],
80
- {
81
- onSolved: (guidelinesSolver) => {},
82
- },
83
- ),
72
+ // definePipelineStep(
73
+ // "guidelinesSolver",
74
+ // GuidelinesSolver,
75
+ // () => [
76
+ // {
77
+ // inputProblem: this.inputProblem,
78
+ // },
79
+ // ],
80
+ // {
81
+ // onSolved: (guidelinesSolver) => {},
82
+ // },
83
+ // ),
84
84
  definePipelineStep(
85
85
  "schematicTraceLinesSolver",
86
86
  SchematicTraceLinesSolver,
@@ -90,7 +90,7 @@ export class SchematicTracePipelineSolver extends BaseSolver {
90
90
  dcConnMap: this.mspConnectionPairSolver!.dcConnMap,
91
91
  globalConnMap: this.mspConnectionPairSolver!.globalConnMap,
92
92
  inputProblem: this.inputProblem,
93
- guidelines: this.guidelinesSolver!.guidelines,
93
+ // guidelines: this.guidelinesSolver!.guidelines,
94
94
  chipMap: this.mspConnectionPairSolver!.chipMap,
95
95
  },
96
96
  ],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/schematic-trace-solver",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.32",
4
+ "version": "0.0.33",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "start": "cosmos",
@@ -411,7 +411,7 @@ export const inputProblem: InputProblem = {
411
411
  ],
412
412
  netConnections: [],
413
413
  availableNetLabelOrientations: {},
414
- maxMspPairDistance: 2,
414
+ maxMspPairDistance: 5,
415
415
  }
416
416
 
417
417
  export default () => <PipelineDebugger inputProblem={inputProblem} />
@@ -2,97 +2,97 @@
2
2
  <rect width="100%" height="100%" fill="white" />
3
3
  <g>
4
4
  <circle data-type="point" data-label="U1.1
5
- x-" data-x="-0.8" data-y="0.2" cx="422.5742574257426" cy="272.8712871287128" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
5
+ x-" data-x="-0.8" data-y="0.2" cx="422.5742574257426" cy="278.4158415841584" r="3" fill="hsl(319, 100%, 50%, 0.8)" />
6
6
  </g>
7
7
  <g>
8
8
  <circle data-type="point" data-label="U1.2
9
- x-" data-x="-0.8" data-y="0" cx="422.5742574257426" cy="295.049504950495" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
9
+ x-" data-x="-0.8" data-y="0" cx="422.5742574257426" cy="300.5940594059406" r="3" fill="hsl(320, 100%, 50%, 0.8)" />
10
10
  </g>
11
11
  <g>
12
12
  <circle data-type="point" data-label="U1.3
13
- x-" data-x="-0.8" data-y="-0.2" cx="422.5742574257426" cy="317.2277227722772" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
13
+ x-" data-x="-0.8" data-y="-0.2" cx="422.5742574257426" cy="322.7722772277228" r="3" fill="hsl(321, 100%, 50%, 0.8)" />
14
14
  </g>
15
15
  <g>
16
16
  <circle data-type="point" data-label="U1.4
17
- x+" data-x="0.8" data-y="-0.2" cx="600" cy="317.2277227722772" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
17
+ x+" data-x="0.8" data-y="-0.2" cx="600" cy="322.7722772277228" r="3" fill="hsl(322, 100%, 50%, 0.8)" />
18
18
  </g>
19
19
  <g>
20
20
  <circle data-type="point" data-label="U1.5
21
- x+" data-x="0.8" data-y="0" cx="600" cy="295.049504950495" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
21
+ x+" data-x="0.8" data-y="0" cx="600" cy="300.5940594059406" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
22
22
  </g>
23
23
  <g>
24
24
  <circle data-type="point" data-label="U1.6
25
- x+" data-x="0.8" data-y="0.2" cx="600" cy="272.8712871287128" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
25
+ x+" data-x="0.8" data-y="0.2" cx="600" cy="278.4158415841584" r="3" fill="hsl(324, 100%, 50%, 0.8)" />
26
26
  </g>
27
27
  <g>
28
28
  <circle data-type="point" data-label="C1.1
29
- y+" data-x="-2" data-y="0.5" cx="289.50495049504957" cy="239.60396039603958" r="3" fill="hsl(121, 100%, 50%, 0.8)" />
29
+ y+" data-x="-2" data-y="0.5" cx="289.50495049504957" cy="245.14851485148515" r="3" fill="hsl(121, 100%, 50%, 0.8)" />
30
30
  </g>
31
31
  <g>
32
32
  <circle data-type="point" data-label="C1.2
33
- y-" data-x="-2" data-y="-0.5" cx="289.50495049504957" cy="350.4950495049505" r="3" fill="hsl(122, 100%, 50%, 0.8)" />
33
+ y-" data-x="-2" data-y="-0.5" cx="289.50495049504957" cy="356.03960396039605" r="3" fill="hsl(122, 100%, 50%, 0.8)" />
34
34
  </g>
35
35
  <g>
36
36
  <circle data-type="point" data-label="C2.1
37
- y+" data-x="-4" data-y="0.5" cx="67.72277227722776" cy="239.60396039603958" r="3" fill="hsl(2, 100%, 50%, 0.8)" />
37
+ y+" data-x="-4" data-y="0.5" cx="67.72277227722776" cy="245.14851485148515" r="3" fill="hsl(2, 100%, 50%, 0.8)" />
38
38
  </g>
39
39
  <g>
40
40
  <circle data-type="point" data-label="C2.2
41
- y-" data-x="-4" data-y="-0.5" cx="67.72277227722776" cy="350.4950495049505" r="3" fill="hsl(3, 100%, 50%, 0.8)" />
41
+ y-" data-x="-4" data-y="-0.5" cx="67.72277227722776" cy="356.03960396039605" r="3" fill="hsl(3, 100%, 50%, 0.8)" />
42
42
  </g>
43
43
  <g>
44
- <circle data-type="point" data-label="" data-x="-1.1" data-y="0.20000000000000018" cx="389.3069306930693" cy="272.8712871287128" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
44
+ <circle data-type="point" data-label="" data-x="-1.1" data-y="0.20000000000000018" cx="389.3069306930693" cy="278.4158415841584" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
45
45
  </g>
46
46
  <g>
47
- <circle data-type="point" data-label="" data-x="-1.275" data-y="0" cx="369.90099009900996" cy="295.049504950495" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
47
+ <circle data-type="point" data-label="" data-x="-1.275" data-y="0" cx="369.90099009900996" cy="300.5940594059406" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
48
48
  </g>
49
49
  <g>
50
- <circle data-type="point" data-label="" data-x="-4" data-y="-0.7000000000000002" cx="67.72277227722776" cy="372.6732673267327" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
50
+ <circle data-type="point" data-label="" data-x="-1.4" data-y="-0.7" cx="356.0396039603961" cy="378.2178217821782" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
51
51
  </g>
52
52
  <g>
53
- <polyline data-points="-0.8,0.2 -2,0.5" data-type="line" data-label="" points="422.5742574257426,272.8712871287128 289.50495049504957,239.60396039603958" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1" />
53
+ <polyline data-points="-0.8,0.2 -2,0.5" data-type="line" data-label="" points="422.5742574257426,278.4158415841584 289.50495049504957,245.14851485148515" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1" />
54
54
  </g>
55
55
  <g>
56
- <polyline data-points="-0.8,0 -4,0.5" data-type="line" data-label="" points="422.5742574257426,295.049504950495 67.72277227722776,239.60396039603958" fill="none" stroke="hsl(57, 100%, 50%, 0.8)" stroke-width="1" />
56
+ <polyline data-points="-0.8,0 -4,0.5" data-type="line" data-label="" points="422.5742574257426,300.5940594059406 67.72277227722776,245.14851485148515" fill="none" stroke="hsl(57, 100%, 50%, 0.8)" stroke-width="1" />
57
57
  </g>
58
58
  <g>
59
- <polyline data-points="-0.8,-0.2 -4,-0.5" data-type="line" data-label="" points="422.5742574257426,317.2277227722772 67.72277227722776,350.4950495049505" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
59
+ <polyline data-points="-0.8,-0.2 -4,-0.5" data-type="line" data-label="" points="422.5742574257426,322.7722772277228 67.72277227722776,356.03960396039605" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
60
60
  </g>
61
61
  <g>
62
- <polyline data-points="-0.8,-0.2 -2,-0.5" data-type="line" data-label="" points="422.5742574257426,317.2277227722772 289.50495049504957,350.4950495049505" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
62
+ <polyline data-points="-0.8,-0.2 -2,-0.5" data-type="line" data-label="" points="422.5742574257426,322.7722772277228 289.50495049504957,356.03960396039605" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
63
63
  </g>
64
64
  <g>
65
- <polyline data-points="-4,-0.5 -2,-0.5" data-type="line" data-label="" points="67.72277227722776,350.4950495049505 289.50495049504957,350.4950495049505" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
65
+ <polyline data-points="-4,-0.5 -2,-0.5" data-type="line" data-label="" points="67.72277227722776,356.03960396039605 289.50495049504957,356.03960396039605" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
66
66
  </g>
67
67
  <g>
68
- <polyline data-points="-0.8,0.20000000000000018 -1.4,0.20000000000000018 -1.4,0.5 -2,0.5" data-type="line" data-label="" points="422.5742574257426,272.8712871287128 356.0396039603961,272.8712871287128 356.0396039603961,239.60396039603958 289.50495049504957,239.60396039603958" fill="none" stroke="purple" stroke-width="1" />
68
+ <polyline data-points="-0.8,0.20000000000000018 -1.4,0.20000000000000018 -1.4,0.6 -2,0.6 -2,0.5" data-type="line" data-label="" points="422.5742574257426,278.4158415841584 356.0396039603961,278.4158415841584 356.0396039603961,234.05940594059405 289.50495049504957,234.05940594059405 289.50495049504957,245.14851485148515" fill="none" stroke="purple" stroke-width="1" />
69
69
  </g>
70
70
  <g>
71
- <polyline data-points="-0.7999999999999998,0 -1.275,0 -1.275,0.7 -4,0.7 -4,0.5" data-type="line" data-label="" points="422.57425742574264,295.049504950495 369.90099009900996,295.049504950495 369.90099009900996,217.4257425742574 67.72277227722776,217.4257425742574 67.72277227722776,239.60396039603958" fill="none" stroke="purple" stroke-width="1" />
71
+ <polyline data-points="-0.7999999999999998,0 -1.275,0 -1.275,0.8000000000000002 -4,0.8000000000000002 -4,0.5" data-type="line" data-label="" points="422.57425742574264,300.5940594059406 369.90099009900996,300.5940594059406 369.90099009900996,211.88118811881185 67.72277227722776,211.88118811881185 67.72277227722776,245.14851485148515" fill="none" stroke="purple" stroke-width="1" />
72
72
  </g>
73
73
  <g>
74
- <polyline data-points="-0.8,-0.20000000000000018 -1.4,-0.20000000000000018 -1.4,-0.6 -2,-0.6 -2,-0.5" data-type="line" data-label="" points="422.5742574257426,317.2277227722772 356.0396039603961,317.2277227722772 356.0396039603961,361.58415841584156 289.50495049504957,361.58415841584156 289.50495049504957,350.4950495049505" fill="none" stroke="purple" stroke-width="1" />
74
+ <polyline data-points="-0.8,-0.20000000000000018 -1.4,-0.20000000000000018 -1.4,-0.7 -2,-0.7 -2,-0.5" data-type="line" data-label="" points="422.5742574257426,322.7722772277228 356.0396039603961,322.7722772277228 356.0396039603961,378.2178217821782 289.50495049504957,378.2178217821782 289.50495049504957,356.03960396039605" fill="none" stroke="purple" stroke-width="1" />
75
75
  </g>
76
76
  <g>
77
- <polyline data-points="-4,-0.5 -4,-0.7000000000000002 -2,-0.7000000000000002 -2,-0.5" data-type="line" data-label="" points="67.72277227722776,350.4950495049505 67.72277227722776,372.6732673267327 289.50495049504957,372.6732673267327 289.50495049504957,350.4950495049505" fill="none" stroke="purple" stroke-width="1" />
77
+ <polyline data-points="-4,-0.5 -4,-0.7000000000000002 -2,-0.7000000000000002 -2,-0.5" data-type="line" data-label="" points="67.72277227722776,356.03960396039605 67.72277227722776,378.21782178217825 289.50495049504957,378.21782178217825 289.50495049504957,356.03960396039605" fill="none" stroke="purple" stroke-width="1" />
78
78
  </g>
79
79
  <g>
80
- <rect data-type="rect" data-label="U1" data-x="0" data-y="0" x="422.5742574257426" y="261.78217821782175" width="177.4257425742574" height="66.53465346534654" fill="hsl(164, 100%, 50%, 0.8)" stroke="black" stroke-width="0.009017857142857143" />
80
+ <rect data-type="rect" data-label="U1" data-x="0" data-y="0" x="422.5742574257426" y="267.3267326732673" width="177.4257425742574" height="66.53465346534654" fill="hsl(164, 100%, 50%, 0.8)" stroke="black" stroke-width="0.009017857142857143" />
81
81
  </g>
82
82
  <g>
83
- <rect data-type="rect" data-label="C1" data-x="-2" data-y="0" x="261.7821782178218" y="239.60396039603958" width="55.445544554455466" height="110.8910891089109" fill="hsl(326, 100%, 50%, 0.8)" stroke="black" stroke-width="0.009017857142857143" />
83
+ <rect data-type="rect" data-label="C1" data-x="-2" data-y="0" x="261.7821782178218" y="245.14851485148515" width="55.445544554455466" height="110.8910891089109" fill="hsl(326, 100%, 50%, 0.8)" stroke="black" stroke-width="0.009017857142857143" />
84
84
  </g>
85
85
  <g>
86
- <rect data-type="rect" data-label="C2" data-x="-4" data-y="0" x="40.00000000000006" y="239.60396039603958" width="55.44554455445541" height="110.8910891089109" fill="hsl(327, 100%, 50%, 0.8)" stroke="black" stroke-width="0.009017857142857143" />
86
+ <rect data-type="rect" data-label="C2" data-x="-4" data-y="0" x="40.00000000000006" y="245.14851485148515" width="55.44554455445541" height="110.8910891089109" fill="hsl(327, 100%, 50%, 0.8)" stroke="black" stroke-width="0.009017857142857143" />
87
87
  </g>
88
88
  <g>
89
- <rect data-type="rect" data-label="" data-x="-1.1" data-y="0.42500000000000016" x="378.21782178217825" y="222.97029702970292" width="22.178217821782198" height="49.9009900990099" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.009017857142857143" />
89
+ <rect data-type="rect" data-label="" data-x="-1.1" data-y="0.42500000000000016" x="378.21782178217825" y="228.51485148514848" width="22.178217821782198" height="49.9009900990099" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.009017857142857143" />
90
90
  </g>
91
91
  <g>
92
- <rect data-type="rect" data-label="" data-x="-1.5" data-y="0" x="320" y="283.96039603960395" width="49.90099009900996" height="22.17821782178214" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.009017857142857143" />
92
+ <rect data-type="rect" data-label="" data-x="-1.5" data-y="0" x="320" y="289.5049504950495" width="49.90099009900996" height="22.17821782178214" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.009017857142857143" />
93
93
  </g>
94
94
  <g>
95
- <rect data-type="rect" data-label="" data-x="-4" data-y="-0.9250000000000002" x="56.63366336633669" y="372.6732673267327" width="22.17821782178214" height="49.900990099009846" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.009017857142857143" />
95
+ <rect data-type="rect" data-label="" data-x="-1.4" data-y="-0.9249999999999999" x="344.950495049505" y="378.2178217821782" width="22.178217821782198" height="49.9009900990099" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.009017857142857143" />
96
96
  </g>
97
97
  <g id="crosshair" style="display: none">
98
98
  <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
@@ -127,7 +127,7 @@ y-" data-x="-4" data-y="-0.5" cx="67.72277227722776" cy="350.4950495049505" r="3
127
127
  "e": 511.2871287128713,
128
128
  "b": 0,
129
129
  "d": -110.89108910891089,
130
- "f": 295.049504950495
130
+ "f": 300.5940594059406
131
131
  };
132
132
  // Manually invert and apply the affine transform
133
133
  // Since we only use translate and scale, we can directly compute:
@@ -53,7 +53,7 @@ x+" data-x="1" data-y="-0.1" cx="500.20151295522464" cy="341.11637364700744" r="
53
53
  x+" data-x="1" data-y="0.1" cx="500.20151295522464" cy="324.189420823755" r="3" fill="hsl(323, 100%, 50%, 0.8)" />
54
54
  </g>
55
55
  <g>
56
- <circle data-type="point" data-label="" data-x="-3.0440232499999995" data-y="1.3024186000000004" cx="157.93655911079327" cy="222.4230062437483" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
56
+ <circle data-type="point" data-label="" data-x="-1.4574283249999997" data-y="1.3024186000000004" cx="292.2176463362275" cy="222.4230062437483" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
57
57
  </g>
58
58
  <g>
59
59
  <circle data-type="point" data-label="" data-x="-3.0434765500000003" data-y="-0.2000000000000004" cx="157.98282893633558" cy="349.5798500586337" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
@@ -62,7 +62,10 @@ x+" data-x="1" data-y="0.1" cx="500.20151295522464" cy="324.189420823755" r="3"
62
62
  <circle data-type="point" data-label="" data-x="1.9148566499999995" data-y="-1.0024186000000008" cx="577.6301897281687" cy="417.4923589921354" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
63
63
  </g>
64
64
  <g>
65
- <circle data-type="point" data-label="" data-x="1.4571549750000001" data-y="0.1" cx="538.8927164289255" cy="324.189420823755" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
65
+ <circle data-type="point" data-label="" data-x="1" data-y="0.1" cx="500.20151295522464" cy="324.189420823755" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
66
+ </g>
67
+ <g>
68
+ <circle data-type="point" data-label="" data-x="1.9143099500000003" data-y="0.09999999999999964" cx="577.5839199026265" cy="324.189420823755" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
66
69
  </g>
67
70
  <g>
68
71
  <polyline data-points="-1,0.2 -1.9148566499999995,1.1024186000000005" data-type="line" data-label="" points="330.93198472269955,315.7259444121287 253.50330794975545,239.34995906700078" fill="none" stroke="hsl(248, 100%, 50%, 0.8)" stroke-width="1" />
@@ -158,10 +161,10 @@ x+" data-x="1" data-y="0.1" cx="500.20151295522464" cy="324.189420823755" r="3"
158
161
  <polyline data-points="-1.9148566499999995,1.1024186000000002 -1.9148566499999995,1.3024186000000004 -3.0440232499999995,1.3024186000000004 -3.0440232499999995,1.1024186000000002" data-type="line" data-label="" points="253.50330794975545,239.3499590670008 253.50330794975545,222.4230062437483 157.93655911079327,222.4230062437483 157.93655911079327,239.3499590670008" fill="none" stroke="purple" stroke-width="1" />
159
162
  </g>
160
163
  <g>
161
- <polyline data-points="-1,0.20000000000000018 -1.4574283249999997,0.20000000000000018 -1.4574283249999997,1.2024186000000006 -1.9148566499999995,1.2024186000000006 -1.9148566499999995,1.1024186000000005" data-type="line" data-label="" points="330.93198472269955,315.7259444121287 292.2176463362275,315.7259444121287 292.2176463362275,230.88648265537452 253.50330794975545,230.88648265537452 253.50330794975545,239.34995906700078" fill="none" stroke="purple" stroke-width="1" />
164
+ <polyline data-points="-1,0.20000000000000018 -1.4574283249999997,0.20000000000000018 -1.4574283249999997,1.3024186000000004 -1.9148566499999995,1.3024186000000004 -1.9148566499999995,1.1024186000000005" data-type="line" data-label="" points="330.93198472269955,315.7259444121287 292.2176463362275,315.7259444121287 292.2176463362275,222.4230062437483 253.50330794975545,222.4230062437483 253.50330794975545,239.34995906700078" fill="none" stroke="purple" stroke-width="1" />
162
165
  </g>
163
166
  <g>
164
- <polyline data-points="-1,-0.2 -1.2,-0.2 -1.2,0.2 -1,0.2" data-type="line" data-label="" points="330.93198472269955,349.5798500586337 314.0050318994471,349.5798500586337 314.0050318994471,315.7259444121287 330.93198472269955,315.7259444121287" fill="none" stroke="purple" stroke-width="1" />
167
+ <polyline data-points="-1,-0.2 -1.1,-0.2 -1.1,-0.30000000000000004 -1.3,-0.30000000000000004 -1.3,0.2 -1,0.2" data-type="line" data-label="" points="330.93198472269955,349.5798500586337 322.4685083110733,349.5798500586337 322.4685083110733,358.04332647025996 305.5415554878208,358.04332647025996 305.5415554878208,315.7259444121287 330.93198472269955,315.7259444121287" fill="none" stroke="purple" stroke-width="1" />
165
168
  </g>
166
169
  <g>
167
170
  <polyline data-points="-3.0434765500000003,-2.220446049250313e-16 -3.0434765500000003,-0.2000000000000004 -4.17264315,-0.2000000000000004 -4.17264315,-2.220446049250313e-16" data-type="line" data-label="" points="157.98282893633558,332.6528972353812 157.98282893633558,349.5798500586337 62.41608009737348,349.5798500586337 62.41608009737348,332.6528972353812" fill="none" stroke="purple" stroke-width="1" />
@@ -170,10 +173,7 @@ x+" data-x="1" data-y="0.1" cx="500.20151295522464" cy="324.189420823755" r="3"
170
173
  <polyline data-points="-1.9143099500000003,-2.220446049250313e-16 -1.9143099500000003,-0.2000000000000004 -3.0434765500000003,-0.2000000000000004 -3.0434765500000003,-2.220446049250313e-16" data-type="line" data-label="" points="253.54957777529776,332.6528972353812 253.54957777529776,349.5798500586337 157.98282893633558,349.5798500586337 157.98282893633558,332.6528972353812" fill="none" stroke="purple" stroke-width="1" />
171
174
  </g>
172
175
  <g>
173
- <polyline data-points="-1,0 -1.325,0 -1.325,-0.1500000000000002 -1.9143099500000003,-0.1500000000000002 -1.9143099500000003,0" data-type="line" data-label="" points="330.93198472269955,332.6528972353812 303.42568638491423,332.6528972353812 303.42568638491423,345.3481118528206 253.54957777529776,345.3481118528206 253.54957777529776,332.6528972353812" fill="none" stroke="purple" stroke-width="1" />
174
- </g>
175
- <g>
176
- <polyline data-points="1,0.1 1.9143099500000003,0.1" data-type="line" data-label="" points="500.20151295522464,324.189420823755 577.5839199026265,324.189420823755" fill="none" stroke="purple" stroke-width="1" />
176
+ <polyline data-points="-1,0 -1.0999999999999999,0 -1.0999999999999999,-0.09999999999999995 -1.9143099500000003,-0.09999999999999995 -1.9143099500000003,0" data-type="line" data-label="" points="330.93198472269955,332.6528972353812 322.4685083110733,332.6528972353812 322.4685083110733,341.11637364700744 253.54957777529776,341.11637364700744 253.54957777529776,332.6528972353812" fill="none" stroke="purple" stroke-width="1" />
177
177
  </g>
178
178
  <g>
179
179
  <rect data-type="rect" data-label="schematic_component_0" data-x="-1.9145832999999999" data-y="0.5512093000000002" x="231.13349767792428" y="239.34995906700078" width="44.78589036920462" height="93.30293816838042" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.011815475714285715" />
@@ -191,7 +191,7 @@ x+" data-x="1" data-y="0.1" cx="500.20151295522464" cy="324.189420823755" r="3"
191
191
  <rect data-type="rect" data-label="schematic_component_4" data-x="0" data-y="0" x="330.93198472269955" y="298.7989915888762" width="169.2695282325251" height="67.70781129300997" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.011815475714285715" />
192
192
  </g>
193
193
  <g>
194
- <rect data-type="rect" data-label="" data-x="-3.0440232499999995" data-y="1.5274186000000005" x="149.47308269916704" y="184.33736239143013" width="16.92695282325252" height="38.08564385231816" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011815475714285715" />
194
+ <rect data-type="rect" data-label="" data-x="-1.4574283249999997" data-y="1.5274186000000005" x="283.75416992460123" y="184.33736239143013" width="16.926952823252577" height="38.08564385231816" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011815475714285715" />
195
195
  </g>
196
196
  <g>
197
197
  <rect data-type="rect" data-label="" data-x="-3.0434765500000003" data-y="-0.4250000000000004" x="149.51935252470935" y="349.5798500586337" width="16.926952823252492" height="38.085643852318185" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011815475714285715" />
@@ -200,7 +200,10 @@ x+" data-x="1" data-y="0.1" cx="500.20151295522464" cy="324.189420823755" r="3"
200
200
  <rect data-type="rect" data-label="" data-x="1.9148566499999995" data-y="-1.2284186000000008" x="569.1667133165424" y="417.5769937562517" width="16.926952823252577" height="38.08564385231813" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011815475714285715" />
201
201
  </g>
202
202
  <g>
203
- <rect data-type="rect" data-label="" data-x="1.4571549750000001" data-y="0.325" x="530.4292400172993" y="286.1037769714368" width="16.926952823252464" height="38.085643852318185" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011815475714285715" />
203
+ <rect data-type="rect" data-label="" data-x="1.226" data-y="0.1" x="500.2861477193409" y="315.7259444121287" width="38.085643852318185" height="16.92695282325252" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011815475714285715" />
204
+ </g>
205
+ <g>
206
+ <rect data-type="rect" data-label="" data-x="1.9143099500000003" data-y="0.3259999999999996" x="569.1204434910002" y="286.01914220732056" width="16.926952823252464" height="38.085643852318185" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.011815475714285715" />
204
207
  </g>
205
208
  <g id="crosshair" style="display: none">
206
209
  <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
@@ -2,30 +2,30 @@
2
2
  <rect width="100%" height="100%" fill="white" />
3
3
  <g>
4
4
  <circle data-type="point" data-label="Q1.1
5
- y+" data-x="0.30397715550000004" data-y="0.5800832909999993" cx="398.5713361931903" cy="210.15008622007596" r="3" fill="hsl(315, 100%, 50%, 0.8)" />
5
+ y+" data-x="0.30397715550000004" data-y="0.5800832909999993" cx="376.82474681593334" cy="221.0795201051653" r="3" fill="hsl(315, 100%, 50%, 0.8)" />
6
6
  </g>
7
7
  <g>
8
8
  <circle data-type="point" data-label="Q1.2
9
- y-" data-x="0.31067575550000137" data-y="-0.5800832909999993" cx="400.643640497834" cy="569.0636206872589" r="3" fill="hsl(316, 100%, 50%, 0.8)" />
9
+ y-" data-x="0.31067575550000137" data-y="-0.5800832909999993" cx="378.69086877497443" cy="544.283224583026" r="3" fill="hsl(316, 100%, 50%, 0.8)" />
10
10
  </g>
11
11
  <g>
12
12
  <circle data-type="point" data-label="Q1.3
13
- x-" data-x="-0.4467558855000001" data-y="-0.10250625000000019" cx="166.32171500335414" cy="421.31857577293414" r="3" fill="hsl(317, 100%, 50%, 0.8)" />
13
+ x-" data-x="-0.4467558855000001" data-y="-0.10250625000000019" cx="167.68262559843902" cy="411.2379608945266" r="3" fill="hsl(317, 100%, 50%, 0.8)" />
14
14
  </g>
15
15
  <g>
16
- <circle data-type="point" data-label="" data-x="0.30397715550000004" data-y="0.6800832909999993" cx="398.5713361931903" cy="179.21370690733488" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
16
+ <circle data-type="point" data-label="" data-x="0.30397715550000004" data-y="0.7800832909999994" cx="376.82474681593334" cy="165.36274468819138" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
17
17
  </g>
18
18
  <g>
19
- <polyline data-points="0.30397715550000004,0.5800832909999993 0.31067575550000137,-0.5800832909999993" data-type="line" data-label="" points="398.5713361931903,210.15008622007596 400.643640497834,569.0636206872589" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
19
+ <polyline data-points="0.30397715550000004,0.5800832909999993 0.31067575550000137,-0.5800832909999993" data-type="line" data-label="" points="376.82474681593334,221.0795201051653 378.69086877497443,544.283224583026" fill="none" stroke="hsl(73, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
20
20
  </g>
21
21
  <g>
22
- <polyline data-points="0.30397715550000004,0.5800832909999993 0.30397715550000004,0.6800832909999993 0.5467558855000001,0.6800832909999993 0.5467558855000001,-0.6800832909999993 0.31067575550000137,-0.6800832909999993 0.31067575550000137,-0.5800832909999993" data-type="line" data-label="" points="398.5713361931903,210.15008622007596 398.5713361931903,179.21370690733488 473.67828499664586,179.21370690733488 473.67828499664586,600 400.643640497834,600 400.643640497834,569.0636206872589" fill="none" stroke="purple" stroke-width="1" />
22
+ <polyline data-points="0.30397715550000004,0.5800832909999993 0.30397715550000004,0.7800832909999994 0.6467558855000002,0.7800832909999994 0.6467558855000002,-0.7800832909999995 0.31067575550000137,-0.7800832909999995 0.31067575550000137,-0.5800832909999993" data-type="line" data-label="" points="376.82474681593334,221.0795201051653 376.82474681593334,165.36274468819138 472.31737440156104,165.36274468819138 472.31737440156104,600 378.69086877497443,600 378.69086877497443,544.283224583026" fill="none" stroke="purple" stroke-width="1" />
23
23
  </g>
24
24
  <g>
25
- <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="166.32171500335414" y="210.15008622007596" width="276.4201906805506" height="358.9135344671829" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.0032324403249999975" />
25
+ <rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="167.68262559843902" y="221.0795201051653" width="248.9179733861481" height="323.2037044778607" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.003589583182142856" />
26
26
  </g>
27
27
  <g>
28
- <rect data-type="rect" data-label="" data-x="0.30397715550000004" data-y="0.9050832909999993" x="367.6349568804492" y="40" width="61.87275862548216" height="139.21370690733488" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.0032324403249999975" />
28
+ <rect data-type="rect" data-label="" data-x="0.30397715550000004" data-y="1.0050832909999994" x="348.9663591074464" y="40.000000000000114" width="55.71677541697386" height="125.36274468819127" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.003589583182142856" />
29
29
  </g>
30
30
  <g id="crosshair" style="display: none">
31
31
  <line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
@@ -55,12 +55,12 @@ x-" data-x="-0.4467558855000001" data-y="-0.10250625000000019" cx="166.321715003
55
55
 
56
56
  // Calculate real coordinates using inverse transformation
57
57
  const matrix = {
58
- "a": 309.3637931274109,
58
+ "a": 278.58387708486947,
59
59
  "c": 0,
60
- "e": 304.53181034362945,
60
+ "e": 292.14161229151307,
61
61
  "b": 0,
62
- "d": -309.3637931274109,
63
- "f": 389.60685345366744
62
+ "d": -278.58387708486947,
63
+ "f": 382.6813723440957
64
64
  };
65
65
  // Manually invert and apply the affine transform
66
66
  // Since we only use translate and scale, we can directly compute: