Public
Edited
Nov 6, 2022
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
surviveCounts = d3.range(9, 17)
Insert cell
birthCounts = [5, 7, 12, 13, 15]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// exposedCells = simulation.filter((cell) => {
// const neighborSum = cell.neighborIndices.reduce((acc, val) => {
// if (simulation[val].alive > 0) {
// return acc + 1;
// } else {
// return acc;
// }
// }, 0);
// if (neighborSum > 0 && neighborSum < 26) {
// return true;
// } else {
// return false;
// }
// }).length
Insert cell
// convex = {
// const geom = new THREE.ConvexGeometry(
// grid
// .filter((d) => d.alive > 0)
// .map(
// (g) =>
// new THREE.Vector3(
// g.coordinate.x - xCount / 2,
// g.coordinate.y - yCount / 2,
// g.coordinate.z - zCount / 2
// )
// )
// );

// const hull = new THREE.Mesh(geom, mat);
// return hull;
// }
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// isoSurface = {
// const buffGeom = new THREE.BufferGeometry();

// const vertices = new Float32Array(iso.positions.flat(Infinity));

// buffGeom.setAttribute("position", new THREE.BufferAttribute(vertices, 3));

// var indices = new Float32Array(iso.cells.flat(Infinity));

// buffGeom.setIndex(new THREE.BufferAttribute(indices, 3));

// return new THREE.Mesh(buffGeom, mat);
// }
Insert cell
iso2 = {
simulation.
}

Insert cell
// iso = {
// return isoS.marchingCubes(
// [xCount, yCount, zCount],
// function (x, y, z) {
// return !Number(grid[z * (yCount * xCount) + y * xCount + x].alive > 0);
// },
// [
// [0, 0, 0],
// [xCount, yCount, zCount]
// ]
// );
// }

Insert cell
isoS = import("https://cdn.skypack.dev/isosurface@1.0.0?min")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more