// generated by diplomat-tool import type { Field3 } from "./Field3.mjs" import type { InterpolationSpace } from "./InterpolationSpace.mjs" import type { NucleationError } from "./NucleationError.mjs" import type { Palette } from "./Palette.mjs" import type { Sdf } from "./Sdf.mjs" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; /** * Decides which block goes at each point of a filled shape. Wraps `BrushEnum`. */ export class Brush { /** @internal */ get ffiValue(): pointer; /** @internal */ constructor(); /** * Every point becomes `block_name` (a block-state string). */ static solid(blockName: string): Brush; /** * Nearest-block-to-RGB-color brush. */ static color(r: number, g: number, b: number): Brush; /** * Linear color gradient between two anchored points. */ static linearGradient(x1: number, y1: number, z1: number, r1: number, g1: number, b1: number, x2: number, y2: number, z2: number, r2: number, g2: number, b2: number, space: InterpolationSpace): Brush; /** * Base color shaded by surface normal against light direction * (`lx`, `ly`, `lz`). */ static shaded(r: number, g: number, b: number, lx: number, ly: number, lz: number): Brush; /** * Bilinear gradient over the patch `origin + s*u + t*v` with corner colors * c00/c10/c01/c11. */ static bilinearGradient(ox: number, oy: number, oz: number, ux: number, uy: number, uz: number, vx: number, vy: number, vz: number, r00: number, g00: number, b00: number, r10: number, g10: number, b10: number, r01: number, g01: number, b01: number, r11: number, g11: number, b11: number, space: InterpolationSpace): Brush; /** * Inverse-distance-weighted gradient between colored anchor points. * `positions` is flat `[x0, y0, z0, x1, …]` and `colors` is flat * `[r0, g0, b0, r1, …]`; both must describe the same non-zero number of * points (`positions.len() == colors.len()`, a multiple of 3). */ static pointGradient(positions: Array, colors: Array, falloff: number, space: InterpolationSpace): Brush; /** * Spotlight-lit base color (`r`, `g`, `b`): Lambert shading toward a * cone light at (`px`, `py`, `pz`) aimed along (`dx`, `dy`, `dz`). * Full intensity inside 0.7 × `cone_angle_deg`, smoothstep falloff * to zero at the cone edge; surfaces facing away or outside the cone * drop to a 4% ambient floor. */ static spotlight(px: number, py: number, pz: number, dx: number, dy: number, dz: number, coneAngleDeg: number, r: number, g: number, b: number): Brush; /** * Use `palette` for this brush's color→block snapping instead of the * default all-blocks palette. No-op for `solid` brushes, which place * a fixed block state. Set it before filling; the palette is shared, * not copied. */ setPalette(palette: Palette): void; /** * Gradient along a parametric curve: `stops` holds the curve parameters in * `[0, 1]` and `colors` the matching flat RGB triples * (`colors.len() == stops.len() * 3`, `stops` non-empty). */ static curveGradient(stops: Array, colors: Array, space: InterpolationSpace): Brush; /** * Compatibility path that colors voxels by evaluating an SDF graph as * a scalar field. Prefer `field3` for new code. * `stops` are in `[0, 1]`; `colors` are flat RGB triples. The sampled * value is remapped from `[lo, hi]` before reading the gradient. */ static fieldSdf(field: Sdf, stops: Array, colors: Array, lo: number, hi: number, space: InterpolationSpace): Brush; /** * Color every voxel by evaluating a geometry-neutral scalar field at * its center. The field is cloned into the brush, so both wrappers * may be independently destroyed after construction. */ static field3(field: Field3, stops: Array, colors: Array, lo: number, hi: number, space: InterpolationSpace): Brush; /** * Legacy JSON-first field brush. Prefer `field3` for new code. */ static field(fieldJson: string, stops: Array, colors: Array, lo: number, hi: number, space: InterpolationSpace): Brush; }