further colour tweaks
parent
fdd75b103b
commit
0433267e62
|
@ -3,8 +3,7 @@ import ColorScheme from 'color-scheme';
|
||||||
export const get_colours = (basis) => {
|
export const get_colours = (basis) => {
|
||||||
const scheme = new ColorScheme;
|
const scheme = new ColorScheme;
|
||||||
const hexbasis = basis.toString(16).padStart(6, "0");
|
const hexbasis = basis.toString(16).padStart(6, "0");
|
||||||
scheme.from_hex(hexbasis).scheme('analogic').variation('hard').distance(0.1);
|
scheme.from_hex(hexbasis).scheme("triade").variation("hard").distance(0.5);
|
||||||
console.log(scheme.colors());
|
|
||||||
return scheme.colors().map((cs) => parseInt('0x' + cs));
|
return scheme.colors().map((cs) => parseInt('0x' + cs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
gui.js
2
gui.js
|
@ -16,7 +16,7 @@ class FourDGUI {
|
||||||
this.params = {
|
this.params = {
|
||||||
shape: this.link['shape'] || DEFAULT_SHAPE,
|
shape: this.link['shape'] || DEFAULT_SHAPE,
|
||||||
thickness: this.link['thickness'] || 1,
|
thickness: this.link['thickness'] || 1,
|
||||||
nodesize: this.link['nodesize'] || 0,
|
nodesize: this.link['nodesize'] || 2,
|
||||||
color: this.link['color'] || DEFAULT_COLOR,
|
color: this.link['color'] || DEFAULT_COLOR,
|
||||||
background: this.link['background'] || DEFAULT_BG,
|
background: this.link['background'] || DEFAULT_BG,
|
||||||
hyperplane: this.link['hyperplane'] || 2,
|
hyperplane: this.link['hyperplane'] || 2,
|
||||||
|
|
3
main.js
3
main.js
|
@ -32,7 +32,8 @@ document.body.appendChild( renderer.domElement );
|
||||||
scene.background = new THREE.Color(0x808080);
|
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);
|
|
||||||
|
|
||||||
const node_ms = node_colours.map((c) => new THREE.MeshStandardMaterial({color: c}));
|
const node_ms = node_colours.map((c) => new THREE.MeshStandardMaterial({color: c}));
|
||||||
|
|
||||||
const link_ms = [ material ];
|
const link_ms = [ material ];
|
||||||
|
|
22
polytopes.js
22
polytopes.js
|
@ -314,7 +314,7 @@ function make_600cell_vertices() {
|
||||||
].flat();
|
].flat();
|
||||||
|
|
||||||
for( const n of nodes ) {
|
for( const n of nodes ) {
|
||||||
n.label = label_vertex(n, coords, partition600);
|
n.label = label_vertex(n, coords, partition600) - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for( const n of nodes ) {
|
for( const n of nodes ) {
|
||||||
|
@ -329,12 +329,32 @@ function make_600cell_vertices() {
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_node(nodes, id) {
|
||||||
|
const ns = nodes.filter((n) => n.id === id);
|
||||||
|
if( ns ) {
|
||||||
|
return ns[0]
|
||||||
|
} else {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function audit_link_labels(nodes, links) {
|
||||||
|
console.log("Link audit");
|
||||||
|
for( const l of links ) {
|
||||||
|
const n1 = get_node(nodes, l.source);
|
||||||
|
const n2 = get_node(nodes, l.target);
|
||||||
|
if( n1.label === n2.label ) {
|
||||||
|
console.log(`link ${l.id} joins ${n1.id} ${n2.id} with label ${n2.label}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export const cell600 = () => {
|
export const cell600 = () => {
|
||||||
const nodes = make_600cell_vertices();
|
const nodes = make_600cell_vertices();
|
||||||
const links = auto_detect_edges(nodes, 12);
|
const links = auto_detect_edges(nodes, 12);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
nodes: nodes,
|
nodes: nodes,
|
||||||
links: links,
|
links: links,
|
||||||
|
|
Loading…
Reference in New Issue