Multiple edges between nodes
Do you have plans to implement multiple edges between nodes?
Right now new edge will overwrite previous.
And this this looks like one edge.
mesh = new THREE.Mesh(self.cylinderGeometry, material);
Looks like we can bend cylinder
Could you clarify? Do you mean multiple edges connecting the same two nodes, like:
Yes.
I'm probably not going to implement that any time soon - haven't been doing much work on this project. However, it should be easy enough to implement by looping the code. Something like:
deltas = [-0.15, 0.15];
deltas.forEach(function (dy) {
mesh = new THREE.Mesh(self.cylinderGeometry, material);
mesh.position.addVectors(n1.position, n2.position).divideScalar(2.0);
mesh.lookAt(n2.position);
mesh.translateY(dy);
mag = n2.position.distanceTo(n1.position);
if (edge.hasOwnProperty('size')) {
mesh.scale.set(edge.size, edge.size, mag);
} else {
mesh.scale.z = mag;
}
// Save array-index references to nodes, mapping from object structure
mesh.source = map[edge.source.toString()];
mesh.target = map[edge.target.toString()];
self.scene.add(mesh);
self.edges.push(mesh);
});
where this would go where the current edge rendering bit is. It's untested, so it will take some finagling to get running.