From 8d1cf5874e8ba67ec5effdac7e0ba03aae49c43b Mon Sep 17 00:00:00 2001 From: Scott Vorthmann Date: Wed, 1 Nov 2023 09:33:17 -0700 Subject: [PATCH 1/2] Cell selection implemented in 59icosahedra This is a bit of a hack, requiring hand-editing of the .vZome files for the two selector models to add `label` attributes to the `GroupSelection` commands. Still, the hack is limited to the Javascript code, so far. For the stellation model, I now have named bookmarks for all the stellation faces, and the first four stellation cells. I have implemented a very rough "macro capture" to use in Online classic, and a means to trigger a macro from the client. The side-effect of clicking on one of the selector cells is still just a log statement, until I work out how to communicate the macros to the stellation worker. For the moment, a background click in the stellation scene will trigger a macro to produce colored "c" cells. --- .../models/icosahedron-stellation-faces.vZome | 3431 +++++++++++++++++ online/public/models/pieces-aceg.vZome | 12 +- online/public/models/pieces-bdfh.vZome | 12 +- online/src/app/59icosahedra/index.jsx | 9 +- online/src/app/59icosahedra/macros.js | 213 + online/src/app/59icosahedra/selector.jsx | 37 +- online/src/viewer/solid/geometry.jsx | 2 +- .../src/worker/legacy/controllers/wrapper.js | 13 +- online/src/worker/legacy/core.js | 28 +- online/src/worker/legacy/scenes.js | 3 +- online/src/worker/vzome-worker-static.js | 16 + online/src/workerClient/actions.js | 2 + online/src/workerClient/controllers-solid.js | 2 + 13 files changed, 3758 insertions(+), 22 deletions(-) create mode 100644 online/public/models/icosahedron-stellation-faces.vZome create mode 100644 online/src/app/59icosahedra/macros.js diff --git a/online/public/models/icosahedron-stellation-faces.vZome b/online/public/models/icosahedron-stellation-faces.vZome new file mode 100644 index 000000000..68c16b89d --- /dev/null +++ b/online/public/models/icosahedron-stellation-faces.vZome @@ -0,0 +1,3431 @@ + + + + + + + + + { + "field": "golden", + "vertices": [ + [ + [ + 0, + 0, + 1 + ], + [ + 0, + 0, + 1 + ], + [ + 0, + 0, + 1 + ] + ], + [ + [ + -2, + -3, + 1 + ], + [ + 3, + 5, + 1 + ], + [ + 5, + 8, + 1 + ] + ], + [ + [ + -5, + -8, + 1 + ], + [ + 2, + 3, + 1 + ], + [ + 3, + 5, + 1 + ] + ], + [ + [ + -5, + -8, + 1 + ], + [ + -2, + -3, + 1 + ], + [ + 3, + 5, + 1 + ] + ], + [ + [ + -2, + -3, + 1 + ], + [ + -3, + -5, + 1 + ], + [ + 5, + 8, + 1 + ] + ], + [ + [ + 0, + 0, + 1 + ], + [ + 0, + 0, + 1 + ], + [ + 6, + 10, + 1 + ] + ], + [ + [ + -5, + -8, + 1 + ], + [ + 0, + 0, + 1 + ], + [ + -8, + -13, + 1 + ] + ], + [ + [ + 5, + 8, + 1 + ], + [ + 0, + 0, + 1 + ], + [ + -8, + -13, + 1 + ] + ], + [ + [ + 0, + 0, + 1 + ], + [ + 8, + 13, + 1 + ], + [ + -5, + -8, + 1 + ] + ], + [ + [ + 29, + 47, + 5 + ], + [ + 29, + 47, + 5 + ], + [ + -29, + -47, + 5 + ] + ], + [ + [ + -29, + -47, + 5 + ], + [ + 29, + 47, + 5 + ], + [ + -29, + -47, + 5 + ] + ], + [ + [ + 0, + 0, + 1 + ], + [ + -18, + -29, + 5 + ], + [ + -47, + -76, + 5 + ] + ], + [ + [ + -21, + -34, + 2 + ], + [ + 8, + 13, + 2 + ], + [ + -13, + -21, + 2 + ] + ], + [ + [ + -13, + -21, + 2 + ], + [ + 21, + 34, + 2 + ], + [ + -8, + -13, + 2 + ] + ], + [ + [ + 8, + 13, + 2 + ], + [ + -13, + -21, + 2 + ], + [ + -21, + -34, + 2 + ] + ], + [ + [ + -8, + -13, + 2 + ], + [ + -13, + -21, + 2 + ], + [ + -21, + -34, + 2 + ] + ], + [ + [ + 21, + 34, + 2 + ], + [ + 8, + 13, + 2 + ], + [ + -13, + -21, + 2 + ] + ], + [ + [ + 13, + 21, + 2 + ], + [ + 21, + 34, + 2 + ], + [ + -8, + -13, + 2 + ] + ], + [ + [ + -3, + -5, + 1 + ], + [ + 13, + 21, + 1 + ], + [ + -3, + -5, + 1 + ] + ], + [ + [ + -10, + -16, + 1 + ], + [ + 8, + 13, + 1 + ], + [ + -5, + -8, + 1 + ] + ], + [ + [ + 0, + 0, + 1 + ], + [ + -8, + -13, + 1 + ], + [ + -11, + -18, + 1 + ] + ], + [ + [ + 10, + 16, + 1 + ], + [ + 8, + 13, + 1 + ], + [ + -5, + -8, + 1 + ] + ], + [ + [ + -11, + -18, + 1 + ], + [ + 0, + 0, + 1 + ], + [ + -8, + -13, + 1 + ] + ], + [ + [ + 8, + 13, + 1 + ], + [ + -5, + -8, + 1 + ], + [ + -10, + -16, + 1 + ] + ], + [ + [ + 3, + 5, + 1 + ], + [ + 13, + 21, + 1 + ], + [ + -3, + -5, + 1 + ] + ], + [ + [ + -8, + -13, + 1 + ], + [ + -5, + -8, + 1 + ], + [ + -10, + -16, + 1 + ] + ], + [ + [ + 11, + 18, + 1 + ], + [ + 0, + 0, + 1 + ], + [ + -8, + -13, + 1 + ] + ], + [ + [ + 0, + 0, + 1 + ], + [ + 76, + 123, + 5 + ], + [ + -11, + -18, + 5 + ] + ], + [ + [ + -13, + -21, + 1 + ], + [ + 29, + 47, + 5 + ], + [ + -29, + -47, + 5 + ] + ], + [ + [ + -18, + -29, + 5 + ], + [ + -47, + -76, + 5 + ], + [ + -58, + -94, + 5 + ] + ], + [ + [ + -58, + -94, + 5 + ], + [ + -18, + -29, + 5 + ], + [ + -47, + -76, + 5 + ] + ], + [ + [ + 13, + 21, + 1 + ], + [ + 29, + 47, + 5 + ], + [ + -29, + -47, + 5 + ] + ], + [ + [ + 58, + 94, + 5 + ], + [ + -18, + -29, + 5 + ], + [ + -47, + -76, + 5 + ] + ], + [ + [ + 47, + 76, + 5 + ], + [ + 58, + 94, + 5 + ], + [ + -18, + -29, + 5 + ] + ], + [ + [ + 18, + 29, + 5 + ], + [ + -47, + -76, + 5 + ], + [ + -58, + -94, + 5 + ] + ], + [ + [ + -47, + -76, + 5 + ], + [ + 58, + 94, + 5 + ], + [ + -18, + -29, + 5 + ] + ], + [ + [ + -21, + -34, + 1 + ], + [ + 0, + 0, + 1 + ], + [ + -8, + -13, + 1 + ] + ], + [ + [ + 13, + 21, + 1 + ], + [ + -13, + -21, + 1 + ], + [ + -13, + -21, + 1 + ] + ], + [ + [ + -13, + -21, + 1 + ], + [ + -13, + -21, + 1 + ], + [ + -13, + -21, + 1 + ] + ], + [ + [ + 8, + 13, + 1 + ], + [ + 21, + 34, + 1 + ], + [ + 0, + 0, + 1 + ] + ], + [ + [ + -8, + -13, + 1 + ], + [ + 21, + 34, + 1 + ], + [ + 0, + 0, + 1 + ] + ], + [ + [ + 21, + 34, + 1 + ], + [ + 0, + 0, + 1 + ], + [ + -8, + -13, + 1 + ] + ], + [ + [ + -34, + -55, + 1 + ], + [ + 21, + 34, + 1 + ], + [ + 0, + 0, + 1 + ] + ], + [ + [ + 0, + 0, + 1 + ], + [ + -34, + -55, + 1 + ], + [ + -21, + -34, + 1 + ] + ], + [ + [ + 34, + 55, + 1 + ], + [ + 21, + 34, + 1 + ], + [ + 0, + 0, + 1 + ] + ], + [ + [ + 76, + 123, + 1 + ], + [ + 21, + 34, + 1 + ], + [ + 0, + 0, + 1 + ] + ], + [ + [ + -21, + -34, + 1 + ], + [ + -68, + -110, + 1 + ], + [ + -34, + -55, + 1 + ] + ], + [ + [ + 0, + 0, + 1 + ], + [ + 76, + 123, + 1 + ], + [ + 21, + 34, + 1 + ] + ], + [ + [ + -68, + -110, + 1 + ], + [ + -34, + -55, + 1 + ], + [ + -21, + -34, + 1 + ] + ], + [ + [ + -55, + -89, + 1 + ], + [ + 55, + 89, + 1 + ], + [ + 13, + 21, + 1 + ] + ], + [ + [ + 68, + 110, + 1 + ], + [ + -34, + -55, + 1 + ], + [ + -21, + -34, + 1 + ] + ], + [ + [ + 21, + 34, + 1 + ], + [ + -68, + -110, + 1 + ], + [ + -34, + -55, + 1 + ] + ], + [ + [ + 55, + 89, + 1 + ], + [ + 55, + 89, + 1 + ], + [ + 13, + 21, + 1 + ] + ], + [ + [ + -76, + -123, + 1 + ], + [ + 21, + 34, + 1 + ], + [ + 0, + 0, + 1 + ] + ] + ], + "balls": [ + { + "vertex": 1, + "color": "#ffffff" + }, + { + "vertex": 2, + "color": "#ffffff" + }, + { + "vertex": 3, + "color": "#ffffff" + }, + { + "vertex": 4, + "color": "#ffffff" + }, + { + "vertex": 5, + "color": "#ffffff" + }, + { + "vertex": 6, + "color": "#ffffff" + }, + { + "vertex": 7, + "color": "#ffffff" + }, + { + "vertex": 8, + "color": "#ffffff" + }, + { + "vertex": 10, + "color": "#ffffff" + }, + { + "vertex": 11, + "color": "#ffffff" + }, + { + "vertex": 9, + "color": "#ffffff" + }, + { + "vertex": 12, + "color": "#ffffff" + }, + { + "vertex": 13, + "color": "#ffffff" + }, + { + "vertex": 14, + "color": "#ffffff" + }, + { + "vertex": 15, + "color": "#ffffff" + }, + { + "vertex": 16, + "color": "#ffffff" + }, + { + "vertex": 17, + "color": "#ffffff" + }, + { + "vertex": 20, + "color": "#ffffff" + }, + { + "vertex": 21, + "color": "#ffffff" + }, + { + "vertex": 22, + "color": "#ffffff" + }, + { + "vertex": 18, + "color": "#ffffff" + }, + { + "vertex": 23, + "color": "#ffffff" + }, + { + "vertex": 25, + "color": "#ffffff" + }, + { + "vertex": 19, + "color": "#ffffff" + }, + { + "vertex": 26, + "color": "#ffffff" + }, + { + "vertex": 24, + "color": "#ffffff" + }, + { + "vertex": 33, + "color": "#ffffff" + }, + { + "vertex": 29, + "color": "#ffffff" + }, + { + "vertex": 34, + "color": "#ffffff" + }, + { + "vertex": 27, + "color": "#ffffff" + }, + { + "vertex": 30, + "color": "#ffffff" + }, + { + "vertex": 28, + "color": "#ffffff" + }, + { + "vertex": 31, + "color": "#ffffff" + }, + { + "vertex": 32, + "color": "#ffffff" + }, + { + "vertex": 35, + "color": "#ffffff" + }, + { + "vertex": 36, + "color": "#ffffff" + }, + { + "vertex": 37, + "color": "#ffffff" + }, + { + "vertex": 38, + "color": "#ffffff" + }, + { + "vertex": 39, + "color": "#ffffff" + }, + { + "vertex": 40, + "color": "#ffffff" + }, + { + "vertex": 41, + "color": "#ffffff" + }, + { + "vertex": 43, + "color": "#ffffff" + }, + { + "vertex": 42, + "color": "#ffffff" + }, + { + "vertex": 44, + "color": "#ffffff" + }, + { + "vertex": 45, + "color": "#ffffff" + }, + { + "vertex": 46, + "color": "#ffffff" + }, + { + "vertex": 47, + "color": "#ffffff" + }, + { + "vertex": 51, + "color": "#ffffff" + }, + { + "vertex": 52, + "color": "#ffffff" + }, + { + "vertex": 48, + "color": "#ffffff" + }, + { + "vertex": 49, + "color": "#ffffff" + }, + { + "vertex": 53, + "color": "#ffffff" + }, + { + "vertex": 50, + "color": "#ffffff" + }, + { + "vertex": 0, + "color": "#ffffff" + } + ], + "struts": [ + { + "vertices": [ + 0, + 1 + ], + "color": "#007695" + }, + { + "vertices": [ + 0, + 2 + ], + "color": "#007695" + }, + { + "vertices": [ + 0, + 3 + ], + "color": "#007695" + }, + { + "vertices": [ + 0, + 4 + ], + "color": "#007695" + }, + { + "vertices": [ + 0, + 5 + ], + "color": "#007695" + }, + { + "vertices": [ + 6, + 7 + ], + "color": "#007695" + }, + { + "vertices": [ + 6, + 8 + ], + "color": "#007695" + }, + { + "vertices": [ + 7, + 8 + ], + "color": "#007695" + }, + { + "vertices": [ + 9, + 7 + ], + "color": "#008d36" + }, + { + "vertices": [ + 10, + 8 + ], + "color": "#008d36" + }, + { + "vertices": [ + 10, + 6 + ], + "color": "#008d36" + }, + { + "vertices": [ + 11, + 6 + ], + "color": "#008d36" + }, + { + "vertices": [ + 11, + 7 + ], + "color": "#008d36" + }, + { + "vertices": [ + 9, + 8 + ], + "color": "#008d36" + }, + { + "vertices": [ + 9, + 17 + ], + "color": "#008d36" + }, + { + "vertices": [ + 10, + 12 + ], + "color": "#008d36" + }, + { + "vertices": [ + 10, + 13 + ], + "color": "#008d36" + }, + { + "vertices": [ + 11, + 15 + ], + "color": "#008d36" + }, + { + "vertices": [ + 11, + 14 + ], + "color": "#008d36" + }, + { + "vertices": [ + 9, + 16 + ], + "color": "#008d36" + }, + { + "vertices": [ + 6, + 15 + ], + "color": "#008d36" + }, + { + "vertices": [ + 8, + 17 + ], + "color": "#008d36" + }, + { + "vertices": [ + 8, + 13 + ], + "color": "#008d36" + }, + { + "vertices": [ + 6, + 12 + ], + "color": "#008d36" + }, + { + "vertices": [ + 7, + 16 + ], + "color": "#008d36" + }, + { + "vertices": [ + 7, + 14 + ], + "color": "#008d36" + }, + { + "vertices": [ + 13, + 18 + ], + "color": "#008d36" + }, + { + "vertices": [ + 19, + 13 + ], + "color": "#008d36" + }, + { + "vertices": [ + 14, + 20 + ], + "color": "#008d36" + }, + { + "vertices": [ + 17, + 21 + ], + "color": "#008d36" + }, + { + "vertices": [ + 22, + 12 + ], + "color": "#008d36" + }, + { + "vertices": [ + 23, + 14 + ], + "color": "#008d36" + }, + { + "vertices": [ + 12, + 19 + ], + "color": "#008d36" + }, + { + "vertices": [ + 24, + 17 + ], + "color": "#008d36" + }, + { + "vertices": [ + 22, + 6 + ], + "color": "#007695" + }, + { + "vertices": [ + 18, + 8 + ], + "color": "#007695" + }, + { + "vertices": [ + 23, + 7 + ], + "color": "#007695" + }, + { + "vertices": [ + 25, + 6 + ], + "color": "#007695" + }, + { + "vertices": [ + 26, + 7 + ], + "color": "#007695" + }, + { + "vertices": [ + 24, + 8 + ], + "color": "#007695" + }, + { + "vertices": [ + 18, + 27 + ], + "color": "#008d36" + }, + { + "vertices": [ + 28, + 19 + ], + "color": "#008d36" + }, + { + "vertices": [ + 20, + 29 + ], + "color": "#008d36" + }, + { + "vertices": [ + 27, + 24 + ], + "color": "#008d36" + }, + { + "vertices": [ + 30, + 22 + ], + "color": "#008d36" + }, + { + "vertices": [ + 21, + 31 + ], + "color": "#008d36" + }, + { + "vertices": [ + 32, + 23 + ], + "color": "#008d36" + }, + { + "vertices": [ + 17, + 33 + ], + "color": "#008d36" + }, + { + "vertices": [ + 15, + 29 + ], + "color": "#008d36" + }, + { + "vertices": [ + 14, + 34 + ], + "color": "#008d36" + }, + { + "vertices": [ + 12, + 28 + ], + "color": "#008d36" + }, + { + "vertices": [ + 16, + 31 + ], + "color": "#008d36" + }, + { + "vertices": [ + 19, + 35 + ], + "color": "#008d36" + }, + { + "vertices": [ + 13, + 35 + ], + "color": "#008d36" + }, + { + "vertices": [ + 15, + 38 + ], + "color": "#008d36" + }, + { + "vertices": [ + 16, + 41 + ], + "color": "#008d36" + }, + { + "vertices": [ + 14, + 37 + ], + "color": "#008d36" + }, + { + "vertices": [ + 13, + 40 + ], + "color": "#008d36" + }, + { + "vertices": [ + 17, + 39 + ], + "color": "#008d36" + }, + { + "vertices": [ + 12, + 36 + ], + "color": "#008d36" + }, + { + "vertices": [ + 29, + 38 + ], + "color": "#008d36" + }, + { + "vertices": [ + 31, + 41 + ], + "color": "#008d36" + }, + { + "vertices": [ + 38, + 30 + ], + "color": "#008d36" + }, + { + "vertices": [ + 41, + 32 + ], + "color": "#008d36" + }, + { + "vertices": [ + 35, + 40 + ], + "color": "#008d36" + }, + { + "vertices": [ + 40, + 27 + ], + "color": "#008d36" + }, + { + "vertices": [ + 38, + 25 + ], + "color": "#007695" + }, + { + "vertices": [ + 37, + 23 + ], + "color": "#007695" + }, + { + "vertices": [ + 41, + 26 + ], + "color": "#007695" + }, + { + "vertices": [ + 39, + 24 + ], + "color": "#007695" + }, + { + "vertices": [ + 40, + 18 + ], + "color": "#007695" + }, + { + "vertices": [ + 36, + 22 + ], + "color": "#007695" + }, + { + "vertices": [ + 27, + 39 + ], + "color": "#008d36" + }, + { + "vertices": [ + 36, + 28 + ], + "color": "#008d36" + }, + { + "vertices": [ + 37, + 41 + ], + "color": "#007695" + }, + { + "vertices": [ + 36, + 38 + ], + "color": "#007695" + }, + { + "vertices": [ + 39, + 40 + ], + "color": "#007695" + }, + { + "vertices": [ + 28, + 42 + ], + "color": "#008d36" + }, + { + "vertices": [ + 34, + 43 + ], + "color": "#008d36" + }, + { + "vertices": [ + 35, + 42 + ], + "color": "#008d36" + }, + { + "vertices": [ + 29, + 43 + ], + "color": "#008d36" + }, + { + "vertices": [ + 33, + 44 + ], + "color": "#008d36" + }, + { + "vertices": [ + 31, + 44 + ], + "color": "#008d36" + }, + { + "vertices": [ + 36, + 42 + ], + "color": "#007695" + }, + { + "vertices": [ + 39, + 44 + ], + "color": "#007695" + }, + { + "vertices": [ + 38, + 43 + ], + "color": "#007695" + }, + { + "vertices": [ + 41, + 44 + ], + "color": "#007695" + }, + { + "vertices": [ + 37, + 43 + ], + "color": "#007695" + }, + { + "vertices": [ + 40, + 42 + ], + "color": "#007695" + }, + { + "vertices": [ + 41, + 45 + ], + "color": "#008d36" + }, + { + "vertices": [ + 38, + 46 + ], + "color": "#008d36" + }, + { + "vertices": [ + 40, + 47 + ], + "color": "#008d36" + }, + { + "vertices": [ + 38, + 48 + ], + "color": "#008d36" + }, + { + "vertices": [ + 40, + 49 + ], + "color": "#008d36" + }, + { + "vertices": [ + 41, + 50 + ], + "color": "#008d36" + }, + { + "vertices": [ + 39, + 47 + ], + "color": "#008d36" + }, + { + "vertices": [ + 37, + 51 + ], + "color": "#008d36" + }, + { + "vertices": [ + 39, + 52 + ], + "color": "#008d36" + }, + { + "vertices": [ + 36, + 48 + ], + "color": "#008d36" + }, + { + "vertices": [ + 36, + 53 + ], + "color": "#008d36" + }, + { + "vertices": [ + 37, + 50 + ], + "color": "#008d36" + }, + { + "vertices": [ + 44, + 45 + ], + "color": "#007695" + }, + { + "vertices": [ + 43, + 46 + ], + "color": "#007695" + }, + { + "vertices": [ + 43, + 51 + ], + "color": "#007695" + }, + { + "vertices": [ + 44, + 52 + ], + "color": "#007695" + }, + { + "vertices": [ + 42, + 49 + ], + "color": "#007695" + }, + { + "vertices": [ + 42, + 53 + ], + "color": "#007695" + } + ], + "panels": [] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/pieces-aceg.vZome b/online/public/models/pieces-aceg.vZome index 19dcc98e1..bf2186648 100644 --- a/online/public/models/pieces-aceg.vZome +++ b/online/public/models/pieces-aceg.vZome @@ -1072,7 +1072,7 @@ - + @@ -1097,7 +1097,7 @@ - + @@ -1126,7 +1126,7 @@ - + @@ -1151,7 +1151,7 @@ - + @@ -1185,7 +1185,7 @@ - + @@ -1281,7 +1281,7 @@ - + diff --git a/online/public/models/pieces-bdfh.vZome b/online/public/models/pieces-bdfh.vZome index 8625c5361..7dd2b6cc8 100644 --- a/online/public/models/pieces-bdfh.vZome +++ b/online/public/models/pieces-bdfh.vZome @@ -1037,7 +1037,7 @@ - + @@ -1126,7 +1126,7 @@ - + @@ -1162,7 +1162,7 @@ - + @@ -1187,7 +1187,7 @@ - + @@ -1230,7 +1230,7 @@ - + @@ -1281,7 +1281,7 @@ - + diff --git a/online/src/app/59icosahedra/index.jsx b/online/src/app/59icosahedra/index.jsx index c3a6a4af1..614fee104 100644 --- a/online/src/app/59icosahedra/index.jsx +++ b/online/src/app/59icosahedra/index.jsx @@ -11,7 +11,7 @@ import { SceneCanvas } from '../../viewer/solid/index.jsx' import { getModelURL } from '../classic/components/folder.jsx'; import { RotationProvider } from "../../viewer/solid/rotation.jsx"; import { InteractionToolProvider } from '../../viewer/solid/interaction.jsx'; -import { CellSelectorTool } from './selector.jsx'; +import { CellSelectorTool, MacroTriggerTool } from './selector.jsx'; // We must have this split using WorkerStateProvider and useWorkerClient because // LightedCameraControls and TrackballControls require the WorkerStateProvider anyway. @@ -85,8 +85,11 @@ const App = () => ( - - + + + + + diff --git a/online/src/app/59icosahedra/macros.js b/online/src/app/59icosahedra/macros.js new file mode 100644 index 000000000..297b4162e --- /dev/null +++ b/online/src/app/59icosahedra/macros.js @@ -0,0 +1,213 @@ + +export const c = [ + { + "controllerPath": "strutBuilder:tools:tool-32", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tetrahedral.tool-2", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "", + "action": "ColorManifestations/d40202ff", + "parameters": {} + }, + { + "controllerPath": "", + "action": "DeselectAll", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-32", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tetrahedral.tool-3", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "", + "action": "ColorManifestations/ffd814ff", + "parameters": {} + }, + { + "controllerPath": "", + "action": "DeselectAll", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-32", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "", + "action": "ColorManifestations/1430ffff", + "parameters": {} + }, + { + "controllerPath": "", + "action": "DeselectAll", + "parameters": {} + }, + { + "controllerPath": "undoRedo", + "action": "undo", + "parameters": {} + }, + { + "controllerPath": "undoRedo", + "action": "undo", + "parameters": {} + }, + { + "controllerPath": "undoRedo", + "action": "undo", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tetrahedral.tool-4", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "", + "action": "DeselectAll", + "parameters": {} + }, + { + "controllerPath": "undoRedo", + "action": "undo", + "parameters": {} + }, + { + "controllerPath": "undoRedo", + "action": "undo", + "parameters": {} + }, + { + "controllerPath": "undoRedo", + "action": "undo", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tetrahedral.tool-4", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "", + "action": "ColorManifestations/1a34ffff", + "parameters": {} + }, + { + "controllerPath": "", + "action": "DeselectAll", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-32", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tetrahedral.tool-5", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "", + "action": "ColorManifestations/ff811aff", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-32", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tool-29", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "strutBuilder:tools:tetrahedral.tool-6", + "action": "apply", + "parameters": {} + }, + { + "controllerPath": "", + "action": "ColorManifestations/069b03ff", + "parameters": {} + }, + { + "controllerPath": "", + "action": "DeselectAll", + "parameters": {} + } +]; diff --git a/online/src/app/59icosahedra/selector.jsx b/online/src/app/59icosahedra/selector.jsx index 3f27e6584..bf1457ad3 100644 --- a/online/src/app/59icosahedra/selector.jsx +++ b/online/src/app/59icosahedra/selector.jsx @@ -4,6 +4,8 @@ import { createEffect } from "solid-js"; import { useWorkerClient } from "../../workerClient/index.js"; import { useInteractionTool } from "../../viewer/solid/interaction.jsx"; import { controllerAction, subController } from "../../workerClient/controllers-solid.js"; +import { c } from './macros.js'; +import { doControllerMacro } from "../../workerClient/actions.js"; export const CellSelectorTool = props => { @@ -14,9 +16,13 @@ export const CellSelectorTool = props => allowTrackball: true, - onClick: ( id, position, type, selected ) => { - if ( !type ) { // a panel + onClick: ( id, position, type, selected, label ) => { + if ( !!label ) { // a labeled panel controllerAction( pickingController(), 'SelectManifestation', { id } ) + console.log( selected? 'deselecting' : 'selecting', label ); + if ( selected && label === 'c' ) { + + } } }, @@ -36,3 +42,30 @@ export const CellSelectorTool = props => return null; } + +export const MacroTriggerTool = props => +{ + const { postMessage } = useWorkerClient(); + + const handlers = { + + allowTrackball: true, + + onClick: ( id, position, type, selected, label ) => {}, + + bkgdClick: () => + { + postMessage( doControllerMacro( c ) ); + }, + + onDragStart: ( id, position, type, starting, evt ) => {}, + onDrag: evt => {}, + onDragEnd: evt => {}, + onContextMenu: ( id, position, type, selected ) => {} + }; + + const [ _, setTool ] = useInteractionTool(); + createEffect( () => setTool( handlers ) ); + + return null; +} diff --git a/online/src/viewer/solid/geometry.jsx b/online/src/viewer/solid/geometry.jsx index 3d928fb24..36827656e 100644 --- a/online/src/viewer/solid/geometry.jsx +++ b/online/src/viewer/solid/geometry.jsx @@ -33,7 +33,7 @@ const Instance = ( props ) => const handler = tool && tool() ?.onClick; if ( handler ) { e.stopPropagation() - handler( props.id, props.position, props.type, props.selected ) + handler( props.id, props.position, props.type, props.selected, props.label ) } } const handleContextMenu = ( e ) => diff --git a/online/src/worker/legacy/controllers/wrapper.js b/online/src/worker/legacy/controllers/wrapper.js index 03d29139f..3a84bf443 100644 --- a/online/src/worker/legacy/controllers/wrapper.js +++ b/online/src/worker/legacy/controllers/wrapper.js @@ -9,6 +9,7 @@ export class ControllerWrapper{ this.__clientEvents = clientEvents; this.__changeTables = {}; this.children = {}; + this.macro = []; } createChildWrapper(name, controller) { @@ -94,7 +95,17 @@ export class ControllerWrapper{ wrapper.controller.setProperty( name, value ); } - doAction(controllerPath, action, parameters = {}) { + doAction( controllerPath, action, parameters = {} ) + { + // Macro recording + // if ( action === 'undoAll' ) { + // if ( !!this.macro.length ) + // console.log( JSON.stringify( this.macro, null, 2 ) ); + // this.macro = []; + // } else { + // this.macro .push( { controllerPath, action, parameters } ); + // } + const controllerNames = controllerPath ? controllerPath.split(':') : []; const wrapper = this.getSubControllerByNames(controllerNames); if (parameters && Object.keys(parameters).length !== 0) diff --git a/online/src/worker/legacy/core.js b/online/src/worker/legacy/core.js index cd19c3220..22e222c52 100644 --- a/online/src/worker/legacy/core.js +++ b/online/src/worker/legacy/core.js @@ -217,8 +217,20 @@ const makeFloatMatrices = ( matrices ) => } const editClass = xmlToEditClass( editName ) - if ( editClass ) - return new editClass( editor ) + if ( editClass ) { + const edit = new editClass( editor ); + + // HACK! This works only when the .vZome file has been hand-edited to add label + // attributes to GroupSelection commands. + if ( editName === 'GroupSelection' ) { + const label = xmlElement .getAttribute( "label" ); + if ( label ) { + edit .label = label; + } + } + + return edit; + } else return new vzomePkg.core.editor.CommandEdit( null, editor ) } @@ -523,6 +535,18 @@ const makeFloatMatrices = ( matrices ) => const edit = editFactory( editor, toolFactories, toolsModel )( wrappedElement ) if ( ! edit ) // Null edit only happens for expected cases (e.g. "Shapshot"); others become CommandEdit. return null // Not indicating failure, just indicating nothing to record in history + + // HACK! This works only when the .vZome file has been hand-edited to add label + // attributes to GroupSelection commands. + if ( xmlElement.tagName === 'GroupSelection' && !!edit.label ) { + console.log( `Performed GroupSelection with label ${edit.label}`); + const selection = edit.mSelection; // HACK! violating encapsulation + for (let index = selection.mManifestations.iterator(); index.hasNext(); ) { + let m = index.next(); + m .mRendered .label = edit.label; + } + } + edit.loadAndPerform( wrappedElement, format, context ) checkSideEffects( edit, wrappedElement ); diff --git a/online/src/worker/legacy/scenes.js b/online/src/worker/legacy/scenes.js index ee8b70d56..30ef1e1b9 100644 --- a/online/src/worker/legacy/scenes.js +++ b/online/src/worker/legacy/scenes.js @@ -26,6 +26,7 @@ export const toWebColor = color => export const normalizeRenderedManifestation = rm => { const id = rm.getGuid().toString(); + const label = rm.label; const type = rm .getShape() .name; const shapeId = 's' + rm.getShapeId().toString(); const positionAV = rm.getLocationAV(); @@ -38,7 +39,7 @@ export const normalizeRenderedManifestation = rm => } let color = toWebColor( rm.getColor() ); - return { id, position: [ x, y, z ], rotation, color, selected, shapeId, type }; + return { id, position: [ x, y, z ], rotation, color, selected, shapeId, type, label }; } export const renderedModelTransducer = ( shapeCache, clientEvents ) => diff --git a/online/src/worker/vzome-worker-static.js b/online/src/worker/vzome-worker-static.js index cc653a4e9..d21cc8a37 100644 --- a/online/src/worker/vzome-worker-static.js +++ b/online/src/worker/vzome-worker-static.js @@ -388,6 +388,22 @@ onmessage = ({ data }) => break; } + case 'MACRO_TRIGGERED': + { + try { + for (const actionData of payload) { + const { controllerPath, action, parameters } = actionData; + designWrapper .doAction( controllerPath, action, parameters ); + } + const { shapes, embedding } = designWrapper .getScene( '--END--', true ); // never send camera or lighting! + postMessage( { type: 'SCENE_RENDERED', payload: { scene: { shapes, embedding } } } ); + } catch (error) { + console.log( `Macro error: ${error.message}` ); + postMessage( { type: 'ALERT_RAISED', payload: `Failed to complete macro.` } ); + } + break; + } + case 'ACTION_TRIGGERED': { const { controllerPath, action, parameters } = payload; diff --git a/online/src/workerClient/actions.js b/online/src/workerClient/actions.js index 62bf73075..cd85ca636 100644 --- a/online/src/workerClient/actions.js +++ b/online/src/workerClient/actions.js @@ -37,6 +37,8 @@ export const newDesign = ( field='golden' ) => workerAction( 'NEW_DESIGN_STARTED export const doControllerAction = ( controllerPath='', action, parameters ) => workerAction( 'ACTION_TRIGGERED', { controllerPath, action, parameters } ); +export const doControllerMacro = ( actions ) => workerAction( 'MACRO_TRIGGERED', actions ); + export const requestControllerProperty = ( controllerPath='', propName, changeName=propName, isList=false ) => workerAction( 'PROPERTY_REQUESTED', { controllerPath, propName, changeName, isList } ); export const setControllerProperty = ( controllerPath='', name, value ) => workerAction( 'PROPERTY_SET', { controllerPath, name, value } ); diff --git a/online/src/workerClient/controllers-solid.js b/online/src/workerClient/controllers-solid.js index c32725038..e7db0be8e 100644 --- a/online/src/workerClient/controllers-solid.js +++ b/online/src/workerClient/controllers-solid.js @@ -201,6 +201,8 @@ const createWorkerStore = ( worker ) => case 'SYMMETRY_CHANGED': case 'DESIGN_XML_PARSED': + case 'LAST_BALL_CREATED': + case 'DESIGN_XML_SAVED': // TODO these are not implemented yet! break; From 50c59e7b2b7c48d5ac3192d83732523514fcba38 Mon Sep 17 00:00:00 2001 From: Scott Vorthmann Date: Thu, 2 Nov 2023 10:30:21 -0700 Subject: [PATCH 2/2] WIP Merging scenes for 59icosahedra This takes a different approach to toggling cell orbits. Rather than scripting macros to operate on a single vZome design, we have several predefined models, one per cell orbit, and combine the scenes in a single canvas. To accomplish this, I had to decouple the CameraStateContext from the WorkerContext. STATUS: - single cell orbit toggling is working great - background click is not working at all - background color for the stellation canvas needs to be controlled - initial camera also --- online/public/models/a.vZome | 225 +++++++++++++++ online/public/models/b.vZome | 214 +++++++++++++++ online/public/models/c.vZome | 222 +++++++++++++++ online/public/models/d.vZome | 193 +++++++++++++ online/public/models/e1.vZome | 259 ++++++++++++++++++ online/public/models/e2.vZome | 251 +++++++++++++++++ online/public/models/f1L.vZome | 221 +++++++++++++++ online/public/models/f1R.vZome | 227 +++++++++++++++ online/public/models/f2.vZome | 241 ++++++++++++++++ online/public/models/g1.vZome | 246 +++++++++++++++++ online/public/models/g2.vZome | 235 ++++++++++++++++ online/public/models/h.vZome | 184 +++++++++++++ online/public/models/just-tools.vZome | 147 ++++++++++ online/public/models/pieces-aceg.vZome | 39 ++- online/public/models/pieces-bdfh.vZome | 20 +- online/src/app/59icosahedra/index.jsx | 114 +++++--- online/src/app/59icosahedra/macros.js | 213 -------------- online/src/app/59icosahedra/selector.jsx | 60 ++-- online/src/app/classic/classic.jsx | 2 +- online/src/app/classic/index.jsx | 3 + online/src/app/classic/menus/contextmenu.jsx | 2 +- online/src/viewer/solid/camera.jsx | 121 ++++++++ online/src/viewer/solid/ltcanvas.jsx | 4 +- online/src/viewer/solid/rotation.jsx | 30 -- online/src/viewer/solid/trackballcontrols.jsx | 6 +- online/src/workerClient/context.jsx | 71 +---- online/src/workerClient/controllers-solid.js | 2 +- 27 files changed, 3156 insertions(+), 396 deletions(-) create mode 100644 online/public/models/a.vZome create mode 100644 online/public/models/b.vZome create mode 100644 online/public/models/c.vZome create mode 100644 online/public/models/d.vZome create mode 100644 online/public/models/e1.vZome create mode 100644 online/public/models/e2.vZome create mode 100644 online/public/models/f1L.vZome create mode 100644 online/public/models/f1R.vZome create mode 100644 online/public/models/f2.vZome create mode 100644 online/public/models/g1.vZome create mode 100644 online/public/models/g2.vZome create mode 100644 online/public/models/h.vZome create mode 100644 online/public/models/just-tools.vZome delete mode 100644 online/src/app/59icosahedra/macros.js create mode 100644 online/src/viewer/solid/camera.jsx delete mode 100644 online/src/viewer/solid/rotation.jsx diff --git a/online/public/models/a.vZome b/online/public/models/a.vZome new file mode 100644 index 000000000..1e3f6ba32 --- /dev/null +++ b/online/public/models/a.vZome @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ ], + "balls" : [ ], + "struts" : [ ], + "panels" : [ ] +} + + { + "field" : "golden", + "vertices" : [ [ [ -8, -13, 1 ], [ -5, -8, 1 ], [ 0, 0, 1 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 0, 0, 1 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ -8, -13, 1 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ 0, 0, 1 ], [ -8, -13, 1 ], [ -5, -8, 1 ] ], [ [ 0, 0, 1 ], [ -8, -13, 1 ], [ 5, 8, 1 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ], [ [ 0, 0, 1 ], [ 8, 13, 1 ], [ -5, -8, 1 ] ], [ [ 0, 0, 1 ], [ 8, 13, 1 ], [ 5, 8, 1 ] ], [ [ 5, 8, 1 ], [ 0, 0, 1 ], [ -8, -13, 1 ] ], [ [ 5, 8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ 8, 13, 1 ], [ -5, -8, 1 ], [ 0, 0, 1 ] ], [ [ 8, 13, 1 ], [ 5, 8, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 6, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 7, 9, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 1, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 11, 5, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 8, 7, 1 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 10, 3, 5 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 12, 11, 9 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 10, 8, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 12, 10, 11 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 8, 12, 7 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 11, 10, 5 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 7, 12, 9 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 8, 1 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 9, 11, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 7, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 5, 3, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 0, 1 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 5, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 9, 4, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 4, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 10, 12, 8 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/b.vZome b/online/public/models/b.vZome new file mode 100644 index 000000000..8d8c506a0 --- /dev/null +++ b/online/public/models/b.vZome @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 0, 0, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ], [ [ 0, 0, 1 ], [ 8, 13, 1 ], [ 5, 8, 1 ] ] ], + "balls" : [ { + "vertex" : 3, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 2, 4, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 2, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 4, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/c.vZome b/online/public/models/c.vZome new file mode 100644 index 000000000..0e1715fac --- /dev/null +++ b/online/public/models/c.vZome @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -47, -76, 5 ], [ 0, 0, 1 ], [ 18, 29, 5 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 0, 0, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 0, 4, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 2, 1 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 0, 1 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 4, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 2, 4 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/d.vZome b/online/public/models/d.vZome new file mode 100644 index 000000000..8ae50e4c3 --- /dev/null +++ b/online/public/models/d.vZome @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/e1.vZome b/online/public/models/e1.vZome new file mode 100644 index 000000000..e336f633a --- /dev/null +++ b/online/public/models/e1.vZome @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -13, -21, 1 ], [ 13, 21, 1 ], [ 13, 21, 1 ] ], [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -10, -16, 1 ], [ 8, 13, 1 ], [ 5, 8, 1 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -13, -21, 2 ], [ 21, 34, 2 ], [ 8, 13, 2 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 10, 16, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 8, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 0, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 0, 1 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 7, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 6, 0, 7 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 0, 6 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 0, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 1, 5, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 6, 4, 5, 7 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 7, 5, 1 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/e2.vZome b/online/public/models/e2.vZome new file mode 100644 index 000000000..697b88266 --- /dev/null +++ b/online/public/models/e2.vZome @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -58, -94, 5 ], [ 18, 29, 5 ], [ 47, 76, 5 ] ], [ [ -11, -18, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 3, 0, 1, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 2, 1 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 2, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 1, 4 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/f1L.vZome b/online/public/models/f1L.vZome new file mode 100644 index 000000000..d284e6be7 --- /dev/null +++ b/online/public/models/f1L.vZome @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -58, -94, 5 ], [ 18, 29, 5 ], [ 47, 76, 5 ] ], [ [ -11, -18, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 4, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 0, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 0, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/f1R.vZome b/online/public/models/f1R.vZome new file mode 100644 index 000000000..573b08108 --- /dev/null +++ b/online/public/models/f1R.vZome @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -13, -21, 1 ], [ 13, 21, 1 ], [ 13, 21, 1 ] ], [ [ -58, -94, 5 ], [ 18, 29, 5 ], [ 47, 76, 5 ] ], [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 4, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 0, 1, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 3, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 2, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 0, 3 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/f2.vZome b/online/public/models/f2.vZome new file mode 100644 index 000000000..e4deb943d --- /dev/null +++ b/online/public/models/f2.vZome @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 1 ], [ 0, 0, 1 ], [ 34, 55, 1 ] ], [ [ -58, -94, 5 ], [ -18, -29, 5 ], [ 47, 76, 5 ] ], [ [ -58, -94, 5 ], [ 18, 29, 5 ], [ 47, 76, 5 ] ], [ [ -11, -18, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 1 ], [ -5, -8, 1 ], [ 10, 16, 1 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ -29, -47, 5 ], [ 13, 21, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 13, 21, 1 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -3, -5, 1 ], [ -3, -5, 1 ], [ 13, 21, 1 ] ], [ [ -3, -5, 1 ], [ 3, 5, 1 ], [ 13, 21, 1 ] ], [ [ -11, -18, 5 ], [ 0, 0, 1 ], [ 76, 123, 5 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 12, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 7, 5, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 11, 10, 7, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 3, 1, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 4, 6, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 6, 9, 11, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 10, 7, 5, 8 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 9, 11, 10, 8 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 6, 9, 8 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 1, 4, 8 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 5, 2, 3, 8 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/g1.vZome b/online/public/models/g1.vZome new file mode 100644 index 000000000..2de146e03 --- /dev/null +++ b/online/public/models/g1.vZome @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -13, -21, 1 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -13, -21, 1 ], [ 13, 21, 1 ], [ 13, 21, 1 ] ], [ [ -58, -94, 5 ], [ 18, 29, 5 ], [ 47, 76, 5 ] ], [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 2, 1, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 1, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 4, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 4, 1 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/g2.vZome b/online/public/models/g2.vZome new file mode 100644 index 000000000..dfd24c16a --- /dev/null +++ b/online/public/models/g2.vZome @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 1 ], [ 0, 0, 1 ], [ 34, 55, 1 ] ], [ [ -13, -21, 1 ], [ 13, 21, 1 ], [ 13, 21, 1 ] ], [ [ -58, -94, 5 ], [ 18, 29, 5 ], [ 47, 76, 5 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 13, 21, 1 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 0, 1, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 2, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 3, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 4, 3 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/h.vZome b/online/public/models/h.vZome new file mode 100644 index 000000000..2afe78979 --- /dev/null +++ b/online/public/models/h.vZome @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -55, -89, 1 ], [ 13, 21, 1 ], [ 55, 89, 1 ] ], [ [ -21, -34, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -21, -34, 1 ], [ 0, 0, 1 ], [ 34, 55, 1 ] ], [ [ -13, -21, 1 ], [ 13, 21, 1 ], [ 13, 21, 1 ] ], [ [ -58, -94, 5 ], [ 18, 29, 5 ], [ 47, 76, 5 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 4, 1, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 2, 3, 4 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 4, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 3, 0 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/just-tools.vZome b/online/public/models/just-tools.vZome new file mode 100644 index 000000000..627663541 --- /dev/null +++ b/online/public/models/just-tools.vZome @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "field" : "golden", + "vertices" : [ [ [ -21, -34, 2 ], [ 8, 13, 2 ], [ 13, 21, 2 ] ], [ [ -8, -13, 1 ], [ 5, 8, 1 ], [ 10, 16, 1 ] ], [ [ -29, -47, 5 ], [ 29, 47, 5 ], [ 29, 47, 5 ] ], [ [ -5, -8, 1 ], [ 0, 0, 1 ], [ 8, 13, 1 ] ], [ [ -8, -13, 2 ], [ 13, 21, 2 ], [ 21, 34, 2 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ] ], + "balls" : [ { + "vertex" : 5, + "color" : "#FFFFFF" + } ], + "struts" : [ ], + "panels" : [ { + "vertices" : [ 1, 4, 2, 0 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 1, 0, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 4, 1, 3 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 0, 3, 2 ], + "color" : "#F7CF7F" + }, { + "vertices" : [ 3, 4, 2 ], + "color" : "#F7CF7F" + } ] +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/pieces-aceg.vZome b/online/public/models/pieces-aceg.vZome index bf2186648..f6639adb2 100644 --- a/online/public/models/pieces-aceg.vZome +++ b/online/public/models/pieces-aceg.vZome @@ -1,6 +1,6 @@ - - + + { "field" : "golden", "vertices" : [ [ [ -3, -5, 1 ], [ -2, -3, 1 ], [ 0, 0, 1 ] ], [ [ -3, -5, 1 ], [ 2, 3, 1 ], [ 0, 0, 1 ] ], [ [ -2, -3, 1 ], [ 0, 0, 1 ], [ -3, -5, 1 ] ], [ [ -2, -3, 1 ], [ 0, 0, 1 ], [ 3, 5, 1 ] ], [ [ 0, 0, 1 ], [ -3, -5, 1 ], [ -2, -3, 1 ] ], [ [ 0, 0, 1 ], [ -3, -5, 1 ], [ 2, 3, 1 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ], [ [ 0, 0, 1 ], [ 7, 11, 5 ], [ 18, 29, 5 ] ], [ [ 0, 0, 1 ], [ 3, 5, 1 ], [ -2, -3, 1 ] ], [ [ 0, 0, 1 ], [ 3, 5, 1 ], [ 2, 3, 1 ] ], [ [ 0, 0, 1 ], [ 3, 5, 1 ], [ 4, 7, 1 ] ], [ [ 0, 0, 1 ], [ 3, 5, 1 ], [ 8, 13, 1 ] ], [ [ 4, 7, 5 ], [ 0, 0, 1 ], [ 29, 47, 5 ] ], [ [ 1, 2, 1 ], [ -1, -2, 1 ], [ 5, 8, 1 ] ], [ [ 1, 2, 1 ], [ 1, 2, 1 ], [ 5, 8, 1 ] ], [ [ 7, 11, 5 ], [ 18, 29, 5 ], [ 22, 36, 5 ] ], [ [ 3, 5, 2 ], [ 5, 8, 2 ], [ 8, 13, 2 ] ], [ [ 2, 3, 1 ], [ 0, 0, 1 ], [ -3, -5, 1 ] ], [ [ 2, 3, 1 ], [ 0, 0, 1 ], [ 3, 5, 1 ] ], [ [ 2, 3, 1 ], [ 4, 6, 1 ], [ 3, 5, 1 ] ], [ [ 11, 18, 5 ], [ -11, -18, 5 ], [ 5, 8, 1 ] ], [ [ 11, 18, 5 ], [ 11, 18, 5 ], [ 11, 18, 5 ] ], [ [ 11, 18, 5 ], [ 11, 18, 5 ], [ 5, 8, 1 ] ], [ [ 5, 8, 2 ], [ 8, 13, 2 ], [ 3, 5, 2 ] ], [ [ 3, 5, 1 ], [ -2, -3, 1 ], [ 0, 0, 1 ] ], [ [ 3, 5, 1 ], [ -2, -3, 1 ], [ 4, 6, 1 ] ], [ [ 3, 5, 1 ], [ 2, 3, 1 ], [ 0, 0, 1 ] ], [ [ 3, 5, 1 ], [ 2, 3, 1 ], [ 4, 6, 1 ] ], [ [ 4, 6, 1 ], [ 3, 5, 1 ], [ 2, 3, 1 ] ], [ [ 8, 13, 2 ], [ 3, 5, 2 ], [ 5, 8, 2 ] ], [ [ 4, 7, 1 ], [ 0, 0, 1 ], [ 3, 5, 1 ] ], [ [ 22, 36, 5 ], [ -7, -11, 5 ], [ 18, 29, 5 ] ], [ [ 22, 36, 5 ], [ 7, 11, 5 ], [ 18, 29, 5 ] ], [ [ 5, 8, 1 ], [ 5, 8, 1 ], [ 5, 8, 1 ] ], [ [ 8, 13, 1 ], [ 0, 0, 1 ], [ 13, 21, 1 ] ], [ [ 13, 21, 1 ], [ 8, 13, 1 ], [ 26, 42, 1 ] ] ], @@ -1049,10 +1049,14 @@ - + + + - + + + @@ -1289,12 +1293,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/online/public/models/pieces-bdfh.vZome b/online/public/models/pieces-bdfh.vZome index 7dd2b6cc8..cdf97cd07 100644 --- a/online/public/models/pieces-bdfh.vZome +++ b/online/public/models/pieces-bdfh.vZome @@ -1,6 +1,6 @@ - - + + { "field" : "golden", "vertices" : [ [ [ -3, -5, 1 ], [ -2, -3, 1 ], [ 0, 0, 1 ] ], [ [ -3, -5, 1 ], [ 2, 3, 1 ], [ 0, 0, 1 ] ], [ [ -2, -3, 1 ], [ 0, 0, 1 ], [ -3, -5, 1 ] ], [ [ -2, -3, 1 ], [ 0, 0, 1 ], [ 3, 5, 1 ] ], [ [ 0, 0, 1 ], [ -3, -5, 1 ], [ -2, -3, 1 ] ], [ [ 0, 0, 1 ], [ -3, -5, 1 ], [ 2, 3, 1 ] ], [ [ 0, 0, 1 ], [ 0, 0, 1 ], [ 0, 0, 1 ] ], [ [ 0, 0, 1 ], [ 7, 11, 5 ], [ 18, 29, 5 ] ], [ [ 0, 0, 1 ], [ 3, 5, 1 ], [ -2, -3, 1 ] ], [ [ 0, 0, 1 ], [ 3, 5, 1 ], [ 2, 3, 1 ] ], [ [ 0, 0, 1 ], [ 3, 5, 1 ], [ 4, 7, 1 ] ], [ [ 0, 0, 1 ], [ 3, 5, 1 ], [ 8, 13, 1 ] ], [ [ 4, 7, 5 ], [ 0, 0, 1 ], [ 29, 47, 5 ] ], [ [ 1, 2, 1 ], [ -1, -2, 1 ], [ 5, 8, 1 ] ], [ [ 1, 2, 1 ], [ 1, 2, 1 ], [ 5, 8, 1 ] ], [ [ 7, 11, 5 ], [ 18, 29, 5 ], [ 22, 36, 5 ] ], [ [ 3, 5, 2 ], [ 5, 8, 2 ], [ 8, 13, 2 ] ], [ [ 2, 3, 1 ], [ 0, 0, 1 ], [ -3, -5, 1 ] ], [ [ 2, 3, 1 ], [ 0, 0, 1 ], [ 3, 5, 1 ] ], [ [ 2, 3, 1 ], [ 4, 6, 1 ], [ 3, 5, 1 ] ], [ [ 11, 18, 5 ], [ -11, -18, 5 ], [ 5, 8, 1 ] ], [ [ 11, 18, 5 ], [ 11, 18, 5 ], [ 11, 18, 5 ] ], [ [ 11, 18, 5 ], [ 11, 18, 5 ], [ 5, 8, 1 ] ], [ [ 5, 8, 2 ], [ 8, 13, 2 ], [ 3, 5, 2 ] ], [ [ 3, 5, 1 ], [ -2, -3, 1 ], [ 0, 0, 1 ] ], [ [ 3, 5, 1 ], [ -2, -3, 1 ], [ 4, 6, 1 ] ], [ [ 3, 5, 1 ], [ 2, 3, 1 ], [ 0, 0, 1 ] ], [ [ 3, 5, 1 ], [ 2, 3, 1 ], [ 4, 6, 1 ] ], [ [ 4, 6, 1 ], [ 3, 5, 1 ], [ 2, 3, 1 ] ], [ [ 8, 13, 2 ], [ 3, 5, 2 ], [ 5, 8, 2 ] ], [ [ 4, 7, 1 ], [ 0, 0, 1 ], [ 3, 5, 1 ] ], [ [ 22, 36, 5 ], [ -7, -11, 5 ], [ 18, 29, 5 ] ], [ [ 22, 36, 5 ], [ 7, 11, 5 ], [ 18, 29, 5 ] ], [ [ 5, 8, 1 ], [ 5, 8, 1 ], [ 5, 8, 1 ] ], [ [ 8, 13, 1 ], [ 0, 0, 1 ], [ 13, 21, 1 ] ], [ [ 13, 21, 1 ], [ 8, 13, 1 ], [ 26, 42, 1 ] ] ], @@ -1341,12 +1341,26 @@ - + + + + + + + + + + + + + + + diff --git a/online/src/app/59icosahedra/index.jsx b/online/src/app/59icosahedra/index.jsx index 614fee104..1ad95c46c 100644 --- a/online/src/app/59icosahedra/index.jsx +++ b/online/src/app/59icosahedra/index.jsx @@ -1,6 +1,6 @@ import { render } from 'solid-js/web'; -import { ErrorBoundary } from "solid-js"; +import { ErrorBoundary, createEffect } from "solid-js"; import Typography from '@suid/material/Typography' import Link from '@suid/material/Link' @@ -9,13 +9,13 @@ import { VZomeAppBar } from '../classic/components/appbar.jsx'; import { WorkerStateProvider, useWorkerClient } from '../../workerClient/context.jsx'; import { SceneCanvas } from '../../viewer/solid/index.jsx' import { getModelURL } from '../classic/components/folder.jsx'; -import { RotationProvider } from "../../viewer/solid/rotation.jsx"; +import { CameraStateProvider, RotationProvider, useCameraState } from "../../viewer/solid/camera.jsx"; import { InteractionToolProvider } from '../../viewer/solid/interaction.jsx'; -import { CellSelectorTool, MacroTriggerTool } from './selector.jsx'; +import { CellOrbitProvider, CellSelectorTool, useCellOrbits } from './selector.jsx'; +import { LightedTrackballCanvas } from '../../viewer/solid/ltcanvas.jsx'; +import { ShapedGeometry } from '../../viewer/solid/geometry.jsx'; -// We must have this split using WorkerStateProvider and useWorkerClient because -// LightedCameraControls and TrackballControls require the WorkerStateProvider anyway. -const ModelScene = props => +const ModelCanvas = () => { const { state } = useWorkerClient(); @@ -27,7 +27,7 @@ const ModelScene = props => } return ( - ) } @@ -49,16 +49,54 @@ const Selector = props =>
- - - - - - + + + + + + + +
) } +const CellOrbitScene = props => +{ + const { state: geometry } = useWorkerClient(); + const { state: toggles } = useCellOrbits(); + const showCell = () => toggles[ props.cell ]; + + return ( + + + + + + ); +} + +const CellOrbit = props => +{ + return ( + + + + ); +} + +const StellationCanvas = props => +{ + const { state } = useCameraState(); + return ( + + {props.children} + + ); +} + const App = () => (
{err.toString()}
} > ( } />
-
- - To toggle different shapes in the stellation shown on the right, - click on the shapes below. (Stellation changes are not yet implemented.) - - -
- - -
-
-
- - - - - - + +
+ + To toggle different shapes in the stellation shown on the right, + click on the shapes below. + + +
+ + +
+
+
+ + + + + + + + + + + + + + + + +
) diff --git a/online/src/app/59icosahedra/macros.js b/online/src/app/59icosahedra/macros.js deleted file mode 100644 index 297b4162e..000000000 --- a/online/src/app/59icosahedra/macros.js +++ /dev/null @@ -1,213 +0,0 @@ - -export const c = [ - { - "controllerPath": "strutBuilder:tools:tool-32", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tetrahedral.tool-2", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "", - "action": "ColorManifestations/d40202ff", - "parameters": {} - }, - { - "controllerPath": "", - "action": "DeselectAll", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-32", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tetrahedral.tool-3", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "", - "action": "ColorManifestations/ffd814ff", - "parameters": {} - }, - { - "controllerPath": "", - "action": "DeselectAll", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-32", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "", - "action": "ColorManifestations/1430ffff", - "parameters": {} - }, - { - "controllerPath": "", - "action": "DeselectAll", - "parameters": {} - }, - { - "controllerPath": "undoRedo", - "action": "undo", - "parameters": {} - }, - { - "controllerPath": "undoRedo", - "action": "undo", - "parameters": {} - }, - { - "controllerPath": "undoRedo", - "action": "undo", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tetrahedral.tool-4", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "", - "action": "DeselectAll", - "parameters": {} - }, - { - "controllerPath": "undoRedo", - "action": "undo", - "parameters": {} - }, - { - "controllerPath": "undoRedo", - "action": "undo", - "parameters": {} - }, - { - "controllerPath": "undoRedo", - "action": "undo", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tetrahedral.tool-4", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "", - "action": "ColorManifestations/1a34ffff", - "parameters": {} - }, - { - "controllerPath": "", - "action": "DeselectAll", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-32", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tetrahedral.tool-5", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "", - "action": "ColorManifestations/ff811aff", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-32", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tool-29", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "strutBuilder:tools:tetrahedral.tool-6", - "action": "apply", - "parameters": {} - }, - { - "controllerPath": "", - "action": "ColorManifestations/069b03ff", - "parameters": {} - }, - { - "controllerPath": "", - "action": "DeselectAll", - "parameters": {} - } -]; diff --git a/online/src/app/59icosahedra/selector.jsx b/online/src/app/59icosahedra/selector.jsx index bf1457ad3..e13b0cca4 100644 --- a/online/src/app/59icosahedra/selector.jsx +++ b/online/src/app/59icosahedra/selector.jsx @@ -1,16 +1,33 @@ -import { createEffect } from "solid-js"; +import { createContext, createEffect, useContext } from "solid-js"; +import { createStore } from "solid-js/store"; import { useWorkerClient } from "../../workerClient/index.js"; import { useInteractionTool } from "../../viewer/solid/interaction.jsx"; import { controllerAction, subController } from "../../workerClient/controllers-solid.js"; -import { c } from './macros.js'; -import { doControllerMacro } from "../../workerClient/actions.js"; -export const CellSelectorTool = props => +const CellOrbitContext = createContext( {} ); + +export const CellOrbitProvider = ( props ) => +{ + const [ state, setState ] = createStore( {} ); + + createEffect( () => console.log( JSON.stringify( state, null, 2 ) ) ); + + return ( + + {props.children} + + ); +} + +export const useCellOrbits = () => { return useContext( CellOrbitContext ); }; + +export const CellSelectorTool = () => { const { rootController } = useWorkerClient(); const pickingController = () => subController( rootController(), 'picking' ); + const { setState } = useCellOrbits(); const handlers = { @@ -18,44 +35,15 @@ export const CellSelectorTool = props => onClick: ( id, position, type, selected, label ) => { if ( !!label ) { // a labeled panel - controllerAction( pickingController(), 'SelectManifestation', { id } ) - console.log( selected? 'deselecting' : 'selecting', label ); - if ( selected && label === 'c' ) { - - } + controllerAction( pickingController(), 'SelectManifestation', { id } ); + setState( label, !selected ); } }, bkgdClick: () => { controllerAction( rootController(), 'DeselectAll' ); - }, - - onDragStart: ( id, position, type, starting, evt ) => {}, - onDrag: evt => {}, - onDragEnd: evt => {}, - onContextMenu: ( id, position, type, selected ) => {} - }; - - const [ _, setTool ] = useInteractionTool(); - createEffect( () => setTool( handlers ) ); - - return null; -} - -export const MacroTriggerTool = props => -{ - const { postMessage } = useWorkerClient(); - - const handlers = { - - allowTrackball: true, - - onClick: ( id, position, type, selected, label ) => {}, - - bkgdClick: () => - { - postMessage( doControllerMacro( c ) ); + setState( () => {} ); }, onDragStart: ( id, position, type, starting, evt ) => {}, diff --git a/online/src/app/classic/classic.jsx b/online/src/app/classic/classic.jsx index e1b771308..8b1ad97f0 100644 --- a/online/src/app/classic/classic.jsx +++ b/online/src/app/classic/classic.jsx @@ -9,7 +9,7 @@ import { SceneEditor } from './components/editor.jsx'; import { useWorkerClient } from "../../workerClient/index.js"; import { OrbitsDialog } from "./dialogs/orbits.jsx"; import { ShapesDialog } from "./dialogs/shapes.jsx"; -import { RotationProvider } from "../../viewer/solid/rotation.jsx"; +import { RotationProvider } from "../../viewer/solid/camera.jsx"; import { PolytopesDialog } from "./dialogs/polytopes.jsx"; import { ErrorAlert } from "./components/alert.jsx"; diff --git a/online/src/app/classic/index.jsx b/online/src/app/classic/index.jsx index cfa2ca823..edf92cc3c 100644 --- a/online/src/app/classic/index.jsx +++ b/online/src/app/classic/index.jsx @@ -16,6 +16,7 @@ import { controllerProperty } from '../../workerClient/controllers-solid.js' import { VZomeAppBar } from './components/appbar.jsx'; import { ClassicEditor, SymmetryProvider } from './classic.jsx'; import { WorkerStateProvider } from '../../workerClient/index.js'; +import { CameraStateProvider } from '../../viewer/solid/camera.jsx'; const Persistence = () => { @@ -43,6 +44,7 @@ const Classic = () => { return (
{err.toString()}
} > + +
); } diff --git a/online/src/app/classic/menus/contextmenu.jsx b/online/src/app/classic/menus/contextmenu.jsx index 9c5451dbf..791d1b654 100644 --- a/online/src/app/classic/menus/contextmenu.jsx +++ b/online/src/app/classic/menus/contextmenu.jsx @@ -3,7 +3,7 @@ import { ContextMenu } from "@kobalte/core"; import { ContextMenuItem, ContextMenuSeparator } from "../../framework/menus"; import { useWorkerClient } from "../../../workerClient"; import { controllerAction, subController } from "../../../workerClient/controllers-solid"; -import { useRotation } from "../../../viewer/solid/rotation"; +import { useRotation } from "../../../viewer/solid/camera.jsx"; export const ContextualMenu = props => { diff --git a/online/src/viewer/solid/camera.jsx b/online/src/viewer/solid/camera.jsx new file mode 100644 index 000000000..a694aa071 --- /dev/null +++ b/online/src/viewer/solid/camera.jsx @@ -0,0 +1,121 @@ + +import { createContext, createSignal, useContext } from 'solid-js'; +import { Vector3 } from "three"; + +import { NEAR_FACTOR, FAR_FACTOR } from "../../workerClient/actions.js"; +import { initialState } from '../../workerClient/index.js'; +import { initialScenes } from '../../workerClient/controllers-solid.js'; +import { createStore } from 'solid-js/store'; + +// We need to record the sourceCamera so we can make sure that trackball changes +// don't try to drive the camera for the same scene + +const defaultRotation = { cameraState: initialState().camera, sourceCamera: null }; + +// TODO: combine RotationContext and CameraStateContext? +const RotationContext = createContext( {} ); + +const RotationProvider = (props) => +{ + const [ lastRotation, setLastRotation ] = createSignal( defaultRotation ); + const publishRotation = ( cameraState, sourceCamera ) => setLastRotation( { cameraState, sourceCamera } ); + + const value = { + lastRotation, publishRotation, + }; + + return ( + + {props.children} + + ); +} + +function useRotation() { return useContext( RotationContext ); } + + +const toVector = vector3 => +{ + const { x, y, z } = vector3; + return [ x, y, z ]; +} + +export const extractCameraState = ( camera, target ) => +{ + const up = toVector( camera.up ); + const position = toVector( camera.position ); + const lookAt = toVector( target ); + const [ x, y, z ] = lookAt.map( (e,i) => e - position[ i ] ); + const distance = Math.sqrt( x*x + y*y + z*z ); + const lookDir = [ x/distance, y/distance, z/distance ]; + + // This was missing, and vZome reads width to set FOV + const fovX = camera.fov * (Math.PI/180) * camera.aspect; // Switch from Y-based FOV degrees to X-based radians + const width = 2 * distance * Math.tan( fovX / 2 ); + // This is needed to keep the fog depth correct in desktop. + const far = camera.far; + const near = camera.near; + + return { lookAt, up, lookDir, distance, width, far, near }; +} + +export const cameraPosition = ( cameraState ) => +{ + const { distance, lookAt, lookDir } = cameraState; + return lookAt .map( (e,i) => e - distance * lookDir[ i ] ); +} + +export const cameraFieldOfViewY = ( cameraState, aspectWtoH ) => +{ + const { width, distance } = cameraState; + const halfX = width / 2; + const halfY = halfX / aspectWtoH; + return 360 * Math.atan( halfY / distance ) / Math.PI; +} + +const _offset = new Vector3(), _target = new Vector3(); + +export const injectCameraOrientation = ( cameraState, target, camera ) => +{ + const { up, lookDir } = cameraState; // ignore distance, lookAt, etc. + _target.set( ...target ); + _offset .copy( camera.position ) .sub( _target ); + const distance = _offset .length(); + _offset .set( ...lookDir ) .multiplyScalar( -distance ); + camera.up.set( ...up ); + camera.position.addVectors( _target, _offset ); + camera.lookAt( _target ); +} + +// TODO: combine RotationContext and CameraStateContext? +const CameraStateContext = createContext( {} ); + +const CameraStateProvider = ( props ) => +{ + const [ state, setState ] = createStore( { ...initialScenes() } ); + + const adjustFrustum = ( camera, target ) => + { + const { distance } = extractCameraState( camera, target ); + // Keep the view frustum at a constant shape, adjusting near & far to track distance + const near = distance * NEAR_FACTOR; + const far = distance * FAR_FACTOR; + setState( 'scene', 'camera', { far, near } ); + } + + // TODO: find a more appropriate place to implement this + const recordCamera = ( camera, target ) => + setState( 'liveCamera', extractCameraState( camera, target ) ); + + return ( + + {props.children} + + ); +} + +const useCameraState = () => { return useContext( CameraStateContext ); }; + +// TODO: combine RotationContext and CameraStateContext? +export { useCameraState, CameraStateProvider }; +export { useRotation, RotationProvider }; \ No newline at end of file diff --git a/online/src/viewer/solid/ltcanvas.jsx b/online/src/viewer/solid/ltcanvas.jsx index fdb6aaa5d..cecb17b78 100644 --- a/online/src/viewer/solid/ltcanvas.jsx +++ b/online/src/viewer/solid/ltcanvas.jsx @@ -7,7 +7,7 @@ import { createElementSize } from "@solid-primitives/resize-observer"; import { PerspectiveCamera } from "./perspectivecamera.jsx"; import { TrackballControls } from "./trackballcontrols.jsx"; import { useInteractionTool } from "./interaction.jsx"; -import { cameraFieldOfViewY, cameraPosition, useWorkerClient } from "../../workerClient/context.jsx"; +import { cameraFieldOfViewY, cameraPosition, useCameraState } from "./camera.jsx"; const Lighting = props => { @@ -41,7 +41,7 @@ const defaultLighting = { const LightedCameraControls = (props) => { - const { adjustFrustum, recordCamera } = useWorkerClient(); + const { adjustFrustum, recordCamera } = useCameraState(); // Here we can useThree, etc., which we could not in LightedTrackballCanvas const trackballChange = evt => diff --git a/online/src/viewer/solid/rotation.jsx b/online/src/viewer/solid/rotation.jsx deleted file mode 100644 index ef7686bd5..000000000 --- a/online/src/viewer/solid/rotation.jsx +++ /dev/null @@ -1,30 +0,0 @@ - -import { createContext, createSignal, useContext } from 'solid-js'; -import { initialState } from '../../workerClient'; - -// We need to record the sourceCamera so we can make sure that trackball changes -// don't try to drive the camera for the same scene - -const defaultRotation = { cameraState: initialState().camera, sourceCamera: null }; - -const RotationContext = createContext( {} ); - -const RotationProvider = (props) => -{ - const [ lastRotation, setLastRotation ] = createSignal( defaultRotation ); - const publishRotation = ( cameraState, sourceCamera ) => setLastRotation( { cameraState, sourceCamera } ); - - const value = { - lastRotation, publishRotation, - }; - - return ( - - {props.children} - - ); -} - -function useRotation() { return useContext( RotationContext ); } - -export { useRotation, RotationProvider } \ No newline at end of file diff --git a/online/src/viewer/solid/trackballcontrols.jsx b/online/src/viewer/solid/trackballcontrols.jsx index a74f6875b..b1a681348 100644 --- a/online/src/viewer/solid/trackballcontrols.jsx +++ b/online/src/viewer/solid/trackballcontrols.jsx @@ -5,9 +5,9 @@ import { createEffect, createMemo, onCleanup } from "solid-js"; import { useFrame, useThree } from "solid-three"; import { TrackballControls as TrackballControlsImpl } from "three-stdlib"; -import { useRotation } from "./rotation.jsx"; +import { useRotation } from "./camera.jsx"; import { useInteractionTool } from "./interaction.jsx"; -import { extractCameraState, injectCameraOrientation, useWorkerClient } from "../../workerClient/context.jsx"; +import { extractCameraState, injectCameraOrientation, useCameraState } from "./camera.jsx"; export const TrackballControls = (props) => { @@ -49,7 +49,7 @@ export const TrackballControls = (props) => }); const { lastRotation, publishRotation } = useRotation(); - const { state } = useWorkerClient(); + const { state } = useCameraState(); createEffect(() => { diff --git a/online/src/workerClient/context.jsx b/online/src/workerClient/context.jsx index 2d0968999..38d4dbee7 100644 --- a/online/src/workerClient/context.jsx +++ b/online/src/workerClient/context.jsx @@ -1,63 +1,10 @@ import { createContext, useContext } from "solid-js"; -import { Vector3 } from "three"; import { createWorker } from "./client.js"; import { createWorkerStore } from "./controllers-solid.js"; -import { NEAR_FACTOR, FAR_FACTOR, fetchDesign } from "./actions.js"; +import { fetchDesign } from "./actions.js"; -const toVector = vector3 => -{ - const { x, y, z } = vector3; - return [ x, y, z ]; -} - -export const extractCameraState = ( camera, target ) => -{ - const up = toVector( camera.up ); - const position = toVector( camera.position ); - const lookAt = toVector( target ); - const [ x, y, z ] = lookAt.map( (e,i) => e - position[ i ] ); - const distance = Math.sqrt( x*x + y*y + z*z ); - const lookDir = [ x/distance, y/distance, z/distance ]; - - // This was missing, and vZome reads width to set FOV - const fovX = camera.fov * (Math.PI/180) * camera.aspect; // Switch from Y-based FOV degrees to X-based radians - const width = 2 * distance * Math.tan( fovX / 2 ); - // This is needed to keep the fog depth correct in desktop. - const far = camera.far; - const near = camera.near; - - return { lookAt, up, lookDir, distance, width, far, near }; -} - -export const cameraPosition = ( cameraState ) => -{ - const { distance, lookAt, lookDir } = cameraState; - return lookAt .map( (e,i) => e - distance * lookDir[ i ] ); -} - -export const cameraFieldOfViewY = ( cameraState, aspectWtoH ) => -{ - const { width, distance } = cameraState; - const halfX = width / 2; - const halfY = halfX / aspectWtoH; - return 360 * Math.atan( halfY / distance ) / Math.PI; -} - -const _offset = new Vector3(), _target = new Vector3(); - -export const injectCameraOrientation = ( cameraState, target, camera ) => -{ - const { up, lookDir } = cameraState; // ignore distance, lookAt, etc. - _target.set( ...target ); - _offset .copy( camera.position ) .sub( _target ); - const distance = _offset .length(); - _offset .set( ...lookDir ) .multiplyScalar( -distance ); - camera.up.set( ...up ); - camera.position.addVectors( _target, _offset ); - camera.lookAt( _target ); -} const WorkerStateContext = createContext( {} ); @@ -66,23 +13,9 @@ const WorkerStateProvider = ( props ) => const workerClient = props.store || createWorkerStore( createWorker() ); const { url } = props.config || {}; url && workerClient.postMessage( fetchDesign( url, props.config ) ); - - // TODO: find a more appropriate place to implement this - const adjustFrustum = ( camera, target ) => - { - const { distance } = extractCameraState( camera, target ); - // Keep the view frustum at a constant shape, adjusting near & far to track distance - const near = distance * NEAR_FACTOR; - const far = distance * FAR_FACTOR; - workerClient.setState( 'scene', 'camera', { far, near } ); - } - - // TODO: find a more appropriate place to implement this - const recordCamera = ( camera, target ) => - workerClient.setState( 'liveCamera', extractCameraState( camera, target ) ); return ( - + {props.children} ); diff --git a/online/src/workerClient/controllers-solid.js b/online/src/workerClient/controllers-solid.js index e7db0be8e..0f23855c7 100644 --- a/online/src/workerClient/controllers-solid.js +++ b/online/src/workerClient/controllers-solid.js @@ -291,4 +291,4 @@ const controllerExportAction = ( controller, format, parameters={} ) => return controller.__store .expectResponse( controllerPath, parameters ); } -export { createWorkerStore, subController, controllerProperty, controllerAction, controllerExportAction }; \ No newline at end of file +export { initialScenes, createWorkerStore, subController, controllerProperty, controllerAction, controllerExportAction }; \ No newline at end of file