nucleation 0.3.17 → 0.3.19
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/AnimationEffect.d.ts +44 -0
- package/AnimationEffect.mjs +204 -0
- package/BuildAnimation.d.ts +130 -0
- package/BuildAnimation.mjs +944 -0
- package/Curve3D.d.ts +27 -0
- package/Curve3D.mjs +101 -0
- package/DistanceField.d.ts +39 -0
- package/DistanceField.mjs +114 -0
- package/RenderConfig.d.ts +14 -0
- package/RenderConfig.mjs +38 -0
- package/Schematic.d.ts +134 -36
- package/Schematic.mjs +586 -42
- package/Shape.d.ts +7 -0
- package/Shape.mjs +25 -0
- package/index.d.ts +8 -0
- package/index.mjs +9 -1
- package/nucleation.wasm +0 -0
- package/package.json +1 -1
package/Shape.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
+
import type { Curve3D } from "./Curve3D"
|
|
2
3
|
import type { NucleationError } from "./NucleationError"
|
|
3
4
|
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
4
5
|
|
|
@@ -15,6 +16,12 @@ export class Shape {
|
|
|
15
16
|
constructor();
|
|
16
17
|
|
|
17
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Thicken a sampled 3D curve into a parametric tube with the given radius.
|
|
21
|
+
* Inputs outside voxel-coordinate or bounded-work limits are rejected.
|
|
22
|
+
*/
|
|
23
|
+
static tubeAlong(curve: Curve3D, radius: number): Shape;
|
|
24
|
+
|
|
18
25
|
/**
|
|
19
26
|
* Sphere centered at (`cx`, `cy`, `cz`) (truncated to block coordinates,
|
|
20
27
|
* matching the old `shape_sphere`).
|
package/Shape.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
+
import { Curve3D } from "./Curve3D.mjs"
|
|
2
3
|
import { NucleationError } from "./NucleationError.mjs"
|
|
3
4
|
import wasm from "./diplomat-wasm.mjs";
|
|
4
5
|
import * as diplomatRuntime from "./diplomat-runtime.mjs";
|
|
@@ -40,6 +41,30 @@ export class Shape {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Thicken a sampled 3D curve into a parametric tube with the given radius.
|
|
46
|
+
* Inputs outside voxel-coordinate or bounded-work limits are rejected.
|
|
47
|
+
*/
|
|
48
|
+
static tubeAlong(curve, radius) {
|
|
49
|
+
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
const result = wasm.Shape_tube_along(diplomatReceive.buffer, curve.ffiValue, radius);
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
if (!diplomatReceive.resultFlag) {
|
|
56
|
+
const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
|
|
57
|
+
throw new globalThis.Error('NucleationError.' + cause.value, { cause });
|
|
58
|
+
}
|
|
59
|
+
return new Shape(diplomatRuntime.internalConstructor, diplomatRuntime.ptrRead(wasm, diplomatReceive.buffer), []);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
finally {
|
|
63
|
+
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
64
|
+
diplomatReceive.free();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
43
68
|
/**
|
|
44
69
|
* Sphere centered at (`cx`, `cy`, `cz`) (truncated to block coordinates,
|
|
45
70
|
* matching the old `shape_sphere`).
|
package/index.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ export { BlockPos, BlockPos_obj } from "./BlockPos"
|
|
|
16
16
|
|
|
17
17
|
export { Dimensions, Dimensions_obj } from "./Dimensions"
|
|
18
18
|
|
|
19
|
+
export { AnimationEffect } from "./AnimationEffect"
|
|
20
|
+
|
|
21
|
+
export { BuildAnimation } from "./BuildAnimation"
|
|
22
|
+
|
|
19
23
|
export { Autostack } from "./Autostack"
|
|
20
24
|
|
|
21
25
|
export { Blocks } from "./Blocks"
|
|
@@ -24,6 +28,8 @@ export { Brush } from "./Brush"
|
|
|
24
28
|
|
|
25
29
|
export { BuildingTool } from "./BuildingTool"
|
|
26
30
|
|
|
31
|
+
export { Curve3D } from "./Curve3D"
|
|
32
|
+
|
|
27
33
|
export { Palette } from "./Palette"
|
|
28
34
|
|
|
29
35
|
export { PaletteBuilder } from "./PaletteBuilder"
|
|
@@ -38,6 +44,8 @@ export { Diff } from "./Diff"
|
|
|
38
44
|
|
|
39
45
|
export { Fingerprint } from "./Fingerprint"
|
|
40
46
|
|
|
47
|
+
export { DistanceField } from "./DistanceField"
|
|
48
|
+
|
|
41
49
|
export { Geo } from "./Geo"
|
|
42
50
|
|
|
43
51
|
export { ChunkMeshResult } from "./ChunkMeshResult"
|
package/index.mjs
CHANGED
|
@@ -14,6 +14,10 @@ export { BlockPos } from "./BlockPos.mjs"
|
|
|
14
14
|
|
|
15
15
|
export { Dimensions } from "./Dimensions.mjs"
|
|
16
16
|
|
|
17
|
+
export { AnimationEffect } from "./AnimationEffect.mjs"
|
|
18
|
+
|
|
19
|
+
export { BuildAnimation } from "./BuildAnimation.mjs"
|
|
20
|
+
|
|
17
21
|
export { Autostack } from "./Autostack.mjs"
|
|
18
22
|
|
|
19
23
|
export { Blocks } from "./Blocks.mjs"
|
|
@@ -22,6 +26,8 @@ export { Brush } from "./Brush.mjs"
|
|
|
22
26
|
|
|
23
27
|
export { BuildingTool } from "./BuildingTool.mjs"
|
|
24
28
|
|
|
29
|
+
export { Curve3D } from "./Curve3D.mjs"
|
|
30
|
+
|
|
25
31
|
export { Palette } from "./Palette.mjs"
|
|
26
32
|
|
|
27
33
|
export { PaletteBuilder } from "./PaletteBuilder.mjs"
|
|
@@ -36,6 +42,8 @@ export { Diff } from "./Diff.mjs"
|
|
|
36
42
|
|
|
37
43
|
export { Fingerprint } from "./Fingerprint.mjs"
|
|
38
44
|
|
|
45
|
+
export { DistanceField } from "./DistanceField.mjs"
|
|
46
|
+
|
|
39
47
|
export { Geo } from "./Geo.mjs"
|
|
40
48
|
|
|
41
49
|
export { ChunkMeshResult } from "./ChunkMeshResult.mjs"
|
|
@@ -123,4 +131,4 @@ export { NucleationError } from "./NucleationError.mjs"
|
|
|
123
131
|
import wasm from "./diplomat-wasm.mjs";
|
|
124
132
|
import {FUNCTION_PARAM_ALLOC, internalConstructor} from "./diplomat-runtime.mjs";
|
|
125
133
|
|
|
126
|
-
FUNCTION_PARAM_ALLOC.reserve(internalConstructor, wasm,
|
|
134
|
+
FUNCTION_PARAM_ALLOC.reserve(internalConstructor, wasm, 56);
|
package/nucleation.wasm
CHANGED
|
Binary file
|