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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more