Skip to content

Commit

Permalink
Cell selection implemented in 59icosahedra
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
vorth committed Nov 2, 2023
1 parent 4cb1675 commit 8d1cf58
Show file tree
Hide file tree
Showing 13 changed files with 3,758 additions and 22 deletions.
3,431 changes: 3,431 additions & 0 deletions online/public/models/icosahedron-stellation-faces.vZome

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions online/public/models/pieces-aceg.vZome
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@
</SelectManifestation>
<EndBlock/>
<ApplyTool copyColors="true" name="icosahedral.builtin/icosahedral around origin" selectInputs="true"/>
<GroupSelection/>
<GroupSelection label="a"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand All @@ -1097,7 +1097,7 @@
<polygonVertex at="21 34 21 34 21 34"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="g2"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand Down Expand Up @@ -1126,7 +1126,7 @@
<polygonVertex at="0 0 13 21 34 55"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="g1"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand All @@ -1151,7 +1151,7 @@
<polygonVertex at="13/2 21/2 21/2 17 17 55/2"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="e2"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand Down Expand Up @@ -1185,7 +1185,7 @@
<polygonVertex at="0 0 13 21 8 13"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="c"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand Down Expand Up @@ -1281,7 +1281,7 @@
<polygonVertex at="17 55/2 13/2 21/2 21/2 17"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="e1"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand Down
12 changes: 6 additions & 6 deletions online/public/models/pieces-bdfh.vZome
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@
<polygonVertex at="13 21 8 13 0 0"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="b"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand Down Expand Up @@ -1126,7 +1126,7 @@
<polygonVertex at="47/5 76/5 47/5 76/5 21 34"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="f2"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand Down Expand Up @@ -1162,7 +1162,7 @@
<polygonVertex at="13 21 8 13 16 26"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="f1L"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand All @@ -1187,7 +1187,7 @@
<polygonVertex at="13 21 8 13 16 26"/>
<polygonVertex at="13/2 21/2 21/2 17 17 55/2"/>
</SelectManifestation>
<GroupSelection/>
<GroupSelection label="d"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand Down Expand Up @@ -1230,7 +1230,7 @@
<polygonVertex at="0 0 13 21 34 55"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="f1R"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand Down Expand Up @@ -1281,7 +1281,7 @@
<polygonVertex at="55 89 34 55 110 178"/>
</SelectManifestation>
<EndBlock/>
<GroupSelection/>
<GroupSelection label="h"/>
<BeginBlock/>
<DeselectAll/>
<SelectManifestation>
Expand Down
9 changes: 6 additions & 3 deletions online/src/app/59icosahedra/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -85,8 +85,11 @@ const App = () => (
</div>
</RotationProvider>
</div>
<ModelWorker model='pieces-all' >
<ModelScene freeCamera={true} />
<ModelWorker model='icosahedron-stellation-faces' >
<InteractionToolProvider>
<MacroTriggerTool/>
<ModelScene freeCamera={true} />
</InteractionToolProvider>
</ModelWorker>
</div>
</ErrorBoundary>
Expand Down
213 changes: 213 additions & 0 deletions online/src/app/59icosahedra/macros.js
Original file line number Diff line number Diff line change
@@ -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": {}
}
];
Loading

0 comments on commit 8d1cf58

Please sign in to comment.