Skip to content

Vibe coding a plugin? Teach your agent Modlumi first. Works with Claude Code, Codex, Cursor and more.

MeshBuilder

Collects points and polygons to add with Entities.addMesh, many faces at once. Points at the same position are stored once, so polygons that share corners share vertices and edges.

const mesh = new modlumi.MeshBuilder();
mesh.addPolygon([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]]);
model.operation("Mesh", () => model.entities.addGroup().entities.addMesh(mesh));

new MeshBuilder(): MeshBuilder

MeshBuilder

readonly pointCount: number


readonly polygonCount: number

addPoint(point): number

Adds a point, or finds one at the same position, and returns its index.

Point3dLike

number


addPolygon(corners, options?): number

Adds a polygon through three or more corners, counterclockwise around its front: points, or indices of added points. Returns the polygon’s index.

Iterable<number | Point3dLike>

Material | null

number