Example script showing how to use glTF-Transform (https://gltf-transform.donmccurdy.com/) to divide a glTF asset — along an axis — into two GLBs, each occupying half the original bounding box. This is just a rough illustration, and has only been tested against a point cloud containing a single mesh. A production implementation would want to do more than this:
- support >2 divisions
- for primitives that lie fully in one division, don't write an empty primitive to the others
- support triangles, lines, etc.
For input with significant outliers (e.g. noisy point clouds), dividing by the center of the bounding box may give unexpected results.