Updated indexing for the smaller polytopes
parent
f9d59a777d
commit
41d8f7ed92
2
main.js
2
main.js
|
@ -35,7 +35,6 @@ scene.background = new THREE.Color(0x808080);
|
||||||
const material = new THREE.MeshStandardMaterial({ color: 0x3293a9 });
|
const material = new THREE.MeshStandardMaterial({ color: 0x3293a9 });
|
||||||
const node_colours = get_colours(0x3293a9);
|
const node_colours = get_colours(0x3293a9);
|
||||||
|
|
||||||
console.log(node_colours);
|
|
||||||
|
|
||||||
material.transparent = true;
|
material.transparent = true;
|
||||||
material.opacity = 0.5;
|
material.opacity = 0.5;
|
||||||
|
@ -75,7 +74,6 @@ function createShape(name) {
|
||||||
if( shape ) {
|
if( shape ) {
|
||||||
scene.remove(shape);
|
scene.remove(shape);
|
||||||
}
|
}
|
||||||
console.log(STRUCTURES[name]);
|
|
||||||
shape = new FourDShape(node_ms, link_ms, face_ms, STRUCTURES[name]);
|
shape = new FourDShape(node_ms, link_ms, face_ms, STRUCTURES[name]);
|
||||||
scene.add(shape);
|
scene.add(shape);
|
||||||
}
|
}
|
||||||
|
|
34
polytopes.js
34
polytopes.js
|
@ -62,11 +62,11 @@ export const cell5 = () => {
|
||||||
const r2 = Math.sqrt(2) / 2;
|
const r2 = Math.sqrt(2) / 2;
|
||||||
return {
|
return {
|
||||||
nodes: [
|
nodes: [
|
||||||
{id:1, label: 0, x: r2, y: r2, z: r2, w: -r2 / r5 },
|
{id:1, label: 1, x: r2, y: r2, z: r2, w: -r2 / r5 },
|
||||||
{id:2, label: 1, x: r2, y: -r2, z: -r2, w: -r2 / r5 },
|
{id:2, label: 2, x: r2, y: -r2, z: -r2, w: -r2 / r5 },
|
||||||
{id:3, label: 2, x: -r2, y: r2, z: -r2, w: -r2 / r5 },
|
{id:3, label: 3, x: -r2, y: r2, z: -r2, w: -r2 / r5 },
|
||||||
{id:4, label: 3, x: -r2, y: -r2, z: r2, w: -r2 / r5 },
|
{id:4, label: 4, x: -r2, y: -r2, z: r2, w: -r2 / r5 },
|
||||||
{id:5, label: 4, x: 0, y: 0, z: 0, w: 4 * r2 / r5 },
|
{id:5, label: 5, x: 0, y: 0, z: 0, w: 4 * r2 / r5 },
|
||||||
],
|
],
|
||||||
links: [
|
links: [
|
||||||
{ id:1, source:1, target: 2},
|
{ id:1, source:1, target: 2},
|
||||||
|
@ -92,14 +92,14 @@ export const cell16 = () => {
|
||||||
let nodes = PERMUTE.coordinates([1, 1, 1, 1], 0);
|
let nodes = PERMUTE.coordinates([1, 1, 1, 1], 0);
|
||||||
nodes = nodes.filter((n) => n.x * n.y * n.z * n.w > 0);
|
nodes = nodes.filter((n) => n.x * n.y * n.z * n.w > 0);
|
||||||
|
|
||||||
nodes[0].label = 0;
|
nodes[0].label = 1;
|
||||||
nodes[3].label = 1;
|
nodes[3].label = 2;
|
||||||
nodes[5].label = 2;
|
nodes[5].label = 3;
|
||||||
nodes[6].label = 3;
|
nodes[6].label = 4;
|
||||||
nodes[7].label = 0;
|
nodes[7].label = 1;
|
||||||
nodes[4].label = 1;
|
nodes[4].label = 2;
|
||||||
nodes[2].label = 2;
|
nodes[2].label = 3;
|
||||||
nodes[1].label = 3;
|
nodes[1].label = 4;
|
||||||
|
|
||||||
index_nodes(nodes);
|
index_nodes(nodes);
|
||||||
scale_nodes(nodes, 0.75);
|
scale_nodes(nodes, 0.75);
|
||||||
|
@ -123,6 +123,8 @@ export const tesseract = () => {
|
||||||
|
|
||||||
for( const n of nodes ) {
|
for( const n of nodes ) {
|
||||||
if( n.x * n.y * n.z * n.w > 0 ) {
|
if( n.x * n.y * n.z * n.w > 0 ) {
|
||||||
|
n.label = 2;
|
||||||
|
} else {
|
||||||
n.label = 1;
|
n.label = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -143,9 +145,9 @@ export const tesseract = () => {
|
||||||
|
|
||||||
|
|
||||||
const CELL24_INDEXING = {
|
const CELL24_INDEXING = {
|
||||||
x: { y: 0, z: 2, w: 1 },
|
x: { y: 1, z: 3, w: 2 },
|
||||||
y: { z: 1, w: 2 },
|
y: { z: 2, w: 3 },
|
||||||
z: { w: 0 }
|
z: { w: 1 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue