@tscircuit/schematic-trace-solver 0.0.28 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +71 -4
- package/lib/solvers/SchematicTraceLinesSolver/SchematicTraceSingleLineSolver/generateElbowVariants.ts +129 -6
- package/package.json +1 -1
- package/site/examples/example08.page.tsx +1 -1
- package/tests/examples/__snapshots__/example01.snap.svg +29 -32
- package/tests/examples/__snapshots__/example02.snap.svg +5 -5
- package/tests/examples/__snapshots__/example04.snap.svg +12 -12
- package/tests/examples/__snapshots__/example05.snap.svg +35 -35
- package/tests/examples/__snapshots__/example06.snap.svg +14 -14
- package/tests/examples/__snapshots__/example08.snap.svg +23 -29
- package/tests/examples/__snapshots__/example11.snap.svg +33 -39
- package/tests/examples/__snapshots__/example12.snap.svg +29 -32
- package/tests/examples/__snapshots__/example13.snap.svg +84 -87
- package/tests/examples/__snapshots__/example15.snap.svg +57 -57
|
@@ -2,88 +2,85 @@
|
|
|
2
2
|
<rect width="100%" height="100%" fill="white" />
|
|
3
3
|
<g>
|
|
4
4
|
<circle data-type="point" data-label="J1.1
|
|
5
|
-
x+" data-x="1.1" data-y="0.2" cx="
|
|
5
|
+
x+" data-x="1.1" data-y="0.2" cx="307.24511930585686" cy="214.38286420824303" r="3" fill="hsl(218, 100%, 50%, 0.8)" />
|
|
6
6
|
</g>
|
|
7
7
|
<g>
|
|
8
8
|
<circle data-type="point" data-label="J1.2
|
|
9
|
-
x+" data-x="1.1" data-y="0" cx="
|
|
9
|
+
x+" data-x="1.1" data-y="0" cx="307.24511930585686" cy="238.67787505423001" r="3" fill="hsl(219, 100%, 50%, 0.8)" />
|
|
10
10
|
</g>
|
|
11
11
|
<g>
|
|
12
12
|
<circle data-type="point" data-label="J1.3
|
|
13
|
-
x+" data-x="1.1" data-y="-0.2" cx="
|
|
13
|
+
x+" data-x="1.1" data-y="-0.2" cx="307.24511930585686" cy="262.972885900217" r="3" fill="hsl(220, 100%, 50%, 0.8)" />
|
|
14
14
|
</g>
|
|
15
15
|
<g>
|
|
16
16
|
<circle data-type="point" data-label="R1.1
|
|
17
|
-
x-" data-x="0.5499999999999996" data-y="-1.7944553499999996" cx="
|
|
17
|
+
x-" data-x="0.5499999999999996" data-y="-1.7944553499999996" cx="240.4338394793926" cy="456.65943600867683" r="3" fill="hsl(226, 100%, 50%, 0.8)" />
|
|
18
18
|
</g>
|
|
19
19
|
<g>
|
|
20
20
|
<circle data-type="point" data-label="R1.2
|
|
21
|
-
x+" data-x="1.6499999999999997" data-y="-1.7944553499999996" cx="
|
|
21
|
+
x+" data-x="1.6499999999999997" data-y="-1.7944553499999996" cx="374.05639913232096" cy="456.65943600867683" r="3" fill="hsl(227, 100%, 50%, 0.8)" />
|
|
22
22
|
</g>
|
|
23
23
|
<g>
|
|
24
24
|
<circle data-type="point" data-label="C1.1
|
|
25
|
-
x-" data-x="2.3099999999999996" data-y="0.01999999999999985" cx="
|
|
25
|
+
x-" data-x="2.3099999999999996" data-y="0.01999999999999985" cx="454.229934924078" cy="236.24837396963133" r="3" fill="hsl(121, 100%, 50%, 0.8)" />
|
|
26
26
|
</g>
|
|
27
27
|
<g>
|
|
28
28
|
<circle data-type="point" data-label="C1.2
|
|
29
|
-
x+" data-x="3.41" data-y="0.01999999999999985" cx="
|
|
29
|
+
x+" data-x="3.41" data-y="0.01999999999999985" cx="587.8524945770065" cy="236.24837396963133" r="3" fill="hsl(122, 100%, 50%, 0.8)" />
|
|
30
30
|
</g>
|
|
31
31
|
<g>
|
|
32
|
-
<circle data-type="point" data-label="" data-x="1.3" data-y="0.2" cx="
|
|
32
|
+
<circle data-type="point" data-label="" data-x="1.3" data-y="0.2" cx="331.5401301518438" cy="214.38286420824303" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
33
33
|
</g>
|
|
34
34
|
<g>
|
|
35
|
-
<circle data-type="point" data-label="" data-x="1.
|
|
35
|
+
<circle data-type="point" data-label="" data-x="1.2" data-y="-0.8972276749999998" cx="319.3926247288503" cy="347.6686555314534" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
36
36
|
</g>
|
|
37
37
|
<g>
|
|
38
|
-
<circle data-type="point" data-label="" data-x="1.
|
|
38
|
+
<circle data-type="point" data-label="" data-x="1.5525" data-y="-1" cx="362.2125813449024" cy="360.15292928416494" r="3" fill="hsl(40, 100%, 50%, 0.9)" />
|
|
39
39
|
</g>
|
|
40
40
|
<g>
|
|
41
|
-
<
|
|
41
|
+
<polyline data-points="1.1,0.2 2.3099999999999996,0.01999999999999985" data-type="line" data-label="" points="307.24511930585686,214.38286420824303 454.229934924078,236.24837396963133" fill="none" stroke="hsl(190, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
42
42
|
</g>
|
|
43
43
|
<g>
|
|
44
|
-
<polyline data-points="1.1,0
|
|
44
|
+
<polyline data-points="1.1,0 0.5499999999999996,-1.7944553499999996" data-type="line" data-label="" points="307.24511930585686,238.67787505423001 240.4338394793926,456.65943600867683" fill="none" stroke="hsl(158, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
45
45
|
</g>
|
|
46
46
|
<g>
|
|
47
|
-
<polyline data-points="1.1
|
|
47
|
+
<polyline data-points="1.1,-0.2 1.6499999999999997,-1.7944553499999996" data-type="line" data-label="" points="307.24511930585686,262.972885900217 374.05639913232096,456.65943600867683" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
48
48
|
</g>
|
|
49
49
|
<g>
|
|
50
|
-
<polyline data-points="1.1,-0.2
|
|
50
|
+
<polyline data-points="1.1,-0.2 3.41,0.01999999999999985" data-type="line" data-label="" points="307.24511930585686,262.972885900217 587.8524945770065,236.24837396963133" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
51
51
|
</g>
|
|
52
52
|
<g>
|
|
53
|
-
<polyline data-points="1.1
|
|
53
|
+
<polyline data-points="1.6499999999999997,-1.7944553499999996 3.41,0.01999999999999985" data-type="line" data-label="" points="374.05639913232096,456.65943600867683 587.8524945770065,236.24837396963133" fill="none" stroke="hsl(157, 100%, 50%, 0.8)" stroke-width="1" stroke-dasharray="4 2" />
|
|
54
54
|
</g>
|
|
55
55
|
<g>
|
|
56
|
-
<polyline data-points="1.
|
|
56
|
+
<polyline data-points="1.1,0.2 1.3,0.2 1.6049999999999998,0.2 1.6049999999999998,0.01999999999999985 2.1099999999999994,0.01999999999999985 2.3099999999999996,0.01999999999999985" data-type="line" data-label="" points="307.24511930585686,214.38286420824303 331.5401301518438,214.38286420824303 368.5900216919739,214.38286420824303 368.5900216919739,236.24837396963133 429.934924078091,236.24837396963133 454.229934924078,236.24837396963133" fill="none" stroke="purple" stroke-width="1" />
|
|
57
57
|
</g>
|
|
58
58
|
<g>
|
|
59
|
-
<polyline data-points="1.1,0
|
|
59
|
+
<polyline data-points="1.1,0 1.2,0 1.2,-0.8972276749999998 0.34999999999999964,-0.8972276749999998 0.34999999999999964,-1.7944553499999996 0.5499999999999996,-1.7944553499999996" data-type="line" data-label="" points="307.24511930585686,238.67787505423001 319.3926247288503,238.67787505423001 319.3926247288503,347.6686555314534 216.1388286334056,347.6686555314534 216.1388286334056,456.65943600867683 240.4338394793926,456.65943600867683" fill="none" stroke="purple" stroke-width="1" />
|
|
60
60
|
</g>
|
|
61
61
|
<g>
|
|
62
|
-
<polyline data-points="1.1
|
|
62
|
+
<polyline data-points="1.1,-0.2 1.805,-0.2 1.805,0.5399999999999998 3.5100000000000002,0.5399999999999998 3.5100000000000002,0.01999999999999985 3.41,0.01999999999999985" data-type="line" data-label="" points="307.24511930585686,262.972885900217 392.8850325379609,262.972885900217 392.8850325379609,173.08134577006518 600,173.08134577006518 600,236.24837396963133 587.8524945770065,236.24837396963133" fill="none" stroke="purple" stroke-width="1" />
|
|
63
63
|
</g>
|
|
64
64
|
<g>
|
|
65
|
-
<polyline data-points="1.6499999999999997,-1.7944553499999996 1.
|
|
65
|
+
<polyline data-points="1.6499999999999997,-1.7944553499999996 1.7049999999999998,-1.7944553499999996 1.7049999999999998,-1 1.4000000000000001,-1 1.4000000000000001,-0.2 1.1,-0.2" data-type="line" data-label="" points="374.05639913232096,456.65943600867683 380.7375271149674,456.65943600867683 380.7375271149674,360.15292928416494 343.6876355748373,360.15292928416494 343.6876355748373,262.972885900217 307.24511930585686,262.972885900217" fill="none" stroke="purple" stroke-width="1" />
|
|
66
66
|
</g>
|
|
67
67
|
<g>
|
|
68
|
-
<rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="40.
|
|
68
|
+
<rect data-type="rect" data-label="schematic_component_0" data-x="0" data-y="0" x="40.00000000000003" y="190.08785336225606" width="267.24511930585686" height="97.18004338394792" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008232142857142858" />
|
|
69
69
|
</g>
|
|
70
70
|
<g>
|
|
71
|
-
<rect data-type="rect" data-label="schematic_component_1" data-x="1.0999999999999996" data-y="-1.7944553499999996" x="
|
|
71
|
+
<rect data-type="rect" data-label="schematic_component_1" data-x="1.0999999999999996" data-y="-1.7944553499999996" x="240.4338394793926" y="433.0379618221259" width="133.62255965292837" height="47.2429483731018" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008232142857142858" />
|
|
72
72
|
</g>
|
|
73
73
|
<g>
|
|
74
|
-
<rect data-type="rect" data-label="schematic_component_2" data-x="2.86" data-y="0.01999999999999985" x="
|
|
74
|
+
<rect data-type="rect" data-label="schematic_component_2" data-x="2.86" data-y="0.01999999999999985" x="454.229934924078" y="185.2288511930587" width="133.6225596529285" height="102.03904555314529" fill="hsl(24, 100%, 50%, 0.8)" stroke="black" stroke-width="0.008232142857142858" />
|
|
75
75
|
</g>
|
|
76
76
|
<g>
|
|
77
|
-
<rect data-type="rect" data-label="" data-x="1.3" data-y="0.42500000000000004" x="
|
|
77
|
+
<rect data-type="rect" data-label="" data-x="1.3" data-y="0.42500000000000004" x="319.3926247288503" y="159.71908980477232" width="24.295010845987008" height="54.66377440347071" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008232142857142858" />
|
|
78
78
|
</g>
|
|
79
79
|
<g>
|
|
80
|
-
<rect data-type="rect" data-label="" data-x="1.
|
|
80
|
+
<rect data-type="rect" data-label="" data-x="1.2" data-y="-1.1222276749999998" x="307.2451193058568" y="347.6686555314534" width="24.295010845987008" height="54.66377440347071" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008232142857142858" />
|
|
81
81
|
</g>
|
|
82
82
|
<g>
|
|
83
|
-
<rect data-type="rect" data-label="" data-x="1.
|
|
84
|
-
</g>
|
|
85
|
-
<g>
|
|
86
|
-
<rect data-type="rect" data-label="" data-x="3.636" data-y="0.01999999999999985" x="549.2037895585568" y="216.4629111066318" width="50.796210441443236" height="22.57609352953034" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008858928571428573" />
|
|
83
|
+
<rect data-type="rect" data-label="" data-x="1.5525" data-y="-1.225" x="350.0650759219089" y="360.15292928416494" width="24.295010845987008" height="54.66377440347071" fill="hsl(40, 100%, 50%, 0.35)" stroke="black" stroke-width="0.008232142857142858" />
|
|
87
84
|
</g>
|
|
88
85
|
<g id="crosshair" style="display: none">
|
|
89
86
|
<line id="crosshair-h" y1="0" y2="640" stroke="#666" stroke-width="0.5" />
|
|
@@ -113,12 +110,12 @@ x+" data-x="3.41" data-y="0.01999999999999985" cx="549.090909090909" cy="227.750
|
|
|
113
110
|
|
|
114
111
|
// Calculate real coordinates using inverse transformation
|
|
115
112
|
const matrix = {
|
|
116
|
-
"a":
|
|
113
|
+
"a": 121.47505422993491,
|
|
117
114
|
"c": 0,
|
|
118
|
-
"e":
|
|
115
|
+
"e": 173.62255965292843,
|
|
119
116
|
"b": 0,
|
|
120
|
-
"d": -
|
|
121
|
-
"f":
|
|
117
|
+
"d": -121.47505422993491,
|
|
118
|
+
"f": 238.67787505423001
|
|
122
119
|
};
|
|
123
120
|
// Manually invert and apply the affine transform
|
|
124
121
|
// Since we only use translate and scale, we can directly compute:
|