@math.gl/geometry 5.0.0-alpha.8 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +97 -49
- package/README.md +16 -1
- package/THIRD-PARTY-NOTICES.md +18 -0
- package/dist/culling/constants.d.ts +3 -0
- package/dist/culling/constants.d.ts.map +1 -0
- package/dist/culling/constants.js +5 -0
- package/dist/culling/constants.js.map +1 -0
- package/dist/culling/index.cjs +2124 -0
- package/dist/culling/index.cjs.map +6 -0
- package/dist/culling/index.d.ts +31 -0
- package/dist/culling/index.d.ts.map +1 -0
- package/dist/culling/index.js +25 -0
- package/dist/culling/index.js.map +1 -0
- package/dist/culling/lib/algorithms/bounding-box-from-points.d.ts +15 -0
- package/dist/culling/lib/algorithms/bounding-box-from-points.d.ts.map +1 -0
- package/dist/culling/lib/algorithms/bounding-box-from-points.js +137 -0
- package/dist/culling/lib/algorithms/bounding-box-from-points.js.map +1 -0
- package/dist/culling/lib/algorithms/bounding-sphere-from-points.d.ts +14 -0
- package/dist/culling/lib/algorithms/bounding-sphere-from-points.d.ts.map +1 -0
- package/dist/culling/lib/algorithms/bounding-sphere-from-points.js +146 -0
- package/dist/culling/lib/algorithms/bounding-sphere-from-points.js.map +1 -0
- package/dist/culling/lib/algorithms/compute-eigen-decomposition.d.ts +37 -0
- package/dist/culling/lib/algorithms/compute-eigen-decomposition.d.ts.map +1 -0
- package/dist/culling/lib/algorithms/compute-eigen-decomposition.js +137 -0
- package/dist/culling/lib/algorithms/compute-eigen-decomposition.js.map +1 -0
- package/dist/culling/lib/algorithms/oriented-bounding-box-quaternion.d.ts +7 -0
- package/dist/culling/lib/algorithms/oriented-bounding-box-quaternion.d.ts.map +1 -0
- package/dist/culling/lib/algorithms/oriented-bounding-box-quaternion.js +26 -0
- package/dist/culling/lib/algorithms/oriented-bounding-box-quaternion.js.map +1 -0
- package/dist/culling/lib/bounding-volumes/axis-aligned-bounding-box.d.ts +56 -0
- package/dist/culling/lib/bounding-volumes/axis-aligned-bounding-box.d.ts.map +1 -0
- package/dist/culling/lib/bounding-volumes/axis-aligned-bounding-box.js +116 -0
- package/dist/culling/lib/bounding-volumes/axis-aligned-bounding-box.js.map +1 -0
- package/dist/culling/lib/bounding-volumes/bounding-sphere.d.ts +40 -0
- package/dist/culling/lib/bounding-volumes/bounding-sphere.d.ts.map +1 -0
- package/dist/culling/lib/bounding-volumes/bounding-sphere.js +123 -0
- package/dist/culling/lib/bounding-volumes/bounding-sphere.js.map +1 -0
- package/dist/culling/lib/bounding-volumes/bounding-volume.d.ts +30 -0
- package/dist/culling/lib/bounding-volumes/bounding-volume.d.ts.map +1 -0
- package/dist/culling/lib/bounding-volumes/bounding-volume.js +7 -0
- package/dist/culling/lib/bounding-volumes/bounding-volume.js.map +1 -0
- package/dist/culling/lib/bounding-volumes/oriented-bounding-box.d.ts +62 -0
- package/dist/culling/lib/bounding-volumes/oriented-bounding-box.d.ts.map +1 -0
- package/dist/culling/lib/bounding-volumes/oriented-bounding-box.js +230 -0
- package/dist/culling/lib/bounding-volumes/oriented-bounding-box.js.map +1 -0
- package/dist/culling/lib/culling-volume.d.ts +46 -0
- package/dist/culling/lib/culling-volume.d.ts.map +1 -0
- package/dist/culling/lib/culling-volume.js +126 -0
- package/dist/culling/lib/culling-volume.js.map +1 -0
- package/dist/culling/lib/perspective-frustum.d.ts +153 -0
- package/dist/culling/lib/perspective-frustum.d.ts.map +1 -0
- package/dist/culling/lib/perspective-frustum.js +191 -0
- package/dist/culling/lib/perspective-frustum.js.map +1 -0
- package/dist/culling/lib/perspective-off-center-frustum.d.ts +158 -0
- package/dist/culling/lib/perspective-off-center-frustum.d.ts.map +1 -0
- package/dist/culling/lib/perspective-off-center-frustum.js +276 -0
- package/dist/culling/lib/perspective-off-center-frustum.js.map +1 -0
- package/dist/culling/lib/plane.d.ts +35 -0
- package/dist/culling/lib/plane.d.ts.map +1 -0
- package/dist/culling/lib/plane.js +90 -0
- package/dist/culling/lib/plane.js.map +1 -0
- package/dist/culling/lib/ray.d.ts +13 -0
- package/dist/culling/lib/ray.d.ts.map +1 -0
- package/dist/culling/lib/ray.js +30 -0
- package/dist/culling/lib/ray.js.map +1 -0
- package/dist/culling/lib/shapes/box-shape.d.ts +19 -0
- package/dist/culling/lib/shapes/box-shape.d.ts.map +1 -0
- package/dist/culling/lib/shapes/box-shape.js +69 -0
- package/dist/culling/lib/shapes/box-shape.js.map +1 -0
- package/dist/culling/lib/shapes/capsule-shape.d.ts +23 -0
- package/dist/culling/lib/shapes/capsule-shape.d.ts.map +1 -0
- package/dist/culling/lib/shapes/capsule-shape.js +151 -0
- package/dist/culling/lib/shapes/capsule-shape.js.map +1 -0
- package/dist/culling/lib/shapes/cylinder-shape.d.ts +22 -0
- package/dist/culling/lib/shapes/cylinder-shape.d.ts.map +1 -0
- package/dist/culling/lib/shapes/cylinder-shape.js +99 -0
- package/dist/culling/lib/shapes/cylinder-shape.js.map +1 -0
- package/dist/culling/lib/shapes/implicit-shape.d.ts +56 -0
- package/dist/culling/lib/shapes/implicit-shape.d.ts.map +1 -0
- package/dist/culling/lib/shapes/implicit-shape.js +142 -0
- package/dist/culling/lib/shapes/implicit-shape.js.map +1 -0
- package/dist/culling/lib/shapes/plane-shape.d.ts +27 -0
- package/dist/culling/lib/shapes/plane-shape.d.ts.map +1 -0
- package/dist/culling/lib/shapes/plane-shape.js +71 -0
- package/dist/culling/lib/shapes/plane-shape.js.map +1 -0
- package/dist/culling/lib/shapes/sphere-shape.d.ts +18 -0
- package/dist/culling/lib/shapes/sphere-shape.d.ts.map +1 -0
- package/dist/culling/lib/shapes/sphere-shape.js +43 -0
- package/dist/culling/lib/shapes/sphere-shape.js.map +1 -0
- package/dist/culling/oriented-box-2d.d.ts +22 -0
- package/dist/culling/oriented-box-2d.d.ts.map +1 -0
- package/dist/culling/oriented-box-2d.js +86 -0
- package/dist/culling/oriented-box-2d.js.map +1 -0
- package/dist/culling/queries.d.ts +44 -0
- package/dist/culling/queries.d.ts.map +1 -0
- package/dist/culling/queries.js +259 -0
- package/dist/culling/queries.js.map +1 -0
- package/dist/curves/bezier-curves.d.ts +18 -0
- package/dist/curves/bezier-curves.d.ts.map +1 -0
- package/dist/curves/bezier-curves.js +54 -0
- package/dist/curves/bezier-curves.js.map +1 -0
- package/dist/curves/catmull-rom-curve.d.ts +15 -0
- package/dist/curves/catmull-rom-curve.d.ts.map +1 -0
- package/dist/curves/catmull-rom-curve.js +77 -0
- package/dist/curves/catmull-rom-curve.js.map +1 -0
- package/dist/curves/curve-arc-length.d.ts +17 -0
- package/dist/curves/curve-arc-length.d.ts.map +1 -0
- package/dist/curves/curve-arc-length.js +58 -0
- package/dist/curves/curve-arc-length.js.map +1 -0
- package/dist/curves/curve.d.ts +23 -0
- package/dist/curves/curve.d.ts.map +1 -0
- package/dist/curves/curve.js +77 -0
- package/dist/curves/curve.js.map +1 -0
- package/dist/curves/hermite-curve.d.ts +9 -0
- package/dist/curves/hermite-curve.d.ts.map +1 -0
- package/dist/curves/hermite-curve.js +24 -0
- package/dist/curves/hermite-curve.js.map +1 -0
- package/dist/curves/index.d.ts +8 -0
- package/dist/curves/index.d.ts.map +1 -0
- package/dist/curves/index.js +9 -0
- package/dist/curves/index.js.map +1 -0
- package/dist/geometries/box-geometry.js +1 -1
- package/dist/geometries/box-geometry.js.map +1 -1
- package/dist/geometries/capsule-geometry.js +1 -1
- package/dist/geometries/capsule-geometry.js.map +1 -1
- package/dist/geometries/cylinder-geometry.js +1 -1
- package/dist/geometries/cylinder-geometry.js.map +1 -1
- package/dist/geometries/geometry-helpers.js +1 -1
- package/dist/geometries/geometry-helpers.js.map +1 -1
- package/dist/geometries/ico-sphere-geometry.js +1 -1
- package/dist/geometries/ico-sphere-geometry.js.map +1 -1
- package/dist/geometries/plane-geometry.js +1 -1
- package/dist/geometries/plane-geometry.js.map +1 -1
- package/dist/geometries/primitive-mesh-builder.d.ts +24 -0
- package/dist/geometries/primitive-mesh-builder.d.ts.map +1 -0
- package/dist/geometries/primitive-mesh-builder.js +74 -0
- package/dist/geometries/primitive-mesh-builder.js.map +1 -0
- package/dist/geometries/prism-geometry.d.ts +13 -0
- package/dist/geometries/prism-geometry.d.ts.map +1 -0
- package/dist/geometries/prism-geometry.js +34 -0
- package/dist/geometries/prism-geometry.js.map +1 -0
- package/dist/geometries/ring-geometry.d.ts +15 -0
- package/dist/geometries/ring-geometry.d.ts.map +1 -0
- package/dist/geometries/ring-geometry.js +64 -0
- package/dist/geometries/ring-geometry.js.map +1 -0
- package/dist/geometries/sphere-geometry.js +1 -1
- package/dist/geometries/sphere-geometry.js.map +1 -1
- package/dist/geometries/surface-of-revolution.js +1 -1
- package/dist/geometries/surface-of-revolution.js.map +1 -1
- package/dist/geometries/truncated-cone-geometry.js +1 -1
- package/dist/geometries/truncated-cone-geometry.js.map +1 -1
- package/dist/index.cjs +5867 -16
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/geometry-utils.js +1 -1
- package/dist/lib/geometry-utils.js.map +1 -1
- package/dist/lib/geometry.d.ts +1 -1
- package/dist/lib/geometry.d.ts.map +1 -1
- package/dist/lib/geometry.js +1 -1
- package/dist/lib/geometry.js.map +1 -1
- package/dist/lib/hinge-tree.d.ts +33 -0
- package/dist/lib/hinge-tree.d.ts.map +1 -0
- package/dist/lib/hinge-tree.js +144 -0
- package/dist/lib/hinge-tree.js.map +1 -0
- package/dist/parametric/lathe-geometry.d.ts +14 -0
- package/dist/parametric/lathe-geometry.d.ts.map +1 -0
- package/dist/parametric/lathe-geometry.js +48 -0
- package/dist/parametric/lathe-geometry.js.map +1 -0
- package/dist/parametric/parametric-geometry.d.ts +20 -0
- package/dist/parametric/parametric-geometry.d.ts.map +1 -0
- package/dist/parametric/parametric-geometry.js +88 -0
- package/dist/parametric/parametric-geometry.js.map +1 -0
- package/dist/parametric/torus-geometry.d.ts +19 -0
- package/dist/parametric/torus-geometry.d.ts.map +1 -0
- package/dist/parametric/torus-geometry.js +89 -0
- package/dist/parametric/torus-geometry.js.map +1 -0
- package/dist/parametric.d.ts +7 -0
- package/dist/parametric.d.ts.map +1 -0
- package/dist/parametric.js +7 -0
- package/dist/parametric.js.map +1 -0
- package/dist/polygon/clip-triangle-mesh.d.ts +41 -0
- package/dist/polygon/clip-triangle-mesh.d.ts.map +1 -0
- package/dist/polygon/clip-triangle-mesh.js +155 -0
- package/dist/polygon/clip-triangle-mesh.js.map +1 -0
- package/dist/polygon/cut-by-grid.d.ts +24 -0
- package/dist/polygon/cut-by-grid.d.ts.map +1 -0
- package/dist/polygon/cut-by-grid.js +221 -0
- package/dist/polygon/cut-by-grid.js.map +1 -0
- package/dist/polygon/cut-by-mercator-bounds.d.ts +17 -0
- package/dist/polygon/cut-by-mercator-bounds.d.ts.map +1 -0
- package/dist/polygon/cut-by-mercator-bounds.js +149 -0
- package/dist/polygon/cut-by-mercator-bounds.js.map +1 -0
- package/dist/polygon/earcut.d.ts +13 -0
- package/dist/polygon/earcut.d.ts.map +1 -0
- package/dist/polygon/earcut.js +627 -0
- package/dist/polygon/earcut.js.map +1 -0
- package/dist/polygon/index.d.ts +14 -0
- package/dist/polygon/index.d.ts.map +1 -0
- package/dist/polygon/index.js +13 -0
- package/dist/polygon/index.js.map +1 -0
- package/dist/polygon/lineclip.d.ts +31 -0
- package/dist/polygon/lineclip.d.ts.map +1 -0
- package/dist/polygon/lineclip.js +184 -0
- package/dist/polygon/lineclip.js.map +1 -0
- package/dist/polygon/polygon-utils.d.ts +103 -0
- package/dist/polygon/polygon-utils.d.ts.map +1 -0
- package/dist/polygon/polygon-utils.js +155 -0
- package/dist/polygon/polygon-utils.js.map +1 -0
- package/dist/polygon/polygon.d.ts +41 -0
- package/dist/polygon/polygon.d.ts.map +1 -0
- package/dist/polygon/polygon.js +76 -0
- package/dist/polygon/polygon.js.map +1 -0
- package/dist/polygon/subdivide-polyline.d.ts +56 -0
- package/dist/polygon/subdivide-polyline.d.ts.map +1 -0
- package/dist/polygon/subdivide-polyline.js +141 -0
- package/dist/polygon/subdivide-polyline.js.map +1 -0
- package/dist/polygon/subdivide-triangle-mesh.d.ts +68 -0
- package/dist/polygon/subdivide-triangle-mesh.d.ts.map +1 -0
- package/dist/polygon/subdivide-triangle-mesh.js +228 -0
- package/dist/polygon/subdivide-triangle-mesh.js.map +1 -0
- package/dist/polygon/utils.d.ts +5 -0
- package/dist/polygon/utils.d.ts.map +1 -0
- package/dist/polygon/utils.js +38 -0
- package/dist/polygon/utils.js.map +1 -0
- package/dist/spatial-index/box-index.d.ts +86 -0
- package/dist/spatial-index/box-index.d.ts.map +1 -0
- package/dist/spatial-index/box-index.js +335 -0
- package/dist/spatial-index/box-index.js.map +1 -0
- package/dist/spatial-index/index.d.ts +7 -0
- package/dist/spatial-index/index.d.ts.map +1 -0
- package/dist/spatial-index/index.js +6 -0
- package/dist/spatial-index/index.js.map +1 -0
- package/dist/spatial-index/triangle-bvh.d.ts +74 -0
- package/dist/spatial-index/triangle-bvh.d.ts.map +1 -0
- package/dist/spatial-index/triangle-bvh.js +221 -0
- package/dist/spatial-index/triangle-bvh.js.map +1 -0
- package/dist/utils/attribute-compression.d.ts +50 -0
- package/dist/utils/attribute-compression.d.ts.map +1 -0
- package/dist/utils/attribute-compression.js +186 -0
- package/dist/utils/attribute-compression.js.map +1 -0
- package/dist/utils/attribute-iterator.d.ts +8 -0
- package/dist/utils/attribute-iterator.d.ts.map +1 -0
- package/dist/utils/attribute-iterator.js +25 -0
- package/dist/utils/attribute-iterator.js.map +1 -0
- package/dist/utils/compute-vertex-normals.d.ts +4 -0
- package/dist/utils/compute-vertex-normals.d.ts.map +1 -0
- package/dist/utils/compute-vertex-normals.js +54 -0
- package/dist/utils/compute-vertex-normals.js.map +1 -0
- package/dist/utils/constants.d.ts +52 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +39 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/coordinates.d.ts +3 -0
- package/dist/utils/coordinates.d.ts.map +1 -0
- package/dist/utils/coordinates.js +8 -0
- package/dist/utils/coordinates.js.map +1 -0
- package/dist/utils/geometry.d.ts +20 -0
- package/dist/utils/geometry.d.ts.map +1 -0
- package/dist/utils/geometry.js +31 -0
- package/dist/utils/geometry.js.map +1 -0
- package/dist/utils/gl-type.d.ts +17 -0
- package/dist/utils/gl-type.d.ts.map +1 -0
- package/dist/utils/gl-type.js +69 -0
- package/dist/utils/gl-type.js.map +1 -0
- package/dist/utils/index.d.ts +18 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/interpolate-packed-attributes.d.ts +43 -0
- package/dist/utils/interpolate-packed-attributes.d.ts.map +1 -0
- package/dist/utils/interpolate-packed-attributes.js +192 -0
- package/dist/utils/interpolate-packed-attributes.js.map +1 -0
- package/dist/utils/mesh-processing.d.ts +18 -0
- package/dist/utils/mesh-processing.d.ts.map +1 -0
- package/dist/utils/mesh-processing.js +300 -0
- package/dist/utils/mesh-processing.js.map +1 -0
- package/dist/utils/primitive-iterator.d.ts +21 -0
- package/dist/utils/primitive-iterator.d.ts.map +1 -0
- package/dist/utils/primitive-iterator.js +117 -0
- package/dist/utils/primitive-iterator.js.map +1 -0
- package/dist/utils/rgb565.d.ts +5 -0
- package/dist/utils/rgb565.d.ts.map +1 -0
- package/dist/utils/rgb565.js +24 -0
- package/dist/utils/rgb565.js.map +1 -0
- package/dist/utils/typed-array-utils.d.ts +3 -0
- package/dist/utils/typed-array-utils.d.ts.map +1 -0
- package/dist/utils/typed-array-utils.js +16 -0
- package/dist/utils/typed-array-utils.js.map +1 -0
- package/package.json +12 -4
- package/src/culling/constants.ts +6 -0
- package/src/culling/index.ts +55 -0
- package/src/culling/lib/algorithms/bounding-box-from-points.ts +174 -0
- package/src/culling/lib/algorithms/bounding-sphere-from-points.ts +175 -0
- package/src/culling/lib/algorithms/compute-eigen-decomposition.ts +171 -0
- package/src/culling/lib/algorithms/oriented-bounding-box-quaternion.ts +32 -0
- package/src/culling/lib/bounding-volumes/axis-aligned-bounding-box.ts +153 -0
- package/src/culling/lib/bounding-volumes/bounding-sphere.ts +154 -0
- package/src/culling/lib/bounding-volumes/bounding-volume.ts +38 -0
- package/src/culling/lib/bounding-volumes/oriented-bounding-box.ts +320 -0
- package/src/culling/lib/culling-volume.ts +163 -0
- package/src/culling/lib/perspective-frustum.ts +288 -0
- package/src/culling/lib/perspective-off-center-frustum.ts +381 -0
- package/src/culling/lib/plane.ts +118 -0
- package/src/culling/lib/ray.ts +33 -0
- package/src/culling/lib/shapes/box-shape.ts +78 -0
- package/src/culling/lib/shapes/capsule-shape.ts +232 -0
- package/src/culling/lib/shapes/cylinder-shape.ts +133 -0
- package/src/culling/lib/shapes/implicit-shape.ts +209 -0
- package/src/culling/lib/shapes/plane-shape.ts +78 -0
- package/src/culling/lib/shapes/sphere-shape.ts +60 -0
- package/src/culling/oriented-box-2d.ts +165 -0
- package/src/culling/queries.ts +332 -0
- package/src/curves/bezier-curves.ts +62 -0
- package/src/curves/catmull-rom-curve.ts +89 -0
- package/src/curves/curve-arc-length.ts +70 -0
- package/src/curves/curve.ts +96 -0
- package/src/curves/hermite-curve.ts +34 -0
- package/src/curves/index.ts +15 -0
- package/src/geometries/box-geometry.ts +1 -1
- package/src/geometries/capsule-geometry.ts +1 -1
- package/src/geometries/cylinder-geometry.ts +1 -1
- package/src/geometries/geometry-helpers.ts +1 -1
- package/src/geometries/ico-sphere-geometry.ts +1 -1
- package/src/geometries/plane-geometry.ts +1 -1
- package/src/geometries/primitive-mesh-builder.ts +84 -0
- package/src/geometries/prism-geometry.ts +57 -0
- package/src/geometries/ring-geometry.ts +102 -0
- package/src/geometries/sphere-geometry.ts +1 -1
- package/src/geometries/surface-of-revolution.ts +1 -1
- package/src/geometries/truncated-cone-geometry.ts +1 -1
- package/src/index.ts +175 -1
- package/src/lib/geometry-utils.ts +2 -2
- package/src/lib/geometry.ts +2 -2
- package/src/lib/hinge-tree.ts +170 -0
- package/src/parametric/lathe-geometry.ts +70 -0
- package/src/parametric/parametric-geometry.ts +118 -0
- package/src/parametric/torus-geometry.ts +118 -0
- package/src/parametric.ts +9 -0
- package/src/polygon/clip-triangle-mesh.ts +218 -0
- package/src/polygon/cut-by-grid.ts +313 -0
- package/src/polygon/cut-by-mercator-bounds.ts +204 -0
- package/src/polygon/earcut.ts +798 -0
- package/src/polygon/index.ts +42 -0
- package/src/polygon/lineclip.ts +218 -0
- package/src/polygon/polygon-utils.ts +273 -0
- package/src/polygon/polygon.ts +105 -0
- package/src/polygon/subdivide-polyline.ts +223 -0
- package/src/polygon/subdivide-triangle-mesh.ts +322 -0
- package/src/polygon/utils.ts +50 -0
- package/src/spatial-index/box-index.ts +452 -0
- package/src/spatial-index/index.ts +20 -0
- package/src/spatial-index/triangle-bvh.ts +345 -0
- package/src/utils/attribute-compression.ts +234 -0
- package/src/utils/attribute-iterator.ts +28 -0
- package/src/utils/compute-vertex-normals.ts +63 -0
- package/src/utils/constants.ts +42 -0
- package/src/utils/coordinates.ts +8 -0
- package/src/utils/geometry.ts +49 -0
- package/src/utils/gl-type.ts +87 -0
- package/src/utils/index.ts +55 -0
- package/src/utils/interpolate-packed-attributes.ts +284 -0
- package/src/utils/mesh-processing.ts +377 -0
- package/src/utils/primitive-iterator.ts +145 -0
- package/src/utils/rgb565.ts +26 -0
- package/src/utils/typed-array-utils.ts +16 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Portable point, line, and triangle primitive types. */
|
|
2
|
+
export declare const GL_PRIMITIVE: {
|
|
3
|
+
readonly POINTS: 0;
|
|
4
|
+
readonly LINES: 1;
|
|
5
|
+
readonly TRIANGLES: 4;
|
|
6
|
+
};
|
|
7
|
+
/** WebGL-compatible primitive topology constants. */
|
|
8
|
+
export declare const GL_PRIMITIVE_MODE: {
|
|
9
|
+
readonly POINTS: 0;
|
|
10
|
+
readonly LINES: 1;
|
|
11
|
+
readonly LINE_LOOP: 2;
|
|
12
|
+
readonly LINE_STRIP: 3;
|
|
13
|
+
readonly TRIANGLES: 4;
|
|
14
|
+
readonly TRIANGLE_STRIP: 5;
|
|
15
|
+
readonly TRIANGLE_FAN: 6;
|
|
16
|
+
};
|
|
17
|
+
/** WebGL-compatible vertex component type constants. */
|
|
18
|
+
export declare const GL_TYPE: {
|
|
19
|
+
readonly BYTE: 5120;
|
|
20
|
+
readonly UNSIGNED_BYTE: 5121;
|
|
21
|
+
readonly SHORT: 5122;
|
|
22
|
+
readonly UNSIGNED_SHORT: 5123;
|
|
23
|
+
readonly INT: 5124;
|
|
24
|
+
readonly UNSIGNED_INT: 5125;
|
|
25
|
+
readonly FLOAT: 5126;
|
|
26
|
+
readonly DOUBLE: 5130;
|
|
27
|
+
readonly UNSIGNED_SHORT_4_4_4_4: 32819;
|
|
28
|
+
readonly UNSIGNED_SHORT_5_5_5_1: 32820;
|
|
29
|
+
readonly UNSIGNED_SHORT_5_6_5: 33635;
|
|
30
|
+
};
|
|
31
|
+
/** WebGL-compatible constants used by geometry utilities. */
|
|
32
|
+
export declare const GL: {
|
|
33
|
+
readonly BYTE: 5120;
|
|
34
|
+
readonly UNSIGNED_BYTE: 5121;
|
|
35
|
+
readonly SHORT: 5122;
|
|
36
|
+
readonly UNSIGNED_SHORT: 5123;
|
|
37
|
+
readonly INT: 5124;
|
|
38
|
+
readonly UNSIGNED_INT: 5125;
|
|
39
|
+
readonly FLOAT: 5126;
|
|
40
|
+
readonly DOUBLE: 5130;
|
|
41
|
+
readonly UNSIGNED_SHORT_4_4_4_4: 32819;
|
|
42
|
+
readonly UNSIGNED_SHORT_5_5_5_1: 32820;
|
|
43
|
+
readonly UNSIGNED_SHORT_5_6_5: 33635;
|
|
44
|
+
readonly POINTS: 0;
|
|
45
|
+
readonly LINES: 1;
|
|
46
|
+
readonly LINE_LOOP: 2;
|
|
47
|
+
readonly LINE_STRIP: 3;
|
|
48
|
+
readonly TRIANGLES: 4;
|
|
49
|
+
readonly TRIANGLE_STRIP: 5;
|
|
50
|
+
readonly TRIANGLE_FAN: 6;
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAIA,0DAA0D;AAC1D,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,qDAAqD;AACrD,eAAO,MAAM,iBAAiB;;;;;;;;CAQpB,CAAC;AAEX,wDAAwD;AACxD,eAAO,MAAM,OAAO;;;;;;;;;;;;CAYV,CAAC;AAEX,6DAA6D;AAC7D,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;CAGL,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/** Portable point, line, and triangle primitive types. */
|
|
5
|
+
export const GL_PRIMITIVE = {
|
|
6
|
+
POINTS: 0x0000,
|
|
7
|
+
LINES: 0x0001,
|
|
8
|
+
TRIANGLES: 0x0004
|
|
9
|
+
};
|
|
10
|
+
/** WebGL-compatible primitive topology constants. */
|
|
11
|
+
export const GL_PRIMITIVE_MODE = {
|
|
12
|
+
POINTS: 0x0000,
|
|
13
|
+
LINES: 0x0001,
|
|
14
|
+
LINE_LOOP: 0x0002,
|
|
15
|
+
LINE_STRIP: 0x0003,
|
|
16
|
+
TRIANGLES: 0x0004,
|
|
17
|
+
TRIANGLE_STRIP: 0x0005,
|
|
18
|
+
TRIANGLE_FAN: 0x0006
|
|
19
|
+
};
|
|
20
|
+
/** WebGL-compatible vertex component type constants. */
|
|
21
|
+
export const GL_TYPE = {
|
|
22
|
+
BYTE: 5120,
|
|
23
|
+
UNSIGNED_BYTE: 5121,
|
|
24
|
+
SHORT: 5122,
|
|
25
|
+
UNSIGNED_SHORT: 5123,
|
|
26
|
+
INT: 5124,
|
|
27
|
+
UNSIGNED_INT: 5125,
|
|
28
|
+
FLOAT: 5126,
|
|
29
|
+
DOUBLE: 5130,
|
|
30
|
+
UNSIGNED_SHORT_4_4_4_4: 32819,
|
|
31
|
+
UNSIGNED_SHORT_5_5_5_1: 32820,
|
|
32
|
+
UNSIGNED_SHORT_5_6_5: 33635
|
|
33
|
+
};
|
|
34
|
+
/** WebGL-compatible constants used by geometry utilities. */
|
|
35
|
+
export const GL = {
|
|
36
|
+
...GL_PRIMITIVE_MODE,
|
|
37
|
+
...GL_TYPE
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,0DAA0D;AAC1D,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,MAAM;CACT,CAAC;AAEX,qDAAqD;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;IACb,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE,MAAM;IACjB,cAAc,EAAE,MAAM;IACtB,YAAY,EAAE,MAAM;CACZ,CAAC;AAEX,wDAAwD;AACxD,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,IAAI,EAAE,IAAI;IACV,aAAa,EAAE,IAAI;IACnB,KAAK,EAAE,IAAI;IACX,cAAc,EAAE,IAAI;IACpB,GAAG,EAAE,IAAI;IACT,YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,IAAI;IACX,MAAM,EAAE,IAAI;IACZ,sBAAsB,EAAE,KAAK;IAC7B,sBAAsB,EAAE,KAAK;IAC7B,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX,6DAA6D;AAC7D,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,GAAG,iBAAiB;IACpB,GAAG,OAAO;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.d.ts","sourceRoot":"","sources":["../../src/utils/coordinates.ts"],"names":[],"mappings":"AAIA,wDAAwD;AACxD,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE1C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/** Wraps a number into the half-open range `[0, 1)`. */
|
|
5
|
+
export function emod(value) {
|
|
6
|
+
return ((value % 1) + 1) % 1;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=coordinates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinates.js","sourceRoot":"","sources":["../../src/utils/coordinates.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,wDAAwD;AACxD,MAAM,UAAU,IAAI,CAAC,KAAa;IAChC,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TypedArray } from '@math.gl/core';
|
|
2
|
+
/** A typed geometry attribute with either loaders.gl-style `value` or legacy `values` storage. */
|
|
3
|
+
export type GeometryAttribute = {
|
|
4
|
+
value?: TypedArray;
|
|
5
|
+
values?: TypedArray;
|
|
6
|
+
size?: number;
|
|
7
|
+
};
|
|
8
|
+
/** Minimal geometry shape understood by the geometry utilities. */
|
|
9
|
+
export type Geometry = {
|
|
10
|
+
mode: number;
|
|
11
|
+
indices?: GeometryAttribute | TypedArray;
|
|
12
|
+
attributes: Record<string, GeometryAttribute>;
|
|
13
|
+
};
|
|
14
|
+
/** Returns whether a value has the minimal geometry shape. */
|
|
15
|
+
export declare function isGeometry(value: unknown): value is Geometry;
|
|
16
|
+
/** Returns the typed array stored in a geometry attribute. */
|
|
17
|
+
export declare function getAttributeValues(attribute: GeometryAttribute | TypedArray): TypedArray;
|
|
18
|
+
/** Returns a geometry's position attribute. */
|
|
19
|
+
export declare function getPositionAttribute(geometry: Geometry): GeometryAttribute;
|
|
20
|
+
//# sourceMappingURL=geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../src/utils/geometry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAE9C,kGAAkG;AAClG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,mEAAmE;AACnE,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,iBAAiB,GAAG,UAAU,CAAC;IACzC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;CAC/C,CAAC;AAEF,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAM5D;AAED,8DAA8D;AAC9D,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,iBAAiB,GAAG,UAAU,GAAG,UAAU,CASxF;AAED,+CAA+C;AAC/C,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,iBAAiB,CAM1E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
/** Returns whether a value has the minimal geometry shape. */
|
|
5
|
+
export function isGeometry(value) {
|
|
6
|
+
if (!value || typeof value !== 'object') {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
const geometry = value;
|
|
10
|
+
return typeof geometry.mode === 'number' && Boolean(geometry.attributes);
|
|
11
|
+
}
|
|
12
|
+
/** Returns the typed array stored in a geometry attribute. */
|
|
13
|
+
export function getAttributeValues(attribute) {
|
|
14
|
+
if (ArrayBuffer.isView(attribute)) {
|
|
15
|
+
return attribute;
|
|
16
|
+
}
|
|
17
|
+
const values = attribute.value || attribute.values;
|
|
18
|
+
if (!values) {
|
|
19
|
+
throw new Error('Geometry attribute does not contain typed-array values');
|
|
20
|
+
}
|
|
21
|
+
return values;
|
|
22
|
+
}
|
|
23
|
+
/** Returns a geometry's position attribute. */
|
|
24
|
+
export function getPositionAttribute(geometry) {
|
|
25
|
+
const position = geometry.attributes['POSITION'] || geometry.attributes['positions'];
|
|
26
|
+
if (!position) {
|
|
27
|
+
throw new Error('Geometry does not contain a position attribute');
|
|
28
|
+
}
|
|
29
|
+
return position;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=geometry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometry.js","sourceRoot":"","sources":["../../src/utils/geometry.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAkB5D,8DAA8D;AAC9D,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,QAAQ,GAAG,KAA0B,CAAC;IAC5C,OAAO,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC3E,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,kBAAkB,CAAC,SAAyC;IAC1E,IAAI,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QAClC,OAAO,SAAuB,CAAC;IACjC,CAAC;IACD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,IAAI,SAAS,CAAC,MAAM,CAAC;IACnD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,oBAAoB,CAAC,QAAkB;IACrD,MAAM,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACrF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TypedArray, TypedArrayConstructor } from '@math.gl/core';
|
|
2
|
+
/** Converts between WebGL component constants and JavaScript typed arrays. */
|
|
3
|
+
export default class GLType {
|
|
4
|
+
/** Returns the WebGL component constant for a typed array or typed-array constructor. */
|
|
5
|
+
static fromTypedArray(arrayOrType: TypedArray | TypedArrayConstructor): number;
|
|
6
|
+
/** Returns a WebGL component constant from its uppercase name. */
|
|
7
|
+
static fromName(name: string): number;
|
|
8
|
+
/** Returns the typed-array constructor for a WebGL component constant. */
|
|
9
|
+
static getArrayType(glType: number): TypedArrayConstructor;
|
|
10
|
+
/** Returns the size in bytes of one element of a WebGL component type. */
|
|
11
|
+
static getByteSize(glType: number): number;
|
|
12
|
+
/** Returns whether a value is a supported WebGL component type. */
|
|
13
|
+
static validate(glType: number): boolean;
|
|
14
|
+
/** Creates a typed view over an ArrayBuffer or an existing ArrayBuffer view. */
|
|
15
|
+
static createTypedArray(glType: number, buffer: ArrayBufferLike | ArrayBufferView, byteOffset?: number, length?: number): TypedArray;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=gl-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gl-type.d.ts","sourceRoot":"","sources":["../../src/utils/gl-type.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,eAAe,CAAC;AAuBrE,8EAA8E;AAC9E,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,yFAAyF;IACzF,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,UAAU,GAAG,qBAAqB,GAAG,MAAM;IAa9E,kEAAkE;IAClE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAQrC,0EAA0E;IAC1E,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,qBAAqB;IAQ1D,0EAA0E;IAC1E,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;IAI1C,mEAAmE;IACnE,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIxC,gFAAgF;IAChF,MAAM,CAAC,gBAAgB,CACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,eAAe,GAAG,eAAe,EACzC,UAAU,SAAI,EACd,MAAM,CAAC,EAAE,MAAM,GACd,UAAU;CASd"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
import { GL_TYPE } from "./constants.js";
|
|
5
|
+
const GL_TYPE_TO_ARRAY_TYPE = {
|
|
6
|
+
[GL_TYPE.DOUBLE]: Float64Array,
|
|
7
|
+
[GL_TYPE.FLOAT]: Float32Array,
|
|
8
|
+
[GL_TYPE.UNSIGNED_SHORT]: Uint16Array,
|
|
9
|
+
[GL_TYPE.UNSIGNED_INT]: Uint32Array,
|
|
10
|
+
[GL_TYPE.UNSIGNED_BYTE]: Uint8Array,
|
|
11
|
+
[GL_TYPE.BYTE]: Int8Array,
|
|
12
|
+
[GL_TYPE.SHORT]: Int16Array,
|
|
13
|
+
[GL_TYPE.INT]: Int32Array,
|
|
14
|
+
[GL_TYPE.UNSIGNED_SHORT_4_4_4_4]: Uint16Array,
|
|
15
|
+
[GL_TYPE.UNSIGNED_SHORT_5_5_5_1]: Uint16Array,
|
|
16
|
+
[GL_TYPE.UNSIGNED_SHORT_5_6_5]: Uint16Array
|
|
17
|
+
};
|
|
18
|
+
const NAME_TO_GL_TYPE = Object.fromEntries(Object.entries(GL_TYPE).map(([name, glType]) => [name, glType]));
|
|
19
|
+
const TYPE_CONVERSION_ERROR = 'Failed to convert GL type';
|
|
20
|
+
/** Converts between WebGL component constants and JavaScript typed arrays. */
|
|
21
|
+
export default class GLType {
|
|
22
|
+
/** Returns the WebGL component constant for a typed array or typed-array constructor. */
|
|
23
|
+
static fromTypedArray(arrayOrType) {
|
|
24
|
+
const arrayType = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;
|
|
25
|
+
if (arrayType === Uint8ClampedArray) {
|
|
26
|
+
return GL_TYPE.UNSIGNED_BYTE;
|
|
27
|
+
}
|
|
28
|
+
for (const [glType, candidateArrayType] of Object.entries(GL_TYPE_TO_ARRAY_TYPE)) {
|
|
29
|
+
if (candidateArrayType === arrayType) {
|
|
30
|
+
return Number(glType);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
throw new Error(TYPE_CONVERSION_ERROR);
|
|
34
|
+
}
|
|
35
|
+
/** Returns a WebGL component constant from its uppercase name. */
|
|
36
|
+
static fromName(name) {
|
|
37
|
+
const glType = NAME_TO_GL_TYPE[name];
|
|
38
|
+
if (glType === undefined) {
|
|
39
|
+
throw new Error(TYPE_CONVERSION_ERROR);
|
|
40
|
+
}
|
|
41
|
+
return glType;
|
|
42
|
+
}
|
|
43
|
+
/** Returns the typed-array constructor for a WebGL component constant. */
|
|
44
|
+
static getArrayType(glType) {
|
|
45
|
+
const ArrayType = GL_TYPE_TO_ARRAY_TYPE[glType];
|
|
46
|
+
if (!ArrayType) {
|
|
47
|
+
throw new Error(TYPE_CONVERSION_ERROR);
|
|
48
|
+
}
|
|
49
|
+
return ArrayType;
|
|
50
|
+
}
|
|
51
|
+
/** Returns the size in bytes of one element of a WebGL component type. */
|
|
52
|
+
static getByteSize(glType) {
|
|
53
|
+
return GLType.getArrayType(glType).BYTES_PER_ELEMENT;
|
|
54
|
+
}
|
|
55
|
+
/** Returns whether a value is a supported WebGL component type. */
|
|
56
|
+
static validate(glType) {
|
|
57
|
+
return Boolean(GL_TYPE_TO_ARRAY_TYPE[glType]);
|
|
58
|
+
}
|
|
59
|
+
/** Creates a typed view over an ArrayBuffer or an existing ArrayBuffer view. */
|
|
60
|
+
static createTypedArray(glType, buffer, byteOffset = 0, length) {
|
|
61
|
+
const ArrayType = GLType.getArrayType(glType);
|
|
62
|
+
const arrayBuffer = ArrayBuffer.isView(buffer) ? buffer.buffer : buffer;
|
|
63
|
+
const viewByteOffset = ArrayBuffer.isView(buffer) ? buffer.byteOffset : 0;
|
|
64
|
+
const resolvedByteOffset = viewByteOffset + byteOffset;
|
|
65
|
+
const resolvedLength = length ?? Math.floor((buffer.byteLength - byteOffset) / ArrayType.BYTES_PER_ELEMENT);
|
|
66
|
+
return new ArrayType(arrayBuffer, resolvedByteOffset, resolvedLength);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=gl-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gl-type.js","sourceRoot":"","sources":["../../src/utils/gl-type.ts"],"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AW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;QACxE,MAAM,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1E,MAAM,kBAAkB,GAAG,cAAc,GAAG,UAAU,CAAC;QACvD,MAAM,cAAc,GAClB,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAAC;QACvF,OAAO,IAAI,SAAS,CAAC,WAA0B,EAAE,kBAAkB,EAAE,cAAc,CAAC,CAAC;IACvF,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type { TypedArray, TypedArrayConstructor } from '@math.gl/core';
|
|
2
|
+
export { GL, GL_TYPE, GL_PRIMITIVE, GL_PRIMITIVE_MODE } from "./constants.js";
|
|
3
|
+
export { default as GLType } from "./gl-type.js";
|
|
4
|
+
export type { Geometry, GeometryAttribute } from "./geometry.js";
|
|
5
|
+
export { isGeometry } from "./geometry.js";
|
|
6
|
+
export type { Primitive } from "./primitive-iterator.js";
|
|
7
|
+
export { makeAttributeIterator } from "./attribute-iterator.js";
|
|
8
|
+
export { makePrimitiveIterator } from "./primitive-iterator.js";
|
|
9
|
+
export { computeVertexNormals } from "./compute-vertex-normals.js";
|
|
10
|
+
export { encodeRGB565, decodeRGB565 } from "./rgb565.js";
|
|
11
|
+
export { concatTypedArrays } from "./typed-array-utils.js";
|
|
12
|
+
export { octEncodeInRange, octEncode, octEncodeToVector4, octDecodeInRange, octDecode, octDecodeFromVector4, octPackFloat, octEncodeFloat, octDecodeFloat, octPack, octUnpack, compressTextureCoordinates, decompressTextureCoordinates, zigZagDeltaDecode } from "./attribute-compression.js";
|
|
13
|
+
export { emod } from "./coordinates.js";
|
|
14
|
+
export { transformGeometry, mergeGeometries, weldGeometry, getDegenerateTriangles } from "./mesh-processing.js";
|
|
15
|
+
export type { WeldGeometryOptions, WeldGeometryResult } from "./mesh-processing.js";
|
|
16
|
+
export { interpolatePackedAttributes } from "./interpolate-packed-attributes.js";
|
|
17
|
+
export type { PackedAttributeType, PackedAttributeInterpolation, PackedAttribute, AttributeInterpolationProvenance, PackedAttributeInterpolationOptions } from "./interpolate-packed-attributes.js";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAC,UAAU,EAAE,qBAAqB,EAAC,MAAM,eAAe,CAAC;AAErE,OAAO,EAAC,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAC,uBAAoB;AACzE,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,qBAAkB;AAE5C,YAAY,EAAC,QAAQ,EAAE,iBAAiB,EAAC,sBAAmB;AAC5D,OAAO,EAAC,UAAU,EAAC,sBAAmB;AAEtC,YAAY,EAAC,SAAS,EAAC,gCAA6B;AACpD,OAAO,EAAC,qBAAqB,EAAC,gCAA6B;AAC3D,OAAO,EAAC,qBAAqB,EAAC,gCAA6B;AAC3D,OAAO,EAAC,oBAAoB,EAAC,oCAAiC;AAE9D,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,oBAAiB;AACpD,OAAO,EAAC,iBAAiB,EAAC,+BAA4B;AAEtD,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,OAAO,EACP,SAAS,EACT,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EAClB,mCAAgC;AAEjC,OAAO,EAAC,IAAI,EAAC,yBAAsB;AAEnC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,sBAAsB,EACvB,6BAA0B;AAC3B,YAAY,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,6BAA0B;AAE/E,OAAO,EAAC,2BAA2B,EAAC,2CAAwC;AAC5E,YAAY,EACV,mBAAmB,EACnB,4BAA4B,EAC5B,eAAe,EACf,gCAAgC,EAChC,mCAAmC,EACpC,2CAAwC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
export { GL, GL_TYPE, GL_PRIMITIVE, GL_PRIMITIVE_MODE } from "./constants.js";
|
|
5
|
+
export { default as GLType } from "./gl-type.js";
|
|
6
|
+
export { isGeometry } from "./geometry.js";
|
|
7
|
+
export { makeAttributeIterator } from "./attribute-iterator.js";
|
|
8
|
+
export { makePrimitiveIterator } from "./primitive-iterator.js";
|
|
9
|
+
export { computeVertexNormals } from "./compute-vertex-normals.js";
|
|
10
|
+
export { encodeRGB565, decodeRGB565 } from "./rgb565.js";
|
|
11
|
+
export { concatTypedArrays } from "./typed-array-utils.js";
|
|
12
|
+
export { octEncodeInRange, octEncode, octEncodeToVector4, octDecodeInRange, octDecode, octDecodeFromVector4, octPackFloat, octEncodeFloat, octDecodeFloat, octPack, octUnpack, compressTextureCoordinates, decompressTextureCoordinates, zigZagDeltaDecode } from "./attribute-compression.js";
|
|
13
|
+
export { emod } from "./coordinates.js";
|
|
14
|
+
export { transformGeometry, mergeGeometries, weldGeometry, getDegenerateTriangles } from "./mesh-processing.js";
|
|
15
|
+
export { interpolatePackedAttributes } from "./interpolate-packed-attributes.js";
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAI5D,OAAO,EAAC,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAC,uBAAoB;AACzE,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,qBAAkB;AAG5C,OAAO,EAAC,UAAU,EAAC,sBAAmB;AAGtC,OAAO,EAAC,qBAAqB,EAAC,gCAA6B;AAC3D,OAAO,EAAC,qBAAqB,EAAC,gCAA6B;AAC3D,OAAO,EAAC,oBAAoB,EAAC,oCAAiC;AAE9D,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,oBAAiB;AACpD,OAAO,EAAC,iBAAiB,EAAC,+BAA4B;AAEtD,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,OAAO,EACP,SAAS,EACT,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EAClB,mCAAgC;AAEjC,OAAO,EAAC,IAAI,EAAC,yBAAsB;AAEnC,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,sBAAsB,EACvB,6BAA0B;AAG3B,OAAO,EAAC,2BAA2B,EAAC,2CAAwC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Scalar storage formats supported by packed attribute interpolation. */
|
|
2
|
+
export type PackedAttributeType = 'int8' | 'uint8' | 'int16' | 'uint16' | 'int32' | 'uint32' | 'float32' | 'float64';
|
|
3
|
+
/** Interpolate numeric values, or require identical values at every contributing vertex. */
|
|
4
|
+
export type PackedAttributeInterpolation = 'linear' | 'flat';
|
|
5
|
+
/** One explicitly described attribute inside an interleaved vertex record. */
|
|
6
|
+
export type PackedAttribute = {
|
|
7
|
+
/** Scalar storage format; values are interpolated in the encoded domain. */
|
|
8
|
+
type: PackedAttributeType;
|
|
9
|
+
/** Number of scalar components. */
|
|
10
|
+
size: number;
|
|
11
|
+
/** Byte offset within each record; unaligned offsets are supported. */
|
|
12
|
+
byteOffset: number;
|
|
13
|
+
/** Policy for the whole attribute, or one explicit policy per component. */
|
|
14
|
+
interpolation: PackedAttributeInterpolation | readonly PackedAttributeInterpolation[];
|
|
15
|
+
};
|
|
16
|
+
/** Three original source indices and corresponding weights per output vertex. */
|
|
17
|
+
export type AttributeInterpolationProvenance = {
|
|
18
|
+
/** Indices into the original source records, matching polygon subdivision provenance. */
|
|
19
|
+
sourceVertexIndices: ArrayLike<number>;
|
|
20
|
+
/** Nonnegative finite weights summing to one per triplet; zero-weight indices are ignored. */
|
|
21
|
+
sourceVertexWeights: ArrayLike<number>;
|
|
22
|
+
};
|
|
23
|
+
/** Byte layout, interpolation policies and output allocation limit. */
|
|
24
|
+
export type PackedAttributeInterpolationOptions = {
|
|
25
|
+
/** Positive byte length of a source and output vertex record. */
|
|
26
|
+
byteStride: number;
|
|
27
|
+
/** Nonoverlapping attribute ranges. Unlisted bytes are copied from the first contributor. */
|
|
28
|
+
attributes: readonly PackedAttribute[];
|
|
29
|
+
/** Byte order for multibyte components. Default true. */
|
|
30
|
+
littleEndian?: boolean;
|
|
31
|
+
/** Maximum allocated output byte length. Default 64 MiB; zero permits empty output only. */
|
|
32
|
+
maxOutputBytes?: number;
|
|
33
|
+
};
|
|
34
|
+
/** Reconstruct interleaved attributes from subdivision's original-vertex provenance.
|
|
35
|
+
* Inputs are never modified. Linear integer components use Math.round once at final output;
|
|
36
|
+
* this is deliberately not repeated midpoint quantization. Flat components reject differing
|
|
37
|
+
* contributing values instead of guessing categorical semantics. Padding and unlisted bytes
|
|
38
|
+
* come from the first positive-weight contributor. Normals are not renormalized, and normalized
|
|
39
|
+
* GPU formats are not decoded. Duplicate source records at attribute seams before subdivision.
|
|
40
|
+
* @throws RangeError For invalid layout, provenance, nonfinite values or allocation limits.
|
|
41
|
+
*/
|
|
42
|
+
export declare function interpolatePackedAttributes(source: Uint8Array, provenance: AttributeInterpolationProvenance, options: PackedAttributeInterpolationOptions): Uint8Array;
|
|
43
|
+
//# sourceMappingURL=interpolate-packed-attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolate-packed-attributes.d.ts","sourceRoot":"","sources":["../../src/utils/interpolate-packed-attributes.ts"],"names":[],"mappings":"AAIA,0EAA0E;AAC1E,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,GACT,SAAS,CAAC;AAEd,4FAA4F;AAC5F,MAAM,MAAM,4BAA4B,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE7D,8EAA8E;AAC9E,MAAM,MAAM,eAAe,GAAG;IAC5B,4EAA4E;IAC5E,IAAI,EAAE,mBAAmB,CAAC;IAC1B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,aAAa,EAAE,4BAA4B,GAAG,SAAS,4BAA4B,EAAE,CAAC;CACvF,CAAC;AAEF,iFAAiF;AACjF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,yFAAyF;IACzF,mBAAmB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACvC,8FAA8F;IAC9F,mBAAmB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CACxC,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,mCAAmC,GAAG;IAChD,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,6FAA6F;IAC7F,UAAU,EAAE,SAAS,eAAe,EAAE,CAAC;IACvC,yDAAyD;IACzD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4FAA4F;IAC5F,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAaF;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,UAAU,EAClB,UAAU,EAAE,gCAAgC,EAC5C,OAAO,EAAE,mCAAmC,GAC3C,UAAU,CA2IZ"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
// math.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
|
|
4
|
+
const BYTE_SIZES = {
|
|
5
|
+
int8: 1,
|
|
6
|
+
uint8: 1,
|
|
7
|
+
int16: 2,
|
|
8
|
+
uint16: 2,
|
|
9
|
+
int32: 4,
|
|
10
|
+
uint32: 4,
|
|
11
|
+
float32: 4,
|
|
12
|
+
float64: 8
|
|
13
|
+
};
|
|
14
|
+
/** Reconstruct interleaved attributes from subdivision's original-vertex provenance.
|
|
15
|
+
* Inputs are never modified. Linear integer components use Math.round once at final output;
|
|
16
|
+
* this is deliberately not repeated midpoint quantization. Flat components reject differing
|
|
17
|
+
* contributing values instead of guessing categorical semantics. Padding and unlisted bytes
|
|
18
|
+
* come from the first positive-weight contributor. Normals are not renormalized, and normalized
|
|
19
|
+
* GPU formats are not decoded. Duplicate source records at attribute seams before subdivision.
|
|
20
|
+
* @throws RangeError For invalid layout, provenance, nonfinite values or allocation limits.
|
|
21
|
+
*/
|
|
22
|
+
export function interpolatePackedAttributes(source, provenance, options) {
|
|
23
|
+
const { byteStride, attributes, littleEndian = true, maxOutputBytes = 64 * 1024 * 1024 } = options;
|
|
24
|
+
const { sourceVertexIndices, sourceVertexWeights } = provenance;
|
|
25
|
+
if (!Number.isSafeInteger(byteStride) ||
|
|
26
|
+
byteStride <= 0 ||
|
|
27
|
+
source.byteLength % byteStride ||
|
|
28
|
+
!Array.isArray(options.attributes) ||
|
|
29
|
+
typeof littleEndian !== 'boolean' ||
|
|
30
|
+
!Number.isSafeInteger(maxOutputBytes) ||
|
|
31
|
+
maxOutputBytes < 0 ||
|
|
32
|
+
!Number.isSafeInteger(sourceVertexIndices.length) ||
|
|
33
|
+
sourceVertexIndices.length < 0 ||
|
|
34
|
+
sourceVertexIndices.length % 3 ||
|
|
35
|
+
sourceVertexIndices.length !== sourceVertexWeights.length) {
|
|
36
|
+
throw new RangeError('Invalid packed attribute layout or provenance lengths');
|
|
37
|
+
}
|
|
38
|
+
const outputCount = sourceVertexIndices.length / 3;
|
|
39
|
+
const outputBytes = outputCount * byteStride;
|
|
40
|
+
if (!Number.isSafeInteger(outputBytes) || outputBytes > maxOutputBytes) {
|
|
41
|
+
throw new RangeError('Packed attribute interpolation exceeded maxOutputBytes');
|
|
42
|
+
}
|
|
43
|
+
const ranges = [];
|
|
44
|
+
for (const attribute of attributes) {
|
|
45
|
+
if (!attribute ||
|
|
46
|
+
typeof attribute !== 'object' ||
|
|
47
|
+
!Object.prototype.hasOwnProperty.call(BYTE_SIZES, attribute.type) ||
|
|
48
|
+
!Number.isSafeInteger(attribute.size) ||
|
|
49
|
+
attribute.size <= 0 ||
|
|
50
|
+
!Number.isSafeInteger(attribute.byteOffset) ||
|
|
51
|
+
attribute.byteOffset < 0) {
|
|
52
|
+
throw new RangeError('Invalid packed attribute descriptor');
|
|
53
|
+
}
|
|
54
|
+
const end = attribute.byteOffset + attribute.size * BYTE_SIZES[attribute.type];
|
|
55
|
+
if (!Number.isSafeInteger(end) ||
|
|
56
|
+
end > byteStride ||
|
|
57
|
+
ranges.some(([start, previousEnd]) => attribute.byteOffset < previousEnd && end > start)) {
|
|
58
|
+
throw new RangeError('Packed attribute ranges must fit the stride and not overlap');
|
|
59
|
+
}
|
|
60
|
+
ranges.push([attribute.byteOffset, end]);
|
|
61
|
+
if (typeof attribute.interpolation === 'string') {
|
|
62
|
+
validateInterpolation(attribute.interpolation);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
if (!Array.isArray(attribute.interpolation) ||
|
|
66
|
+
attribute.interpolation.length !== attribute.size) {
|
|
67
|
+
throw new RangeError('Expected one interpolation policy per component');
|
|
68
|
+
}
|
|
69
|
+
for (let component = 0; component < attribute.size; component++) {
|
|
70
|
+
validateInterpolation(attribute.interpolation[component]);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const sourceCount = source.byteLength / byteStride;
|
|
75
|
+
const input = new DataView(source.buffer, source.byteOffset, source.byteLength);
|
|
76
|
+
const output = new Uint8Array(outputBytes);
|
|
77
|
+
const result = new DataView(output.buffer);
|
|
78
|
+
for (let vertex = 0; vertex < outputCount; vertex++) {
|
|
79
|
+
let sum = 0;
|
|
80
|
+
let firstSource = -1;
|
|
81
|
+
let contributors = 0;
|
|
82
|
+
for (let slot = 0; slot < 3; slot++) {
|
|
83
|
+
const weight = sourceVertexWeights[vertex * 3 + slot];
|
|
84
|
+
const index = sourceVertexIndices[vertex * 3 + slot];
|
|
85
|
+
if (!Number.isFinite(weight) ||
|
|
86
|
+
weight < 0 ||
|
|
87
|
+
weight > 1 ||
|
|
88
|
+
(weight > 0 && (!Number.isSafeInteger(index) || index < 0 || index >= sourceCount))) {
|
|
89
|
+
throw new RangeError('Invalid contributing source index or interpolation weight');
|
|
90
|
+
}
|
|
91
|
+
if (weight > 0) {
|
|
92
|
+
contributors++;
|
|
93
|
+
if (firstSource < 0)
|
|
94
|
+
firstSource = index;
|
|
95
|
+
}
|
|
96
|
+
sum += weight;
|
|
97
|
+
}
|
|
98
|
+
if (firstSource < 0 || Math.abs(sum - 1) > 1e-10) {
|
|
99
|
+
throw new RangeError('Interpolation weights must sum to one');
|
|
100
|
+
}
|
|
101
|
+
output.set(source.subarray(firstSource * byteStride, (firstSource + 1) * byteStride), vertex * byteStride);
|
|
102
|
+
for (const attribute of attributes) {
|
|
103
|
+
for (let component = 0; component < attribute.size; component++) {
|
|
104
|
+
const offset = attribute.byteOffset + component * BYTE_SIZES[attribute.type];
|
|
105
|
+
const policy = typeof attribute.interpolation === 'string'
|
|
106
|
+
? attribute.interpolation
|
|
107
|
+
: attribute.interpolation[component];
|
|
108
|
+
const firstValue = readComponent(input, firstSource * byteStride + offset, attribute.type, littleEndian);
|
|
109
|
+
let value = 0;
|
|
110
|
+
for (let slot = 0; slot < 3; slot++) {
|
|
111
|
+
const weight = sourceVertexWeights[vertex * 3 + slot];
|
|
112
|
+
if (weight === 0)
|
|
113
|
+
continue;
|
|
114
|
+
const sourceValue = readComponent(input, sourceVertexIndices[vertex * 3 + slot] * byteStride + offset, attribute.type, littleEndian);
|
|
115
|
+
if (!Number.isFinite(sourceValue))
|
|
116
|
+
throw new RangeError('Packed attributes must be finite');
|
|
117
|
+
if (policy === 'flat' && sourceValue !== firstValue) {
|
|
118
|
+
throw new RangeError('Flat attribute contributors must agree');
|
|
119
|
+
}
|
|
120
|
+
value += sourceValue * weight;
|
|
121
|
+
}
|
|
122
|
+
if (policy === 'linear') {
|
|
123
|
+
if (!Number.isFinite(value))
|
|
124
|
+
throw new RangeError('Interpolated attributes must be finite');
|
|
125
|
+
// Identity provenance preserves every original encoded bit, including signed zero.
|
|
126
|
+
if (contributors !== 1 || sum !== 1) {
|
|
127
|
+
writeComponent(result, vertex * byteStride + offset, attribute.type, value, littleEndian);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return output;
|
|
134
|
+
}
|
|
135
|
+
/** Reject implicit or unknown interpolation semantics. */
|
|
136
|
+
function validateInterpolation(interpolation) {
|
|
137
|
+
if (interpolation !== 'linear' && interpolation !== 'flat') {
|
|
138
|
+
throw new RangeError('Expected linear or flat interpolation');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** Read an encoded scalar relative to the source view, including its byte offset. */
|
|
142
|
+
function readComponent(view, offset, type, littleEndian) {
|
|
143
|
+
switch (type) {
|
|
144
|
+
case 'int8':
|
|
145
|
+
return view.getInt8(offset);
|
|
146
|
+
case 'uint8':
|
|
147
|
+
return view.getUint8(offset);
|
|
148
|
+
case 'int16':
|
|
149
|
+
return view.getInt16(offset, littleEndian);
|
|
150
|
+
case 'uint16':
|
|
151
|
+
return view.getUint16(offset, littleEndian);
|
|
152
|
+
case 'int32':
|
|
153
|
+
return view.getInt32(offset, littleEndian);
|
|
154
|
+
case 'uint32':
|
|
155
|
+
return view.getUint32(offset, littleEndian);
|
|
156
|
+
case 'float32':
|
|
157
|
+
return view.getFloat32(offset, littleEndian);
|
|
158
|
+
case 'float64':
|
|
159
|
+
return view.getFloat64(offset, littleEndian);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** Write one final interpolated scalar, rounding integer encodings consistently. */
|
|
163
|
+
function writeComponent(view, offset, type, value, littleEndian) {
|
|
164
|
+
const integer = Math.round(value);
|
|
165
|
+
switch (type) {
|
|
166
|
+
case 'int8':
|
|
167
|
+
view.setInt8(offset, integer);
|
|
168
|
+
break;
|
|
169
|
+
case 'uint8':
|
|
170
|
+
view.setUint8(offset, integer);
|
|
171
|
+
break;
|
|
172
|
+
case 'int16':
|
|
173
|
+
view.setInt16(offset, integer, littleEndian);
|
|
174
|
+
break;
|
|
175
|
+
case 'uint16':
|
|
176
|
+
view.setUint16(offset, integer, littleEndian);
|
|
177
|
+
break;
|
|
178
|
+
case 'int32':
|
|
179
|
+
view.setInt32(offset, integer, littleEndian);
|
|
180
|
+
break;
|
|
181
|
+
case 'uint32':
|
|
182
|
+
view.setUint32(offset, integer, littleEndian);
|
|
183
|
+
break;
|
|
184
|
+
case 'float32':
|
|
185
|
+
view.setFloat32(offset, value, littleEndian);
|
|
186
|
+
break;
|
|
187
|
+
case 'float64':
|
|
188
|
+
view.setFloat64(offset, value, littleEndian);
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=interpolate-packed-attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interpolate-packed-attributes.js","sourceRoot":"","sources":["../../src/utils/interpolate-packed-attributes.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAgD5D,MAAM,UAAU,GAAwC;IACtD,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,C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O,CAAC,CAAC;YAC/B,MAAM;QACR,KAAK,OAAO;YACV,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;YAC7C,MAAM;QACR,KAAK,QAAQ;YACX,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;YAC9C,MAAM;QACR,KAAK,OAAO;YACV,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;YAC7C,MAAM;QACR,KAAK,QAAQ;YACX,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC;YAC9C,MAAM;QACR,KAAK,SAAS;YACZ,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;YAC7C,MAAM;QACR,KAAK,SAAS;YACZ,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;YAC7C,MAAM;IACV,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Geometry } from "./geometry.js";
|
|
2
|
+
/** Fresh, indexed triangle-list geometry. No input buffers are changed. */
|
|
3
|
+
export declare function transformGeometry(geometry: Geometry, matrix: Readonly<ArrayLike<number>>): Geometry;
|
|
4
|
+
/** Concatenates compatible triangle meshes and offsets vertex indices. */
|
|
5
|
+
export declare function mergeGeometries(geometries: readonly Geometry[]): Geometry;
|
|
6
|
+
export type WeldGeometryOptions = {
|
|
7
|
+
/** Position quantization step; zero means exact matching. */ positionGridSize?: number;
|
|
8
|
+
};
|
|
9
|
+
export type WeldGeometryResult = {
|
|
10
|
+
geometry: Geometry;
|
|
11
|
+
vertexMap: Uint32Array;
|
|
12
|
+
removedVertices: number;
|
|
13
|
+
};
|
|
14
|
+
/** Welds full attribute tuples, preserving UV seams and hard normal edges. */
|
|
15
|
+
export declare function weldGeometry(geometry: Geometry, options?: WeldGeometryOptions): WeldGeometryResult;
|
|
16
|
+
/** Returns triangle numbers with area <= areaEpsilon, in original draw order. */
|
|
17
|
+
export declare function getDegenerateTriangles(geometry: Geometry, areaEpsilon?: number): Uint32Array;
|
|
18
|
+
//# sourceMappingURL=mesh-processing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mesh-processing.d.ts","sourceRoot":"","sources":["../../src/utils/mesh-processing.ts"],"names":[],"mappings":"AAOA,OAAO,EAAqB,KAAK,QAAQ,EAAyB,sBAAmB;AASrF,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAClC,QAAQ,CAkFV;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,UAAU,EAAE,SAAS,QAAQ,EAAE,GAAG,QAAQ,CA8CzE;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,6DAA6D,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CACzF,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,WAAW,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,8EAA8E;AAC9E,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,QAAQ,EAClB,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CAmDpB;AAED,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,SAAI,GAAG,WAAW,CAoCvF"}
|