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));Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MeshBuilder():
MeshBuilder
Returns
Section titled “Returns”MeshBuilder
Properties
Section titled “Properties”pointCount
Section titled “pointCount”
readonlypointCount:number
polygonCount
Section titled “polygonCount”
readonlypolygonCount:number
Methods
Section titled “Methods”addPoint()
Section titled “addPoint()”addPoint(
point):number
Adds a point, or finds one at the same position, and returns its index.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number
addPolygon()
Section titled “addPolygon()”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.
Parameters
Section titled “Parameters”corners
Section titled “corners”Iterable<number | Point3dLike>
options?
Section titled “options?”material?
Section titled “material?”Material | null
Returns
Section titled “Returns”number