Pure-function builders — no scene side-effects; each call
returns plain typed arrays the caller hands to the SceneModel
builder. Same input → same output, easy to test, easy to
memoise.
Curated catalogs — geometry primitives, materials, and
environments are organised into named entries so application
menus can list them with metadata.
Tileable PBR painters — the paintMaterials painters
produce a colour + normal + metallic-roughness triple at any
square texture size. Outputs are seamless under tiling, with
engineering hatch metadata attached per painter for use by
sectionCaps and
materials.
Heat-map painter — paintHeatMap takes a per-vertex scalar
field + colour ramp and emits a heat-map texture together with
planar UVs; consumed by
heatmaps.
// 2) Paint a 256x256 copper PBR set, upload each map, and bind them // into a SceneMaterial. Colour is sRGB; normal and metallic- // roughness are linear.
xeokit Procedural Generation
Functions to procedurally generate 3D content
Three submodules, each a pure-function library returning data ready for the SceneModel builder APIs:
GeometryArrayssuitable forSceneModel.createGeometry.MaterialMapstriple ofMaterialPixelBuffers suitable forSceneModel.createTexture+SceneModel.createMaterial.IBL.setEnvironmentImage.Shape
Features
paintMaterialspainters produce a colour + normal + metallic-roughness triple at any square texture size. Outputs are seamless under tiling, with engineering hatch metadata attached per painter for use by sectionCaps and materials.paintHeatMaptakes a per-vertex scalar field + colour ramp and emits a heat-map texture together with planar UVs; consumed by heatmaps.paintEnvironmentsreturns pre-painted equirectangular RGBA images suitable for IBL prefilter.Installation
Usage
Build a single textured sphere in a SceneModel: