@ac-kit/math-geometry 0.4.0 → 0.5.0
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 +73 -0
- package/README.md +37 -6
- package/dist/_polyline-simplify.d.ts +11 -0
- package/dist/_polyline-simplify.d.ts.map +1 -0
- package/dist/_polyline-simplify.js +92 -0
- package/dist/_polyline-simplify.js.map +1 -0
- package/dist/_triangle3-cross.d.ts.map +1 -1
- package/dist/_triangle3-cross.js +16 -7
- package/dist/_triangle3-cross.js.map +1 -1
- package/dist/convex-hull2.d.ts +26 -0
- package/dist/convex-hull2.d.ts.map +1 -0
- package/dist/convex-hull2.js +88 -0
- package/dist/convex-hull2.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mesh/_index-kernels-u16.d.ts +21 -28
- package/dist/mesh/_index-kernels-u16.d.ts.map +1 -1
- package/dist/mesh/_index-kernels-u16.js +892 -363
- package/dist/mesh/_index-kernels-u16.js.map +1 -1
- package/dist/mesh/_index-kernels-u32.d.ts +21 -28
- package/dist/mesh/_index-kernels-u32.d.ts.map +1 -1
- package/dist/mesh/_index-kernels-u32.js +892 -363
- package/dist/mesh/_index-kernels-u32.js.map +1 -1
- package/dist/mesh/mesh3-kernels.d.ts +73 -29
- package/dist/mesh/mesh3-kernels.d.ts.map +1 -1
- package/dist/mesh/mesh3-kernels.js +92 -34
- package/dist/mesh/mesh3-kernels.js.map +1 -1
- package/dist/polygon2.d.ts +22 -0
- package/dist/polygon2.d.ts.map +1 -1
- package/dist/polygon2.js +69 -0
- package/dist/polygon2.js.map +1 -1
- package/dist/polyline2.d.ts +20 -0
- package/dist/polyline2.d.ts.map +1 -1
- package/dist/polyline2.js +25 -0
- package/dist/polyline2.js.map +1 -1
- package/dist/polyline3.d.ts +17 -0
- package/dist/polyline3.d.ts.map +1 -1
- package/dist/polyline3.js +22 -0
- package/dist/polyline3.js.map +1 -1
- package/dist/predicates2.d.ts +51 -0
- package/dist/predicates2.d.ts.map +1 -0
- package/dist/predicates2.js +172 -0
- package/dist/predicates2.js.map +1 -0
- package/package.json +8 -8
|
@@ -34,37 +34,30 @@ export declare function mesh3FaceNormalsU16(out: Float64Array, positions: Float6
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function mesh3SurfaceAreaU16(positions: Float64Array, indices: Uint16Array): number;
|
|
36
36
|
/**
|
|
37
|
-
* The `Uint16Array` twin of the signed volume: six times it is `Σ
|
|
38
|
-
* −
|
|
39
|
-
* the same volume for a closed mesh)
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* and the whole summed exactly (`PreciseSum`). With the face-local edge
|
|
48
|
-
* differences exact, which they are wherever a face is small beside its
|
|
49
|
-
* distance from the origin (Sterbenz), the result is six times the volume
|
|
50
|
-
* rounded once, then divided by 6: the same number in every face order and at
|
|
51
|
-
* every offset, and a vertex no triangle uses is never read. A term below about
|
|
52
|
-
* 2^−1900 of the largest may lose digits to the subnormal range; so may a
|
|
53
|
-
* volume that small beside the largest term. O(triangles), no allocation.
|
|
37
|
+
* The `Uint16Array` twin of the signed volume: six times it is T = `Σ det[a −
|
|
38
|
+
* o, b − o, c − o]` over the faces, o being the frame's anchor (any point gives
|
|
39
|
+
* the same volume for a closed mesh), every coordinate exact. An ordinary mesh
|
|
40
|
+
* is certified by the doubled-precision filter, which proves the rounded T / 6;
|
|
41
|
+
* anywhere else every face's term is summed exactly in a long accumulator
|
|
42
|
+
* ({@link exactSixVolume_}), whatever the magnitudes, and T / 6 is rounded once
|
|
43
|
+
* from it ({@link roundQuotient_}): the same number in every face order and for
|
|
44
|
+
* every rotation of a face's corners, and a vertex no triangle uses is never
|
|
45
|
+
* read. Written to `out[0]`: a double returned from a call the engine does not
|
|
46
|
+
* inline is boxed. O(triangles), no allocation.
|
|
54
47
|
*/
|
|
55
|
-
export declare function mesh3VolumeU16(positions: Float64Array, indices: Uint16Array):
|
|
48
|
+
export declare function mesh3VolumeU16(out: Float64Array, positions: Float64Array, indices: Uint16Array): void;
|
|
56
49
|
/**
|
|
57
|
-
* The `Uint16Array` twin of the surface centroid:
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
50
|
+
* The `Uint16Array` twin of the surface centroid: `Σ ω (a + b + c) / (3 Σ ω)`,
|
|
51
|
+
* ω each face's doubled area (`faceArea_`, as m · 2^k), both sums exact in long
|
|
52
|
+
* accumulators at any magnitude, their quotient rounded once
|
|
53
|
+
* ({@link roundQuotient_}): the same number in every face order, correctly
|
|
54
|
+
* rounded for those weights at any size or distance from the origin, and a
|
|
55
|
+
* vertex no triangle uses is never read. A zero total area divides zero by
|
|
56
|
+
* zero: `NaN`. With `faithful`, the first stage {@link faithfulCentroid_} runs
|
|
57
|
+
* first and the rest only where it cannot prove its result. O(triangles), no
|
|
58
|
+
* allocation.
|
|
66
59
|
*/
|
|
67
|
-
export declare function mesh3CentroidU16(out: Vec3, positions: Float64Array, indices: Uint16Array): void;
|
|
60
|
+
export declare function mesh3CentroidU16(out: Vec3, positions: Float64Array, indices: Uint16Array, faithful?: boolean): void;
|
|
68
61
|
/**
|
|
69
62
|
* The `Uint16Array` twin of the nearest ray hit: the triangle index, `−1` for a
|
|
70
63
|
* miss; `out` is `[t, u, v]`, `NaN` for a miss. O(triangles).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_index-kernels-u16.d.ts","sourceRoot":"","sources":["../../src/mesh/_index-kernels-u16.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_index-kernels-u16.d.ts","sourceRoot":"","sources":["../../src/mesh/_index-kernels-u16.ts"],"names":[],"mappings":"AAQA,OAAO,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