diff --git a/package-lock.json b/package-lock.json
index 4fa86aaf..37eeeeab 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,7 +10,7 @@
"dependencies": {
"harmonic-entropy": "^0.2.0",
"isomorphic-qwerty": "^0.0.2",
- "ji-lattice": "^0.0.3",
+ "ji-lattice": "github:xenharmonic-devs/ji-lattice#3d",
"jszip": "^3.10.1",
"moment-of-symmetry": "^0.8.0",
"pinia": "^2.1.7",
@@ -3803,8 +3803,8 @@
},
"node_modules/ji-lattice": {
"version": "0.0.3",
- "resolved": "https://registry.npmjs.org/ji-lattice/-/ji-lattice-0.0.3.tgz",
- "integrity": "sha512-LAO8u0aO4qpDr7WucJmWRpXocy1pnIYlvDNjXmS4/VUhMc4xxMjTzLf4TN0kL/bWTPIhAxRd+0amTEjN1Mnptg==",
+ "resolved": "git+ssh://git@github.com/xenharmonic-devs/ji-lattice.git#6c37e9a7a71a2b663a9c0f2a0097e1a8b734fb83",
+ "license": "MIT",
"dependencies": {
"xen-dev-utils": "^0.2.8"
},
diff --git a/package.json b/package.json
index c3205ece..500f95d7 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
"dependencies": {
"harmonic-entropy": "^0.2.0",
"isomorphic-qwerty": "^0.0.2",
- "ji-lattice": "^0.0.3",
+ "ji-lattice": "github:xenharmonic-devs/ji-lattice#3d",
"jszip": "^3.10.1",
"moment-of-symmetry": "^0.8.0",
"pinia": "^2.1.7",
diff --git a/src/components/EdoCycles.vue b/src/components/EdoCycles.vue
index 45132a1d..aae015a5 100644
--- a/src/components/EdoCycles.vue
+++ b/src/components/EdoCycles.vue
@@ -108,7 +108,6 @@ const viewBox = computed(
:y="v.y + store.size * store.labelOffset * labelY(j, v.indices.length)"
:font-size="`${1.1 * store.size}px`"
:stroke-width="store.size * 0.01"
- dominant-baseline="middle"
>
{{ labels[idx] }}
diff --git a/src/components/Faux3DLattice.vue b/src/components/Faux3DLattice.vue
new file mode 100644
index 00000000..8e1c959d
--- /dev/null
+++ b/src/components/Faux3DLattice.vue
@@ -0,0 +1,177 @@
+
+
+
+
+
diff --git a/src/components/GridLattice.vue b/src/components/GridLattice.vue
index 7f050b44..b4062946 100644
--- a/src/components/GridLattice.vue
+++ b/src/components/GridLattice.vue
@@ -126,7 +126,6 @@ watch(
:y="v.y + store.size * store.labelOffset * labelY(j, v.indices.length)"
:font-size="`${2.5 * store.size}px`"
:stroke-width="store.size * 0.05"
- dominant-baseline="middle"
>
{{ labels[idx] }}
diff --git a/src/components/JustIntonationLattice.vue b/src/components/JustIntonationLattice.vue
index 8b4767bc..05750a7c 100644
--- a/src/components/JustIntonationLattice.vue
+++ b/src/components/JustIntonationLattice.vue
@@ -192,7 +192,6 @@ watch(
v-for="(v, i) of lattice.vertices"
:key="i"
class="node-label"
- dominant-baseline="middle"
:x="v.x"
:y="v.y - store.labelOffset * store.size"
:font-size="`${3 * store.size}px`"
diff --git a/src/stores/ji-lattice.ts b/src/stores/ji-lattice.ts
index 34e9fab0..0ef7036b 100644
--- a/src/stores/ji-lattice.ts
+++ b/src/stores/ji-lattice.ts
@@ -1,6 +1,6 @@
import { computed, reactive, ref, watch } from 'vue'
import { defineStore } from 'pinia'
-import { kraigGrady9, type LatticeOptions, scottDakota24, primeRing72, align } from 'ji-lattice'
+import { kraigGrady9, type LatticeOptions, scottDakota24, primeRing72, align, type LatticeOptions3D, WGP9 } from 'ji-lattice'
import { LOG_PRIMES, mmod } from 'xen-dev-utils'
import { computedAndError } from '@/utils'
import { TimeMonzo, parseChord } from 'sonic-weave'
@@ -79,6 +79,23 @@ export const useJiLatticeStore = defineStore('ji-lattice', () => {
}
})
+ const opts3D = WGP9(0);
+ const xCoords = reactive(opts3D.horizontalCoordinates);
+ const yCoords = reactive(opts3D.verticalCoordinates);
+ const zCoords = reactive(opts3D.depthwiseCoordinates);
+ const depth = ref(100)
+
+ const latticeOptions3D = computed(() => {
+ return {
+ horizontalCoordinates: xCoords,
+ verticalCoordinates: yCoords,
+ depthwiseCoordinates: zCoords,
+ maxDistance: maxDistance.value,
+ edgeMonzos: edgeMonzos.value,
+ mergeEdges: true
+ }
+ })
+
watch(rotation, (newValue) => {
if (newValue < 0 || newValue >= 360) {
rotation.value = mmod(newValue, 360)
@@ -150,12 +167,17 @@ export const useJiLatticeStore = defineStore('ji-lattice', () => {
rotation,
drawArrows,
grayExtras,
+ xCoords,
+ yCoords,
+ zCoords,
+ depth,
// Computed state
edgeMonzos,
edgesError,
horizontals,
verticals,
latticeOptions,
+ latticeOptions3D,
// Methods
kraigGrady,
scott24,
diff --git a/src/views/LatticeView.vue b/src/views/LatticeView.vue
index f022b4ef..8b37678a 100644
--- a/src/views/LatticeView.vue
+++ b/src/views/LatticeView.vue
@@ -11,6 +11,7 @@ import { useJiLatticeStore } from '@/stores/ji-lattice'
import { useGridStore } from '@/stores/grid'
import { useCyclesStore } from '@/stores/edo-cycles'
import { setAndReportValidity } from '@/utils'
+import Faux3DLattice from '@/components/Faux3DLattice.vue'
const state = useStateStore()
const scale = useScaleStore()
@@ -201,6 +202,14 @@ onMounted(() => {
+
+
+
Lattice visualization