cubing 0.29.0 → 0.29.2
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/README.md +1 -6
- package/dist/esm/alg/index.js +1 -1
- package/dist/esm/bluetooth/index.js +36 -31
- package/dist/esm/bluetooth/index.js.map +2 -2
- package/dist/esm/{chunk-NI7U4XAZ.js → chunk-7OIUETFU.js} +9 -8
- package/dist/esm/chunk-7OIUETFU.js.map +7 -0
- package/dist/esm/{chunk-DZGFGBKT.js → chunk-EOEJDDXN.js} +95 -58
- package/dist/esm/chunk-EOEJDDXN.js.map +7 -0
- package/dist/esm/{chunk-WXCNEGW3.js → chunk-HR5D6SD4.js} +2 -2
- package/dist/esm/{chunk-WXCNEGW3.js.map → chunk-HR5D6SD4.js.map} +2 -2
- package/dist/esm/{chunk-LV7IKG36.js → chunk-J5KJ2WWA.js} +35 -34
- package/dist/esm/chunk-J5KJ2WWA.js.map +7 -0
- package/dist/esm/{chunk-ZNAYJGVL.js → chunk-NUMCMGLU.js} +2 -2
- package/dist/esm/{chunk-ZNAYJGVL.js.map → chunk-NUMCMGLU.js.map} +0 -0
- package/dist/esm/{chunk-LSCTPPWV.js → chunk-OT7AIIFN.js} +4 -4
- package/dist/esm/chunk-OT7AIIFN.js.map +7 -0
- package/dist/esm/{chunk-XU5ILFX5.js → chunk-POCUG6QW.js} +6 -4
- package/dist/esm/{chunk-XU5ILFX5.js.map → chunk-POCUG6QW.js.map} +2 -2
- package/dist/esm/{chunk-OX6O2ZO5.js → chunk-QHWK5RXN.js} +1 -1
- package/dist/esm/chunk-QHWK5RXN.js.map +7 -0
- package/dist/esm/{chunk-GW4FGG42.js → chunk-RH4WZIGC.js} +2 -2
- package/dist/esm/{chunk-GW4FGG42.js.map → chunk-RH4WZIGC.js.map} +0 -0
- package/dist/esm/{chunk-TGPS3CXW.js → chunk-RIXFKOD6.js} +7 -7
- package/dist/esm/{chunk-TGPS3CXW.js.map → chunk-RIXFKOD6.js.map} +2 -2
- package/dist/esm/{chunk-2IZUSAXQ.js → chunk-WEYPAZEE.js} +1 -1
- package/dist/esm/{chunk-2IZUSAXQ.js.map → chunk-WEYPAZEE.js.map} +1 -1
- package/dist/esm/{chunk-Q4W5ZR4U.js → chunk-WNZXZ4MW.js} +10 -8
- package/dist/esm/{chunk-Q4W5ZR4U.js.map → chunk-WNZXZ4MW.js.map} +2 -2
- package/dist/esm/{chunk-PYWGREIP.js → chunk-YD2TMJI2.js} +33 -31
- package/dist/esm/chunk-YD2TMJI2.js.map +7 -0
- package/dist/esm/kpuzzle/index.js +2 -2
- package/dist/esm/notation/index.js +2 -2
- package/dist/esm/protocol/index.js +4 -4
- package/dist/esm/puzzle-geometry/index.js +114 -88
- package/dist/esm/puzzle-geometry/index.js.map +2 -2
- package/dist/esm/puzzles/index.js +10 -6
- package/dist/esm/{puzzles-dynamic-side-events-5C7LMBWX.js → puzzles-dynamic-side-events-3K26JTOG.js} +2 -2
- package/dist/esm/{puzzles-dynamic-side-events-5C7LMBWX.js.map → puzzles-dynamic-side-events-3K26JTOG.js.map} +1 -1
- package/dist/esm/scramble/index.js +3 -3
- package/dist/esm/search/index.js +8 -8
- package/dist/esm/{search-dynamic-sgs-side-events-AYX7MZO7.js → search-dynamic-sgs-side-events-AE3TLLPA.js} +6 -6
- package/dist/esm/search-dynamic-sgs-side-events-AE3TLLPA.js.map +7 -0
- package/dist/esm/{search-dynamic-sgs-unofficial-DLJOJFJL.js → search-dynamic-sgs-unofficial-JUXMNMNO.js} +122 -67
- package/dist/esm/search-dynamic-sgs-unofficial-JUXMNMNO.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-3x3x3-7XZTYQMO.js → search-dynamic-solve-3x3x3-SA75BI5I.js} +649 -405
- package/dist/esm/search-dynamic-solve-3x3x3-SA75BI5I.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-4x4x4-CWWTFKMR.js → search-dynamic-solve-4x4x4-ALKH43DT.js} +399 -150
- package/dist/esm/search-dynamic-solve-4x4x4-ALKH43DT.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-fto-4LI23P6K.js → search-dynamic-solve-fto-5B5ZESQC.js} +74 -34
- package/dist/esm/search-dynamic-solve-fto-5B5ZESQC.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-kilominx-3HEVQ4MC.js → search-dynamic-solve-kilominx-OY4VIARG.js} +136 -71
- package/dist/esm/search-dynamic-solve-kilominx-OY4VIARG.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-master_tetraminx-UB32C7MM.js → search-dynamic-solve-master_tetraminx-GE2BTRGI.js} +84 -41
- package/dist/esm/search-dynamic-solve-master_tetraminx-GE2BTRGI.js.map +7 -0
- package/dist/esm/{search-dynamic-solve-sq1-HA72TYF2.js → search-dynamic-solve-sq1-W6PSSLR6.js} +129 -54
- package/dist/esm/search-dynamic-solve-sq1-W6PSSLR6.js.map +7 -0
- package/dist/esm/{search-worker-inside-generated-string-AMEXYCKK.js → search-worker-inside-generated-string-7HYFSSPW.js} +28 -28
- package/dist/esm/search-worker-inside-generated-string-7HYFSSPW.js.map +7 -0
- package/dist/esm/{search-worker-js-entry-TP2T3NUL.js → search-worker-js-entry-SNUA3SOE.js} +44 -35
- package/dist/esm/search-worker-js-entry-SNUA3SOE.js.map +7 -0
- package/dist/esm/{search-worker-ts-entry-NEH77S4I.js → search-worker-ts-entry-LNB7KNFY.js} +3 -3
- package/dist/esm/{search-worker-ts-entry-NEH77S4I.js.map → search-worker-ts-entry-LNB7KNFY.js.map} +0 -0
- package/dist/esm/stream/index.js +1 -1
- package/dist/esm/stream/index.js.map +2 -2
- package/dist/esm/twisty/index.js +287 -273
- package/dist/esm/twisty/index.js.map +2 -2
- package/dist/esm/{twisty-dynamic-3d-D3ZDBJUH.js → twisty-dynamic-3d-PU74EKRA.js} +57 -59
- package/dist/esm/twisty-dynamic-3d-PU74EKRA.js.map +7 -0
- package/dist/types/{TwizzleLink-bef52ecd.d.ts → TwizzleLink-ce20e840.d.ts} +1 -1
- package/dist/types/puzzles/index.d.ts +5 -3
- package/dist/types/twisty/index.d.ts +2 -2
- package/package.json +51 -147
- package/dist/esm/chunk-DZGFGBKT.js.map +0 -7
- package/dist/esm/chunk-LSCTPPWV.js.map +0 -7
- package/dist/esm/chunk-LV7IKG36.js.map +0 -7
- package/dist/esm/chunk-NI7U4XAZ.js.map +0 -7
- package/dist/esm/chunk-OX6O2ZO5.js.map +0 -7
- package/dist/esm/chunk-PYWGREIP.js.map +0 -7
- package/dist/esm/search-dynamic-sgs-side-events-AYX7MZO7.js.map +0 -7
- package/dist/esm/search-dynamic-sgs-unofficial-DLJOJFJL.js.map +0 -7
- package/dist/esm/search-dynamic-solve-3x3x3-7XZTYQMO.js.map +0 -7
- package/dist/esm/search-dynamic-solve-4x4x4-CWWTFKMR.js.map +0 -7
- package/dist/esm/search-dynamic-solve-fto-4LI23P6K.js.map +0 -7
- package/dist/esm/search-dynamic-solve-kilominx-3HEVQ4MC.js.map +0 -7
- package/dist/esm/search-dynamic-solve-master_tetraminx-UB32C7MM.js.map +0 -7
- package/dist/esm/search-dynamic-solve-sq1-HA72TYF2.js.map +0 -7
- package/dist/esm/search-worker-inside-generated-string-AMEXYCKK.js.map +0 -7
- package/dist/esm/search-worker-js-entry-TP2T3NUL.js.map +0 -7
- package/dist/esm/twisty-dynamic-3d-D3ZDBJUH.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Move,
|
|
3
3
|
QuantumMove
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-7OIUETFU.js";
|
|
5
5
|
import "../chunk-SBZRVSPK.js";
|
|
6
6
|
|
|
7
7
|
// src/cubing/puzzle-geometry/FaceNameSwizzler.ts
|
|
@@ -41,7 +41,7 @@ var FaceNameSwizzler = class {
|
|
|
41
41
|
r.push(currentMatch);
|
|
42
42
|
at += this.facenames[currentMatch].length;
|
|
43
43
|
} else {
|
|
44
|
-
throw new Error(
|
|
44
|
+
throw new Error(`Could not split ${s} into face names.`);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
return r;
|
|
@@ -267,7 +267,7 @@ var NxNxNCubeMapper = class {
|
|
|
267
267
|
}
|
|
268
268
|
notationToInternal(move) {
|
|
269
269
|
const grip = move.family;
|
|
270
|
-
if (!move.innerLayer
|
|
270
|
+
if (!(move.innerLayer || move.outerLayer)) {
|
|
271
271
|
if (grip === "x") {
|
|
272
272
|
move = new Move("Rv", move.amount);
|
|
273
273
|
} else if (grip === "y") {
|
|
@@ -316,7 +316,7 @@ var NxNxNCubeMapper = class {
|
|
|
316
316
|
}
|
|
317
317
|
notationToExternal(move) {
|
|
318
318
|
const grip = move.family;
|
|
319
|
-
if (!move.innerLayer
|
|
319
|
+
if (!(move.innerLayer || move.outerLayer)) {
|
|
320
320
|
if (grip === "Rv") {
|
|
321
321
|
return new Move("x", move.amount);
|
|
322
322
|
} else if (grip === "Uv") {
|
|
@@ -575,7 +575,7 @@ function parseOptions(argv) {
|
|
|
575
575
|
options.puzzleOrientation = JSON.parse(argv[argp]);
|
|
576
576
|
argp++;
|
|
577
577
|
} else {
|
|
578
|
-
throw new Error(
|
|
578
|
+
throw new Error(`Bad option: ${option}`);
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
581
|
const puzzleDescription = parsePuzzleDescription(argv.slice(argp).join(" "));
|
|
@@ -633,7 +633,7 @@ function identity(n) {
|
|
|
633
633
|
return new Perm(iota(n));
|
|
634
634
|
}
|
|
635
635
|
function factorial(a) {
|
|
636
|
-
let r =
|
|
636
|
+
let r = BigInt(1);
|
|
637
637
|
while (a > 1) {
|
|
638
638
|
r *= BigInt(a);
|
|
639
639
|
a--;
|
|
@@ -662,7 +662,7 @@ var Perm = class {
|
|
|
662
662
|
this.p = a;
|
|
663
663
|
}
|
|
664
664
|
toString() {
|
|
665
|
-
return
|
|
665
|
+
return `Perm[${this.p.join(" ")}]`;
|
|
666
666
|
}
|
|
667
667
|
mul(p2) {
|
|
668
668
|
const c = Array(this.n);
|
|
@@ -705,7 +705,7 @@ var Perm = class {
|
|
|
705
705
|
incyc.push(1 + j);
|
|
706
706
|
seen[j] = true;
|
|
707
707
|
}
|
|
708
|
-
cyc.push(
|
|
708
|
+
cyc.push(`(${incyc.join(",")})`);
|
|
709
709
|
}
|
|
710
710
|
return cyc.join("");
|
|
711
711
|
}
|
|
@@ -789,18 +789,18 @@ var PGOrbitsDef = class {
|
|
|
789
789
|
}
|
|
790
790
|
const pd = this.moveops[i].orbits[s];
|
|
791
791
|
for (let j = 0; j < n; j++) {
|
|
792
|
-
if (pd.perm[j]
|
|
792
|
+
if (pd.perm[j] !== j || pd.ori[j] !== 0) {
|
|
793
793
|
m[j].push(mvname);
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
796
|
}
|
|
797
797
|
for (let j = 0; j < n; j++) {
|
|
798
|
-
r.push(
|
|
798
|
+
r.push(`# ${j + 1} ${m[j].join(" ")}`);
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
801
|
toKsolve(name, mapper = new NullMapper()) {
|
|
802
802
|
const result = [];
|
|
803
|
-
result.push(
|
|
803
|
+
result.push(`Name ${name}`);
|
|
804
804
|
result.push("");
|
|
805
805
|
for (let i = 0; i < this.orbitnames.length; i++) {
|
|
806
806
|
result.push(
|
|
@@ -830,10 +830,14 @@ var PGOrbitsDef = class {
|
|
|
830
830
|
doinv = true;
|
|
831
831
|
name2 = name2.substring(0, name2.length - 1);
|
|
832
832
|
}
|
|
833
|
-
result.push(
|
|
833
|
+
result.push(`Move ${name2}`);
|
|
834
834
|
for (let j = 0; j < this.orbitnames.length; j++) {
|
|
835
835
|
if (doinv) {
|
|
836
|
-
this.moveops[i].orbits[j].inv().appendDefinition(
|
|
836
|
+
this.moveops[i].orbits[j].inv().appendDefinition(
|
|
837
|
+
result,
|
|
838
|
+
this.orbitnames[j],
|
|
839
|
+
true
|
|
840
|
+
);
|
|
837
841
|
} else {
|
|
838
842
|
this.moveops[i].orbits[j].appendDefinition(
|
|
839
843
|
result,
|
|
@@ -1030,7 +1034,7 @@ var PGOrbitsDef = class {
|
|
|
1030
1034
|
return s;
|
|
1031
1035
|
}
|
|
1032
1036
|
reassemblySize() {
|
|
1033
|
-
let n =
|
|
1037
|
+
let n = BigInt(1);
|
|
1034
1038
|
for (let i = 0; i < this.orbitdefs.length; i++) {
|
|
1035
1039
|
n *= this.orbitdefs[i].reassemblySize();
|
|
1036
1040
|
}
|
|
@@ -1422,47 +1426,47 @@ var PGPuzzles = {
|
|
|
1422
1426
|
"20x20x20": "c f 0 f .1 f .2 f .3 f .4 f .5 f .6 f .7 f .8 f .9",
|
|
1423
1427
|
"30x30x30": "c f 0 f .066667 f .133333 f .2 f .266667 f .333333 f .4 f .466667 f .533333 f .6 f .666667 f .733333 f .8 f .866667 f .933333",
|
|
1424
1428
|
"40x40x40": "c f 0 f .05 f .1 f .15 f .2 f .25 f .3 f .35 f .4 f .45 f .5 f .55 f .6 f .65 f .7 f .75 f .8 f .85 f .9 f .95",
|
|
1425
|
-
|
|
1429
|
+
skewb: "c v 0",
|
|
1426
1430
|
"master skewb": "c v 0.275",
|
|
1427
1431
|
"professor skewb": "c v 0 v 0.38",
|
|
1428
1432
|
"compy cube": "c v 0.915641442663986",
|
|
1429
|
-
|
|
1433
|
+
helicopter: "c e 0.707106781186547",
|
|
1430
1434
|
"curvy copter": "c e 0.83",
|
|
1431
|
-
|
|
1435
|
+
dino: "c v 0.577350269189626",
|
|
1432
1436
|
"little chop": "c e 0",
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
+
pyramorphix: "t e 0",
|
|
1438
|
+
mastermorphix: "t e 0.346184634065199",
|
|
1439
|
+
pyraminx: "t v 0.333333333333333 v 1.66666666666667",
|
|
1440
|
+
tetraminx: "t v 0.333333333333333",
|
|
1437
1441
|
"master pyraminx": "t v 0 v 1 v 2",
|
|
1438
1442
|
"master tetraminx": "t v 0 v 1",
|
|
1439
1443
|
"professor pyraminx": "t v -0.2 v 0.6 v 1.4 v 2.2",
|
|
1440
1444
|
"professor tetraminx": "t v -0.2 v 0.6 v 1.4",
|
|
1441
1445
|
"Jing pyraminx": "t f 0",
|
|
1442
1446
|
"master pyramorphix": "t e 0.866025403784437",
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1447
|
+
megaminx: "d f 0.7",
|
|
1448
|
+
gigaminx: "d f 0.64 f 0.82",
|
|
1449
|
+
teraminx: "d f 0.64 f 0.76 f 0.88",
|
|
1450
|
+
petaminx: "d f 0.64 f 0.73 f 0.82 f 0.91",
|
|
1451
|
+
examinx: "d f 0.64 f 0.712 f 0.784 f 0.856 f 0.928",
|
|
1452
|
+
zetaminx: "d f 0.64 f 0.7 f 0.76 f 0.82 f 0.88 f 0.94",
|
|
1453
|
+
yottaminx: "d f 0.64 f 0.6914 f 0.7429 f 0.7943 f 0.8457 f 0.8971 f 0.9486",
|
|
1454
|
+
pentultimate: "d f 0",
|
|
1451
1455
|
"master pentultimate": "d f 0.1",
|
|
1452
1456
|
"elite pentultimate": "d f 0 f 0.145905",
|
|
1453
|
-
|
|
1457
|
+
starminx: "d v 0.937962370425399",
|
|
1454
1458
|
"starminx 2": "d f 0.23606797749979",
|
|
1455
1459
|
"pyraminx crystal": "d f 0.447213595499989",
|
|
1456
|
-
|
|
1460
|
+
chopasaurus: "d v 0",
|
|
1457
1461
|
"big chop": "d e 0",
|
|
1458
1462
|
"skewb diamond": "o f 0",
|
|
1459
|
-
|
|
1463
|
+
FTO: "o f 0.333333333333333",
|
|
1460
1464
|
"master FTO": "o f 0.5 f 0",
|
|
1461
1465
|
"Christopher's jewel": "o v 0.577350269189626",
|
|
1462
|
-
|
|
1466
|
+
octastar: "o e 0",
|
|
1463
1467
|
"Trajber's octahedron": "o v 0.433012701892219",
|
|
1464
1468
|
"radio chop": "i f 0",
|
|
1465
|
-
|
|
1469
|
+
icosamate: "i v 0",
|
|
1466
1470
|
"icosahedron 2": "i v 0.18759247376021",
|
|
1467
1471
|
"icosahedron 3": "i v 0.18759247376021 e 0",
|
|
1468
1472
|
"icosahedron static faces": "i v 0.84",
|
|
@@ -1916,10 +1920,10 @@ function schreierSims(g, disp) {
|
|
|
1916
1920
|
sgslen[i][i] = 0;
|
|
1917
1921
|
}
|
|
1918
1922
|
let none = 0;
|
|
1919
|
-
let sz =
|
|
1923
|
+
let sz = BigInt(1);
|
|
1920
1924
|
for (let i = 0; i < g.length; i++) {
|
|
1921
1925
|
knutha(n - 1, g[i], 1);
|
|
1922
|
-
sz =
|
|
1926
|
+
sz = BigInt(1);
|
|
1923
1927
|
let tks = 0;
|
|
1924
1928
|
let sollen = 0;
|
|
1925
1929
|
const avgs = [];
|
|
@@ -2399,7 +2403,7 @@ function getmovename(geo, bits, slices) {
|
|
|
2399
2403
|
let movenameFamily = geo[0];
|
|
2400
2404
|
let movenamePrefix = "";
|
|
2401
2405
|
if (bits[0] === 0 && bits[1] === slices) {
|
|
2402
|
-
movenameFamily = movenameFamily
|
|
2406
|
+
movenameFamily = `${movenameFamily}v`;
|
|
2403
2407
|
} else if (bits[0] === bits[1]) {
|
|
2404
2408
|
if (bits[1] > 0) {
|
|
2405
2409
|
movenamePrefix = String(bits[1] + 1);
|
|
@@ -2433,7 +2437,7 @@ function splitByFaceNames(s, facenames) {
|
|
|
2433
2437
|
r.push(currentMatch);
|
|
2434
2438
|
at += currentMatch.length;
|
|
2435
2439
|
} else {
|
|
2436
|
-
throw new Error(
|
|
2440
|
+
throw new Error(`Could not split ${s} into face names.`);
|
|
2437
2441
|
}
|
|
2438
2442
|
}
|
|
2439
2443
|
return r;
|
|
@@ -2480,27 +2484,32 @@ var PuzzleGeometry = class {
|
|
|
2480
2484
|
this.cubies = [];
|
|
2481
2485
|
let g = null;
|
|
2482
2486
|
switch (shape) {
|
|
2483
|
-
case "c":
|
|
2487
|
+
case "c": {
|
|
2484
2488
|
g = cube();
|
|
2485
2489
|
break;
|
|
2486
|
-
|
|
2490
|
+
}
|
|
2491
|
+
case "o": {
|
|
2487
2492
|
g = octahedron();
|
|
2488
2493
|
break;
|
|
2489
|
-
|
|
2494
|
+
}
|
|
2495
|
+
case "i": {
|
|
2490
2496
|
g = icosahedron();
|
|
2491
2497
|
break;
|
|
2492
|
-
|
|
2498
|
+
}
|
|
2499
|
+
case "t": {
|
|
2493
2500
|
g = tetrahedron();
|
|
2494
2501
|
break;
|
|
2495
|
-
|
|
2502
|
+
}
|
|
2503
|
+
case "d": {
|
|
2496
2504
|
g = dodecahedron();
|
|
2497
2505
|
break;
|
|
2506
|
+
}
|
|
2498
2507
|
default:
|
|
2499
|
-
throw new Error(
|
|
2508
|
+
throw new Error(`Bad shape argument: ${shape}`);
|
|
2500
2509
|
}
|
|
2501
2510
|
this.rotations = closure(g);
|
|
2502
2511
|
if (this.options.verbosity) {
|
|
2503
|
-
console.log(
|
|
2512
|
+
console.log(`# Rotations: ${this.rotations.length}`);
|
|
2504
2513
|
}
|
|
2505
2514
|
const baseplane = g[0];
|
|
2506
2515
|
this.baseplanerot = uniqueplanes(baseplane, this.rotations);
|
|
@@ -2511,19 +2520,19 @@ var PuzzleGeometry = class {
|
|
|
2511
2520
|
this.net = net;
|
|
2512
2521
|
this.colors = defaultcolors()[baseplanes.length];
|
|
2513
2522
|
if (this.options.verbosity > 0) {
|
|
2514
|
-
console.log(
|
|
2523
|
+
console.log(`# Base planes: ${baseplanes.length}`);
|
|
2515
2524
|
}
|
|
2516
2525
|
const baseface = getface(baseplanes);
|
|
2517
2526
|
const zero = new Quat(0, 0, 0, 0);
|
|
2518
2527
|
if (this.options.verbosity > 0) {
|
|
2519
|
-
console.log(
|
|
2528
|
+
console.log(`# Face vertices: ${baseface.length}`);
|
|
2520
2529
|
}
|
|
2521
2530
|
const facenormal = baseplanes[0].makenormal();
|
|
2522
2531
|
const edgenormal = baseface[0].sum(baseface[1]).makenormal();
|
|
2523
2532
|
const vertexnormal = baseface[0].makenormal();
|
|
2524
2533
|
const boundary = new Quat(1, facenormal.b, facenormal.c, facenormal.d);
|
|
2525
2534
|
if (this.options.verbosity > 0) {
|
|
2526
|
-
console.log(
|
|
2535
|
+
console.log(`# Boundary is ${boundary}`);
|
|
2527
2536
|
}
|
|
2528
2537
|
const planerot = uniqueplanes(boundary, this.rotations);
|
|
2529
2538
|
const planes = planerot.map((_) => boundary.rotateplane(_));
|
|
@@ -2539,23 +2548,26 @@ var PuzzleGeometry = class {
|
|
|
2539
2548
|
let normal = null;
|
|
2540
2549
|
let distance = 0;
|
|
2541
2550
|
switch (cut.cutType) {
|
|
2542
|
-
case "f":
|
|
2551
|
+
case "f": {
|
|
2543
2552
|
normal = facenormal;
|
|
2544
2553
|
distance = 1;
|
|
2545
2554
|
sawface = true;
|
|
2546
2555
|
break;
|
|
2547
|
-
|
|
2556
|
+
}
|
|
2557
|
+
case "v": {
|
|
2548
2558
|
normal = vertexnormal;
|
|
2549
2559
|
distance = this.vertexdistance;
|
|
2550
2560
|
sawvertex = true;
|
|
2551
2561
|
break;
|
|
2552
|
-
|
|
2562
|
+
}
|
|
2563
|
+
case "e": {
|
|
2553
2564
|
normal = edgenormal;
|
|
2554
2565
|
distance = this.edgedistance;
|
|
2555
2566
|
sawedge = true;
|
|
2556
2567
|
break;
|
|
2568
|
+
}
|
|
2557
2569
|
default:
|
|
2558
|
-
throw new Error(
|
|
2570
|
+
throw new Error(`Bad cut argument: ${cut.cutType}`);
|
|
2559
2571
|
}
|
|
2560
2572
|
cutplanes.push(normal.makecut(cut.distance));
|
|
2561
2573
|
intersects.push(cut.distance < distance);
|
|
@@ -2711,14 +2723,14 @@ var PuzzleGeometry = class {
|
|
|
2711
2723
|
}
|
|
2712
2724
|
for (let i = 0; i < edgenames.length; i++) {
|
|
2713
2725
|
if (edgenames[i].length !== 3) {
|
|
2714
|
-
throw new Error(
|
|
2726
|
+
throw new Error(`Bad length in edge names ${edgenames[i]}`);
|
|
2715
2727
|
}
|
|
2716
2728
|
const f1 = edgenames[i][1];
|
|
2717
2729
|
const f2 = edgenames[i][2];
|
|
2718
2730
|
let c1 = faceindextoname[f1];
|
|
2719
2731
|
const c2 = faceindextoname[f2];
|
|
2720
2732
|
const bits = 1 << f1 | 1 << f2;
|
|
2721
|
-
if (markedface[bits]
|
|
2733
|
+
if (markedface[bits] === f1) {
|
|
2722
2734
|
c1 = c1 + sep + c2;
|
|
2723
2735
|
} else {
|
|
2724
2736
|
c1 = c2 + sep + c1;
|
|
@@ -2763,9 +2775,9 @@ var PuzzleGeometry = class {
|
|
|
2763
2775
|
}
|
|
2764
2776
|
this.markedface = markedface;
|
|
2765
2777
|
if (this.options.verbosity > 1) {
|
|
2766
|
-
console.log(
|
|
2767
|
-
console.log(
|
|
2768
|
-
console.log(
|
|
2778
|
+
console.log(`# Face names: ${facenames.map((_) => _[1]).join(" ")}`);
|
|
2779
|
+
console.log(`# Edge names: ${edgenames.map((_) => _[1]).join(" ")}`);
|
|
2780
|
+
console.log(`# Vertex names: ${vertexnames.map((_) => _[1]).join(" ")}`);
|
|
2769
2781
|
}
|
|
2770
2782
|
const geonormals = [];
|
|
2771
2783
|
for (const faceplane of faceplanes) {
|
|
@@ -2786,7 +2798,7 @@ var PuzzleGeometry = class {
|
|
|
2786
2798
|
this.swizzler.setGripNames(geonormalnames);
|
|
2787
2799
|
if (this.options.verbosity > 0) {
|
|
2788
2800
|
console.log(
|
|
2789
|
-
|
|
2801
|
+
`# Distances: face ${1} edge ${this.edgedistance} vertex ${this.vertexdistance}`
|
|
2790
2802
|
);
|
|
2791
2803
|
}
|
|
2792
2804
|
for (let c = 0; c < cutplanes.length; c++) {
|
|
@@ -2819,7 +2831,7 @@ var PuzzleGeometry = class {
|
|
|
2819
2831
|
const faces = ft.collect([], true);
|
|
2820
2832
|
this.faces = faces;
|
|
2821
2833
|
if (this.options.verbosity > 0) {
|
|
2822
|
-
console.log(
|
|
2834
|
+
console.log(`# Faces is now ${faces.length}`);
|
|
2823
2835
|
}
|
|
2824
2836
|
this.stickersperface = faces.length;
|
|
2825
2837
|
const simplerot = [];
|
|
@@ -2869,7 +2881,7 @@ var PuzzleGeometry = class {
|
|
|
2869
2881
|
}
|
|
2870
2882
|
}
|
|
2871
2883
|
if (this.options.verbosity > 0) {
|
|
2872
|
-
console.log(
|
|
2884
|
+
console.log(`# Short edge is ${this.shortedge}`);
|
|
2873
2885
|
}
|
|
2874
2886
|
if (shape === "c" && sawface && !sawedge && !sawvertex) {
|
|
2875
2887
|
this.addNotationMapper = "NxNxNCubeMapper";
|
|
@@ -2886,7 +2898,7 @@ var PuzzleGeometry = class {
|
|
|
2886
2898
|
this.swizzler,
|
|
2887
2899
|
new FaceNameSwizzler(["F", "D", "L", "BL", "R", "U", "BR", "B"])
|
|
2888
2900
|
);
|
|
2889
|
-
if (!sawedge
|
|
2901
|
+
if (!(sawedge || sawvertex)) {
|
|
2890
2902
|
this.addNotationMapper = "FTOMapper";
|
|
2891
2903
|
}
|
|
2892
2904
|
}
|
|
@@ -3005,7 +3017,7 @@ var PuzzleGeometry = class {
|
|
|
3005
3017
|
const t1 = tstart("allstickers");
|
|
3006
3018
|
this.faces = expandfaces(this.baseplanerot, this.faces);
|
|
3007
3019
|
if (this.options.verbosity > 0) {
|
|
3008
|
-
console.log(
|
|
3020
|
+
console.log(`# Total stickers is now ${this.faces.length}`);
|
|
3009
3021
|
}
|
|
3010
3022
|
this.facecentermass = new Array(this.faces.length);
|
|
3011
3023
|
for (let i = 0; i < this.faces.length; i++) {
|
|
@@ -3050,7 +3062,7 @@ var PuzzleGeometry = class {
|
|
|
3050
3062
|
this.moveplanenormals = moveplanenormals;
|
|
3051
3063
|
const sizes = moveplanesets.map((_) => _.length);
|
|
3052
3064
|
if (this.options.verbosity > 0) {
|
|
3053
|
-
console.log(
|
|
3065
|
+
console.log(`# Move plane sets: ${sizes}`);
|
|
3054
3066
|
}
|
|
3055
3067
|
const moverotations = [];
|
|
3056
3068
|
for (let i = 0; i < moveplanesets.length; i++) {
|
|
@@ -3161,7 +3173,7 @@ var PuzzleGeometry = class {
|
|
|
3161
3173
|
console.log("# Splitting core.");
|
|
3162
3174
|
}
|
|
3163
3175
|
for (let suff = 0; suff < arr.length; suff++) {
|
|
3164
|
-
const s2 = s
|
|
3176
|
+
const s2 = `${s} ${suff}`;
|
|
3165
3177
|
facelisthash.set(s2, [arr[suff]]);
|
|
3166
3178
|
}
|
|
3167
3179
|
}
|
|
@@ -3169,7 +3181,7 @@ var PuzzleGeometry = class {
|
|
|
3169
3181
|
}
|
|
3170
3182
|
this.facelisthash = facelisthash;
|
|
3171
3183
|
if (this.options.verbosity > 0) {
|
|
3172
|
-
console.log(
|
|
3184
|
+
console.log(`# Cubies: ${facelisthash.size}`);
|
|
3173
3185
|
}
|
|
3174
3186
|
const cubies = [];
|
|
3175
3187
|
const facetocubie = [];
|
|
@@ -3349,12 +3361,12 @@ var PuzzleGeometry = class {
|
|
|
3349
3361
|
}
|
|
3350
3362
|
if (this.fixedCubie < 0) {
|
|
3351
3363
|
throw new Error(
|
|
3352
|
-
|
|
3364
|
+
`Could not find a cubie of type ${this.options.fixedPieceType} to fix.`
|
|
3353
3365
|
);
|
|
3354
3366
|
}
|
|
3355
3367
|
}
|
|
3356
3368
|
if (this.options.verbosity > 0) {
|
|
3357
|
-
console.log(
|
|
3369
|
+
console.log(`# Cubie orbit sizes ${cubieords}`);
|
|
3358
3370
|
}
|
|
3359
3371
|
tend(t1);
|
|
3360
3372
|
}
|
|
@@ -3369,7 +3381,7 @@ var PuzzleGeometry = class {
|
|
|
3369
3381
|
const re = RegExp("^(([0-9]+)-)?([0-9]+)?([^0-9]+)([0-9]+'?)?$");
|
|
3370
3382
|
const p = mv.match(re);
|
|
3371
3383
|
if (p === null) {
|
|
3372
|
-
throw new Error(
|
|
3384
|
+
throw new Error(`Bad move passed ${mv}`);
|
|
3373
3385
|
}
|
|
3374
3386
|
const grip = p[4];
|
|
3375
3387
|
let loslice = void 0;
|
|
@@ -3388,7 +3400,7 @@ var PuzzleGeometry = class {
|
|
|
3388
3400
|
if (p[5] !== void 0) {
|
|
3389
3401
|
amountstr = p[5];
|
|
3390
3402
|
if (amountstr[0] === "'") {
|
|
3391
|
-
amountstr =
|
|
3403
|
+
amountstr = `-${amountstr.substring(1)}`;
|
|
3392
3404
|
}
|
|
3393
3405
|
amount = parseInt(amountstr, 10);
|
|
3394
3406
|
}
|
|
@@ -3397,7 +3409,7 @@ var PuzzleGeometry = class {
|
|
|
3397
3409
|
parseMove(move) {
|
|
3398
3410
|
const bm = this.notationMapper.notationToInternal(move);
|
|
3399
3411
|
if (bm === null) {
|
|
3400
|
-
throw new Error(
|
|
3412
|
+
throw new Error(`Bad move ${move.family}`);
|
|
3401
3413
|
}
|
|
3402
3414
|
move = bm;
|
|
3403
3415
|
let grip = move.family;
|
|
@@ -3435,7 +3447,7 @@ var PuzzleGeometry = class {
|
|
|
3435
3447
|
hislice = 2;
|
|
3436
3448
|
}
|
|
3437
3449
|
if (geo === void 0) {
|
|
3438
|
-
throw new Error(
|
|
3450
|
+
throw new Error(`Bad grip in move ${move.family}`);
|
|
3439
3451
|
}
|
|
3440
3452
|
if (move.outerLayer !== void 0) {
|
|
3441
3453
|
loslice = move.outerLayer;
|
|
@@ -3460,7 +3472,7 @@ var PuzzleGeometry = class {
|
|
|
3460
3472
|
}
|
|
3461
3473
|
if (loslice < 0 || loslice > this.moveplanesets[msi].length || hislice < 0 || hislice > this.moveplanesets[msi].length) {
|
|
3462
3474
|
throw new Error(
|
|
3463
|
-
|
|
3475
|
+
`Bad slice spec ${loslice} ${hislice} vs ${this.moveplanesets[msi].length}`
|
|
3464
3476
|
);
|
|
3465
3477
|
}
|
|
3466
3478
|
if (!permissivieMoveParsing && loslice === 0 && hislice === this.moveplanesets[msi].length && !fullrotation) {
|
|
@@ -3505,7 +3517,7 @@ var PuzzleGeometry = class {
|
|
|
3505
3517
|
if (Math.abs(normal.dot(this.faces[kk].get(hii2).sub(center)) - hiv) < eps3) {
|
|
3506
3518
|
hii = hii2;
|
|
3507
3519
|
}
|
|
3508
|
-
if (hii
|
|
3520
|
+
if (hii !== 0) {
|
|
3509
3521
|
const qs = [];
|
|
3510
3522
|
for (let ii = 0; ii < this.faces[kk].length; ii++) {
|
|
3511
3523
|
qs.push(this.faces[kk].get((ii + hii) % this.faces[kk].length));
|
|
@@ -3756,7 +3768,7 @@ var PuzzleGeometry = class {
|
|
|
3756
3768
|
const r = [];
|
|
3757
3769
|
const mvs = [];
|
|
3758
3770
|
for (let i = 0; i < os.moveops.length; i++) {
|
|
3759
|
-
let movename =
|
|
3771
|
+
let movename = `M_${externalName(this.notationMapper, os.movenames[i])}`;
|
|
3760
3772
|
let doinv = false;
|
|
3761
3773
|
if (movename[movename.length - 1] === "'") {
|
|
3762
3774
|
movename = movename.substring(0, movename.length - 1);
|
|
@@ -3764,9 +3776,9 @@ var PuzzleGeometry = class {
|
|
|
3764
3776
|
}
|
|
3765
3777
|
mvs.push(movename);
|
|
3766
3778
|
if (doinv) {
|
|
3767
|
-
r.push(movename
|
|
3779
|
+
r.push(`${movename}:=${os.moveops[i].toPerm().inv().toGap()};`);
|
|
3768
3780
|
} else {
|
|
3769
|
-
r.push(movename
|
|
3781
|
+
r.push(`${movename}:=${os.moveops[i].toPerm().toGap()};`);
|
|
3770
3782
|
}
|
|
3771
3783
|
}
|
|
3772
3784
|
r.push("Gen:=[");
|
|
@@ -3774,7 +3786,9 @@ var PuzzleGeometry = class {
|
|
|
3774
3786
|
r.push("];");
|
|
3775
3787
|
const ip = os.solved.identicalPieces();
|
|
3776
3788
|
r.push(
|
|
3777
|
-
|
|
3789
|
+
`ip:=[${ip.map((_) => `[${_.map((__) => __ + 1).join(",")}]`).join(
|
|
3790
|
+
","
|
|
3791
|
+
)}];`
|
|
3778
3792
|
);
|
|
3779
3793
|
r.push("# Size(Group(Gen));");
|
|
3780
3794
|
r.push("# Size(Stabilizer(Group(Gen), ip, OnTuplesSets));");
|
|
@@ -3918,7 +3932,7 @@ var PuzzleGeometry = class {
|
|
|
3918
3932
|
}
|
|
3919
3933
|
hasrotation[k] = sawone;
|
|
3920
3934
|
}
|
|
3921
|
-
if (this.options.
|
|
3935
|
+
if (this.options.addRotations && (this.options.moveList || this.options.fixedPieceType !== null)) {
|
|
3922
3936
|
for (let i = 0; i < this.moverotations.length; i++) {
|
|
3923
3937
|
addrot[i] = 0;
|
|
3924
3938
|
}
|
|
@@ -4169,14 +4183,16 @@ var PuzzleGeometry = class {
|
|
|
4169
4183
|
}
|
|
4170
4184
|
}
|
|
4171
4185
|
if (!feature1) {
|
|
4172
|
-
throw new Error(
|
|
4186
|
+
throw new Error(`Could not find feature ${feature1name}`);
|
|
4173
4187
|
}
|
|
4174
4188
|
if (!feature2) {
|
|
4175
|
-
throw new Error(
|
|
4189
|
+
throw new Error(`Could not find feature ${feature2name}`);
|
|
4176
4190
|
}
|
|
4177
4191
|
const r1 = feature1.pointrotation(direction1);
|
|
4178
4192
|
const feature2rot = feature2.rotatepoint(r1);
|
|
4179
|
-
const r2 = feature2rot.unproject(direction1).pointrotation(
|
|
4193
|
+
const r2 = feature2rot.unproject(direction1).pointrotation(
|
|
4194
|
+
direction2.unproject(direction1)
|
|
4195
|
+
);
|
|
4180
4196
|
return r2.mul(r1);
|
|
4181
4197
|
}
|
|
4182
4198
|
getInitial3DRotation() {
|
|
@@ -4283,7 +4299,7 @@ var PuzzleGeometry = class {
|
|
|
4283
4299
|
}
|
|
4284
4300
|
}
|
|
4285
4301
|
if (gfi < 0) {
|
|
4286
|
-
throw new Error(
|
|
4302
|
+
throw new Error(`Could not find first face name ${f0}`);
|
|
4287
4303
|
}
|
|
4288
4304
|
const thisface = bg.facenames[gfi][0];
|
|
4289
4305
|
for (let j = 1; j < neti.length; j++) {
|
|
@@ -4297,7 +4313,9 @@ var PuzzleGeometry = class {
|
|
|
4297
4313
|
];
|
|
4298
4314
|
extendedges(edges2[f1], polyn);
|
|
4299
4315
|
const caf0 = connectat[gfi];
|
|
4300
|
-
const mp = thisface[(caf0 + j) % polyn].sum(
|
|
4316
|
+
const mp = thisface[(caf0 + j) % polyn].sum(
|
|
4317
|
+
thisface[(caf0 + j + polyn - 1) % polyn]
|
|
4318
|
+
).smul(0.5);
|
|
4301
4319
|
const epi = findelement(bg.edgenames, mp);
|
|
4302
4320
|
const edgename = bg.edgenames[epi][1];
|
|
4303
4321
|
const el = splitByFaceNames(edgename, this.facenames);
|
|
@@ -4363,7 +4381,10 @@ var PuzzleGeometry = class {
|
|
|
4363
4381
|
generatesvg(w = 800, h = 500, trim = 10, threed = false) {
|
|
4364
4382
|
const mappt2d = this.generate2dmapping(w, h, trim, threed);
|
|
4365
4383
|
function drawedges(id, pts, color) {
|
|
4366
|
-
return
|
|
4384
|
+
return `<polygon id="${id}" class="sticker" style="fill: ${color}" points="${pts.map(
|
|
4385
|
+
(p) => `${p[0]} ${p[1]}`
|
|
4386
|
+
).join(" ")}"/>
|
|
4387
|
+
`;
|
|
4367
4388
|
}
|
|
4368
4389
|
const pos = this.getsolved();
|
|
4369
4390
|
const colormap = [];
|
|
@@ -4383,7 +4404,8 @@ var PuzzleGeometry = class {
|
|
|
4383
4404
|
const svg = [];
|
|
4384
4405
|
for (let j = 0; j < this.baseFaceCount; j++) {
|
|
4385
4406
|
svg.push("<g>");
|
|
4386
|
-
svg.push(
|
|
4407
|
+
svg.push(`<title>${this.facenames[j][1]}</title>
|
|
4408
|
+
`);
|
|
4387
4409
|
for (let ii = 0; ii < this.stickersperface; ii++) {
|
|
4388
4410
|
const i = j * this.stickersperface + ii;
|
|
4389
4411
|
const cubie = this.facetocubie[i];
|
|
@@ -4391,18 +4413,22 @@ var PuzzleGeometry = class {
|
|
|
4391
4413
|
const cubiesetnum = this.cubiesetnums[cubie];
|
|
4392
4414
|
const cubieord = this.cubieordnums[cubie];
|
|
4393
4415
|
const color = this.graybyori(cubie) ? "#808080" : colormap[pos.p[i]];
|
|
4394
|
-
let id = this.cubiesetnames[cubiesetnum]
|
|
4416
|
+
let id = `${this.cubiesetnames[cubiesetnum]}-l${cubieord}-o${cubieori}`;
|
|
4395
4417
|
svg.push(drawedges(id, facegeo[i], color));
|
|
4396
4418
|
if (this.duplicatedFaces[i]) {
|
|
4397
4419
|
for (let jj = 1; jj < this.duplicatedFaces[i]; jj++) {
|
|
4398
|
-
id = this.cubiesetnames[cubiesetnum]
|
|
4420
|
+
id = `${this.cubiesetnames[cubiesetnum]}-l${cubieord}-o${jj}`;
|
|
4399
4421
|
svg.push(drawedges(id, facegeo[i], color));
|
|
4400
4422
|
}
|
|
4401
4423
|
}
|
|
4402
4424
|
}
|
|
4403
4425
|
svg.push("</g>");
|
|
4404
4426
|
}
|
|
4405
|
-
const html =
|
|
4427
|
+
const html = `<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 800 500">
|
|
4428
|
+
<style type="text/css"><![CDATA[.sticker { stroke: #000000; stroke-width: 1px; }]]></style>
|
|
4429
|
+
${svg.join(
|
|
4430
|
+
""
|
|
4431
|
+
)}</svg>`;
|
|
4406
4432
|
return html;
|
|
4407
4433
|
}
|
|
4408
4434
|
get3d(options) {
|