@manycore/aholo-splat-transform 1.2.7 → 1.2.9
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/CHANGELOG.md +120 -106
- package/COPYRIGHT.md +17 -0
- package/README.md +39 -39
- package/THIRD_PARTY_LICENSES.txt +1373 -0
- package/bin/cli.js +125 -118
- package/dist/SplatData.d.ts +67 -67
- package/dist/SplatData.js +167 -156
- package/dist/constant.d.ts +3 -3
- package/dist/constant.js +13 -13
- package/dist/file/IFile.d.ts +5 -5
- package/dist/file/IFile.js +1 -1
- package/dist/file/esz.d.ts +11 -0
- package/dist/file/esz.js +337 -0
- package/dist/file/index.d.ts +8 -7
- package/dist/file/index.js +7 -6
- package/dist/file/ksplat.d.ts +12 -12
- package/dist/file/ksplat.js +293 -232
- package/dist/file/lcc.d.ts +11 -11
- package/dist/file/lcc.js +161 -157
- package/dist/file/ply.d.ts +13 -13
- package/dist/file/ply.js +439 -388
- package/dist/file/sog.d.ts +80 -80
- package/dist/file/sog.js +525 -504
- package/dist/file/splat.d.ts +6 -6
- package/dist/file/splat.js +119 -99
- package/dist/file/spz.d.ts +11 -8
- package/dist/file/spz.js +597 -400
- package/dist/file/voxel.d.ts +43 -37
- package/dist/file/voxel.js +411 -280
- package/dist/index.d.ts +33 -33
- package/dist/index.js +54 -54
- package/dist/native/index.d.ts +54 -54
- package/dist/native/index.js +122 -128
- package/dist/native/utils.d.ts +1 -0
- package/dist/native/utils.js +54 -0
- package/dist/tasks/AutoChunkLodTask.d.ts +13 -13
- package/dist/tasks/AutoChunkLodTask.js +117 -117
- package/dist/tasks/AutoLodTask.d.ts +10 -10
- package/dist/tasks/AutoLodTask.js +20 -20
- package/dist/tasks/BaseTask.d.ts +15 -15
- package/dist/tasks/BaseTask.js +5 -5
- package/dist/tasks/FlexLodTask.d.ts +12 -12
- package/dist/tasks/FlexLodTask.js +54 -44
- package/dist/tasks/ModifyTask.d.ts +9 -9
- package/dist/tasks/ModifyTask.js +166 -156
- package/dist/tasks/ReadTask.d.ts +9 -9
- package/dist/tasks/ReadTask.js +29 -29
- package/dist/tasks/SkeletonLodTask.d.ts +10 -10
- package/dist/tasks/SkeletonLodTask.js +176 -156
- package/dist/tasks/VoxelTask.d.ts +35 -30
- package/dist/tasks/VoxelTask.js +40 -37
- package/dist/tasks/WriteTask.d.ts +12 -11
- package/dist/tasks/WriteTask.js +70 -70
- package/dist/utils/BufferReader.d.ts +12 -12
- package/dist/utils/BufferReader.js +45 -47
- package/dist/utils/Logger.d.ts +11 -11
- package/dist/utils/Logger.js +40 -38
- package/dist/utils/StreamChunkDecoder.d.ts +16 -16
- package/dist/utils/StreamChunkDecoder.js +31 -36
- package/dist/utils/index.d.ts +27 -27
- package/dist/utils/index.js +101 -101
- package/dist/utils/k-means.d.ts +4 -4
- package/dist/utils/k-means.js +340 -350
- package/dist/utils/math.d.ts +46 -46
- package/dist/utils/math.js +350 -351
- package/dist/utils/quantize-1d.d.ts +4 -4
- package/dist/utils/quantize-1d.js +164 -164
- package/dist/utils/sh-rotate.d.ts +2 -2
- package/dist/utils/sh-rotate.js +236 -175
- package/dist/utils/splat.d.ts +21 -20
- package/dist/utils/splat.js +397 -378
- package/dist/utils/voxel/binary.d.ts +8 -0
- package/dist/utils/voxel/binary.js +176 -0
- package/dist/utils/voxel/common.d.ts +178 -162
- package/dist/utils/voxel/common.js +1752 -1700
- package/dist/utils/voxel/coplanar-merge.d.ts +63 -63
- package/dist/utils/voxel/coplanar-merge.js +818 -819
- package/dist/utils/voxel/filter-cluster.d.ts +20 -0
- package/dist/utils/voxel/filter-cluster.js +628 -0
- package/dist/utils/voxel/gpu-dilation.d.ts +2 -2
- package/dist/utils/voxel/gpu-dilation.js +677 -665
- package/dist/utils/voxel/marching-cubes.d.ts +42 -42
- package/dist/utils/voxel/marching-cubes.js +1645 -1657
- package/dist/utils/voxel/mesh.d.ts +3 -3
- package/dist/utils/voxel/mesh.js +130 -130
- package/dist/utils/voxel/nav.d.ts +29 -29
- package/dist/utils/voxel/nav.js +1068 -1043
- package/dist/utils/voxel/postprocess.d.ts +23 -23
- package/dist/utils/voxel/postprocess.js +408 -375
- package/dist/utils/voxel/voxel-faces.d.ts +18 -18
- package/dist/utils/voxel/voxel-faces.js +662 -663
- package/dist/utils/voxel/voxelize.d.ts +34 -33
- package/dist/utils/voxel/voxelize.js +1208 -1193
- package/dist/utils/webgpu.d.ts +8 -8
- package/dist/utils/webgpu.js +122 -122
- package/package.json +37 -30
- package/dist/native/cpp/bin/linux/binding.node +0 -0
- package/dist/native/cpp/bin/windows/binding.node +0 -0
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import type { Mesh } from './marching-cubes.js';
|
|
2
|
-
/**
|
|
3
|
-
* Losslessly reduce coplanar regions of a marching-cubes mesh by
|
|
4
|
-
* topology-preserving vertex removal.
|
|
5
|
-
*
|
|
6
|
-
* For a closed manifold MC mesh, a vertex `v` is "lossless-removable" iff
|
|
7
|
-
* its incident-tri fan, walked in cyclic order, falls into one of:
|
|
8
|
-
*
|
|
9
|
-
* 1. K=1 coplanar fan. Every triangle in v's fan lies on the same plane
|
|
10
|
-
* (same unit normal and same plane offset, within tolerance). Removing
|
|
11
|
-
* v is the inverse of vertex split: re-triangulate the boundary
|
|
12
|
-
* polygon in the same plane.
|
|
13
|
-
*
|
|
14
|
-
* 2. K=2 collinear seam. The fan splits into exactly two contiguous
|
|
15
|
-
* coplanar arcs (different planes). The two crease vertices `a` and
|
|
16
|
-
* `b` (the boundary points where the plane changes around v) are
|
|
17
|
-
* collinear with v in 3D, with v between them. Removing v collapses
|
|
18
|
-
* the two crease edges (v-a, v-b) into a single straight edge (a-b)
|
|
19
|
-
* that lies in both planes; each arc's polygon re-triangulates
|
|
20
|
-
* without v.
|
|
21
|
-
*
|
|
22
|
-
* Vertices with K >= 3 (multi-way corners) are kept.
|
|
23
|
-
*
|
|
24
|
-
* Removing a removable v is exact-lossless: the surface footprint is
|
|
25
|
-
* identical, no vertex moves and none are created. The transformation
|
|
26
|
-
* is the inverse of vertex split, so it is topology-preserving by
|
|
27
|
-
* construction:
|
|
28
|
-
*
|
|
29
|
-
* - No T-junctions. Every old vertex on the polygon boundary remains a
|
|
30
|
-
* vertex of every triangle that previously touched it. Adjacent fused
|
|
31
|
-
* regions and verbatim regions stay coupled at every shared vertex.
|
|
32
|
-
* - Watertight. The closed manifold structure is preserved across
|
|
33
|
-
* removal. Both the K=1 and K=2 cases preserve the K=2 seam edge as
|
|
34
|
-
* a single shared edge between the two plane groups.
|
|
35
|
-
* - Bit-exact. Every output position is a verbatim copy of an input
|
|
36
|
-
* position; no vertex is fabricated.
|
|
37
|
-
*
|
|
38
|
-
* Algorithm:
|
|
39
|
-
*
|
|
40
|
-
* 1. Build per-vertex incident-tri lists and per-tri normalized normals
|
|
41
|
-
* and plane offsets.
|
|
42
|
-
* 2. Process vertices via a dirty-flag worklist. Initially queue every
|
|
43
|
-
* vertex; after a successful removal, re-queue the ring neighbours
|
|
44
|
-
* so chains of K=1 / K=2 vertices collapse in one run.
|
|
45
|
-
* 3. For each dequeued vertex `v`:
|
|
46
|
-
* a. Walk the fan to extract the cyclic ring vertices and the
|
|
47
|
-
* cyclic ordered tris (each tri (v, ring[i], ring[(i+1)%k]) is
|
|
48
|
-
* the i-th tri in fan order).
|
|
49
|
-
* b. Decide K. If all tris share a plane: K=1. Otherwise count
|
|
50
|
-
* transitions in cyclic order; K=2 if exactly two arcs.
|
|
51
|
-
* c. K>=3: skip. K=2: verify ring[i1], v, ring[i2] are collinear.
|
|
52
|
-
* d. For each arc, project its polygon to 2D using the arc's
|
|
53
|
-
* plane basis, ear-clip, and append the new tris.
|
|
54
|
-
* e. Mark v's old tris dead, register the new tris in each polygon
|
|
55
|
-
* vertex's incident list, and re-queue the ring.
|
|
56
|
-
* 4. Compact: drop dead tris and unused vertices, remap indices.
|
|
57
|
-
*
|
|
58
|
-
* @param mesh - Input triangle mesh from {@link marchingCubes}.
|
|
59
|
-
* @param voxelResolution - Size of one voxel in world units. Used to scale the plane-offset tolerance. (The K=2 collinearity check is purely angular and has no voxel-scaled term.)
|
|
60
|
-
* @returns A new mesh with the same surface geometry, no T-junctions, and far fewer triangles.
|
|
61
|
-
*/
|
|
62
|
-
declare
|
|
63
|
-
export { coplanarMerge };
|
|
1
|
+
import type { Mesh } from './marching-cubes.js';
|
|
2
|
+
/**
|
|
3
|
+
* Losslessly reduce coplanar regions of a marching-cubes mesh by
|
|
4
|
+
* topology-preserving vertex removal.
|
|
5
|
+
*
|
|
6
|
+
* For a closed manifold MC mesh, a vertex `v` is "lossless-removable" iff
|
|
7
|
+
* its incident-tri fan, walked in cyclic order, falls into one of:
|
|
8
|
+
*
|
|
9
|
+
* 1. K=1 coplanar fan. Every triangle in v's fan lies on the same plane
|
|
10
|
+
* (same unit normal and same plane offset, within tolerance). Removing
|
|
11
|
+
* v is the inverse of vertex split: re-triangulate the boundary
|
|
12
|
+
* polygon in the same plane.
|
|
13
|
+
*
|
|
14
|
+
* 2. K=2 collinear seam. The fan splits into exactly two contiguous
|
|
15
|
+
* coplanar arcs (different planes). The two crease vertices `a` and
|
|
16
|
+
* `b` (the boundary points where the plane changes around v) are
|
|
17
|
+
* collinear with v in 3D, with v between them. Removing v collapses
|
|
18
|
+
* the two crease edges (v-a, v-b) into a single straight edge (a-b)
|
|
19
|
+
* that lies in both planes; each arc's polygon re-triangulates
|
|
20
|
+
* without v.
|
|
21
|
+
*
|
|
22
|
+
* Vertices with K >= 3 (multi-way corners) are kept.
|
|
23
|
+
*
|
|
24
|
+
* Removing a removable v is exact-lossless: the surface footprint is
|
|
25
|
+
* identical, no vertex moves and none are created. The transformation
|
|
26
|
+
* is the inverse of vertex split, so it is topology-preserving by
|
|
27
|
+
* construction:
|
|
28
|
+
*
|
|
29
|
+
* - No T-junctions. Every old vertex on the polygon boundary remains a
|
|
30
|
+
* vertex of every triangle that previously touched it. Adjacent fused
|
|
31
|
+
* regions and verbatim regions stay coupled at every shared vertex.
|
|
32
|
+
* - Watertight. The closed manifold structure is preserved across
|
|
33
|
+
* removal. Both the K=1 and K=2 cases preserve the K=2 seam edge as
|
|
34
|
+
* a single shared edge between the two plane groups.
|
|
35
|
+
* - Bit-exact. Every output position is a verbatim copy of an input
|
|
36
|
+
* position; no vertex is fabricated.
|
|
37
|
+
*
|
|
38
|
+
* Algorithm:
|
|
39
|
+
*
|
|
40
|
+
* 1. Build per-vertex incident-tri lists and per-tri normalized normals
|
|
41
|
+
* and plane offsets.
|
|
42
|
+
* 2. Process vertices via a dirty-flag worklist. Initially queue every
|
|
43
|
+
* vertex; after a successful removal, re-queue the ring neighbours
|
|
44
|
+
* so chains of K=1 / K=2 vertices collapse in one run.
|
|
45
|
+
* 3. For each dequeued vertex `v`:
|
|
46
|
+
* a. Walk the fan to extract the cyclic ring vertices and the
|
|
47
|
+
* cyclic ordered tris (each tri (v, ring[i], ring[(i+1)%k]) is
|
|
48
|
+
* the i-th tri in fan order).
|
|
49
|
+
* b. Decide K. If all tris share a plane: K=1. Otherwise count
|
|
50
|
+
* transitions in cyclic order; K=2 if exactly two arcs.
|
|
51
|
+
* c. K>=3: skip. K=2: verify ring[i1], v, ring[i2] are collinear.
|
|
52
|
+
* d. For each arc, project its polygon to 2D using the arc's
|
|
53
|
+
* plane basis, ear-clip, and append the new tris.
|
|
54
|
+
* e. Mark v's old tris dead, register the new tris in each polygon
|
|
55
|
+
* vertex's incident list, and re-queue the ring.
|
|
56
|
+
* 4. Compact: drop dead tris and unused vertices, remap indices.
|
|
57
|
+
*
|
|
58
|
+
* @param mesh - Input triangle mesh from {@link marchingCubes}.
|
|
59
|
+
* @param voxelResolution - Size of one voxel in world units. Used to scale the plane-offset tolerance. (The K=2 collinearity check is purely angular and has no voxel-scaled term.)
|
|
60
|
+
* @returns A new mesh with the same surface geometry, no T-junctions, and far fewer triangles.
|
|
61
|
+
*/
|
|
62
|
+
declare function coplanarMerge(mesh: Mesh, voxelResolution: number): Mesh;
|
|
63
|
+
export { coplanarMerge };
|