nucleation 0.3.18 → 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/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"
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"
@@ -125,4 +131,4 @@ export { NucleationError } from "./NucleationError.mjs"
125
131
  import wasm from "./diplomat-wasm.mjs";
126
132
  import {FUNCTION_PARAM_ALLOC, internalConstructor} from "./diplomat-runtime.mjs";
127
133
 
128
- FUNCTION_PARAM_ALLOC.reserve(internalConstructor, wasm, 52);
134
+ FUNCTION_PARAM_ALLOC.reserve(internalConstructor, wasm, 56);
package/nucleation.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nucleation",
3
- "version": "0.3.18",
3
+ "version": "0.3.19",
4
4
  "description": "A high-performance Minecraft schematic parser and utility library",
5
5
  "type": "module",
6
6
  "main": "index.mjs",