// generated by diplomat-tool import type { Curve3D } from "./Curve3D.mjs" import type { NucleationError } from "./NucleationError.mjs" import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; /** * A solid region of blocks: primitives (sphere, cuboid, …) and boolean * combinations thereof. Wraps `ShapeEnum`. */ export class Shape { /** @internal */ get ffiValue(): pointer; /** @internal */ constructor(); /** * Thicken a sampled 3D curve into a parametric tube with the given radius. * Inputs outside voxel-coordinate or bounded-work limits are rejected. */ static tubeAlong(curve: Curve3D, radius: number): Shape; /** * Sphere centered at (`cx`, `cy`, `cz`) (truncated to block coordinates, * matching the old `shape_sphere`). */ static sphere(cx: number, cy: number, cz: number, radius: number): Shape; /** * Axis-aligned box spanning the two corners (inclusive). */ static cuboid(minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Shape; /** * A closed 2D polygon extruded between two Y levels (inclusive). The * footprint is `polygon_json`, a JSON array of `[x, z]` world-coordinate * pairs in order (winding does not matter; the ring closes implicitly); * any simple polygon works, concave ones included. This is the shape * behind extruded building footprints, lake outlines, and plot fills. * Errors with `Parse` on invalid JSON and `InvalidArgument` on non-UTF-8 * or fewer than three vertices. */ static polygonPrism(polygonJson: string, yMin: number, yMax: number): Shape; /** * Ellipsoid centered at (`cx`, `cy`, `cz`) with per-axis radii. */ static ellipsoid(cx: number, cy: number, cz: number, rx: number, ry: number, rz: number): Shape; /** * Cylinder from base point along an axis vector. */ static cylinder(bx: number, by: number, bz: number, ax: number, ay: number, az: number, radius: number, height: number): Shape; /** * Cylinder spanning the segment between two points. */ static cylinderBetween(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, radius: number): Shape; /** * Cone with apex at (`ax`, `ay`, `az`) opening along direction (`dx`, `dy`, `dz`). */ static cone(ax: number, ay: number, az: number, dx: number, dy: number, dz: number, radius: number, height: number): Shape; /** * Torus centered at (`cx`, `cy`, `cz`) with the given major/minor radii and * axis (`ax`, `ay`, `az`). */ static torus(cx: number, cy: number, cz: number, majorR: number, minorR: number, ax: number, ay: number, az: number): Shape; /** * Rectangular pyramid: base center, half-extents, height, up-axis. */ static pyramid(bx: number, by: number, bz: number, halfW: number, halfD: number, height: number, ax: number, ay: number, az: number): Shape; /** * Flat disk: center, radius, plane normal, thickness. */ static disk(cx: number, cy: number, cz: number, radius: number, nx: number, ny: number, nz: number, thickness: number): Shape; /** * Finite plane patch: origin, two spanning vectors `u`/`v`, extents along * each, thickness. */ static plane(ox: number, oy: number, oz: number, ux: number, uy: number, uz: number, vx: number, vy: number, vz: number, uExt: number, vExt: number, thickness: number): Shape; /** * Filled triangle between three vertices, thickened by `thickness`. */ static triangle(ax: number, ay: number, az: number, bx: number, by: number, bz: number, cx: number, cy: number, cz: number, thickness: number): Shape; /** * Line segment between two points, thickened by `thickness`. */ static line(x1: number, y1: number, z1: number, x2: number, y2: number, z2: number, thickness: number): Shape; /** * Bézier curve through `control_points` (flat `[x0, y0, z0, x1, y1, z1, …]`, * so the length must be a non-zero multiple of 3), thickened by `thickness` * and sampled at `resolution` steps. */ static bezier(controlPoints: Array, thickness: number, resolution: number): Shape; /** * Any SDF tree as a Shape: the same JSON the terrain sampler takes * (primitives, smooth booleans, noise — see the SDF guide) becomes * fillable with every brush, combinable with other shapes, and * usable in masked fills. Normals come from the field gradient, so * the shaded brush shades smooth blends smoothly. Errors with * `Parse` on invalid JSON and `InvalidArgument` for unbounded trees * (use `sdf_bounded`). */ static sdf(sdfJson: string): Shape; /** * Like `sdf`, with explicit sampling bounds (inclusive block * coordinates) for unbounded trees such as planes. */ static sdfBounded(sdfJson: string, minX: number, minY: number, minZ: number, maxX: number, maxY: number, maxZ: number): Shape; /** * Hollowed-out copy of this shape with the given wall thickness (clones the * input, like the old `shape_hollow`). */ hollow(thickness: number): Shape; /** * Boolean union of this shape and `other` (clones both inputs). */ unionWith(other: Shape): Shape; /** * Boolean intersection of this shape and `other` (clones both inputs). */ intersectionWith(other: Shape): Shape; /** * Boolean difference: this shape minus `other` (clones both inputs). */ differenceWith(other: Shape): Shape; }