nucleation 0.6.0 → 0.8.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/AnimationEffect.d.mts +44 -0
- package/AnimationEffect.d.ts +1 -1
- package/Autostack.d.mts +43 -0
- package/Autostack.d.ts +2 -2
- package/BlockPos.d.mts +28 -0
- package/BlockState.d.mts +39 -0
- package/BlockState.d.ts +1 -1
- package/Blocks.d.mts +91 -0
- package/Blocks.d.ts +1 -1
- package/Brush.d.mts +99 -0
- package/Brush.d.ts +21 -12
- package/Brush.mjs +66 -9
- package/BuildAnimation.d.mts +142 -0
- package/BuildAnimation.d.ts +5 -5
- package/BuildingTool.d.mts +46 -0
- package/BuildingTool.d.ts +4 -4
- package/CellularSdfConfig.d.mts +22 -0
- package/CellularSdfConfig.d.ts +22 -0
- package/CellularSdfConfig.mjs +69 -0
- package/ChunkMeshResult.d.mts +75 -0
- package/ChunkMeshResult.d.ts +7 -7
- package/CircuitBuilder.d.mts +118 -0
- package/CircuitBuilder.d.ts +6 -6
- package/Curve3D.d.mts +27 -0
- package/Curve3D.d.ts +1 -1
- package/DefinitionRegion.d.mts +274 -0
- package/DefinitionRegion.d.ts +5 -5
- package/Diff.d.mts +88 -0
- package/Diff.d.ts +2 -2
- package/Dimensions.d.mts +28 -0
- package/DistanceField.d.mts +39 -0
- package/DistanceField.d.ts +1 -1
- package/ExecutionMode.d.mts +42 -0
- package/ExecutionMode.d.ts +2 -2
- package/Field3.d.mts +40 -0
- package/Field3.d.ts +40 -0
- package/Field3.mjs +160 -0
- package/FieldProgram.d.mts +40 -0
- package/FieldProgram.d.ts +40 -0
- package/FieldProgram.mjs +167 -0
- package/FieldProgramBinaryOp.d.mts +42 -0
- package/FieldProgramBinaryOp.d.ts +42 -0
- package/FieldProgramBinaryOp.mjs +118 -0
- package/FieldProgramBuilder.d.mts +104 -0
- package/FieldProgramBuilder.d.ts +104 -0
- package/FieldProgramBuilder.mjs +486 -0
- package/FieldProgramDistanceKind.d.mts +26 -0
- package/FieldProgramDistanceKind.d.ts +26 -0
- package/FieldProgramDistanceKind.mjs +78 -0
- package/FieldProgramUnaryOp.d.mts +34 -0
- package/FieldProgramUnaryOp.d.ts +34 -0
- package/FieldProgramUnaryOp.mjs +102 -0
- package/FieldProgramValueType.d.mts +25 -0
- package/FieldProgramValueType.d.ts +25 -0
- package/FieldProgramValueType.mjs +75 -0
- package/FieldRange.d.mts +15 -0
- package/FieldRange.d.ts +15 -0
- package/FieldRange.mjs +108 -0
- package/Fingerprint.d.mts +44 -0
- package/Fingerprint.d.ts +2 -2
- package/GeneratedChunk.d.mts +35 -0
- package/GeneratedChunk.d.ts +35 -0
- package/GeneratedChunk.mjs +178 -0
- package/GeneratedChunkCoverage.d.mts +25 -0
- package/GeneratedChunkCoverage.d.ts +25 -0
- package/GeneratedChunkCoverage.mjs +75 -0
- package/GeneratedChunkOverlayMode.d.mts +24 -0
- package/GeneratedChunkOverlayMode.d.ts +24 -0
- package/GeneratedChunkOverlayMode.mjs +72 -0
- package/GeneratedWorldStream.d.mts +28 -0
- package/GeneratedWorldStream.d.ts +28 -0
- package/GeneratedWorldStream.mjs +86 -0
- package/Geo.d.mts +41 -0
- package/Geo.d.ts +2 -2
- package/InterpolationSpace.d.mts +25 -0
- package/IoLayout.d.mts +26 -0
- package/IoLayoutBuilder.d.mts +73 -0
- package/IoLayoutBuilder.d.ts +4 -4
- package/IoType.d.mts +41 -0
- package/ItemModelConfig.d.mts +65 -0
- package/ItemModelConfig.d.ts +1 -1
- package/ItemModelPackBuilder.d.mts +32 -0
- package/ItemModelPackBuilder.d.ts +1 -1
- package/ItemModelResult.d.mts +72 -0
- package/ItemModelResult.d.ts +7 -7
- package/ItemScale.d.mts +31 -0
- package/LayoutFunction.d.mts +52 -0
- package/LayoutFunction.d.ts +1 -1
- package/MchprsWorld.d.mts +131 -0
- package/MchprsWorld.d.ts +3 -3
- package/MeshBounds.d.mts +40 -0
- package/MeshConfig.d.mts +101 -0
- package/MeshConfig.d.ts +1 -1
- package/MeshJob.d.mts +44 -0
- package/MeshJob.d.ts +7 -7
- package/MeshPhase.d.mts +38 -0
- package/MeshProgress.d.mts +32 -0
- package/MeshProgress.d.ts +1 -1
- package/MeshResult.d.mts +65 -0
- package/MeshResult.d.ts +5 -5
- package/MultiMeshResult.d.mts +50 -0
- package/MultiMeshResult.d.ts +5 -5
- package/Nbt.d.mts +50 -0
- package/Nbt.d.ts +1 -1
- package/NucleationError.d.mts +41 -0
- package/NucleationError.d.ts +5 -0
- package/NucleationError.mjs +8 -1
- package/OutputCondition.d.mts +45 -0
- package/OutputCondition.d.ts +1 -1
- package/Palette.d.mts +145 -0
- package/Palette.d.ts +9 -1
- package/Palette.mjs +35 -0
- package/PaletteBuilder.d.mts +119 -0
- package/PaletteBuilder.d.ts +2 -2
- package/RawMeshExport.d.mts +74 -0
- package/RawMeshExport.d.ts +4 -4
- package/RedstoneGraph.d.mts +58 -0
- package/RedstoneGraph.d.ts +1 -1
- package/RegionBounds.d.mts +41 -0
- package/RenderConfig.d.mts +101 -0
- package/RenderConfig.d.ts +1 -1
- package/Renderer.d.mts +51 -0
- package/Renderer.d.ts +4 -4
- package/ResourcePack.d.mts +105 -0
- package/ResourcePack.d.ts +3 -3
- package/ResourcePackList.d.mts +32 -0
- package/Schematic.d.mts +734 -0
- package/Schematic.d.ts +4 -4
- package/SchematicBuilder.d.mts +103 -0
- package/SchematicBuilder.d.ts +2 -2
- package/SchematicRegions.d.mts +93 -0
- package/SchematicRegions.d.ts +3 -3
- package/Scripting.d.mts +40 -0
- package/Scripting.d.ts +2 -2
- package/Sdf.d.mts +234 -0
- package/Sdf.d.ts +208 -13
- package/Sdf.mjs +1106 -11
- package/SdfAxis.d.mts +25 -0
- package/SdfAxis.d.ts +25 -0
- package/SdfAxis.mjs +75 -0
- package/SdfBounds.d.mts +19 -0
- package/SdfBounds.d.ts +19 -0
- package/SdfBounds.mjs +160 -0
- package/SdfCellMode.d.mts +26 -0
- package/SdfCellMode.d.ts +26 -0
- package/SdfCellMode.mjs +78 -0
- package/SdfNormal.d.mts +16 -0
- package/SdfNormal.d.ts +16 -0
- package/SdfNormal.mjs +121 -0
- package/Shape.d.mts +143 -0
- package/Shape.d.ts +2 -2
- package/SortStrategy.d.mts +86 -0
- package/SortStrategy.d.ts +1 -1
- package/Store.d.mts +83 -0
- package/Store.d.ts +2 -2
- package/StoreIo.d.mts +71 -0
- package/StoreIo.d.ts +2 -2
- package/TextureAtlas.d.mts +40 -0
- package/TextureAtlas.d.ts +4 -4
- package/TextureInfo.d.mts +34 -0
- package/TypedCircuitExecutor.d.mts +101 -0
- package/TypedCircuitExecutor.d.ts +6 -6
- package/Value.d.mts +73 -0
- package/Value.d.ts +1 -1
- package/VideoConfig.d.mts +15 -0
- package/Voxelizer.d.mts +58 -0
- package/Voxelizer.d.ts +4 -4
- package/WorldChunkView.d.mts +75 -0
- package/WorldChunkView.d.ts +2 -2
- package/WorldGenerator.d.mts +75 -0
- package/WorldGenerator.d.ts +75 -0
- package/WorldGenerator.mjs +255 -0
- package/WorldSink.d.mts +50 -0
- package/WorldSink.d.ts +2 -2
- package/WorldStream.d.mts +45 -0
- package/WorldStream.d.ts +2 -2
- package/WsPartitionHints.d.mts +29 -0
- package/WsPartitionHints.d.ts +1 -1
- package/WsProfile.d.mts +46 -0
- package/WsProfile.d.ts +1 -1
- package/WsRunResult.d.mts +83 -0
- package/WsRunResult.d.ts +5 -5
- package/WsSegmentJob.d.mts +28 -0
- package/WsSegmentJob.d.ts +1 -1
- package/diplomat-runtime.d.mts +15 -0
- package/index.d.mts +177 -0
- package/index.d.ts +106 -70
- package/index.mjs +37 -1
- package/nucleation.wasm +0 -0
- package/package.json +2 -1
package/Sdf.d.ts
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
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"
|
|
4
11
|
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
5
12
|
|
|
6
13
|
|
|
7
14
|
|
|
8
15
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
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.
|
|
11
22
|
*/
|
|
12
23
|
export class Sdf {
|
|
13
24
|
/** @internal */
|
|
@@ -16,24 +27,208 @@ export class Sdf {
|
|
|
16
27
|
constructor();
|
|
17
28
|
|
|
18
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
|
+
|
|
19
219
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* the ergonomic path for bounded trees (all primitives except
|
|
23
|
-
* `plane`). Fails with `InvalidArgument` for unbounded trees; use
|
|
24
|
-
* `schematic_from_sdf` with explicit bounds for those.
|
|
220
|
+
* Legacy JSON-first terrain helper. Prefer typed constructors and
|
|
221
|
+
* `to_shape()` with `BuildingTool.fill()` for new code.
|
|
25
222
|
*/
|
|
26
223
|
static schematicFromSdfAuto(sdfJson: string, rulesJson: string): Schematic;
|
|
27
224
|
|
|
28
225
|
/**
|
|
29
|
-
*
|
|
30
|
-
* `InvalidArgument` for unbounded trees) and the `min_*`/`max_*` arguments
|
|
31
|
-
* are ignored.
|
|
226
|
+
* Legacy JSON-first terrain helper with optional explicit bounds.
|
|
32
227
|
*/
|
|
33
228
|
static schematicFromSdf(sdfJson: string, rulesJson: string, hasBounds: boolean, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Schematic;
|
|
34
229
|
|
|
35
230
|
/**
|
|
36
|
-
*
|
|
231
|
+
* Legacy JSON-first evaluator. Prefer `Sdf.from_json_string(...).eval_at(...)`.
|
|
37
232
|
*/
|
|
38
233
|
static eval(sdfJson: string, x: number, y: number, z: number): number;
|
|
39
234
|
}
|