sources.plane
A flat grid in the XZ plane, width along x and height along z, of quads facing +Y with persistent ids.
Usage
Sources.plane(params?: SourcePlaneParams): Result<Geometry>Parameters
params.widthnumberExtent along x. Default
1. In model.params.heightnumberExtent along z. Default
1. In model.params.widthSegmentsnumberCells along x; an integer. Default
1. Range [1, 1024] count.params.heightSegmentsnumberCells along z; an integer. Default
1. Range [1, 1024] count.params.scopestringThe host’s node id; ids are minted under it. Default
undefined (index ids, minter 0).
Returns
Ok with polygon geometry of (widthSegments + 1) · (heightSegments + 1) points row by row from (−x, −z) and widthSegments · heightSegments quads; no N.
Errors
Guarantees
- the area equals width · height and every quad’s normal is +Y
- the same parameters give the same bytes (geometryContentHash), natively and in WASM
- The same result on every machine.
Example
const r = Sources.plane({ width: 4, height: 2, widthSegments: 4, heightSegments: 2 })
r.ok || r.diagnostics[0].code // → 15 points and 8 quads once loadGeometryKernel() has run