nucleation 0.5.1 → 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.
- 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/Palette.d.mts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A set of colored blocks that color/gradient brushes snap their computed
|
|
9
|
+
* colors to (nearest neighbor in Oklab space). Wraps an Arc'd
|
|
10
|
+
* {@link crate::building::BlockPalette}; sharing one palette across many
|
|
11
|
+
* brushes is cheap.
|
|
12
|
+
*/
|
|
13
|
+
export class Palette {
|
|
14
|
+
/** @internal */
|
|
15
|
+
get ffiValue(): pointer;
|
|
16
|
+
/** @internal */
|
|
17
|
+
constructor();
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Every block blockpedia knows a color for (the default palette
|
|
22
|
+
* brushes use when none is set).
|
|
23
|
+
*/
|
|
24
|
+
static all(): Palette;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Only solid blocks: no transparency, gravity, tile entities, or
|
|
28
|
+
* support requirements.
|
|
29
|
+
*/
|
|
30
|
+
static solid(): Palette;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Conservative structural set (full building blocks).
|
|
34
|
+
*/
|
|
35
|
+
static structural(): Palette;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Decorative set: allows stairs/slabs but no tile entities.
|
|
39
|
+
*/
|
|
40
|
+
static decorative(): Palette;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The 16 concrete colors (excludes concrete powder).
|
|
44
|
+
*/
|
|
45
|
+
static concrete(): Palette;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The 16 wool colors.
|
|
49
|
+
*/
|
|
50
|
+
static wool(): Palette;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Terracotta colors (excludes glazed variants).
|
|
54
|
+
*/
|
|
55
|
+
static terracotta(): Palette;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Genuinely gray blocks: opaque full cubes whose measured color
|
|
59
|
+
* is near-neutral (low Oklab chroma) — judged from color data,
|
|
60
|
+
* not names.
|
|
61
|
+
*/
|
|
62
|
+
static grayscale(): Palette;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The planks family — a natural light→dark wood ramp.
|
|
66
|
+
*/
|
|
67
|
+
static wood(): Palette;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A copy of this palette with ordered dithering enabled: brushes
|
|
71
|
+
* snapping through it alternate between the two nearest blocks per
|
|
72
|
+
* voxel (4x4 Bayer threshold, deterministic in position), which
|
|
73
|
+
* reads as intermediate shades at a distance — the classic map-art
|
|
74
|
+
* trick. Ramp and list queries are unaffected.
|
|
75
|
+
*/
|
|
76
|
+
dithered(): Palette;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* A copy of this palette ordered by perceptual lightness (Oklab L,
|
|
80
|
+
* dark → light). Combined with `block_ids_json`, gives a
|
|
81
|
+
* ready-to-index ramp: `ids[i]` for intensity `i / (len - 1)`.
|
|
82
|
+
*/
|
|
83
|
+
sortedByLightness(): Palette;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* JSON array of exactly `steps` DISTINCT block ids forming the
|
|
87
|
+
* smoothest ramp this palette can make from (`r1`,`g1`,`b1`) to
|
|
88
|
+
* (`r2`,`g2`,`b2`): targets are evenly spaced along the Oklab line
|
|
89
|
+
* and blocks are chosen by a minimum-cost monotonic matching, so
|
|
90
|
+
* off-hue blocks are penalized and no block repeats. Errors with
|
|
91
|
+
* `InvalidArgument` when the palette has fewer than `steps` blocks,
|
|
92
|
+
* `steps` is 0, or start equals end.
|
|
93
|
+
*/
|
|
94
|
+
rampIdsJson(r1: number, g1: number, b1: number, r2: number, g2: number, b2: number, steps: number): string;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* JSON array of exactly `steps` block ids sampling the color
|
|
98
|
+
* gradient from (`r1`,`g1`,`b1`) to (`r2`,`g2`,`b2`) in Oklab
|
|
99
|
+
* space, each step snapped to this palette's closest block. Built
|
|
100
|
+
* for value→block lookups (heatmaps, fractals): index the returned
|
|
101
|
+
* list by `intensity * (steps - 1)`. Entries may repeat on coarse
|
|
102
|
+
* palettes; errors with `NotFound` on an empty palette.
|
|
103
|
+
*/
|
|
104
|
+
gradientIdsJson(r1: number, g1: number, b1: number, r2: number, g2: number, b2: number, steps: number): string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* JSON array of exactly `steps` block ids sampling an Oklab gradient
|
|
108
|
+
* whose endpoints are the measured texture colors of `start_block`
|
|
109
|
+
* and `end_block`. Errors with `NotFound` when either id is unknown
|
|
110
|
+
* or has no measured color, or when this palette is empty.
|
|
111
|
+
*/
|
|
112
|
+
gradientIdsBetweenBlocksJson(startBlock: string, endBlock: string, steps: number): string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Custom palette from a JSON array of block ids, e.g.
|
|
116
|
+
* `["minecraft:stone", "minecraft:oak_planks"]`. Ids blockpedia has
|
|
117
|
+
* no color for are silently skipped — check `len` afterwards.
|
|
118
|
+
*/
|
|
119
|
+
static fromBlockIds(idsJson: string): Palette;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Number of blocks in the palette.
|
|
123
|
+
*/
|
|
124
|
+
len(): number;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The palette's block ids as a JSON array string.
|
|
128
|
+
*/
|
|
129
|
+
blockIdsJson(): string;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Position-aware dithered snap: the block for the given RGB at
|
|
133
|
+
* voxel (x, y, z), alternating between the two nearest palette
|
|
134
|
+
* blocks per position (4x4 Bayer) — the per-pixel entry point for
|
|
135
|
+
* pixel art and image mapping. Deterministic. Errors with
|
|
136
|
+
* `NotFound` on an empty palette.
|
|
137
|
+
*/
|
|
138
|
+
closestBlockDithered(r: number, g: number, b: number, x: number, y: number, z: number): string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The palette block whose color is closest (Oklab distance) to the
|
|
142
|
+
* given RGB. Errors with `NotFound` on an empty palette.
|
|
143
|
+
*/
|
|
144
|
+
closestBlock(r: number, g: number, b: number): string;
|
|
145
|
+
}
|
package/Palette.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
-
import type { NucleationError } from "./NucleationError"
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
3
|
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
4
4
|
|
|
5
5
|
|
|
@@ -103,6 +103,14 @@ export class Palette {
|
|
|
103
103
|
*/
|
|
104
104
|
gradientIdsJson(r1: number, g1: number, b1: number, r2: number, g2: number, b2: number, steps: number): string;
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* JSON array of exactly `steps` block ids sampling an Oklab gradient
|
|
108
|
+
* whose endpoints are the measured texture colors of `start_block`
|
|
109
|
+
* and `end_block`. Errors with `NotFound` when either id is unknown
|
|
110
|
+
* or has no measured color, or when this palette is empty.
|
|
111
|
+
*/
|
|
112
|
+
gradientIdsBetweenBlocksJson(startBlock: string, endBlock: string, steps: number): string;
|
|
113
|
+
|
|
106
114
|
/**
|
|
107
115
|
* Custom palette from a JSON array of block ids, e.g.
|
|
108
116
|
* `["minecraft:stone", "minecraft:oak_planks"]`. Ids blockpedia has
|
package/Palette.mjs
CHANGED
|
@@ -291,6 +291,41 @@ export class Palette {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
+
/**
|
|
295
|
+
* JSON array of exactly `steps` block ids sampling an Oklab gradient
|
|
296
|
+
* whose endpoints are the measured texture colors of `start_block`
|
|
297
|
+
* and `end_block`. Errors with `NotFound` when either id is unknown
|
|
298
|
+
* or has no measured color, or when this palette is empty.
|
|
299
|
+
*/
|
|
300
|
+
gradientIdsBetweenBlocksJson(startBlock, endBlock, steps) {
|
|
301
|
+
let functionCleanupArena = new diplomatRuntime.CleanupArena();
|
|
302
|
+
|
|
303
|
+
const startBlockSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, startBlock)));
|
|
304
|
+
const endBlockSlice = functionCleanupArena.alloc(diplomatRuntime.DiplomatBuf.sliceWrapper(wasm, diplomatRuntime.DiplomatBuf.str8(wasm, endBlock)));
|
|
305
|
+
const diplomatReceive = new diplomatRuntime.DiplomatReceiveBuf(wasm, 5, 4, true);
|
|
306
|
+
|
|
307
|
+
const write = new diplomatRuntime.DiplomatWriteBuf(wasm);
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
const result = wasm.Palette_gradient_ids_between_blocks_json(diplomatReceive.buffer, this.ffiValue, startBlockSlice.ptr, endBlockSlice.ptr, steps, write.buffer);
|
|
311
|
+
|
|
312
|
+
try {
|
|
313
|
+
if (!diplomatReceive.resultFlag) {
|
|
314
|
+
const cause = new NucleationError(diplomatRuntime.internalConstructor, diplomatRuntime.enumDiscriminant(wasm, diplomatReceive.buffer));
|
|
315
|
+
throw new globalThis.Error('NucleationError.' + cause.value, { cause });
|
|
316
|
+
}
|
|
317
|
+
return write.readString8();
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
finally {
|
|
321
|
+
diplomatRuntime.FUNCTION_PARAM_ALLOC.clean();
|
|
322
|
+
functionCleanupArena.free();
|
|
323
|
+
|
|
324
|
+
diplomatReceive.free();
|
|
325
|
+
write.free();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
294
329
|
/**
|
|
295
330
|
* Custom palette from a JSON array of block ids, e.g.
|
|
296
331
|
* `["minecraft:stone", "minecraft:oak_planks"]`. Ids blockpedia has
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import type { Palette } from "./Palette.mjs"
|
|
4
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Filter-driven palette construction (wraps
|
|
10
|
+
* {@link crate::building::PaletteBuilder}, which fronts blockpedia's
|
|
11
|
+
* `BlockFilter`). Call flag methods, then `build` — the builder is
|
|
12
|
+
* consumed; further calls error with `AlreadyConsumed`.
|
|
13
|
+
*/
|
|
14
|
+
export class PaletteBuilder {
|
|
15
|
+
/** @internal */
|
|
16
|
+
get ffiValue(): pointer;
|
|
17
|
+
/** @internal */
|
|
18
|
+
constructor();
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A builder matching every colored block (no filters yet).
|
|
23
|
+
*/
|
|
24
|
+
static create(): PaletteBuilder;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Exclude gravity-affected blocks (sand, gravel, ...).
|
|
28
|
+
*/
|
|
29
|
+
excludeFalling(): void;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Exclude blocks with block entities (chests, furnaces, ...).
|
|
33
|
+
*/
|
|
34
|
+
excludeTileEntities(): void;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Keep only full cube blocks (no stairs, slabs, fences, ...).
|
|
38
|
+
* Metadata-driven: uses the official model geometry extracted from
|
|
39
|
+
* the vanilla jars, not block-name guessing.
|
|
40
|
+
*/
|
|
41
|
+
fullBlocksOnly(): void;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Exclude blocks that need supporting blocks (torches, rails, ...).
|
|
45
|
+
*/
|
|
46
|
+
excludeNeedsSupport(): void;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Exclude transparent/translucent blocks (glass, leaves, ...).
|
|
50
|
+
* Metadata-driven: uses the per-block transparency flag from the
|
|
51
|
+
* block-data pipeline, not block-name guessing.
|
|
52
|
+
*/
|
|
53
|
+
excludeTransparent(): void;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Exclude light-emitting blocks (glowstone, lanterns, ...).
|
|
57
|
+
*/
|
|
58
|
+
excludeLightSources(): void;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Keep only blocks obtainable in survival.
|
|
62
|
+
*/
|
|
63
|
+
survivalOnly(): void;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Exclude blocks whose id contains `keyword`.
|
|
67
|
+
*/
|
|
68
|
+
excludeKeyword(keyword: string): void;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Keep only blocks whose id contains `keyword` (repeatable; matches
|
|
72
|
+
* any of the included keywords).
|
|
73
|
+
*/
|
|
74
|
+
includeKeyword(keyword: string): void;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Require the vanilla block tag `t` (`minecraft:wool` or short
|
|
78
|
+
* `wool`, nested paths like `mineable/pickaxe` too). Repeatable —
|
|
79
|
+
* a block must carry ALL required tags (AND semantics).
|
|
80
|
+
*/
|
|
81
|
+
tag(t: string): void;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Exclude blocks carrying the vanilla block tag `t` (any listed
|
|
85
|
+
* tag disqualifies). Repeatable.
|
|
86
|
+
*/
|
|
87
|
+
excludeTag(t: string): void;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Keep only blocks of the official definition kind `k`
|
|
91
|
+
* (`minecraft:stair` or short `stair`; plain full blocks are
|
|
92
|
+
* `minecraft:block`). Repeatable — a block matching ANY listed
|
|
93
|
+
* kind passes (OR semantics).
|
|
94
|
+
*/
|
|
95
|
+
kind(k: string): void;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Keep only blocks whose measured Oklab lightness L is within
|
|
99
|
+
* `[min, max]` (0.0 = black, 1.0 = white).
|
|
100
|
+
*/
|
|
101
|
+
lightnessBetween(min: number, max: number): void;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Keep only near-neutral blocks: measured Oklab chroma at most
|
|
105
|
+
* `max` (the grayscale preset uses 0.022).
|
|
106
|
+
*/
|
|
107
|
+
chromaBelow(max: number): void;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Keep only blocks whose measured color is within `max_distance`
|
|
111
|
+
* (Oklab; ~0.05 = same family, ~0.15 = generous) of the RGB color.
|
|
112
|
+
*/
|
|
113
|
+
colorNear(r: number, g: number, b: number, maxDistance: number): void;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Build the palette; consumes the builder.
|
|
117
|
+
*/
|
|
118
|
+
build(): Palette;
|
|
119
|
+
}
|
package/PaletteBuilder.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
-
import type { NucleationError } from "./NucleationError"
|
|
3
|
-
import type { Palette } from "./Palette"
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import type { Palette } from "./Palette.mjs"
|
|
4
4
|
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
5
5
|
|
|
6
6
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { MeshConfig } from "./MeshConfig.mjs"
|
|
3
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
4
|
+
import type { ResourcePack } from "./ResourcePack.mjs"
|
|
5
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
6
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Raw vertex streams for custom rendering. Wraps {@link crate::meshing::RawMeshExport}.
|
|
12
|
+
*/
|
|
13
|
+
export class RawMeshExport {
|
|
14
|
+
/** @internal */
|
|
15
|
+
get ffiValue(): pointer;
|
|
16
|
+
/** @internal */
|
|
17
|
+
constructor();
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Export raw mesh data (old ABI: `schematic_to_raw_mesh`).
|
|
22
|
+
*/
|
|
23
|
+
static create(schematic: Schematic, pack: ResourcePack, config: MeshConfig): RawMeshExport;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Number of vertices in the exported mesh.
|
|
27
|
+
*/
|
|
28
|
+
vertexCount(): number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Number of triangles in the exported mesh.
|
|
32
|
+
*/
|
|
33
|
+
triangleCount(): number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Flat `[x,y,z,...]` positions as little-endian `f32` bytes, base64-encoded.
|
|
37
|
+
*/
|
|
38
|
+
positionsB64(): string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Flat normals as little-endian `f32` bytes, base64-encoded.
|
|
42
|
+
*/
|
|
43
|
+
normalsB64(): string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Flat UVs as little-endian `f32` bytes, base64-encoded.
|
|
47
|
+
*/
|
|
48
|
+
uvsB64(): string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Flat vertex colors as little-endian `f32` bytes, base64-encoded.
|
|
52
|
+
*/
|
|
53
|
+
colorsB64(): string;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Triangle indices as little-endian `u32` bytes, base64-encoded.
|
|
57
|
+
*/
|
|
58
|
+
indicesB64(): string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Raw RGBA texture pixels, base64-encoded.
|
|
62
|
+
*/
|
|
63
|
+
textureRgbaB64(): string;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Width of the baked texture in pixels.
|
|
67
|
+
*/
|
|
68
|
+
textureWidth(): number;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Height of the baked texture in pixels.
|
|
72
|
+
*/
|
|
73
|
+
textureHeight(): number;
|
|
74
|
+
}
|
package/RawMeshExport.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// generated by diplomat-tool
|
|
2
|
-
import type { MeshConfig } from "./MeshConfig"
|
|
3
|
-
import type { NucleationError } from "./NucleationError"
|
|
4
|
-
import type { ResourcePack } from "./ResourcePack"
|
|
5
|
-
import type { Schematic } from "./Schematic"
|
|
2
|
+
import type { MeshConfig } from "./MeshConfig.mjs"
|
|
3
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
4
|
+
import type { ResourcePack } from "./ResourcePack.mjs"
|
|
5
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
6
6
|
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
7
7
|
|
|
8
8
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* An extracted redstone logic graph. Wraps
|
|
9
|
+
* {@link crate::simulation::graph::RedstoneGraph}.
|
|
10
|
+
*/
|
|
11
|
+
export class RedstoneGraph {
|
|
12
|
+
/** @internal */
|
|
13
|
+
get ffiValue(): pointer;
|
|
14
|
+
/** @internal */
|
|
15
|
+
constructor();
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Number of nodes in the graph.
|
|
20
|
+
*/
|
|
21
|
+
nodeCount(): number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Total number of directed edges in the graph.
|
|
25
|
+
*/
|
|
26
|
+
edgeCount(): number;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The nodes as a JSON array string.
|
|
30
|
+
*/
|
|
31
|
+
nodesJson(): string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The directed edges as a JSON array string.
|
|
35
|
+
*/
|
|
36
|
+
edgesJson(): string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Computed graph features as a JSON object string.
|
|
40
|
+
*/
|
|
41
|
+
featuresJson(): string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Fingerprint (hex string) for `preset` ("structural" | "functional" |
|
|
45
|
+
* "exact"; empty defaults to "structural").
|
|
46
|
+
*/
|
|
47
|
+
fingerprint(preset: string): string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Serialize the whole graph to JSON.
|
|
51
|
+
*/
|
|
52
|
+
toJson(): string;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Deserialize a graph from a JSON string.
|
|
56
|
+
*/
|
|
57
|
+
static fromJson(json: string): RedstoneGraph;
|
|
58
|
+
}
|
package/RedstoneGraph.d.ts
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
3
|
+
|
|
4
|
+
export type RegionBounds_obj = {
|
|
5
|
+
minX: number;
|
|
6
|
+
minY: number;
|
|
7
|
+
minZ: number;
|
|
8
|
+
maxX: number;
|
|
9
|
+
maxY: number;
|
|
10
|
+
maxZ: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* An inclusive block-coordinate box (a definition region is a union of
|
|
17
|
+
* these).
|
|
18
|
+
*/
|
|
19
|
+
export class RegionBounds {
|
|
20
|
+
get minX(): number;
|
|
21
|
+
set minX(value: number);
|
|
22
|
+
get minY(): number;
|
|
23
|
+
set minY(value: number);
|
|
24
|
+
get minZ(): number;
|
|
25
|
+
set minZ(value: number);
|
|
26
|
+
get maxX(): number;
|
|
27
|
+
set maxX(value: number);
|
|
28
|
+
get maxY(): number;
|
|
29
|
+
set maxY(value: number);
|
|
30
|
+
get maxZ(): number;
|
|
31
|
+
set maxZ(value: number);
|
|
32
|
+
/** @internal */
|
|
33
|
+
static fromFields(structObj : RegionBounds_obj) : RegionBounds;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Create `RegionBounds` from an object that contains all of `RegionBounds`s fields.
|
|
37
|
+
* Optional fields do not need to be included in the provided object.
|
|
38
|
+
*/
|
|
39
|
+
constructor(structObj: RegionBounds_obj);
|
|
40
|
+
|
|
41
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Camera / output configuration for rendering.
|
|
9
|
+
*/
|
|
10
|
+
export class RenderConfig {
|
|
11
|
+
/** @internal */
|
|
12
|
+
get ffiValue(): pointer;
|
|
13
|
+
/** @internal */
|
|
14
|
+
constructor();
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Create a config with the given output size in pixels. Camera starts
|
|
19
|
+
* at the defaults: yaw 45°, pitch 30°, zoom 1.0, fov 45°, perspective
|
|
20
|
+
* projection, default sky background.
|
|
21
|
+
*/
|
|
22
|
+
static create(width: number, height: number): RenderConfig;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Set the camera yaw (horizontal orbit angle) in degrees. Default: 45.
|
|
26
|
+
*/
|
|
27
|
+
setYaw(yaw: number): void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Set the camera pitch (downward tilt) in degrees. Default: 30.
|
|
31
|
+
*/
|
|
32
|
+
setPitch(pitch: number): void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Set the zoom factor applied to the auto-fitted framing
|
|
36
|
+
* (1.0 = frame the whole model; 2.0 = twice as close; 0.5 = twice
|
|
37
|
+
* as far). Default: 1.0.
|
|
38
|
+
*/
|
|
39
|
+
setZoom(zoom: number): void;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Fit the camera to the model's bounding sphere instead of its
|
|
43
|
+
* yaw-dependent silhouette. The sphere is rotation invariant, so
|
|
44
|
+
* orbiting cameras (turntables) keep a constant distance instead
|
|
45
|
+
* of pulsing as the silhouette changes. Frames slightly looser
|
|
46
|
+
* than the default fit. Default: false.
|
|
47
|
+
*/
|
|
48
|
+
setSphereFit(sphereFit: boolean): void;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Set the vertical field of view in degrees (perspective projection
|
|
52
|
+
* only). Default: 45.
|
|
53
|
+
*/
|
|
54
|
+
setFov(fov: number): void;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Set the world-space directional light and its non-negative intensity.
|
|
58
|
+
*/
|
|
59
|
+
setDirectionalLight(x: number, y: number, z: number, intensity: number): void;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Set the unlit floor for non-HDRI rendering, in `0..=1`.
|
|
63
|
+
*/
|
|
64
|
+
setAmbientLight(ambient: number): void;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Set a solid RGBA clear color (linear 0.0–1.0). Alpha < 1.0 yields a
|
|
68
|
+
* transparent PNG. Ignored when HDRI is enabled.
|
|
69
|
+
*/
|
|
70
|
+
setBackground(r: number, g: number, b: number, a: number): void;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Clear the custom background — revert to default sky / HDRI.
|
|
74
|
+
*/
|
|
75
|
+
clearBackground(): void;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Configure a one-block world grid. Models are centred on integer
|
|
79
|
+
* schematic coordinates, so grid lines are placed on half-integer
|
|
80
|
+
* block boundaries automatically.
|
|
81
|
+
*/
|
|
82
|
+
setGrid(halfExtent: number, spacing: number, planeY: number, showAxes: boolean, red: number, green: number, blue: number, alpha: number): void;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Configure a compact grid fitted to half-integer block boundaries.
|
|
86
|
+
*/
|
|
87
|
+
setFittedGrid(margin: number, spacing: number, planeY: number, showAxes: boolean, red: number, green: number, blue: number, alpha: number): void;
|
|
88
|
+
|
|
89
|
+
clearGrid(): void;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Enable (`true`) or disable orthographic projection.
|
|
93
|
+
*/
|
|
94
|
+
setOrthographic(orthographic: boolean): void;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Configure a true isometric view: orthographic at yaw 45° /
|
|
98
|
+
* pitch ≈35.264° (preserves the current width/height).
|
|
99
|
+
*/
|
|
100
|
+
setIsometric(): void;
|
|
101
|
+
}
|
package/RenderConfig.d.ts
CHANGED
package/Renderer.d.mts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// generated by diplomat-tool
|
|
2
|
+
import type { NucleationError } from "./NucleationError.mjs"
|
|
3
|
+
import type { RenderConfig } from "./RenderConfig.mjs"
|
|
4
|
+
import type { ResourcePack } from "./ResourcePack.mjs"
|
|
5
|
+
import type { Schematic } from "./Schematic.mjs"
|
|
6
|
+
import type { pointer, codepoint } from "./diplomat-runtime.d.ts";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Namespace type for the render entry points (PORTING rule 12).
|
|
12
|
+
*/
|
|
13
|
+
export class Renderer {
|
|
14
|
+
/** @internal */
|
|
15
|
+
get ffiValue(): pointer;
|
|
16
|
+
/** @internal */
|
|
17
|
+
constructor();
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Render a schematic to raw RGBA pixel bytes, written as base64
|
|
22
|
+
* (PORTING rule 6). `pack_zip` is a resource-pack zip in memory.
|
|
23
|
+
*/
|
|
24
|
+
static renderPixelsB64(schematic: Schematic, packZip: Array<number>, config: RenderConfig): string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Render a schematic to PNG bytes, written as base64 (PORTING rule 6).
|
|
28
|
+
* `pack_zip` is a resource-pack zip in memory.
|
|
29
|
+
*/
|
|
30
|
+
static renderPngB64(schematic: Schematic, packZip: Array<number>, config: RenderConfig): string;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Render a schematic to a PNG file at `path`.
|
|
34
|
+
*/
|
|
35
|
+
static renderToFile(schematic: Schematic, packZip: Array<number>, config: RenderConfig, path: string): void;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Render with an already parsed resource pack, avoiding repeated ZIP parsing.
|
|
39
|
+
*/
|
|
40
|
+
static renderToFileWithPack(schematic: Schematic, pack: ResourcePack, config: RenderConfig, path: string): void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Render raw RGBA pixels with an already parsed resource pack.
|
|
44
|
+
*/
|
|
45
|
+
static renderPixelsB64WithPack(schematic: Schematic, pack: ResourcePack, config: RenderConfig): string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Render PNG bytes with an already parsed resource pack.
|
|
49
|
+
*/
|
|
50
|
+
static renderPngB64WithPack(schematic: Schematic, pack: ResourcePack, config: RenderConfig): string;
|
|
51
|
+
}
|