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
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { BlockPos } from "./BlockPos.mjs"
|
|
3
|
+
import type { Dimensions } from "./Dimensions.mjs"
|
|
4
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
5
|
+
import type { RegionBounds } from "./RegionBounds.mjs"
|
|
6
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
7
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A named sub-volume of a schematic: a union of boxes plus a metadata map.
|
|
13
|
+
*/
|
|
14
|
+
export class DefinitionRegion {
|
|
15
|
+
/** @internal */
|
|
16
|
+
get ffiValue(): pointer;
|
|
17
|
+
/** @internal */
|
|
18
|
+
constructor();
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Create a new empty region (no boxes, no metadata).
|
|
23
|
+
*/
|
|
24
|
+
static create(): DefinitionRegion;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A region consisting of a single inclusive box. Min/max are swapped
|
|
28
|
+
* per axis if given out of order.
|
|
29
|
+
*/
|
|
30
|
+
static fromBounds(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): DefinitionRegion;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Build a region from single-block positions crossing as flat `[i32]`
|
|
34
|
+
* chunked in threes (PORTING rule 7). Errors with `InvalidArgument` if
|
|
35
|
+
* the length is not a multiple of 3.
|
|
36
|
+
*/
|
|
37
|
+
static fromPositions(positions: Array<number>): DefinitionRegion;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Build a region from bounding boxes crossing as flat `[i32]` chunked in
|
|
41
|
+
* sixes (`min_x, min_y, min_z, max_x, max_y, max_z` per box). Errors
|
|
42
|
+
* with `InvalidArgument` if the length is not a multiple of 6.
|
|
43
|
+
*/
|
|
44
|
+
static fromBoundingBoxes(boxes: Array<number>): DefinitionRegion;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Add an inclusive box to the region. Min/max are swapped per axis if
|
|
48
|
+
* given out of order.
|
|
49
|
+
*/
|
|
50
|
+
addBounds(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): void;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Add a single block position (a 1x1x1 box) to the region.
|
|
54
|
+
*/
|
|
55
|
+
addPoint(x: number, y: number, z: number): void;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Set a metadata entry (insert or overwrite the key).
|
|
59
|
+
*/
|
|
60
|
+
setMetadata(key: string, value: string): void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Errors with `NotFound` when the key is absent.
|
|
64
|
+
*/
|
|
65
|
+
getMetadata(key: string): string;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The full metadata map, written as a JSON object string (the old ABI
|
|
69
|
+
* returned an array of `"key=value"` strings).
|
|
70
|
+
*/
|
|
71
|
+
allMetadataJson(): string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The metadata keys, written as a JSON array string.
|
|
75
|
+
*/
|
|
76
|
+
metadataKeysJson(): string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Store a filter expression in the region's metadata under the `filter`
|
|
80
|
+
* key.
|
|
81
|
+
*/
|
|
82
|
+
addFilter(filter: string): void;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* `true` if the region contains no boxes.
|
|
86
|
+
*/
|
|
87
|
+
isEmpty(): boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The total volume in blocks, summed box by box: positions covered by
|
|
91
|
+
* several overlapping boxes are counted once per box.
|
|
92
|
+
*/
|
|
93
|
+
volume(): bigint;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Whether the position lies inside any of the region's boxes.
|
|
97
|
+
*/
|
|
98
|
+
contains(x: number, y: number, z: number): boolean;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Translate every box by (`dx`, `dy`, `dz`) in place.
|
|
102
|
+
*/
|
|
103
|
+
shift(dx: number, dy: number, dz: number): void;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Grow every box in place by (`x`, `y`, `z`) outward on both sides of
|
|
107
|
+
* each axis. Negative values contract; boxes that shrink away are
|
|
108
|
+
* removed.
|
|
109
|
+
*/
|
|
110
|
+
expand(x: number, y: number, z: number): void;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Shrink every box in place by `amount` on all sides (the inverse of
|
|
114
|
+
* a uniform `expand`); boxes that shrink away are removed.
|
|
115
|
+
*/
|
|
116
|
+
contract(amount: number): void;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* A new region: the intersection of `self` and `other`.
|
|
120
|
+
*/
|
|
121
|
+
intersected(other: DefinitionRegion): DefinitionRegion;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* A new region: the union of `self` and `other`.
|
|
125
|
+
*/
|
|
126
|
+
unionWith(other: DefinitionRegion): DefinitionRegion;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* A new region: `self` minus `other`.
|
|
130
|
+
*/
|
|
131
|
+
subtracted(other: DefinitionRegion): DefinitionRegion;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Merge `other`'s boxes and metadata into `self`.
|
|
135
|
+
*/
|
|
136
|
+
merge(other: DefinitionRegion): void;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Union `other`'s boxes into `self` in place.
|
|
140
|
+
*/
|
|
141
|
+
unionInto(other: DefinitionRegion): void;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The overall bounding box. Errors with `NotFound` when the region is
|
|
145
|
+
* empty.
|
|
146
|
+
*/
|
|
147
|
+
bounds(): RegionBounds;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The (width, height, length) of the overall bounding box; all zeros
|
|
151
|
+
* when the region is empty.
|
|
152
|
+
*/
|
|
153
|
+
dimensions(): Dimensions;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* The center block position. Errors with `NotFound` when the region is
|
|
157
|
+
* empty.
|
|
158
|
+
*/
|
|
159
|
+
center(): BlockPos;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The exact (fractional) center, written as a JSON `[x, y, z]` array of
|
|
163
|
+
* floats. Errors with `NotFound` when the region is empty.
|
|
164
|
+
*/
|
|
165
|
+
centerF32Json(): string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Every contained position, written as a flat JSON array of ints
|
|
169
|
+
* (`[x0, y0, z0, x1, y1, z1, …]`), deduplicated, in box order.
|
|
170
|
+
*/
|
|
171
|
+
positionsJson(): string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Every contained position in sorted (y, z, x) order, written as a flat
|
|
175
|
+
* JSON array of ints.
|
|
176
|
+
*/
|
|
177
|
+
positionsSortedJson(): string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The number of boxes making up this region.
|
|
181
|
+
*/
|
|
182
|
+
boxCount(): number;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* The box at `index`. Errors with `NotFound` when out of range.
|
|
186
|
+
*/
|
|
187
|
+
getBox(index: number): RegionBounds;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Every box, written as a flat JSON array of ints (six ints per box:
|
|
191
|
+
* `min_x, min_y, min_z, max_x, max_y, max_z`).
|
|
192
|
+
*/
|
|
193
|
+
boxesJson(): string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Whether all positions form a single face-connected (6-connectivity)
|
|
197
|
+
* component. `true` for empty and single-block regions.
|
|
198
|
+
*/
|
|
199
|
+
isContiguous(): boolean;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The number of face-connected (6-connectivity) components; 0 when
|
|
203
|
+
* the region is empty.
|
|
204
|
+
*/
|
|
205
|
+
connectedComponents(): number;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Merge overlapping/adjacent boxes into a minimal representation.
|
|
209
|
+
*/
|
|
210
|
+
simplify(): void;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* A new region containing only the positions where `schematic` has a
|
|
214
|
+
* block named `block_name`.
|
|
215
|
+
*/
|
|
216
|
+
filterByBlock(schematic: Schematic, blockName: string): DefinitionRegion;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* A new region containing only the positions where the block in
|
|
220
|
+
* `schematic` matches every property in `properties_json` (a JSON
|
|
221
|
+
* object of property name → value strings).
|
|
222
|
+
*/
|
|
223
|
+
filterByProperties(schematic: Schematic, propertiesJson: string): DefinitionRegion;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Remove every position where `schematic` has a block named
|
|
227
|
+
* `block_name` (in place).
|
|
228
|
+
*/
|
|
229
|
+
excludeBlock(schematic: Schematic, blockName: string): void;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Whether any of the region's boxes intersects the given inclusive
|
|
233
|
+
* box (useful for frustum culling).
|
|
234
|
+
*/
|
|
235
|
+
intersectsBounds(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): boolean;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* A new region shifted by (`dx`, `dy`, `dz`).
|
|
239
|
+
*/
|
|
240
|
+
shifted(dx: number, dy: number, dz: number): DefinitionRegion;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* A new region expanded by (`x`, `y`, `z`) on each axis.
|
|
244
|
+
*/
|
|
245
|
+
expanded(x: number, y: number, z: number): DefinitionRegion;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* A new region contracted by `amount` on every axis.
|
|
249
|
+
*/
|
|
250
|
+
contracted(amount: number): DefinitionRegion;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* A deep copy of this region.
|
|
254
|
+
*/
|
|
255
|
+
copy(): DefinitionRegion;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Store a display color (`0xRRGGBB`) in the region's metadata.
|
|
259
|
+
*/
|
|
260
|
+
setColor(color: number): void;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The blocks of `schematic` inside this region, written as a JSON array
|
|
264
|
+
* of `{"x", "y", "z", "name", "properties"}` objects (the old ABI
|
|
265
|
+
* returned a `CBlockArray`).
|
|
266
|
+
*/
|
|
267
|
+
blocksJson(schematic: Schematic): string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Write this region into `schematic`'s definition-region map under
|
|
271
|
+
* `name` (insert or overwrite).
|
|
272
|
+
*/
|
|
273
|
+
sync(schematic: Schematic, name: string): void;
|
|
274
|
+
}
|
package/DefinitionRegion.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
-
import type { BlockPos } from "./BlockPos"
|
|
3
|
-
import type { Dimensions } from "./Dimensions"
|
|
4
|
-
import type { NucleationError } from "./NucleationError"
|
|
5
|
-
import type { RegionBounds } from "./RegionBounds"
|
|
6
|
-
import type { Schematic } from "./Schematic"
|
|
2
|
+
import type { BlockPos } from "./BlockPos.mjs"
|
|
3
|
+
import type { Dimensions } from "./Dimensions.mjs"
|
|
4
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
5
|
+
import type { RegionBounds } from "./RegionBounds.mjs"
|
|
6
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
7
7
|
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
8
8
|
|
|
9
9
|
|
package/Diff.d.mts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
* A computed diff between two schematics.
|
|
10
|
+
*/
|
|
11
|
+
export class Diff {
|
|
12
|
+
/** @internal */
|
|
13
|
+
get ffiValue(): pointer;
|
|
14
|
+
/** @internal */
|
|
15
|
+
constructor();
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Diff two schematics with the given preset (default cost model).
|
|
20
|
+
* Errors with `InvalidArgument` on an unknown preset.
|
|
21
|
+
*/
|
|
22
|
+
static compute(a: Schematic, b: Schematic, preset: string): Diff;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Diff two schematics with optional cost/symmetry overrides. Negative
|
|
26
|
+
* cost ints mean "unset" (use the preset default); an empty `symmetry`
|
|
27
|
+
* string means "unset". Errors with `InvalidArgument` on an unknown
|
|
28
|
+
* preset or symmetry name.
|
|
29
|
+
*/
|
|
30
|
+
static computeWithOpts(a: Schematic, b: Schematic, preset: string, costAdd: number, costDelete: number, costChange: number, costSwap: number, symmetry: string): Diff;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Reconstruct a diff from its JSON representation.
|
|
34
|
+
*/
|
|
35
|
+
static fromJson(json: string): Diff;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The edit distance of the diff.
|
|
39
|
+
*/
|
|
40
|
+
distance(): bigint;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The support (alignment confidence) of the diff.
|
|
44
|
+
*/
|
|
45
|
+
support(): number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Serialize the diff to its full JSON representation.
|
|
49
|
+
*/
|
|
50
|
+
toJson(): string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Serialize the diff to its compact summary JSON.
|
|
54
|
+
*/
|
|
55
|
+
summaryJson(): string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A new schematic containing only the blocks added in this diff.
|
|
59
|
+
*/
|
|
60
|
+
added(): Schematic;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A new schematic containing only the blocks removed in this diff.
|
|
64
|
+
*/
|
|
65
|
+
removed(): Schematic;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A new schematic containing only the blocks changed in this diff.
|
|
69
|
+
*/
|
|
70
|
+
changed(): Schematic;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* A new schematic containing only the blocks swapped in this diff.
|
|
74
|
+
*/
|
|
75
|
+
swapped(): Schematic;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* A new schematic with marker blocks summarizing this diff.
|
|
79
|
+
*/
|
|
80
|
+
markers(): Schematic;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Render a diff overlay on top of an "after" GLB buffer, returning the
|
|
84
|
+
* new GLB as base64 (PORTING rule 6). Requires the `meshing` feature;
|
|
85
|
+
* errors with `Mesh` when compiled without it.
|
|
86
|
+
*/
|
|
87
|
+
toOverlayGlbB64(afterGlb: Array<number>): string;
|
|
88
|
+
}
|
package/Diff.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/Dimensions.d.mts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
export type Dimensions_obj = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
z: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export class Dimensions {
|
|
13
|
+
get x(): number;
|
|
14
|
+
set x(value: number);
|
|
15
|
+
get y(): number;
|
|
16
|
+
set y(value: number);
|
|
17
|
+
get z(): number;
|
|
18
|
+
set z(value: number);
|
|
19
|
+
/** @internal */
|
|
20
|
+
static fromFields(structObj : Dimensions_obj) : Dimensions;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Create `Dimensions` from an object that contains all of `Dimensions`s fields.
|
|
24
|
+
* Optional fields do not need to be included in the provided object.
|
|
25
|
+
*/
|
|
26
|
+
constructor(structObj: Dimensions_obj);
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
3
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export class DistanceField {
|
|
8
|
+
/** @internal */
|
|
9
|
+
get ffiValue(): pointer;
|
|
10
|
+
/** @internal */
|
|
11
|
+
constructor();
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Distance transform of a build's occupied voxels: every solid block
|
|
16
|
+
* learns how many blocks it sits below the surface, and the gradient of
|
|
17
|
+
* that depth gives the outward normal. Computed once over the
|
|
18
|
+
* schematic's bounding box.
|
|
19
|
+
*/
|
|
20
|
+
static fromSchematic(schematic: Schematic): DistanceField;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Blocks below the surface at a voxel: 0 for empty/outside, 1 at the
|
|
24
|
+
* surface, increasing inward.
|
|
25
|
+
*/
|
|
26
|
+
depth(x: number, y: number, z: number): number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The upward component of the outward surface normal: 1 on flat ground,
|
|
30
|
+
* 0 on a vertical face, negative under an overhang. The scalar to key
|
|
31
|
+
* slope-based landscaping on (grass on the flats, stone on the steeps).
|
|
32
|
+
*/
|
|
33
|
+
slope(x: number, y: number, z: number): number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The full outward surface normal as JSON `[nx, ny, nz]`.
|
|
37
|
+
*/
|
|
38
|
+
normalJson(x: number, y: number, z: number): string;
|
|
39
|
+
}
|
package/DistanceField.d.ts
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import type { OutputCondition } from "./OutputCondition.mjs"
|
|
4
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* How long to run the circuit for one `execute` call (PORTING rule 10).
|
|
10
|
+
*/
|
|
11
|
+
export class ExecutionMode {
|
|
12
|
+
/** @internal */
|
|
13
|
+
get ffiValue(): pointer;
|
|
14
|
+
/** @internal */
|
|
15
|
+
constructor();
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Run for exactly `ticks` ticks.
|
|
20
|
+
*/
|
|
21
|
+
static fixedTicks(ticks: number): ExecutionMode;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Run until the output named `output_name` meets `condition`,
|
|
25
|
+
* checking every `check_interval` ticks, giving up after `max_ticks`
|
|
26
|
+
* ticks (the result's `condition_met` reports which happened).
|
|
27
|
+
*/
|
|
28
|
+
static untilCondition(outputName: string, condition: OutputCondition, maxTicks: number, checkInterval: number): ExecutionMode;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Run until any output changes from its initial reading, checking
|
|
32
|
+
* every `check_interval` ticks, giving up after `max_ticks` ticks.
|
|
33
|
+
*/
|
|
34
|
+
static untilChange(maxTicks: number, checkInterval: number): ExecutionMode;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Run (one tick at a time) until all outputs have been unchanged for
|
|
38
|
+
* `stable_ticks` consecutive ticks, giving up after `max_ticks`
|
|
39
|
+
* ticks (the result's `condition_met` reports stability).
|
|
40
|
+
*/
|
|
41
|
+
static untilStable(stableTicks: number, maxTicks: number): ExecutionMode;
|
|
42
|
+
}
|
package/ExecutionMode.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
-
import type { NucleationError } from "./NucleationError"
|
|
3
|
-
import type { OutputCondition } from "./OutputCondition"
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import type { OutputCondition } from "./OutputCondition.mjs"
|
|
4
4
|
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
5
5
|
|
|
6
6
|
|
package/Field3.d.mts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { FieldRange } from "./FieldRange.mjs"
|
|
3
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
4
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Immutable scalar field evaluated over world-space `(x, y, z)`.
|
|
10
|
+
*
|
|
11
|
+
* A `Field3` has scalar semantics only. It may be shared by geometry and
|
|
12
|
+
* material consumers without being reinterpreted as a signed-distance field.
|
|
13
|
+
*/
|
|
14
|
+
export class Field3 {
|
|
15
|
+
/** @internal */
|
|
16
|
+
get ffiValue(): pointer;
|
|
17
|
+
/** @internal */
|
|
18
|
+
constructor();
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Deterministic value-noise FBM normalized to `[-1, 1]`.
|
|
23
|
+
*/
|
|
24
|
+
static valueNoiseFbm(frequency: number, seed: number, octaves: number): Field3;
|
|
25
|
+
|
|
26
|
+
evalAt(x: number, y: number, z: number): number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The field's analytically proven output range.
|
|
30
|
+
*
|
|
31
|
+
* Returns `NotFound` when no range can be proven — callers mapping a
|
|
32
|
+
* field onto a gradient must handle that rather than silently
|
|
33
|
+
* propagating a sentinel into their `lo`/`hi` bounds.
|
|
34
|
+
*/
|
|
35
|
+
outputRange(): FieldRange;
|
|
36
|
+
|
|
37
|
+
static fromJsonString(json: string): Field3;
|
|
38
|
+
|
|
39
|
+
toJson(): string;
|
|
40
|
+
}
|
package/Field3.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { FieldRange } from "./FieldRange.mjs"
|
|
3
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
4
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Immutable scalar field evaluated over world-space `(x, y, z)`.
|
|
10
|
+
*
|
|
11
|
+
* A `Field3` has scalar semantics only. It may be shared by geometry and
|
|
12
|
+
* material consumers without being reinterpreted as a signed-distance field.
|
|
13
|
+
*/
|
|
14
|
+
export class Field3 {
|
|
15
|
+
/** @internal */
|
|
16
|
+
get ffiValue(): pointer;
|
|
17
|
+
/** @internal */
|
|
18
|
+
constructor();
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Deterministic value-noise FBM normalized to `[-1, 1]`.
|
|
23
|
+
*/
|
|
24
|
+
static valueNoiseFbm(frequency: number, seed: number, octaves: number): Field3;
|
|
25
|
+
|
|
26
|
+
evalAt(x: number, y: number, z: number): number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The field's analytically proven output range.
|
|
30
|
+
*
|
|
31
|
+
* Returns `NotFound` when no range can be proven — callers mapping a
|
|
32
|
+
* field onto a gradient must handle that rather than silently
|
|
33
|
+
* propagating a sentinel into their `lo`/`hi` bounds.
|
|
34
|
+
*/
|
|
35
|
+
outputRange(): FieldRange;
|
|
36
|
+
|
|
37
|
+
static fromJsonString(json: string): Field3;
|
|
38
|
+
|
|
39
|
+
toJson(): string;
|
|
40
|
+
}
|