nucleation 0.6.0 → 0.7.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.
Files changed (190) hide show
  1. package/AnimationEffect.d.mts +44 -0
  2. package/AnimationEffect.d.ts +1 -1
  3. package/Autostack.d.mts +43 -0
  4. package/Autostack.d.ts +2 -2
  5. package/BlockPos.d.mts +28 -0
  6. package/BlockState.d.mts +39 -0
  7. package/BlockState.d.ts +1 -1
  8. package/Blocks.d.mts +91 -0
  9. package/Blocks.d.ts +1 -1
  10. package/Brush.d.mts +99 -0
  11. package/Brush.d.ts +21 -12
  12. package/Brush.mjs +66 -9
  13. package/BuildAnimation.d.mts +142 -0
  14. package/BuildAnimation.d.ts +5 -5
  15. package/BuildingTool.d.mts +46 -0
  16. package/BuildingTool.d.ts +4 -4
  17. package/CellularSdfConfig.d.mts +22 -0
  18. package/CellularSdfConfig.d.ts +22 -0
  19. package/CellularSdfConfig.mjs +69 -0
  20. package/ChunkMeshResult.d.mts +75 -0
  21. package/ChunkMeshResult.d.ts +7 -7
  22. package/CircuitBuilder.d.mts +118 -0
  23. package/CircuitBuilder.d.ts +6 -6
  24. package/Curve3D.d.mts +27 -0
  25. package/Curve3D.d.ts +1 -1
  26. package/DefinitionRegion.d.mts +274 -0
  27. package/DefinitionRegion.d.ts +5 -5
  28. package/Diff.d.mts +88 -0
  29. package/Diff.d.ts +2 -2
  30. package/Dimensions.d.mts +28 -0
  31. package/DistanceField.d.mts +39 -0
  32. package/DistanceField.d.ts +1 -1
  33. package/ExecutionMode.d.mts +42 -0
  34. package/ExecutionMode.d.ts +2 -2
  35. package/Field3.d.mts +40 -0
  36. package/Field3.d.ts +40 -0
  37. package/Field3.mjs +160 -0
  38. package/FieldProgram.d.mts +40 -0
  39. package/FieldProgram.d.ts +40 -0
  40. package/FieldProgram.mjs +167 -0
  41. package/FieldProgramBinaryOp.d.mts +42 -0
  42. package/FieldProgramBinaryOp.d.ts +42 -0
  43. package/FieldProgramBinaryOp.mjs +118 -0
  44. package/FieldProgramBuilder.d.mts +104 -0
  45. package/FieldProgramBuilder.d.ts +104 -0
  46. package/FieldProgramBuilder.mjs +486 -0
  47. package/FieldProgramDistanceKind.d.mts +26 -0
  48. package/FieldProgramDistanceKind.d.ts +26 -0
  49. package/FieldProgramDistanceKind.mjs +78 -0
  50. package/FieldProgramUnaryOp.d.mts +34 -0
  51. package/FieldProgramUnaryOp.d.ts +34 -0
  52. package/FieldProgramUnaryOp.mjs +102 -0
  53. package/FieldProgramValueType.d.mts +25 -0
  54. package/FieldProgramValueType.d.ts +25 -0
  55. package/FieldProgramValueType.mjs +75 -0
  56. package/FieldRange.d.mts +15 -0
  57. package/FieldRange.d.ts +15 -0
  58. package/FieldRange.mjs +108 -0
  59. package/Fingerprint.d.mts +44 -0
  60. package/Fingerprint.d.ts +2 -2
  61. package/GeneratedChunk.d.mts +35 -0
  62. package/GeneratedChunk.d.ts +35 -0
  63. package/GeneratedChunk.mjs +178 -0
  64. package/GeneratedChunkCoverage.d.mts +25 -0
  65. package/GeneratedChunkCoverage.d.ts +25 -0
  66. package/GeneratedChunkCoverage.mjs +75 -0
  67. package/GeneratedChunkOverlayMode.d.mts +24 -0
  68. package/GeneratedChunkOverlayMode.d.ts +24 -0
  69. package/GeneratedChunkOverlayMode.mjs +72 -0
  70. package/GeneratedWorldStream.d.mts +28 -0
  71. package/GeneratedWorldStream.d.ts +28 -0
  72. package/GeneratedWorldStream.mjs +86 -0
  73. package/Geo.d.mts +41 -0
  74. package/Geo.d.ts +2 -2
  75. package/InterpolationSpace.d.mts +25 -0
  76. package/IoLayout.d.mts +26 -0
  77. package/IoLayoutBuilder.d.mts +73 -0
  78. package/IoLayoutBuilder.d.ts +4 -4
  79. package/IoType.d.mts +41 -0
  80. package/ItemModelConfig.d.mts +65 -0
  81. package/ItemModelConfig.d.ts +1 -1
  82. package/ItemModelPackBuilder.d.mts +32 -0
  83. package/ItemModelPackBuilder.d.ts +1 -1
  84. package/ItemModelResult.d.mts +72 -0
  85. package/ItemModelResult.d.ts +7 -7
  86. package/ItemScale.d.mts +31 -0
  87. package/LayoutFunction.d.mts +52 -0
  88. package/LayoutFunction.d.ts +1 -1
  89. package/MchprsWorld.d.mts +131 -0
  90. package/MchprsWorld.d.ts +3 -3
  91. package/MeshBounds.d.mts +40 -0
  92. package/MeshConfig.d.mts +101 -0
  93. package/MeshConfig.d.ts +1 -1
  94. package/MeshJob.d.mts +44 -0
  95. package/MeshJob.d.ts +7 -7
  96. package/MeshPhase.d.mts +38 -0
  97. package/MeshProgress.d.mts +32 -0
  98. package/MeshProgress.d.ts +1 -1
  99. package/MeshResult.d.mts +65 -0
  100. package/MeshResult.d.ts +5 -5
  101. package/MultiMeshResult.d.mts +50 -0
  102. package/MultiMeshResult.d.ts +5 -5
  103. package/Nbt.d.mts +50 -0
  104. package/Nbt.d.ts +1 -1
  105. package/NucleationError.d.mts +41 -0
  106. package/NucleationError.d.ts +5 -0
  107. package/NucleationError.mjs +8 -1
  108. package/OutputCondition.d.mts +45 -0
  109. package/OutputCondition.d.ts +1 -1
  110. package/Palette.d.mts +145 -0
  111. package/Palette.d.ts +9 -1
  112. package/Palette.mjs +35 -0
  113. package/PaletteBuilder.d.mts +119 -0
  114. package/PaletteBuilder.d.ts +2 -2
  115. package/RawMeshExport.d.mts +74 -0
  116. package/RawMeshExport.d.ts +4 -4
  117. package/RedstoneGraph.d.mts +58 -0
  118. package/RedstoneGraph.d.ts +1 -1
  119. package/RegionBounds.d.mts +41 -0
  120. package/RenderConfig.d.mts +101 -0
  121. package/RenderConfig.d.ts +1 -1
  122. package/Renderer.d.mts +51 -0
  123. package/Renderer.d.ts +4 -4
  124. package/ResourcePack.d.mts +105 -0
  125. package/ResourcePack.d.ts +3 -3
  126. package/ResourcePackList.d.mts +32 -0
  127. package/Schematic.d.mts +734 -0
  128. package/Schematic.d.ts +4 -4
  129. package/SchematicBuilder.d.mts +103 -0
  130. package/SchematicBuilder.d.ts +2 -2
  131. package/SchematicRegions.d.mts +93 -0
  132. package/SchematicRegions.d.ts +3 -3
  133. package/Scripting.d.mts +40 -0
  134. package/Scripting.d.ts +2 -2
  135. package/Sdf.d.mts +234 -0
  136. package/Sdf.d.ts +208 -13
  137. package/Sdf.mjs +1106 -11
  138. package/SdfAxis.d.mts +25 -0
  139. package/SdfAxis.d.ts +25 -0
  140. package/SdfAxis.mjs +75 -0
  141. package/SdfBounds.d.mts +19 -0
  142. package/SdfBounds.d.ts +19 -0
  143. package/SdfBounds.mjs +160 -0
  144. package/SdfCellMode.d.mts +26 -0
  145. package/SdfCellMode.d.ts +26 -0
  146. package/SdfCellMode.mjs +78 -0
  147. package/SdfNormal.d.mts +16 -0
  148. package/SdfNormal.d.ts +16 -0
  149. package/SdfNormal.mjs +121 -0
  150. package/Shape.d.mts +143 -0
  151. package/Shape.d.ts +2 -2
  152. package/SortStrategy.d.mts +86 -0
  153. package/SortStrategy.d.ts +1 -1
  154. package/Store.d.mts +83 -0
  155. package/Store.d.ts +2 -2
  156. package/StoreIo.d.mts +71 -0
  157. package/StoreIo.d.ts +2 -2
  158. package/TextureAtlas.d.mts +40 -0
  159. package/TextureAtlas.d.ts +4 -4
  160. package/TextureInfo.d.mts +34 -0
  161. package/TypedCircuitExecutor.d.mts +101 -0
  162. package/TypedCircuitExecutor.d.ts +6 -6
  163. package/Value.d.mts +73 -0
  164. package/Value.d.ts +1 -1
  165. package/VideoConfig.d.mts +15 -0
  166. package/Voxelizer.d.mts +58 -0
  167. package/Voxelizer.d.ts +4 -4
  168. package/WorldChunkView.d.mts +75 -0
  169. package/WorldChunkView.d.ts +2 -2
  170. package/WorldGenerator.d.mts +75 -0
  171. package/WorldGenerator.d.ts +75 -0
  172. package/WorldGenerator.mjs +255 -0
  173. package/WorldSink.d.mts +50 -0
  174. package/WorldSink.d.ts +2 -2
  175. package/WorldStream.d.mts +45 -0
  176. package/WorldStream.d.ts +2 -2
  177. package/WsPartitionHints.d.mts +29 -0
  178. package/WsPartitionHints.d.ts +1 -1
  179. package/WsProfile.d.mts +46 -0
  180. package/WsProfile.d.ts +1 -1
  181. package/WsRunResult.d.mts +83 -0
  182. package/WsRunResult.d.ts +5 -5
  183. package/WsSegmentJob.d.mts +28 -0
  184. package/WsSegmentJob.d.ts +1 -1
  185. package/diplomat-runtime.d.mts +15 -0
  186. package/index.d.mts +177 -0
  187. package/index.d.ts +106 -70
  188. package/index.mjs +37 -1
  189. package/nucleation.wasm +0 -0
  190. package/package.json +2 -1
package/Schematic.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  // generated by diplomat-tool
2
- import type { BlockPos } from "./BlockPos"
3
- import type { BlockState } from "./BlockState"
4
- import type { Dimensions } from "./Dimensions"
5
- import type { NucleationError } from "./NucleationError"
2
+ import type { BlockPos } from "./BlockPos.mjs"
3
+ import type { BlockState } from "./BlockState.mjs"
4
+ import type { Dimensions } from "./Dimensions.mjs"
5
+ import type { NucleationError } from "./NucleationError.mjs"
6
6
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
7
7
 
8
8
 
@@ -0,0 +1,103 @@
1
+ // generated by diplomat-tool
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { Schematic } from "./Schematic.mjs"
4
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
+
6
+
7
+
8
+ /**
9
+ * Fluent builder for schematics from character-mapped text layers.
10
+ *
11
+ * `build` is consuming (PORTING rule 11): the inner builder is held in an
12
+ * `Option` and taken on `build`; every method afterwards returns
13
+ * `AlreadyConsumed`.
14
+ */
15
+ export class SchematicBuilder {
16
+ /** @internal */
17
+ get ffiValue(): pointer;
18
+ /** @internal */
19
+ constructor();
20
+
21
+
22
+ /**
23
+ * Create a new builder, pre-loaded with the standard Unicode palette
24
+ * (override any character via `map` or `palette`).
25
+ */
26
+ static create(): SchematicBuilder;
27
+
28
+ /**
29
+ * Parse a builder from the canonical template text format.
30
+ */
31
+ static fromTemplate(template: string): SchematicBuilder;
32
+
33
+ /**
34
+ * Set the schematic name.
35
+ */
36
+ name(name: string): void;
37
+
38
+ /**
39
+ * Map a palette character to a block string. `ch` must contain exactly
40
+ * one character (its first char is used).
41
+ */
42
+ map(ch: string, block: string): void;
43
+
44
+ /**
45
+ * Append layers. `layers_json` is a JSON array of arrays of row strings,
46
+ * e.g. `[["ab","cd"],["ef","gh"]]`.
47
+ */
48
+ layers(layersJson: string): void;
49
+
50
+ /**
51
+ * Append a single layer of rows. `rows_json` is a JSON array of strings,
52
+ * e.g. `["abc", "def"]`. Equivalent to a one-element layers array.
53
+ */
54
+ layer(rowsJson: string): void;
55
+
56
+ /**
57
+ * Bulk-register palette characters. `pairs_json` is a JSON array of
58
+ * `[char, block]` two-element arrays, e.g.
59
+ * `[["c", "minecraft:gray_concrete"], [" ", "minecraft:air"]]`.
60
+ */
61
+ palette(pairsJson: string): void;
62
+
63
+ /**
64
+ * Set the build offset applied to every placed block.
65
+ */
66
+ offset(x: number, y: number, z: number): void;
67
+
68
+ /**
69
+ * Register the standard Unicode palette (redstone wires, repeaters,
70
+ * comparators, torches, blocks, air...; the same set `create`
71
+ * pre-loads), overwriting any clashing character mappings.
72
+ */
73
+ useStandardPalette(): void;
74
+
75
+ /**
76
+ * Register the minimal palette (an essentials-only subset of the
77
+ * standard one), overwriting any clashing character mappings.
78
+ */
79
+ useMinimalPalette(): void;
80
+
81
+ /**
82
+ * Register the compact ASCII-only palette, overwriting any clashing
83
+ * character mappings.
84
+ */
85
+ useCompactPalette(): void;
86
+
87
+ /**
88
+ * Run pre-build validation without consuming the builder.
89
+ */
90
+ validate(): void;
91
+
92
+ /**
93
+ * Serialize the builder back into the canonical template format.
94
+ */
95
+ toTemplate(): string;
96
+
97
+ /**
98
+ * Build the schematic. Consuming: the builder cannot be reused afterwards
99
+ * (subsequent calls return `AlreadyConsumed`), including after a failed
100
+ * build.
101
+ */
102
+ build(): Schematic;
103
+ }
@@ -1,6 +1,6 @@
1
1
  // generated by diplomat-tool
2
- import type { NucleationError } from "./NucleationError"
3
- import type { Schematic } from "./Schematic"
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { Schematic } from "./Schematic.mjs"
4
4
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
5
 
6
6
 
@@ -0,0 +1,93 @@
1
+ // generated by diplomat-tool
2
+ import type { DefinitionRegion } from "./DefinitionRegion.mjs"
3
+ import type { NucleationError } from "./NucleationError.mjs"
4
+ import type { Schematic } from "./Schematic.mjs"
5
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
6
+
7
+
8
+
9
+ /**
10
+ * Namespace type for the schematic-attached definition-region operations
11
+ * (PORTING rule 12; the `Schematic` opaque lives in another module, so
12
+ * these are statics taking it explicitly, like `Autostack`).
13
+ */
14
+ export class SchematicRegions {
15
+ /** @internal */
16
+ get ffiValue(): pointer;
17
+ /** @internal */
18
+ constructor();
19
+
20
+
21
+ /**
22
+ * Insert (or overwrite) `region` under `name`.
23
+ */
24
+ static add(schematic: Schematic, name: string, region: DefinitionRegion): void;
25
+
26
+ /**
27
+ * Overwrite the region stored under `name` (identical to `add` in the
28
+ * old ABI too; kept as a separate method for 1:1 coverage of
29
+ * `schematic_update_region`).
30
+ */
31
+ static update(schematic: Schematic, name: string, region: DefinitionRegion): void;
32
+
33
+ /**
34
+ * A copy of the region stored under `name`. Errors with `NotFound` when
35
+ * absent.
36
+ */
37
+ static get(schematic: Schematic, name: string): DefinitionRegion;
38
+
39
+ /**
40
+ * Remove the region stored under `name`. Errors with `NotFound` when
41
+ * absent.
42
+ */
43
+ static remove(schematic: Schematic, name: string): void;
44
+
45
+ /**
46
+ * The names of every definition region, written as a JSON array string.
47
+ */
48
+ static namesJson(schematic: Schematic): string;
49
+
50
+ /**
51
+ * Create an empty region under `name`.
52
+ */
53
+ static create(schematic: Schematic, name: string): void;
54
+
55
+ /**
56
+ * Create a single-point region under `name`.
57
+ */
58
+ static createFromPoint(schematic: Schematic, name: string, x: number, y: number, z: number): void;
59
+
60
+ /**
61
+ * Create a single-box region under `name`.
62
+ */
63
+ static createFromBounds(schematic: Schematic, name: string, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): void;
64
+
65
+ /**
66
+ * Create a single-box region under `name` and return a copy of it.
67
+ */
68
+ static createRegion(schematic: Schematic, name: string, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): DefinitionRegion;
69
+
70
+ /**
71
+ * Add a box to the region stored under `name`. Errors with `NotFound`
72
+ * when absent.
73
+ */
74
+ static addBoundsTo(schematic: Schematic, name: string, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): void;
75
+
76
+ /**
77
+ * Add a point to the region stored under `name`. Errors with `NotFound`
78
+ * when absent.
79
+ */
80
+ static addPointTo(schematic: Schematic, name: string, x: number, y: number, z: number): void;
81
+
82
+ /**
83
+ * Set a metadata entry on the region stored under `name`. Errors with
84
+ * `NotFound` when absent.
85
+ */
86
+ static setMetadataOn(schematic: Schematic, name: string, key: string, value: string): void;
87
+
88
+ /**
89
+ * Shift the region stored under `name` by (`dx`, `dy`, `dz`). Errors
90
+ * with `NotFound` when absent.
91
+ */
92
+ static shiftRegion(schematic: Schematic, name: string, dx: number, dy: number, dz: number): void;
93
+ }
@@ -1,7 +1,7 @@
1
1
  // generated by diplomat-tool
2
- import type { DefinitionRegion } from "./DefinitionRegion"
3
- import type { NucleationError } from "./NucleationError"
4
- import type { Schematic } from "./Schematic"
2
+ import type { DefinitionRegion } from "./DefinitionRegion.mjs"
3
+ import type { NucleationError } from "./NucleationError.mjs"
4
+ import type { Schematic } from "./Schematic.mjs"
5
5
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
6
6
 
7
7
 
@@ -0,0 +1,40 @@
1
+ // generated by diplomat-tool
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { Schematic } from "./Schematic.mjs"
4
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
+
6
+
7
+
8
+ /**
9
+ * Namespace for the script-runner free functions of the old ABI
10
+ * (`run_lua_script`, `run_js_script`, `run_script`).
11
+ */
12
+ export class Scripting {
13
+ /** @internal */
14
+ get ffiValue(): pointer;
15
+ /** @internal */
16
+ constructor();
17
+
18
+
19
+ /**
20
+ * Run a Lua script file. Returns the schematic the script assigns to
21
+ * `result`; `NotFound` if it produced none, `Parse` if it failed, and
22
+ * `InvalidArgument` when built without the `scripting-lua` feature.
23
+ */
24
+ static runLuaScript(path: string): Schematic;
25
+
26
+ /**
27
+ * Run a JS script file. Returns the schematic the script assigns to
28
+ * `result`; `NotFound` if it produced none, `Parse` if it failed, and
29
+ * `InvalidArgument` when built without the `scripting-js` feature.
30
+ */
31
+ static runJsScript(path: string): Schematic;
32
+
33
+ /**
34
+ * Run a script file, auto-detecting the engine by extension (`.lua` or
35
+ * `.js`). Returns the schematic the script assigns to `result`; `NotFound`
36
+ * if it produced none, `Parse` if it failed (including unsupported
37
+ * extensions).
38
+ */
39
+ static runScript(path: string): Schematic;
40
+ }
package/Scripting.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // generated by diplomat-tool
2
- import type { NucleationError } from "./NucleationError"
3
- import type { Schematic } from "./Schematic"
2
+ import type { NucleationError } from "./NucleationError.mjs"
3
+ import type { Schematic } from "./Schematic.mjs"
4
4
  import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
5
5
 
6
6
 
package/Sdf.d.mts ADDED
@@ -0,0 +1,234 @@
1
+ // generated by diplomat-tool
2
+ import type { Field3 } from "./Field3.mjs"
3
+ import type { FieldProgram } from "./FieldProgram.mjs"
4
+ import type { NucleationError } from "./NucleationError.mjs"
5
+ import type { Schematic } from "./Schematic.mjs"
6
+ import type { SdfAxis } from "./SdfAxis.mjs"
7
+ import type { SdfBounds } from "./SdfBounds.mjs"
8
+ import type { SdfCellMode } from "./SdfCellMode.mjs"
9
+ import type { SdfNormal } from "./SdfNormal.mjs"
10
+ import type { Shape } from "./Shape.mjs"
11
+ import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
12
+
13
+
14
+
15
+ /**
16
+ * An immutable, composable signed-distance-field expression graph.
17
+ *
18
+ * Primitive constructors and every combinator return a new graph, so values
19
+ * can be shared safely between Flow nodes and across Kotlin/Java, JavaScript,
20
+ * and Python bindings. JSON is retained only for explicit import/export and
21
+ * the legacy sampling helpers.
22
+ */
23
+ export class Sdf {
24
+ /** @internal */
25
+ get ffiValue(): pointer;
26
+ /** @internal */
27
+ constructor();
28
+
29
+
30
+ static sphere(radius: number): Sdf;
31
+
32
+ /**
33
+ * Axis-aligned rounded box, centered at the origin.
34
+ */
35
+ static boxShape(halfX: number, halfY: number, halfZ: number, rounding: number): Sdf;
36
+
37
+ static ellipsoid(radiusX: number, radiusY: number, radiusZ: number): Sdf;
38
+
39
+ static torus(majorRadius: number, minorRadius: number): Sdf;
40
+
41
+ /**
42
+ * Torus ring cut down to an arc. `cap_angle_degrees` is the half-aperture
43
+ * in `(0, 180]`, measured from +X and mirrored across X; `180` is a full
44
+ * torus.
45
+ */
46
+ static cappedTorus(majorRadius: number, minorRadius: number, capAngleDegrees: number): Sdf;
47
+
48
+ /**
49
+ * Chain-link shape: a torus stretched along Z by `half_length` and
50
+ * capped by two half-tori. `half_length: 0` is a plain torus.
51
+ */
52
+ static link(majorRadius: number, minorRadius: number, halfLength: number): Sdf;
53
+
54
+ static capsule(ax: number, ay: number, az: number, bx: number, by: number, bz: number, radius: number): Sdf;
55
+
56
+ /**
57
+ * Convex hull of two spheres: a capsule with a linear taper between
58
+ * `r1` (at `a`) and `r2` (at `b`) instead of one constant radius.
59
+ */
60
+ static roundCone(ax: number, ay: number, az: number, bx: number, by: number, bz: number, r1: number, r2: number): Sdf;
61
+
62
+ /**
63
+ * Sphere of `radius` intersected with an infinite cone of
64
+ * half-aperture `angle_degrees` (in `(0, 180)`) from the +Y axis,
65
+ * apex at the origin.
66
+ */
67
+ static solidAngle(radius: number, angleDegrees: number): Sdf;
68
+
69
+ /**
70
+ * Sphere cut by the plane `y = height`, keeping the cap above it
71
+ * (a dome). `height` must be strictly between `-radius` and
72
+ * `radius`.
73
+ */
74
+ static cutSphere(radius: number, height: number): Sdf;
75
+
76
+ /**
77
+ * Open (hollow) shell of `cut_sphere`'s dome: just the spherical
78
+ * cap surface, offset by `thickness`, with no flat floor.
79
+ */
80
+ static cutHollowSphere(radius: number, height: number, thickness: number): Sdf;
81
+
82
+ static cappedCylinder(radius: number, halfHeight: number): Sdf;
83
+
84
+ /**
85
+ * Exact Y-axis cylinder with infinite extent. Sampling requires explicit bounds.
86
+ */
87
+ static infiniteCylinder(radius: number): Sdf;
88
+
89
+ static cappedCone(halfHeight: number, bottomRadius: number, topRadius: number): Sdf;
90
+
91
+ static plane(normalX: number, normalY: number, normalZ: number, offset: number): Sdf;
92
+
93
+ static octahedron(size: number): Sdf;
94
+
95
+ static hexPrism(radius: number, halfHeight: number): Sdf;
96
+
97
+ static superPrism(halfX: number, halfY: number, halfZ: number, exponent: number): Sdf;
98
+
99
+ /**
100
+ * Hollow wireframe box: only the 12 edge beams are solid.
101
+ */
102
+ static boxFrame(halfX: number, halfY: number, halfZ: number, thickness: number): Sdf;
103
+
104
+ /**
105
+ * Exact but unbounded Y-axis infinite cone: apex at the origin,
106
+ * single nappe opening along +Y, half-aperture `angle_degrees`
107
+ * strictly in `(0, 90)`.
108
+ */
109
+ static infiniteCone(angleDegrees: number): Sdf;
110
+
111
+ /**
112
+ * Square-base pyramid, vertically centered: base (half-extent
113
+ * `half_base`) at `y = -height/2`, apex at `y = height/2`. `height`
114
+ * must be at least the smallest positive normal `f32`.
115
+ */
116
+ static squarePyramid(halfBase: number, height: number): Sdf;
117
+
118
+ static cells(frequency: number, seed: number, jitter: number, mode: SdfCellMode, threshold: number): Sdf;
119
+
120
+ unionWith(other: Sdf): Sdf;
121
+
122
+ intersectionWith(other: Sdf): Sdf;
123
+
124
+ subtract(other: Sdf): Sdf;
125
+
126
+ smoothUnion(other: Sdf, radius: number): Sdf;
127
+
128
+ smoothSubtract(other: Sdf, radius: number): Sdf;
129
+
130
+ smoothIntersection(other: Sdf, radius: number): Sdf;
131
+
132
+ rounded(radius: number): Sdf;
133
+
134
+ shell(thickness: number): Sdf;
135
+
136
+ /**
137
+ * Symmetric difference (XOR): solid where exactly one of `self`/
138
+ * `other` is solid.
139
+ */
140
+ xorWith(other: Sdf): Sdf;
141
+
142
+ /**
143
+ * Stretches this graph with IQ's origin-centered `opElongate` fold.
144
+ * Exactness requires a suitable origin-centered, reflection-symmetric
145
+ * child; off-center/asymmetric children are mirrored and produce only
146
+ * an estimate. Half-lengths must be finite and non-negative, with at
147
+ * least one strictly positive.
148
+ */
149
+ elongate(halfX: number, halfY: number, halfZ: number): Sdf;
150
+
151
+ translate(x: number, y: number, z: number): Sdf;
152
+
153
+ rotate(xDegrees: number, yDegrees: number, zDegrees: number): Sdf;
154
+
155
+ scale(factor: number): Sdf;
156
+
157
+ mirror(axis: SdfAxis): Sdf;
158
+
159
+ /**
160
+ * Twists this graph about the Y axis by `amount` radians per unit
161
+ * Y (IQ's `opTwist`). *Distorted*: not guaranteed exact even when
162
+ * `self` is.
163
+ */
164
+ twist(amount: number): Sdf;
165
+
166
+ /**
167
+ * Cheaply bends this graph by `amount` radians per unit X (IQ's
168
+ * `opCheapBend`). *Distorted*: not guaranteed exact even when
169
+ * `self` is.
170
+ */
171
+ bend(amount: number): Sdf;
172
+
173
+ repeatInfinite(spacingX: number, spacingY: number, spacingZ: number): Sdf;
174
+
175
+ repeatCounted(spacingX: number, spacingY: number, spacingZ: number, countX: number, countY: number, countZ: number): Sdf;
176
+
177
+ /**
178
+ * Finite rigid instances of this graph at arbitrary XYZ offsets.
179
+ * `offsets` is flat `[x0, y0, z0, x1, y1, z1, ...]` and may contain
180
+ * at most 4096 points.
181
+ */
182
+ repeatPoints(offsets: Array<number>): Sdf;
183
+
184
+ displace(amplitude: number, frequency: number, seed: number, octaves: number): Sdf;
185
+
186
+ /**
187
+ * Offset this surface by a reusable scalar field. The resulting zero
188
+ * set is generally an approximate field, not an exact distance field.
189
+ */
190
+ offsetByField(field: Field3, amplitude: number): Sdf;
191
+
192
+ warp(amplitude: number, frequency: number, seed: number): Sdf;
193
+
194
+ evalAt(x: number, y: number, z: number): number;
195
+
196
+ normal(x: number, y: number, z: number, epsilon: number): SdfNormal;
197
+
198
+ /**
199
+ * Conservative finite bounds, or `NotFound` for an unbounded graph
200
+ * (a bare `plane` or `infinite_cylinder` has no finite extent).
201
+ */
202
+ bounds(): SdfBounds;
203
+
204
+ toShape(): Shape;
205
+
206
+ toShapeBounded(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Shape;
207
+
208
+ static fromJsonString(json: string): Sdf;
209
+
210
+ toJson(): string;
211
+
212
+ /**
213
+ * Wrap a validated {@link FieldProgram} as an `Sdf` graph (cloning it,
214
+ * with its own explicit bounds and distance-kind metadata), so it
215
+ * composes with every other combinator.
216
+ */
217
+ static fromProgram(program: FieldProgram): Sdf;
218
+
219
+ /**
220
+ * Legacy JSON-first terrain helper. Prefer typed constructors and
221
+ * `to_shape()` with `BuildingTool.fill()` for new code.
222
+ */
223
+ static schematicFromSdfAuto(sdfJson: string, rulesJson: string): Schematic;
224
+
225
+ /**
226
+ * Legacy JSON-first terrain helper with optional explicit bounds.
227
+ */
228
+ static schematicFromSdf(sdfJson: string, rulesJson: string, hasBounds: boolean, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Schematic;
229
+
230
+ /**
231
+ * Legacy JSON-first evaluator. Prefer `Sdf.from_json_string(...).eval_at(...)`.
232
+ */
233
+ static eval(sdfJson: string, x: number, y: number, z: number): number;
234
+ }