BetaBetaBetaPuts a beam on every edge of the Voronoi cells of seeds in a planar face, each shared edge once, with a sphere at each node.
A beam is a cylinder, or a prism of sides flat sides; nothing is fused. build graph builds
only the edges. Curved pieces of the face's boundary get no beam.
The face, the seeds and their weights, and the beams' radius, sides and nodes
A compound of the beams and spheres, or of the edges
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const seeds = await bitbybit.occt.patterns.voronoi.seeds2d({ face, method: Bit.Inputs.OCCT.voronoiSeedMethodEnum.poisson, maxSpacing: 12, relax: 3 });
const beams = await bitbybit.occt.patterns.voronoi.beams2d({ face, seeds, radius: 1, sides: 6 });
BetaPuts beams on the cells' edges in a planar face as beams2d does, and reports each cell, each
beam and sphere, and the beams as a graph.
The graph gives the nodes, the struts between them and every radius, ready for analysis.
The face, the seeds and their weights, and the beams' radius, sides and nodes
The compound of the beams and spheres, or of the edges, and the report
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const { shape, report } = await bitbybit.occt.patterns.voronoi.beams2dWithReport({ face, seeds: [[-30, 0, -10], [10, 0, 15], [25, 0, -20]], radius: 1, build: Bit.Inputs.OCCT.voronoiBeamBuildEnum.graph });
console.log(report.nodes.length, report.struts.length);
BetaPuts a beam on every edge of the Voronoi cells of seeds in a convex solid, each shared edge once, with a sphere at each node: a strut lattice.
A beam is a cylinder, or a prism of sides flat sides; nothing is fused. build graph builds
only the edges. sizes grade the radii one seed at a time.
The solid, the seeds and their weights, and the beams' radius, sides and nodes
A compound of the beams and spheres, or of the edges
const box = await bitbybit.occt.shapes.solid.createBox({ width: 40, length: 40, height: 40, center: [0, 0, 0] });
const seeds = await bitbybit.occt.patterns.voronoi.seeds3d({ shape: box, count: 20, relax: 2 });
const lattice = await bitbybit.occt.patterns.voronoi.beams3d({ shape: box, seeds, radius: 0.8 });
BetaPuts beams on the cells' edges in a convex solid as beams3d does, and reports each cell, each
beam and sphere, and the beams as a graph.
The graph gives the nodes, the struts between them and every radius, ready for analysis.
The solid, the seeds and their weights, and the beams' radius, sides and nodes
The compound of the beams and spheres, or of the edges, and the report
const box = await bitbybit.occt.shapes.solid.createBox({ width: 40, length: 40, height: 40, center: [0, 0, 0] });
const { shape, report } = await bitbybit.occt.patterns.voronoi.beams3dWithReport({ shape: box, seeds: [[-10, -10, -10], [12, -8, 5], [-6, 14, 9]], build: Bit.Inputs.OCCT.voronoiBeamBuildEnum.graph });
console.log(report.nodes.length, report.struts.length);
BetaSplits a planar face into the Voronoi cells of seeds, each the part nearer its seed than any other.
faces gives one face a cell, edges each shared edge once. A convex face of straight edges is
cut exactly; any other takes a boolean per cell crossing its boundary, and a cell it splits keeps
several faces.
The face, the seeds and their weights, and what to build
A compound of the cells' faces or edges
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const seeds = [[-30, 0, -10], [10, 0, 15], [25, 0, -20], [-5, 0, 20]];
const cells = await bitbybit.occt.patterns.voronoi.cells2d({ face, seeds, output: Bit.Inputs.OCCT.voronoiCells2dOutputEnum.edges });
BetaSplits a planar face into Voronoi cells as cells2d does, and reports each seed's cell and each
piece of the compound.
The report gives each cell's state, area, placement and centroid, the seeds and walls of each piece, and how many booleans cutting the cells to the face took.
The face, the seeds and their weights, and what to build
The compound of the cells' faces or edges, and the report
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const { shape, report } = await bitbybit.occt.patterns.voronoi.cells2dWithReport({ face, seeds: [[-30, 0, -10], [10, 0, 15], [25, 0, -20]] });
console.log(report.cells.map(cell => cell.area), report.booleans);
BetaSplits a solid into the Voronoi cells of seeds, each the part nearer its seed than any other.
solids gives one solid a cell, faces and edges each shared face or edge once. A convex solid
of planar faces is cut exactly; any other takes a boolean per cell crossing its boundary and
refuses faces and edges.
The solid, the seeds and their weights, and what to build
A compound of the cells' solids, faces or edges
const box = await bitbybit.occt.shapes.solid.createBox({ width: 40, length: 40, height: 40, center: [0, 0, 0] });
const seeds = [[-10, -10, -10], [12, -8, 5], [-6, 14, 9], [9, 11, -12]];
const cells = await bitbybit.occt.patterns.voronoi.cells3d({ shape: box, seeds, output: Bit.Inputs.OCCT.voronoiCells3dOutputEnum.solids });
BetaSplits a solid into Voronoi cells as cells3d does, and reports each seed's cell and each piece
of the compound.
The report gives each cell's state, volume, placement and centroid, the seeds and walls of each piece, and how many booleans cutting the cells to the solid took.
The solid, the seeds and their weights, and what to build
The compound of the cells' solids, faces or edges, and the report
const sphere = await bitbybit.occt.shapes.solid.createSphere({ radius: 20, center: [0, 0, 0] });
const { shape, report } = await bitbybit.occt.patterns.voronoi.cells3dWithReport({ shape: sphere, seeds: [[-8, 0, 0], [8, 2, 0], [0, 9, 5]] });
console.log(report.cells.map(cell => cell.volume), report.booleans);
BetaBuilds the Voronoi cells of seeds in a convex solid as one compsolid, whose cells share every vertex, edge and face they meet along.
Each face between two cells is one face of both, so the cells stay joined without a boolean, as analysis and meshing across cells need.
The solid, the seeds and their weights
The compsolid of the cells
BetaJoins the seeds whose Voronoi cells meet inside a planar face, by the edges or triangles of their Delaunay triangulation.
edges joins every two seeds whose cells share an edge, triangles every three whose cells meet
at a point. In a face that is not convex, seeds whose cells meet only outside it stay apart.
The face, the seeds and their weights, and what to build
A compound of the edges or triangles, on the face's plane
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const seeds = [[-30, 0, -10], [10, 0, 15], [25, 0, -20], [-5, 0, 20]];
const triangles = await bitbybit.occt.patterns.voronoi.delaunay2d({ face, seeds, output: Bit.Inputs.OCCT.voronoiDelaunayOutputEnum.triangles });
BetaJoins seeds as delaunay2d does, and reports each seed's cell and the seeds each edge or triangle
joins.
The report gives each cell's state, area, placement and centroid, the seeds of each piece, and how many booleans reading a face that is not convex took.
The face, the seeds and their weights, and what to build
The compound of the edges or triangles, and the report
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const { shape, report } = await bitbybit.occt.patterns.voronoi.delaunay2dWithReport({ face, seeds: [[-30, 0, -10], [10, 0, 15], [25, 0, -20]] });
console.log(report.pieces.map(piece => piece.seeds));
BetaMakes a shape an affector: points, curves, faces, shells or solids whose nearness grades cells,
through field and the seed methods.
Its influence is strength at the shape and falls to 0 at radius. A solid or closed shell gives
full influence everywhere inside it unless mode is surface.
The shape, its radius and strength, its falloff and how it is measured
The affector, ready for field, seeds2d and seeds3d
const hole = await bitbybit.occt.shapes.edge.createCircleEdge({ radius: 10, center: [0, 0, 0], direction: [0, 1, 0] });
const near = await bitbybit.occt.patterns.voronoi.affector({ shape: hole, radius: 30, falloff: Bit.Inputs.OCCT.voronoiFalloffEnum.smooth });
const values = await bitbybit.occt.patterns.voronoi.field({ points: [[0, 0, 20], [0, 0, 40]], affectors: [near] });
BetaGives the affectors' combined influence at each point, mapped linearly from 0 and 1 onto from
and to.
This is how anything is graded: read the field at the seeds and pass the values on as sizes,
weights or perforation factors. For openings 0 keeps a cell solid and 1 opens it most.
The points, the affectors, how they combine and the range to map onto
One value a point
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const seeds = await bitbybit.occt.patterns.voronoi.seeds2d({ face, count: 60, relax: 2 });
const hole = await bitbybit.occt.shapes.edge.createCircleEdge({ radius: 8, center: [0, 0, 0], direction: [0, 1, 0] });
const near = await bitbybit.occt.patterns.voronoi.affector({ shape: hole, radius: 30, falloff: Bit.Inputs.OCCT.voronoiFalloffEnum.smooth });
const factors = await bitbybit.occt.patterns.voronoi.field({ points: seeds, affectors: [near], from: 0.8, to: 0.2 });
const panel = await bitbybit.occt.patterns.voronoi.perforate({ face, seeds, factors });
BetaMakes a solid into foam: one solid holding a void in each seed's Voronoi cell, the cell scaled by
scale or inset by inset.
Voids keep skin from the outside; windows joins them through a window in each face two voids
share, for open-cell foam. In a solid that is not convex only cells wholly inside get a void.
The solid, the seeds and their weights, and how to size the voids, the skin and the windows
The one solid, its voids as inner shells
const box = await bitbybit.occt.shapes.solid.createBox({ width: 40, length: 40, height: 40, center: [0, 0, 0] });
const seeds = await bitbybit.occt.patterns.voronoi.seeds3d({ shape: box, count: 30, relax: 2 });
const foam = await bitbybit.occt.patterns.voronoi.foam({ shape: box, seeds, scale: 0.7, skin: 1 });
const open = await bitbybit.occt.patterns.voronoi.foam({ shape: box, seeds, scale: 0.7, skin: 1, windows: Bit.Inputs.OCCT.voronoiWindowsEnum.scale, windowScale: 0.5 });
BetaMakes a solid into foam as foam does, and reports what became of each seed's cell and void.
Each void's fate says whether it was made, kept closed, not wholly inside, too close to the outside or without a cell; a made void gives its volume and the windows it opens.
The solid, the seeds and their weights, and how to size the voids, the skin and the windows
The one solid, and the report
const sphere = await bitbybit.occt.shapes.solid.createSphere({ radius: 20, center: [0, 0, 0] });
const { shape, report } = await bitbybit.occt.patterns.voronoi.foamWithReport({ shape: sphere, seeds: [[-6, 0, 0], [6, 2, 0], [0, 7, 4], [0, -6, -5]], scale: 0.6, skin: 2 });
console.log(report.cells.map(cell => cell.voidFate));
BetaBuilds every face between the Voronoi cells of seeds in a convex solid once, each with a window
scaled by scale or inset by inset, its corners rounded by radius.
With a wall, each cell is a hollow solid instead, its windows tunnels to its inside, so
neighbours touch face to face and never overlap.
The solid, the seeds and their weights, and how to size, round and wall each window
A compound of the frames as faces, or of the hollow cells as solids
const box = await bitbybit.occt.shapes.solid.createBox({ width: 40, length: 40, height: 40, center: [0, 0, 0] });
const seeds = await bitbybit.occt.patterns.voronoi.seeds3d({ shape: box, count: 12, seed: 3 });
const frames = await bitbybit.occt.patterns.voronoi.frames3d({ shape: box, seeds, scale: 0.6, radius: 1 });
const cells = await bitbybit.occt.patterns.voronoi.frames3d({ shape: box, seeds, scale: 0.6, wall: Bit.Inputs.OCCT.voronoiWallEnum.scale, thickness: 0.15 });
BetaFrames the faces between Voronoi cells as frames3d does, and reports each seed's cell and each
frame or hollow cell.
Each frame gives the cells or wall it lies between, the scale or inset its window took, and
whether it has one; with a wall, each cell whether it is hollow and how many windows it opened
or closed.
The solid, the seeds and their weights, and how to size, round and wall each window
The compound of the frames or hollow cells, and the report
const box = await bitbybit.occt.shapes.solid.createBox({ width: 40, length: 40, height: 40, center: [0, 0, 0] });
const { shape, report } = await bitbybit.occt.patterns.voronoi.frames3dWithReport({ shape: box, seeds: [[-10, -10, -10], [12, -8, 5], [-6, 14, 9]], shrink: Bit.Inputs.OCCT.voronoiShrinkEnum.inset, inset: 2 });
console.log(report.pieces.filter(piece => !piece.window).length);
BetaPerforates a planar face with one hole a seed's Voronoi cell, each cell shrunk by scale about its
centroid or by inset along its edges, its corners rounded by radius.
The result is the same face with the holes as inner wires, made without a boolean. A hole closer
than margin to the face's boundary is left out.
The face, the seeds and their weights, and how to shrink and round each hole
The face with its holes
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const seeds = [[-30, 0, -10], [10, 0, 15], [25, 0, -20], [-5, 0, 20]];
const panel = await bitbybit.occt.patterns.voronoi.perforate({ face, seeds, shrink: Bit.Inputs.OCCT.voronoiShrinkEnum.inset, inset: 2, radius: 3, margin: 4 });
const plate = await bitbybit.occt.operations.extrude({ shape: panel, direction: [0, 2, 0] });
BetaPerforates a planar face as perforate does, and reports what became of each seed's cell and hole.
Each hole's fate says whether it was made, consumed by the shrink, too close to the boundary or without a cell; a made hole gives its area and how many of its corners took a smaller radius.
The face, the seeds and their weights, and how to shrink and round each hole
The face with its holes, and the report
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const { shape, report } = await bitbybit.occt.patterns.voronoi.perforateWithReport({ face, seeds: [[-30, 0, -10], [10, 0, 15], [25, 0, -20]], scale: 0.7, margin: 3 });
console.log(report.cells.map(cell => cell.hole.fate));
BetaPlaces seeds in a planar face: at random, on a jittered grid, or evenly spaced by Poisson
sampling, whose spacing affectors can grade; then evens them out by relax rounds.
The same seed gives the same seeds, so a design stays put between runs.
The face, how to place the seeds, and the affectors that grade their spacing
The seeds, on the face's plane
const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 100, length: 60, center: [0, 0, 0], direction: [0, 1, 0] });
const seeds = await bitbybit.occt.patterns.voronoi.seeds2d({ face, method: Bit.Inputs.OCCT.voronoiSeedMethodEnum.poisson, maxSpacing: 10, relax: 3 });
const cells = await bitbybit.occt.patterns.voronoi.cells2d({ face, seeds, output: Bit.Inputs.OCCT.voronoiCells2dOutputEnum.edges });
BetaPlaces seeds in a solid: at random, on a jittered grid, or evenly spaced by Poisson sampling,
whose spacing affectors can grade; then evens them out by relax rounds.
The same seed gives the same seeds, so a design stays put between runs.
The solid, how to place the seeds, and the affectors that grade their spacing
The seeds, inside the solid
const box = await bitbybit.occt.shapes.solid.createBox({ width: 40, length: 40, height: 40, center: [0, 0, 0] });
const seeds = await bitbybit.occt.patterns.voronoi.seeds3d({ shape: box, method: Bit.Inputs.OCCT.voronoiSeedMethodEnum.grid, spacing: 8, jitter: 0.4 });
const cells = await bitbybit.occt.patterns.voronoi.cells3d({ shape: box, seeds });
Voronoi cells of seed points, built as exact shapes in a face or a solid: cells, the edges and faces between them, Delaunay joins, perforated faces, frames and hollow walls, beams and their graph, closed-cell and open-cell foam and a compsolid; seeds placed at random, on a grid or evenly spaced; and affectors whose field grades any of it.
Each cell is the part of the face or solid nearer its seed than any other. Weights make power cells, where a heavier seed's cell grows. Most methods have a twin that also reports what was built. Lengths are in model units.
Experimental: the methods and the report may still change.