@metamesh/modeling 0.10.0 → 0.11.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 +40 -0
- package/README.md +56 -17
- package/dist/api/engine.d.ts +105 -8
- package/dist/api/index.d.ts +754 -771
- package/dist/engine/construction-operations.js +3 -1
- package/dist/engine/deferred-context.js +182 -0
- package/dist/engine/execution.js +38 -4
- package/dist/engine/finalization.js +65 -133
- package/dist/engine/geometry-recipes.js +12 -0
- package/dist/engine/immutable-generation-data.js +186 -0
- package/dist/engine/index.js +57 -35
- package/dist/engine/kernel/manifold.wasm +0 -0
- package/dist/engine/model-dependencies.js +46 -0
- package/dist/engine/model-summary.js +43 -0
- package/dist/engine/native/ownership.js +11 -5
- package/dist/engine/placement.js +24 -0
- package/dist/engine/recipe-realization.js +119 -0
- package/dist/engine/session-graph.js +442 -0
- package/dist/engine/session-native.js +90 -0
- package/dist/engine/session-snapshot.js +153 -0
- package/dist/engine/session.js +184 -0
- package/dist/engine/shape-anchors.js +5 -0
- package/dist/geometry/mesh-centroid.js +7 -6
- package/dist/geometry/mesh-planar.js +11 -10
- package/dist/geometry/mesh-quality.js +15 -14
- package/dist/geometry/mesh-signature.js +8 -7
- package/dist/geometry/mesh-solid.js +10 -4
- package/dist/geometry/mesh.js +36 -31
- package/dist/index.js +2 -0
- package/dist/model/execution-binding.js +5 -5
- package/dist/model/generation.js +27 -0
- package/dist/model/immutable-buffer.js +111 -0
- package/dist/model/modeling-context.js +1 -0
- package/dist/model/operations.js +521 -160
- package/dist/model/shape-handles.js +44 -0
- package/package.json +4 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { currentModelContext } from "./execution-binding.js";
|
|
2
|
+
// Resolve the current transaction on every call: cached recipes outlive the revision that
|
|
3
|
+
// created them. Neither instances nor these shared methods retain an execution or native value.
|
|
4
|
+
function forward(name) {
|
|
5
|
+
return function (...args) {
|
|
6
|
+
const context = currentModelContext(name);
|
|
7
|
+
return Reflect.apply(context[name], undefined, [this, ...args]);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function prototype(methods) {
|
|
11
|
+
return Object.freeze(Object.create(Object.prototype, Object.fromEntries(Object.entries(methods).map(([name, value]) => [name, { value, enumerable: false }]))));
|
|
12
|
+
}
|
|
13
|
+
const common = {
|
|
14
|
+
translate: forward("translate"),
|
|
15
|
+
rotate: forward("rotate"),
|
|
16
|
+
scale: forward("scale"),
|
|
17
|
+
mirror: forward("mirror"),
|
|
18
|
+
transform: forward("transform"),
|
|
19
|
+
subtract: forward("subtract"),
|
|
20
|
+
simplify: forward("simplify"),
|
|
21
|
+
withAnchors: forward("withAnchors"),
|
|
22
|
+
};
|
|
23
|
+
const solidPrototype = prototype({
|
|
24
|
+
...common,
|
|
25
|
+
attach: forward("attach"),
|
|
26
|
+
setTolerance: forward("setTolerance"),
|
|
27
|
+
projectSection: forward("projectSection"),
|
|
28
|
+
sliceSection: forward("sliceSection"),
|
|
29
|
+
});
|
|
30
|
+
const sectionPrototype = prototype({
|
|
31
|
+
...common,
|
|
32
|
+
offset: forward("offset"),
|
|
33
|
+
extrude: forward("extrude"),
|
|
34
|
+
revolve: forward("revolve"),
|
|
35
|
+
sweep: forward("sweep"),
|
|
36
|
+
});
|
|
37
|
+
/** Creates only the immutable public facade; the caller owns its private geometry identity. */
|
|
38
|
+
export function createSolidHandle() {
|
|
39
|
+
return Object.freeze(Object.create(solidPrototype));
|
|
40
|
+
}
|
|
41
|
+
/** Creates only the immutable public facade; the caller owns its private geometry identity. */
|
|
42
|
+
export function createSectionHandle() {
|
|
43
|
+
return Object.freeze(Object.create(sectionPrototype));
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamesh/modeling",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Scoped solid modeling and pure geometry foundations for Node and browsers.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"@metamesh/config": "0.0.0",
|
|
57
57
|
"@microsoft/api-extractor": "^7.59.4",
|
|
58
58
|
"@types/fontkit": "^2.0.9",
|
|
59
|
-
"@vitest/coverage-v8": "^5.0.
|
|
59
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
60
60
|
"esbuild": "^0.28.2",
|
|
61
61
|
"fast-check": "4.10.2",
|
|
62
62
|
"typedoc": "0.28.20",
|
|
63
|
-
"typedoc-plugin-markdown": "4.
|
|
63
|
+
"typedoc-plugin-markdown": "4.14.0",
|
|
64
64
|
"typescript": "6.0.3",
|
|
65
|
-
"vitest": "^5.0.
|
|
65
|
+
"vitest": "^5.0.5",
|
|
66
66
|
"manifold-3d": "3.5.4",
|
|
67
67
|
"fontkit": "^2.0.4",
|
|
68
68
|
"woff2-encoder": "2.0.0"
|