declare namespace Bit { /** * Every parameter object the API takes. Almost no method here has a positional argument list - * each one takes a single DTO instead, so this namespace is where the parameter names, their types, * their defaults and their units live. It is organised by kernel and by feature area, and the same * shape name deliberately recurs across kernels: there is a CircleDto for OCCT, for JSCAD, for * Manifold and for Verb, each with the fields that kernel actually accepts. Read the namespace, not * just the class name, to be sure which one you want. */ declare namespace Inputs { /** * The primitive types every other namespace is built from: Point2 and Point3, Vector2 and * Vector3, Line and Segment, colour values, transformation matrices, and the alignment, * interpolation and orientation enumerations shared across the API. All of them are plain * arrays or plain objects rather than classes, so they pass between kernels, between engines * and in and out of JSON without conversion. * * This namespace is merged from the base, core and engine packages, so it is the union of what * all three contribute. If a parameter elsewhere is typed Base.Point3, this is where its shape * is defined. */ declare namespace Base { /** * A color as a CSS string - a hex value such as #ff8800, or any other form the browser * accepts. This is the form every draw option and material takes; use the color API to convert * to and from RGB and HSL. */ type Color = string; /** * A color as separate red, green and blue channels, each 0-255. Use it when you need to compute * with the channels; convert to a Color string before handing it to a draw call. */ type ColorRGB = { r: number; g: number; b: number; }; /** * Red, green and blue channels plus an alpha channel for transparency. Alpha 0 is fully * transparent, 1 fully opaque. */ type ColorRGBA = { r: number; g: number; b: number; a: number; }; /** * An engine material object, passed through untyped because its shape depends on which renderer * is in use. Create one through the engine's material API rather than by hand. */ type Material = any; /** * A point in the plane as [x, y]. Points and vectors share the same array shape - the difference * is meaning, not structure: a point is a position, a vector is a direction and a magnitude. */ type Point2 = [ number, number ]; /** * A direction and magnitude in the plane as [x, y]. Structurally identical to Point2; use this * name where the value means a direction rather than a position. */ type Vector2 = [ number, number ]; /** * A point in space as [x, y, z], and the single most common type in the whole API. Y is up. * A plain array, so it survives JSON, passes between kernels unchanged, and can be built by * ordinary array code without a constructor. */ type Point3 = [ number, number, number ]; /** * A direction and magnitude in space as [x, y, z]. Structurally identical to Point3; use this * name where the value means a direction - a normal, an axis, an offset - rather than a position. * Many operations expect it normalized, and say so on the parameter. */ type Vector3 = [ number, number, number ]; /** * An axis in space: an origin point and a direction vector. Used wherever an operation needs both * a position and an orientation - rotating about an arbitrary line, revolving a profile, mirroring * across a line. */ type Axis3 = { origin: Base.Point3; direction: Base.Vector3; }; /** * An axis in the plane: an origin point and a direction vector. */ type Axis2 = { origin: Base.Point2; direction: Base.Vector2; }; /** * A finite straight segment in the plane as a pair of points, [start, end]. */ type Segment2 = [ Point2, Point2 ]; /** * A finite straight segment in space as a pair of points, [start, end]. The array form, as opposed * to Line3 which names its ends; both describe the same thing and different APIs prefer different * shapes. */ type Segment3 = [ Point3, Point3 ]; /** Triangle plane is efficient definition described by a normal vector and d value (N dot X = d) */ type TrianglePlane3 = { normal: Vector3; d: number; }; /** * A triangle as three points. The winding order decides which way the face points, so reversing it * flips the normal. */ type Triangle3 = [ Base.Point3, Base.Point3, Base.Point3 ]; /** * A mesh as a flat list of triangles. The simplest possible mesh representation - no shared * vertices and no index buffer - which makes it easy to build and to reason about, at the cost of * repeating coordinates. */ type Mesh3 = Triangle3[]; /** * An infinite plane: an origin point, a normal vector, and a direction vector that fixes the * plane's rotation about its own normal. That third field is what lets an operation place 2D * geometry on the plane with a predictable orientation rather than an arbitrary one. */ type Plane3 = { origin: Base.Point3; normal: Base.Vector3; direction: Base.Vector3; }; /** * The axis-aligned box enclosing a shape, as a min and a max corner, with the center and the * width, height and length filled in as a convenience. Use it to size a camera to a model, to lay * objects out without overlap, or to check a part fits a build volume. */ type BoundingBox = { min: Base.Point3; max: Base.Point3; center?: Base.Point3; width?: number; height?: number; length?: number; }; /** * A finite straight line in the plane, named as start and end. */ type Line2 = { start: Base.Point2; end: Base.Point2; }; /** * A finite straight line in space, named as start and end. The named form, as opposed to Segment3 * which is a pair of points; different APIs prefer different shapes. */ type Line3 = { start: Base.Point3; end: Base.Point3; }; /** * A connected chain of points in space, optionally closed, with an optional color. Closing it * turns the chain into an outline that can become a face. */ type Polyline3 = { points: Base.Point3[]; isClosed?: boolean; color?: number[]; }; /** * A connected chain of points in the plane, optionally closed, with an optional color. */ type Polyline2 = { points: Base.Point2[]; isClosed?: boolean; color?: number[]; }; /** * A 3x3 transformation matrix as 9 numbers, for transforms in the plane. */ type TransformMatrix3x3 = [ number, number, number, number, number, number, number, number, number ]; /** * A list of 3x3 transformation matrices, applied one after another, first to last, as one * combined transform in the plane. */ type TransformMatrixes3x3 = TransformMatrix3x3[]; /** * A 4x4 transformation matrix as 16 numbers in column-major order, so the translation sits at * indices 12 to 14. Translation, rotation and scale combined into one value that any geometry * API will accept, so the same transform applies equally to points, curves and solids. */ type TransformMatrix = [ number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number ]; /** * A list of 4x4 transformation matrices, applied one after another, first to last, as one * combined transform. A method that takes a list gives one result, not one per matrix. */ type TransformMatrixes = TransformMatrix[]; /** * Horizontal alignment of content against its anchor: left, center or right. */ enum horizontalAlignEnum { left = "left", center = "center", right = "right" } /** * Vertical alignment of content against its anchor: top, middle or bottom. */ enum verticalAlignmentEnum { top = "top", middle = "middle", bottom = "bottom" } /** * Which of the two ends of something to act on - the top or the bottom. Used where an operation * can cap, extend or trim one end of a shape. */ enum topBottomEnum { top = "top", bottom = "bottom" } /** * Alignment against a nine-cell grid, combining a horizontal and a vertical position into one * value - topLeft through bottomRight. Used to place text and 2D content without needing two * separate alignment settings. */ enum basicAlignmentEnum { topLeft = "topLeft", topMid = "topMid", topRight = "topRight", midLeft = "midLeft", midMid = "midMid", midRight = "midRight", bottomLeft = "bottomLeft", bottomMid = "bottomMid", bottomRight = "bottomRight" } /** * Defines how colors are mapped to entities when there are more entities than colors. * - firstColorForAll: Uses the first color for all entities (legacy behavior) * - lastColorRemainder: Maps colors 1:1, then uses last color for remaining entities * - repeatColors: Cycles through colors in a repeating pattern * - reversedColors: After exhausting colors, reverses direction (ping-pong pattern) */ enum colorMapStrategyEnum { /** Uses the first color for all entities (legacy behavior) */ firstColorForAll = "firstColorForAll", /** Maps colors 1:1, then uses last color for remaining entities */ lastColorRemainder = "lastColorRemainder", /** Cycles through colors in a repeating pattern */ repeatColors = "repeatColors", /** After exhausting colors, reverses direction (ping-pong pattern) */ reversedColors = "reversedColors" } /** NURBS curve type from verb-nurbs library */ type VerbCurve = { tessellate: (options: any) => any; }; /** NURBS surface type from verb-nurbs library */ type VerbSurface = { tessellate: (options: any) => any; }; /** Texture type for BabylonJS materials */ type Texture = any; /** * Which built-in skybox environment to use as the scene's background and image-based lighting: * default, clear sky, city or a plain grey gradient. The skybox lights the model as well as * filling the background, so changing it changes how materials look. */ enum skyboxEnum { default = "default", clearSky = "clearSky", city = "city", greyGradient = "greyGradient" } /** * How distance fog thickens: not at all, linearly between a start and an end distance, or * exponentially - squared exponential being the densest. Linear is the predictable one because you * set exactly where fog begins and ends. */ enum fogModeEnum { none = "none", exponential = "exponential", exponentialSquared = "exponentialSquared", linear = "linear" } /** * The direction a linear gradient runs, given either as a named direction such as to bottom right * or as an angle in degrees. The values match the CSS gradient syntax. */ enum gradientDirectionEnum { toTop = "to top", toTopRight = "to top right", toRight = "to right", toBottomRight = "to bottom right", toBottom = "to bottom", toBottomLeft = "to bottom left", toLeft = "to left", toTopLeft = "to top left", deg0 = "0deg", deg45 = "45deg", deg90 = "90deg", deg135 = "135deg", deg180 = "180deg", deg225 = "225deg", deg270 = "270deg", deg315 = "315deg" } /** * Where the center of a radial gradient sits, as a named position or a percentage pair. The values * match the CSS gradient syntax. */ enum gradientPositionEnum { center = "center", top = "top", topLeft = "top left", topRight = "top right", bottom = "bottom", bottomLeft = "bottom left", bottomRight = "bottom right", left = "left", right = "right", centerTop = "50% 0%", centerBottom = "50% 100%", leftCenter = "0% 50%", rightCenter = "100% 50%" } /** * The shape of a radial gradient: a circle, or an ellipse that stretches to its container. */ enum gradientShapeEnum { circle = "circle", ellipse = "ellipse" } /** * How a background image tiles: repeating in both directions, in one direction only, not at all, * or with space or round adjusting the tiles so they fit the area exactly. The values match the * CSS background-repeat syntax. */ enum backgroundRepeatEnum { repeat = "repeat", repeatX = "repeat-x", repeatY = "repeat-y", noRepeat = "no-repeat", space = "space", round = "round" } /** * How a background image is scaled to its area: at its natural size, covering the area and * cropping the overflow, or contained entirely within it with empty space around. The values match * the CSS background-size syntax. */ enum backgroundSizeEnum { auto = "auto", cover = "cover", contain = "contain" } /** * Whether a background image scrolls with its content, stays fixed to the viewport, or scrolls * within its own element. The values match the CSS background-attachment syntax. */ enum backgroundAttachmentEnum { scroll = "scroll", fixed = "fixed", local = "local" } /** * Which box a background image is positioned and clipped against - the padding, border or content * box. The values match the CSS background-origin and background-clip syntax. */ enum backgroundOriginClipEnum { paddingBox = "padding-box", borderBox = "border-box", contentBox = "content-box" } } /** * Re-export Base namespace from @bitbybit-dev/base. * JSCAD package uses the same foundational types without additions. */ /** * Every parameter object the JSCAD kernel accepts. JSCAD models by combining primitives with * booleans, expansions, hulls and extrusions, working on tessellated geometry rather than exact * surfaces, so its DTOs carry mesh-level settings - segment counts, corner styles, expansion deltas - * where the OCCT equivalents would carry tolerances. * * It is lighter and quicker to start with than OCCT and a good fit when a shape is a combination of * simple volumes and manufacturing-grade surface accuracy is not required. Names repeat across * kernels: the CircleDto here is not the one in Inputs.OCCT. */ declare namespace JSCAD { /** A 2D point or vector, `[x, y]`. */ type JSCADVec2 = [ number, number ]; /** A 3D point or vector, `[x, y, z]`. */ type JSCADVec3 = [ number, number, number ]; /** A 4x4 transformation matrix, in column-major order. */ type JSCADMat4 = [ number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number ]; /** A plane, `[normalX, normalY, normalZ, distanceFromOrigin]`. */ type JSCADPlane = [ number, number, number, number ]; /** A color, either `[r, g, b]` or `[r, g, b, a]`, each channel from 0 to 1. */ type JSCADColor = [ number, number, number ] | [ number, number, number, number ]; /** A convex polygon in 3D - the face of a solid. */ type JSCADPoly3 = { vertices: JSCADVec3[]; color?: JSCADColor; plane?: JSCADPlane; }; /** 2D geometry: a closed region, held as the edges that bound it. */ type JSCADGeom2 = { sides: [ JSCADVec2, JSCADVec2 ][]; transforms: JSCADMat4; color?: JSCADColor; }; /** 3D geometry: a solid, held as the polygons that enclose it. */ type JSCADGeom3 = { polygons: JSCADPoly3[]; transforms: JSCADMat4; color?: JSCADColor; }; /** A 2D path: an open or closed sequence of points, with no enclosed area. */ type JSCADPath2 = { points: JSCADVec2[]; isClosed: boolean; transforms: JSCADMat4; color?: JSCADColor; }; /** * Anything JSCAD hands back: a 2D region, a 3D solid, or a 2D path. The three share no members * beyond their transform, so narrow on the one you want - `"polygons" in entity` for a solid, * `"isClosed" in entity` for a path, `"sides" in entity` for a 2D region. * * These are structural mirrors of the library's own types rather than imports of them, so the * published declarations stay self-contained; jscad-entity.test.ts fails the build if the two * ever stop matching. */ type JSCADEntity = JSCADGeom2 | JSCADGeom3 | JSCADPath2; /** A geometry flattened for rendering: triangle positions, normals, indices and its transform. */ type JSCADMeshData = { positions: number[]; normals: number[]; indices: number[]; transforms: JSCADMat4; }; /** * A polyline as a plain list of points, the form `polygon.createFromPolyline`, * `path.createFromPolyline` and `path.appendPolyline` read; only X and Y of each point are used by * them. */ class PolylinePropertiesDto { /** * Provide options without default values */ constructor(points?: Base.Point3[], isClosed?: boolean); /** * The corner points in order, given in 3D; JSCAD methods use only X and Y */ points: Base.Point3[]; /** * Whether the last point joins back to the first; the JSCAD methods decide closure on their own * and ignore this flag * @optional true */ isClosed?: boolean | undefined; /** * A color carried along with the polyline for drawing, as a hex string or an RGB list; the * JSCAD methods ignore it * @optional true */ color?: string | number[] | undefined; } /** * How the corners of an expanded or rounded solid are formed. */ enum solidCornerTypeEnum { /** * Edges will meet at a corner */ edge = "edge", /** * Edges will be rounded on the corner */ round = "round", /** * Edges will be chamfered on the corner */ chamfer = "chamfer" } /** * Horizontal alignment of JSCAD text against its anchor point. */ enum jscadTextAlignEnum { /** * Aligns text to the left */ left = "left", /** * Aligns text to the center */ center = "center", /** * Aligns text to the right */ right = "right" } /** * Feeds `toPolygonPoints` and `shapeToMesh` on the JSCAD service with the one entity to turn into * triangles or mesh data; a 2D shape is given a tiny thickness on the way. */ class MeshDto { constructor(mesh?: JSCADEntity); /** * The solid to convert; a flat 2D shape works too and is given a tiny thickness first */ mesh: JSCADEntity; } /** * Feeds `shapesToMeshes` on the JSCAD service with the entities to turn into mesh data, one result * per entry in the same order. */ class MeshesDto { constructor(meshes?: JSCADEntity[]); /** * The solids to convert, in the order the results should come back; flat 2D shapes work too */ meshes: JSCADEntity[]; } /** * The options `draw.drawAnyAsync` passes on when the entity is one JSCAD solid or 2D shape: color, * opacity, visibility, the two-sided rendering and the mesh to reuse when redrawing. */ class DrawSolidMeshDto { /** * Provide options without default values */ constructor(mesh?: JSCADEntity, opacity?: number, colours?: string | string[], updatable?: boolean, hidden?: boolean, jscadMesh?: T, drawTwoSided?: boolean, backFaceColour?: string, backFaceOpacity?: number); /** * The solid or flat 2D shape to draw; it is converted to mesh data on the way */ mesh: JSCADEntity; /** * How opaque the faces are, from 0 for invisible to 1 for solid * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity: number; /** * Hex color of the faces; a list uses its first entry. An entity colored with `colors.colorize` * keeps its own color instead * @default #444444 */ colours: string | string[]; /** * When true, the drawn mesh can be refreshed in place on later draws by passing it back as * `jscadMesh` * @default false */ updatable: boolean; /** * When true, the mesh is created but not shown until it is made visible * @default false */ hidden: boolean; /** * A mesh from an earlier draw to refresh instead of creating a new one; used only when * `updatable` is true * @default undefined * @optional true * @ignore true */ jscadMesh?: T | undefined; /** * When true, the back of every face is drawn as well, in `backFaceColour`, which helps to see * face orientation * @default true */ drawTwoSided: boolean; /** * Hex color of the back faces, the side the face normal points away from; used only when * `drawTwoSided` is true * @default #0000ff */ backFaceColour: string; /** * How opaque the back faces are, from 0 to 1; used only when `drawTwoSided` is true * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; } /** * The options `draw.drawAnyAsync` passes on when the entity is a list of JSCAD solids or 2D shapes: * colors, opacity, visibility, the two-sided rendering and the parent mesh to reuse when redrawing. */ class DrawSolidMeshesDto { /** * Provide options without default values */ constructor(meshes?: JSCADEntity[], opacity?: number, colours?: string | string[], updatable?: boolean, hidden?: boolean, jscadMesh?: T, drawTwoSided?: boolean, backFaceColour?: string, backFaceOpacity?: number); /** * The solids or flat 2D shapes to draw, each becoming a child of one parent mesh * @default undefined * @optional true */ meshes?: JSCADEntity[] | undefined; /** * How opaque the faces are, from 0 for invisible to 1 for solid * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity: number; /** * Hex color of the faces; a list with one entry per entity colors each in turn, any other list * uses its first entry. Colorized entities keep their own color * @default #444444 */ colours: string | string[]; /** * When true, the drawn meshes can be refreshed in place on later draws by passing the parent * back as `jscadMesh` * @default false */ updatable: boolean; /** * When true, the meshes are created but not shown until they are made visible * @default false */ hidden: boolean; /** * The parent mesh from an earlier draw to refresh instead of creating a new one; used only when * `updatable` is true * @default undefined * @optional true * @ignore true */ jscadMesh?: T | undefined; /** * When true, the back of every face is drawn as well, in `backFaceColour`, which helps to see * face orientation * @default true */ drawTwoSided: boolean; /** * Hex color of the back faces, the side the face normal points away from; used only when * `drawTwoSided` is true * @default #0000ff */ backFaceColour: string; /** * How opaque the back faces are, from 0 to 1; used only when `drawTwoSided` is true * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; } /** * The options `draw.drawAnyAsync` passes on when the entity is a JSCAD 2D path, drawn as a line * through its points: color, opacity, line width and the line to reuse when redrawing. */ class DrawPathDto { /** * Provide options without default values */ constructor(path?: JSCADEntity, colour?: string, opacity?: number, width?: number, updatable?: boolean, pathMesh?: T); /** * The 2D path to draw as a line; a closed path is drawn back to its first point * @default undefined */ path: JSCADEntity; /** * Hex color of the line; a path colored with `colors.colorize` keeps its own color instead * @default #444444 */ colour: string; /** * How opaque the line is, from 0 for invisible to 1 for solid * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity: number; /** * Thickness of the drawn line * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ width: number; /** * When true, the drawn line can be refreshed in place on later draws by passing it back as * `pathMesh` * @default false */ updatable: boolean; /** * A line from an earlier draw to refresh instead of creating a new one; used only when * `updatable` is true * @default undefined * @optional true * @ignore true */ pathMesh?: T | undefined; } /** * Feeds `transformSolids` on the JSCAD service: the solids to move and the matrix, or matrices, * applied to each of them. */ class TransformSolidsDto { constructor(meshes?: JSCADEntity[], transformation?: Base.TransformMatrixes); /** * The solids to transform; they stay as they are and transformed copies come back in the same * order * @default undefined */ meshes: JSCADEntity[]; /** * One 4x4 matrix, a list of matrices applied in order, or a list of such lists, as the * `transforms` methods produce * @default undefined */ transformation: Base.TransformMatrixes; } /** * Feeds `transformSolid` on the JSCAD service: the solid to move and the matrix, or matrices, * applied to it. */ class TransformSolidDto { constructor(mesh?: JSCADEntity, transformation?: Base.TransformMatrixes); /** * The solid to transform; it stays as it is and a transformed copy comes back. A 2D shape or a * path throws an error * @default undefined */ mesh: JSCADEntity; /** * One 4x4 matrix, a list of matrices applied in order, or a list of such lists, as the * `transforms` methods produce * @default undefined */ transformation: Base.TransformMatrixes; } /** * Feeds `downloadSolidSTL` on the JSCAD service: the solid to write and the name of the STL file. */ class DownloadSolidDto { constructor(mesh?: JSCADEntity, fileName?: string); /** * The solid to write to the file * @default undefined */ mesh: JSCADEntity; /** * Name of the downloaded file without the extension, which is added * @default undefined */ fileName: string; } /** * Feeds `downloadGeometryDxf` and `downloadGeometry3MF` on the JSCAD service: the geometry to * write, the file name and optional options for the file writer. */ class DownloadGeometryDto { constructor(geometry?: JSCADEntity | JSCADEntity[], fileName?: string, options?: Record); /** * A solid, a 2D shape, a path, or a list of them, all written into one file * @default undefined */ geometry: JSCADEntity | JSCADEntity[]; /** * Name of the downloaded file without the extension, which is added * @default jscad-geometry */ fileName: string; /** * Options handed to the DXF or 3MF writer as they are; leave it out for the defaults * @default undefined * @optional true */ options?: Record | undefined; } /** * Feeds `downloadSolidsSTL` on the JSCAD service: the solids to write into one STL file and the * file's name. */ class DownloadSolidsDto { constructor(meshes?: JSCADEntity[], fileName?: string); /** * The solids to write, all into the same file * @default undefined */ meshes: JSCADEntity[]; /** * Name of the downloaded file without the extension, which is added * @default undefined */ fileName: string; } /** * Feeds `colors.colorize`: the geometry to tint, one entity or a list, and the color it is drawn in * from then on. */ class ColorizeDto { constructor(geometry?: JSCADEntity, color?: string); /** * A solid, a 2D shape, a path, or a list of them; colored copies come back in the same shape as * the input * @default undefined */ geometry: JSCADEntity | JSCADEntity[]; /** * Hex color string the geometry is always drawn in, ahead of the drawing options * @default #0000ff */ color: string; } /** * Feeds `booleans.union`, `booleans.intersect` and `booleans.subtract` with any number of inputs; * for `subtract` the first entry is the one being cut. All entries must be of one kind, solids or * 2D shapes. */ class BooleanObjectsDto { constructor(meshes?: JSCADEntity[]); /** * The solids, or the 2D shapes, to combine; the inputs stay as they are and a new entity comes * back * @default undefined */ meshes: JSCADEntity[]; } /** * Feeds `booleans.unionTwo`, `booleans.intersectTwo` and `booleans.subtractTwo` with exactly two * inputs of one kind, solids or 2D shapes; for `subtractTwo`, `second` is cut out of `first`. */ class BooleanTwoObjectsDto { constructor(first?: JSCADEntity, second?: JSCADEntity); /** * The first solid or 2D shape, the one that is kept and cut in a subtraction * @default undefined */ first: JSCADEntity; /** * The second solid or 2D shape, of the same kind as `first` * @default undefined */ second: JSCADEntity; } /** * Feeds `booleans.subtractFrom`: `from` is the base and every entry of `meshes` is cut out of it. * All must be of one kind, solids or 2D shapes. */ class BooleanObjectsFromDto { constructor(from?: JSCADEntity, meshes?: JSCADEntity[]); /** * The solid or 2D shape to cut from; it stays as it is and a cut copy comes back * @default undefined */ from: JSCADEntity; /** * The solids or 2D shapes to cut out of `from`, of the same kind as it * @default undefined */ meshes: JSCADEntity[]; } /** * Feeds `booleans.minkowskiSum` with the solids to sweep over one another; unlike the other * booleans this one takes solids only, a 2D shape is refused. */ class MinkowskiSumDto { constructor(meshes?: JSCADEntity[]); /** * The solids to sum, at least two; each later one is swept over the surface of the running * result * @default undefined */ meshes: JSCADEntity[]; } /** * Feeds `expansions.expand` and `expansions.offset`: the geometry, the signed distance to move its * boundary by and how the corners are shaped on the way. */ class ExpansionDto { constructor(geometry?: JSCADEntity, delta?: number, corners?: solidCornerTypeEnum, segments?: number); /** * The 2D shape, path or solid to grow; `offset` takes 2D shapes and paths only. It stays as it * is and a new entity comes back * @default undefined */ geometry: JSCADEntity; /** * How far the boundary moves, in model units: positive grows the geometry, negative shrinks it * (a solid accepts positive only) * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ delta: number; /** * How a convex corner is shaped: `edge` keeps it sharp, `chamfer` cuts it flat, `round` curves * it; a solid accepts `round` only * @default edge */ corners: solidCornerTypeEnum; /** * Number of straight pieces a `round` corner is made of over a full circle; more makes it * smoother * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `extrusions.extrudeLinear`: the flat shape, how far it rises along Z and the optional twist * applied on the way up. */ class ExtrudeLinearDto { constructor(geometry?: JSCADEntity, height?: number, twistAngle?: number, twistSteps?: number); /** * The flat 2D shape in the XY plane to raise into a solid; a closed path also works, an open * one throws an error * @default undefined */ geometry: JSCADEntity; /** * How far the shape rises along Z, in model units; negative extrudes downward * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ height: number; /** * How far the top is turned relative to the bottom around Z, in degrees; 0 gives a straight * extrusion * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ twistAngle: number; /** * Number of slices the twist is built from, at least 1; more makes a smoother twist and a * heavier mesh * @default 15 * @minimum 0 * @maximum Infinity * @step 1 */ twistSteps: number; } /** * Feeds `hulls.hull` and `hulls.hullChain` with the entities to wrap, all of one kind: solids, 2D * shapes or paths. For `hullChain` the order is the order they connect in. */ class HullDto { constructor(meshes?: JSCADEntity[]); /** * The solids, 2D shapes or paths to wrap, all of one kind; for a chain, in the order they * connect * @default undefined */ meshes: JSCADEntity[]; } /** * Feeds `hulls.isConvex` with the one solid to examine. */ class SolidDto { constructor(mesh?: JSCADEntity); /** * The solid to examine; a 2D shape or a path is refused * @default undefined */ mesh: JSCADEntity; } /** * Feeds `extrusions.extrudeRectangular`: the outline to build a wall along, the wall's height along * Z and its half thickness. */ class ExtrudeRectangularDto { constructor(geometry?: JSCADEntity, height?: number, size?: number); /** * The 2D shape or path whose outline the wall follows; the inside of a shape stays empty * @default undefined */ geometry: JSCADEntity; /** * How tall the wall is along Z, in model units, standing on the XY plane * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * How far the wall reaches to each side of the outline, in model units, so the wall is twice * this thick * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; } /** * Feeds `extrusions.extrudeRectangularPoints`: the points of the line to build a wall along, the * wall's height along Z and its half thickness. */ class ExtrudeRectangularPointsDto { constructor(points?: Base.Point3[], height?: number, size?: number); /** * The corner points of the line the wall follows, in order; only X and Y are used * @default undefined */ points: Base.Point3[]; /** * How tall the wall is along Z, in model units, standing on the XY plane * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * How far the wall reaches to each side of the line, in model units, so the wall is twice this * thick * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; } /** * Feeds `extrusions.extrudeRotate`: the flat profile to spin around the Z axis, how far and from * where to spin it, and how finely the round result is faceted. */ class ExtrudeRotateDto { constructor(polygon?: JSCADEntity, angle?: number, startAngle?: number, segments?: number); /** * The flat 2D shape in the XY plane to revolve around the Z axis; its X coordinates are the * distances from the axis, which clips it where it crosses * @default undefined */ polygon: JSCADEntity; /** * How far to revolve, in degrees: 360 makes a full ring, the default 90 a quarter * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle: number; /** * Where the revolution starts, in degrees from the X axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ startAngle: number; /** * Number of steps in a full turn; a partial angle uses proportionally fewer. Fewer than 3 * throws an error * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `polygon.createFromPolyline` with the polyline whose points become the outline of a filled * 2D shape. */ class PolylineDto { constructor(polyline?: PolylinePropertiesDto); /** * The polyline whose points, in order, outline the shape; only X and Y are used */ polyline: PolylinePropertiesDto; } /** * Feeds `polygon.createFromCurve` with a NURBS curve, which is sampled into points to outline a * filled 2D shape. */ class CurveDto { constructor(curve?: any); /** * A NURBS curve that can be sampled into points; only X and Y of the samples are used */ curve: any; } /** * Feeds `polygon.createFromPoints` with the outline points of a filled 2D shape, listed in order * around it. */ class PointsDto { constructor(points?: Base.Point3[]); /** * The outline points in order, at least three; only X and Y are used */ points: Base.Point3[]; } /** * Feeds `path.close` and `polygon.createFromPath` with the one 2D path to work on; a 2D shape or a * solid throws an error. */ class PathDto { constructor(path?: JSCADEntity); /** * The 2D path to work on; it stays as it is and a new path or shape comes back * @default undefined */ path: JSCADEntity; } /** * Feeds `path.createFromPoints`: the points a new 2D path runs through and whether it closes back * to the first. */ class PathFromPointsDto { constructor(points?: Base.Point2[], closed?: boolean); /** * The points the path runs through, in order; only X and Y are used and repeated consecutive * points are dropped * @default undefined */ points: Base.Point2[]; /** * When true, the last point joins back to the first and the path accepts no more points * @default false */ closed: boolean; } /** * Feeds `path.createPathsFromPoints` with several point lists, one 2D path each; a list ending on * its first point makes a closed path. */ class PathsFromPointsDto { constructor(pointsLists?: Base.Point3[][] | Base.Point2[][]); /** * One list of points per path, in the order the paths should come back; a list whose last point * equals its first gives a closed path * @default undefined */ pointsLists: Base.Point3[][] | Base.Point2[][]; } /** * Feeds `path.createFromPolyline`: the polyline a new 2D path runs through and whether it closes * back to the first point. */ class PathFromPolylineDto { constructor(polyline?: PolylinePropertiesDto, closed?: boolean); /** * The polyline whose points the path runs through; only X and Y are used and its own closed * flag is ignored * @default undefined */ polyline: PolylinePropertiesDto; /** * When true, the last point joins back to the first and the path accepts no more points * @default false */ closed: boolean; } /** * Feeds `path.appendPoints`: an open 2D path and the points to add after its last point. */ class PathAppendPointsDto { constructor(points?: Base.Point2[], path?: JSCADEntity); /** * The points to add after the path's last point, in order; only X and Y are used * @default undefined */ points: Base.Point2[]; /** * The open 2D path to extend; it stays as it is and a longer copy comes back. A closed path * throws an error * @default undefined */ path: JSCADEntity; } /** * Feeds `path.appendPolyline`: an open 2D path and the polyline whose points are added after its * last point. */ class PathAppendPolylineDto { constructor(polyline?: PolylinePropertiesDto, path?: JSCADEntity); /** * The polyline whose points are added after the path's last point; only X and Y are used * @default undefined */ polyline: PolylinePropertiesDto; /** * The open 2D path to extend; it stays as it is and a longer copy comes back. A closed path * throws an error * @default undefined */ path: JSCADEntity; } /** * Feeds `path.appendArc`: an open 2D path with at least one point, the point the arc ends on, the * ellipse the arc is cut from and which of the four fitting arcs to take. */ class PathAppendArcDto { constructor(path?: JSCADEntity, endPoint?: Base.Point2, xAxisRotation?: number, clockwise?: boolean, large?: boolean, segments?: number, radiusX?: number, radiusY?: number); /** * The open 2D path to extend, with at least one point; the arc starts at its last point * @default undefined */ path: JSCADEntity; /** * Where the arc ends, as a 2D point in the XY plane * @default [1, 1] */ endPoint: Base.Point2; /** * Tilt of the ellipse the arc is cut from, in degrees from the X axis; it changes nothing for a * circle * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ xAxisRotation: number; /** * When true, the arc turns clockwise from the start to the end point; false turns * counter-clockwise * @default true */ clockwise: boolean; /** * When true, the longer of the two arcs between the points is taken, more than half the ellipse * @default false */ large: boolean; /** * Number of straight pieces for a full ellipse; the arc gets its proportional share * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; /** * Half width of the ellipse along its own X axis, in model units; scaled up when too small to * reach the end point * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ radiusX: number; /** * Half height of the ellipse along its own Y axis, in model units; equal to `radiusX` for a * circular arc * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ radiusY: number; } /** * Feeds `polygon.circle`: a filled circle in the XY plane, given by its 2D center, radius and the * number of straight sides that approximate it. */ class CircleDto { constructor(center?: Base.Point2, radius?: number, segments?: number); /** * The 2D center point, as X and Y in the plane * @default [0, 0] */ center: Base.Point2; /** * Distance from the center to the rim, in model units * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of straight sides around the circle; more makes it rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `polygon.ellipse`: a filled ellipse in the XY plane, given by its 2D center, its two * half-sizes and the number of straight sides that approximate it. */ class EllipseDto { constructor(center?: Base.Point2, radius?: Base.Point2, segments?: number); /** * The 2D center point, as X and Y in the plane * @default [0, 0] */ center: Base.Point2; /** * The half width along X and the half height along Y, in model units, as `[x, y]` * @default [1, 2] */ radius: Base.Point2; /** * Number of straight sides around the ellipse; more makes it rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `polygon.square`: a filled square in the XY plane with sides parallel to the axes, given by * its 2D center and side length. */ class SquareDto { constructor(center?: Base.Point2, size?: number); /** * The 2D center point, as X and Y in the plane * @default [0, 0] */ center: Base.Point2; /** * Length of each side, in model units * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ size: number; } /** * Feeds `polygon.rectangle`: a filled rectangle in the XY plane with sides parallel to the axes, * given by its 2D center, width along X and length along Y. */ class RectangleDto { constructor(center?: Base.Point2, width?: number, length?: number); /** * The 2D center point, as X and Y in the plane * @default [0, 0] */ center: Base.Point2; /** * Full size along X, in model units * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ width: number; /** * Full size along Y, in model units * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ length: number; } /** * Feeds `polygon.roundedRectangle`: a filled rectangle in the XY plane whose four corners are * rounded, given by its 2D center, its sizes, the corner radius and how finely the corners are * faceted. */ class RoundedRectangleDto { constructor(center?: Base.Point2, roundRadius?: number, segments?: number, width?: number, length?: number); /** * The 2D center point, as X and Y in the plane * @default [0, 0] */ center: Base.Point2; /** * Radius of each rounded corner, in model units; it must be less than half of the smaller side * or an error is thrown * @default 0.2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ roundRadius: number; /** * Number of straight pieces a full circle of rounding is made of, so each corner gets a * quarter; more makes it smoother * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; /** * Full size along X, in model units * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ width: number; /** * Full size along Y, in model units * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ length: number; } /** * Feeds `polygon.star`: a filled star in the XY plane, given by its 2D center, how many tips it * has, how far the tips and the notches between them reach and where the first tip points. */ class StarDto { constructor(center?: Base.Point2, vertices?: number, density?: number, outerRadius?: number, innerRadius?: number, startAngle?: number); /** * The 2D center point, as X and Y in the plane * @default [0, 0] */ center: Base.Point2; /** * Number of tips; the star has as many notches between them * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ vertices: number; /** * Read only when `innerRadius` is 0: how many tips apart the edges connect, 2 for a pentagram, * from which the notch radius is derived * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ density: number; /** * Distance from the center to each tip, in model units * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ outerRadius: number; /** * Distance from the center to each notch, in model units; 0 lets `density` decide it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ innerRadius: number; /** * Direction of the first tip, in degrees counter-clockwise from the X axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ startAngle: number; } /** * Feeds `shapes.cube`: a cube with faces parallel to the axes, given by its center point and edge * length. */ class CubeDto { constructor(center?: Base.Point3, size?: number); /** * The point the cube is centered on, so half the edge length lies on each side of it * @default [0, 0, 0] */ center: Base.Point3; /** * Length of every edge, in model units * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ size: number; } /** * Feeds `shapes.cubesOnCenterPoints`: one cube of the same edge length on every center point, * coming back in the same order. */ class CubeCentersDto { constructor(centers?: Base.Point3[], size?: number); /** * The points the cubes are centered on, one cube each, in the order the results come back * @default undefined */ centers: Base.Point3[]; /** * Length of every edge of every cube, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; } /** * Feeds `shapes.cuboid`: a box with faces parallel to the axes, given by its center point and its * sizes along X, Y and Z. */ class CuboidDto { constructor(center?: Base.Point3, width?: number, length?: number, height?: number); /** * The point the box is centered on, so half of each size lies on each side of it * @default [0, 0, 0] */ center: Base.Point3; /** * Full size along X, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * Full size along Z, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * Full size along Y, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; } /** * Feeds `shapes.cuboidsOnCenterPoints`: one box of the same sizes on every center point, coming * back in the same order. */ class CuboidCentersDto { constructor(centers?: Base.Point3[], width?: number, length?: number, height?: number); /** * The points the boxes are centered on, one box each, in the order the results come back * @default undefined */ centers: Base.Point3[]; /** * Full size of every box along X, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * Full size of every box along Z, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * Full size of every box along Y, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; } /** * Feeds `shapes.roundedCuboid`: a box with every edge and corner rounded, given by its center, its * sizes along X, Y and Z, the rounding radius and how finely the rounding is faceted. */ class RoundedCuboidDto { constructor(center?: Base.Point3, roundRadius?: number, width?: number, length?: number, height?: number, segments?: number); /** * The point the box is centered on, so half of each size lies on each side of it * @default [0, 0, 0] */ center: Base.Point3; /** * Radius of the rounding on every edge, in model units; it must be less than half of the * smallest side or an error is thrown * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ roundRadius: number; /** * Full size along X, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * Full size along Z, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * Full size along Y, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Number of straight pieces a full circle of rounding is made of; more makes the edges smoother * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.roundedCuboidsOnCenterPoints`: one rounded box of the same sizes and rounding on * every center point, coming back in the same order. */ class RoundedCuboidCentersDto { constructor(centers?: Base.Point3[], roundRadius?: number, width?: number, length?: number, height?: number, segments?: number); /** * The points the boxes are centered on, one box each, in the order the results come back * @default undefined */ centers: Base.Point3[]; /** * Radius of the rounding on every edge, in model units; it must be less than half of the * smallest side or an error is thrown * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ roundRadius: number; /** * Full size of every box along X, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * Full size of every box along Z, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * Full size of every box along Y, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Number of straight pieces a full circle of rounding is made of; more makes the edges smoother * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.cylinderElliptic`: a cylinder standing along Z with an elliptical cross-section * that can differ between its two ends, so it also makes cones and tapers. */ class CylidnerEllipticDto { constructor(center?: Base.Point3, height?: number, startRadius?: Base.Point2, endRadius?: Base.Point2, segments?: number); /** * The point halfway up the axis; half the height lies above it along Z and half below * @default [0, 0, 0] */ center: Base.Point3; /** * Full length along Z, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The X and Y radii of the bottom end, in model units, as `[x, y]` * @default [1, 2] */ startRadius: Base.Vector2; /** * The X and Y radii of the top end, in model units, as `[x, y]`; `[0, 0]` closes it to a point * @default [2, 3] */ endRadius: Base.Vector2; /** * Number of flat sides around the cylinder; more makes it rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.cylinderEllipticOnCenterPoints`: one elliptic cylinder of the same size on every * center point, coming back in the same order. */ class CylidnerCentersEllipticDto { constructor(centers?: Base.Point3[], height?: number, startRadius?: Base.Point2, endRadius?: Base.Point2, segments?: number); /** * The points halfway up each axis, one cylinder each, in the order the results come back * @default undefined */ centers: Base.Point3[]; /** * Full length of every cylinder along Z, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The X and Y radii of every bottom end, in model units, as `[x, y]` * @default [1, 2] */ startRadius: Base.Point2; /** * The X and Y radii of every top end, in model units, as `[x, y]`; `[0, 0]` closes them to a * point * @default [2, 3] */ endRadius: Base.Point2; /** * Number of flat sides around each cylinder; more makes them rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.cylinder`: a round cylinder standing along Z, given by the point halfway up its * axis, its height, its radius and how many flat sides approximate it. */ class CylidnerDto { constructor(center?: Base.Point3, height?: number, radius?: number, segments?: number); /** * The point halfway up the axis; half the height lies above it along Z and half below * @default [0, 0, 0] */ center: Base.Point3; /** * Full length along Z, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Distance from the axis to the side, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of flat sides around the cylinder; more makes it rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.roundedCylinder`: a cylinder standing along Z whose two rims are rounded, given by * the point halfway up its axis, the rounding radius, its height and radius and how finely it is * faceted. */ class RoundedCylidnerDto { constructor(center?: Base.Point3, roundRadius?: number, height?: number, radius?: number, segments?: number); /** * The point halfway up the axis; half the height lies above it along Z and half below * @default [0, 0, 0] */ center: Base.Point3; /** * Radius of the rounding on both rims, in model units; the height must be more than twice it or * an error is thrown * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ roundRadius: number; /** * Full length along Z, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Distance from the axis to the side, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of flat sides around the cylinder and pieces in the rounding; more makes it smoother * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.ellipsoid`: a sphere stretched separately along X, Y and Z, given by its center, * its three radii and how finely it is faceted. */ class EllipsoidDto { constructor(center?: Base.Point3, radius?: Base.Point3, segments?: number); /** * The point the ellipsoid is centered on * @default [0, 0, 0] */ center: Base.Point3; /** * The half sizes along X, Y and Z, in model units, as `[x, y, z]`; equal values make a sphere * @default [1, 2, 3] */ radius: Base.Point3; /** * Number of facets around the ellipsoid; more makes it smoother * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.ellipsoidsOnCenterPoints`: one ellipsoid of the same radii on every center point, * coming back in the same order. */ class EllipsoidCentersDto { constructor(centers?: Base.Point3[], radius?: Base.Point3, segments?: number); /** * The points the ellipsoids are centered on, one each, in the order the results come back * @default undefined */ centers: Base.Point3[]; /** * The half sizes of every ellipsoid along X, Y and Z, in model units, as `[x, y, z]` * @default [1, 2, 3] */ radius: Base.Point3; /** * Number of facets around each ellipsoid; more makes them smoother * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.geodesicSphere`: a sphere made of evenly sized triangles, given by its center, its * radius and how finely the twenty starting faces are subdivided. */ class GeodesicSphereDto { constructor(center?: Base.Point3, radius?: number, frequency?: number); /** * The point the sphere is centered on * @default [0, 0, 0] */ center: Base.Point3; /** * Distance from the center to the surface, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * How finely each of the twenty starting faces is subdivided; used in whole multiples of 6, at * least 6, and higher is rounder * @default 12 * @minimum 0 * @maximum Infinity * @step 1 */ frequency: number; } /** * Feeds `shapes.geodesicSpheresOnCenterPoints`: one geodesic sphere of the same radius on every * center point, coming back in the same order. */ class GeodesicSphereCentersDto { constructor(centers?: Base.Point3[], radius?: number, frequency?: number); /** * The points the spheres are centered on, one each, in the order the results come back * @default undefined */ centers: Base.Point3[]; /** * Distance from each center to its surface, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * How finely each of the twenty starting faces is subdivided; used in whole multiples of 6, at * least 6, and higher is rounder * @default 12 * @minimum 0 * @maximum Infinity * @step 0.1 */ frequency: number; } /** * Feeds `shapes.cylindersOnCenterPoints`: one round cylinder of the same size standing along Z on * every center point, coming back in the same order. */ class CylidnerCentersDto { constructor(centers?: Base.Point3[], height?: number, radius?: number, segments?: number); /** * The points halfway up each axis, one cylinder each, in the order the results come back * @default undefined */ centers: Base.Point3[]; /** * Full length of every cylinder along Z, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Distance from the axis to the side of every cylinder, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of flat sides around each cylinder; more makes them rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.roundedCylindersOnCenterPoints`: one rounded cylinder of the same size on every * center point, coming back in the same order. */ class RoundedCylidnerCentersDto { constructor(centers?: Base.Point3[], roundRadius?: number, height?: number, radius?: number, segments?: number); /** * The points halfway up each axis, one cylinder each, in the order the results come back * @default undefined */ centers: Base.Point3[]; /** * Radius of the rounding on both rims of every cylinder, in model units; the height must be * more than twice it or an error is thrown * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ roundRadius: number; /** * Full length of every cylinder along Z, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Distance from the axis to the side of every cylinder, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of flat sides around each cylinder and pieces in the rounding; more makes them * smoother * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.sphere`: a sphere given by its center point, its radius and how many facets * approximate it. */ class SphereDto { constructor(center?: Base.Point3, radius?: number, segments?: number); /** * The point the sphere is centered on * @default [0, 0, 0] */ center: Base.Point3; /** * Distance from the center to the surface, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of facets around the sphere; more makes it rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.spheresOnCenterPoints`: one sphere of the same radius on every center point, coming * back in the same order. */ class SphereCentersDto { constructor(centers?: Base.Point3[], radius?: number, segments?: number); /** * The points the spheres are centered on, one each, in the order the results come back * @default undefined */ centers: Base.Point3[]; /** * Distance from each center to its surface, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of facets around each sphere; more makes them rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; } /** * Feeds `shapes.torus`: a ring with a round cross-section lying flat in the XY plane around * `center`, given by the ring and tube radii, the facet counts of each and the angles that can * leave the ring partly open. */ class TorusDto { constructor(center?: Base.Point3, innerRadius?: number, outerRadius?: number, innerSegments?: number, outerSegments?: number, innerRotation?: number, outerRotation?: number, startAngle?: number); /** * The point the ring is centered on, in model units * @default [0, 0, 0] */ center: Base.Point3; /** * Radius of the tube itself, in model units; it must be less than `outerRadius` * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ innerRadius: number; /** * Distance from the ring's center to the middle of the tube, in model units, so the ring spans * twice the sum of both radii * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ outerRadius: number; /** * Number of flat pieces around the tube's cross-section; more makes the tube rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ innerSegments: number; /** * Number of flat pieces around the ring; more makes the ring rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ outerSegments: number; /** * Turn of the tube's cross-section about its own center, in degrees; it shows when * `innerSegments` is low enough for the facets to be visible * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ innerRotation: number; /** * How far the tube is swept around the ring, in degrees; 360 closes the ring and less leaves it * open * @default 360 * @minimum -Infinity * @maximum Infinity * @step 1 */ outerRotation: number; /** * Where the sweep around the ring starts, in degrees from the X axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ startAngle: number; } /** * Feeds `text.createVectorText` with the text and the font options: where the text starts, how tall * a capital letter is, the spacing of lines and letters, the alignment of several lines and the * stroke compensation. `CylinderTextDto` and `SphereTextDto` reuse them. */ class TextDto { constructor(text?: string, segments?: number, xOffset?: number, yOffset?: number, height?: number, lineSpacing?: number, letterSpacing?: number, align?: jscadTextAlignEnum, extrudeOffset?: number); /** * The characters to write; a newline starts a new line and a character outside plain ASCII * becomes a question mark * @default Hello World */ text: string; /** * Number of straight pieces used for curved strokes; more makes letters rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; /** * Where the text starts along X, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset: number; /** * Where the baseline of the first line sits along Y, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset: number; /** * Height of a capital letter, in model units; the whole text scales with it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Step from one line down to the next as a multiple of the letter height; 1.4 leaves a 40 * percent gap * @default 1.4 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ lineSpacing: number; /** * Multiplies the step from one letter to the next; 1 is the font's own spacing and 2 spreads * letters twice as far apart * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ letterSpacing: number; /** * How the lines of a multi-line text line up: to the left, the center or the right * @default center */ align: jscadTextAlignEnum; /** * Thickness the strokes will get later, in model units; the outlines are pulled in by half of * it so letters keep their size once thick * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extrudeOffset: number; } /** * Feeds `text.cylindricalText`: the text and font options of `TextDto` plus the size of the * cylinders every stroke is chained from. */ class CylinderTextDto { constructor(text?: string, extrusionHeight?: number, extrusionSize?: number, segments?: number, xOffset?: number, yOffset?: number, height?: number, lineSpacing?: number, letterSpacing?: number, align?: jscadTextAlignEnum, extrudeOffset?: number); /** * The characters to write; a newline starts a new line and a character outside plain ASCII * becomes a question mark * @default Hello World */ text: string; /** * Length of the cylinders along Z, in model units; the strokes sit on the XY plane with half of * it on each side * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionHeight: number; /** * Radius of the cylinders, in model units, which is half the thickness of the strokes * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionSize: number; /** * Number of flat sides around each cylinder and pieces in curved strokes; more makes the * letters rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; /** * Where the text starts along X before it is centered, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset: number; /** * Where the baseline of the first line sits along Y, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset: number; /** * Height of a capital letter, in model units; the whole text scales with it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Step from one line down to the next as a multiple of the letter height; 1.4 leaves a 40 * percent gap * @default 1.4 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ lineSpacing: number; /** * Multiplies the step from one letter to the next; 1 is the font's own spacing and 2 spreads * letters twice as far apart * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ letterSpacing: number; /** * How the lines of a multi-line text line up: to the left, the center or the right * @default center */ align: jscadTextAlignEnum; /** * Pulls the strokes inward by half this amount, in model units, so thick strokes keep the * intended letter size * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extrudeOffset: number; } /** * Feeds `text.sphericalText`: the text and font options of `TextDto` plus the size of the spheres * every stroke is chained from. */ class SphereTextDto { constructor(text?: string, radius?: number, segments?: number, xOffset?: number, yOffset?: number, height?: number, lineSpacing?: number, letterSpacing?: number, align?: jscadTextAlignEnum, extrudeOffset?: number); /** * The characters to write; a newline starts a new line and a character outside plain ASCII * becomes a question mark * @default Hello World */ text: string; /** * Radius of the spheres, in model units, which is half the thickness of the strokes * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of facets around each sphere and pieces in curved strokes; more makes the letters * rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; /** * Where the text starts along X before it is centered, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset: number; /** * Where the baseline of the first line sits along Y, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset: number; /** * Height of a capital letter, in model units; the whole text scales with it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Step from one line down to the next as a multiple of the letter height; 1.4 leaves a 40 * percent gap * @default 1.4 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ lineSpacing: number; /** * Multiplies the step from one letter to the next; 1 is the font's own spacing and 2 spreads * letters twice as far apart * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ letterSpacing: number; /** * How the lines of a multi-line text line up: to the left, the center or the right * @default center */ align: jscadTextAlignEnum; /** * Pulls the strokes inward by half this amount, in model units, so thick strokes keep the * intended letter size * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extrudeOffset: number; } /** * Feeds `shapes.fromPolygonPoints` with the faces of a solid, each as the list of points around it, * listed clockwise as seen from outside. */ class FromPolygonPoints { constructor(polygonPoints?: Base.Point3[][]); /** * One list of points per face, each going around the face clockwise as seen from outside; the * lists are read, not changed */ polygonPoints: Base.Point3[][]; } } /** * Re-export Base namespace from @bitbybit-dev/base. * Manifold package uses the same foundational types without additions. */ /** * Every parameter object the Manifold kernel accepts. Manifold specialises in fast, reliably * watertight mesh booleans, so its DTOs carry manifold handles and the settings that keep results * valid - segment counts, precision and the operands of a boolean. * * It also models in 2D: cross sections can be built, offset and booleaned in the plane, then extruded * or revolved into solids, which is often the cheapest route to a profile-driven part. Names repeat * across kernels: the CircleDto here is not the one in Inputs.OCCT. */ declare namespace Manifold { /** * A handle to a solid living inside the Manifold kernel, not the geometry itself. The kernel runs * as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference. Pass it into the next operation to keep building, and dispose it when finished to * release the kernel memory behind it. */ type ManifoldPointer = { hash: number; type: "manifold-shape"; }; /** * A handle to a 2D cross section inside the Manifold kernel. Cross sections are built, offset and * booleaned in the plane, then extruded or revolved into solids - often the cheapest route to a * profile-driven part. */ type CrossSectionPointer = { hash: number; type: "manifold-shape"; }; /** * A handle to raw mesh data inside the Manifold kernel, used when importing an existing mesh into * the kernel or reading one back out. */ type MeshPointer = { hash: number; type: "manifold-shape"; }; /** * How overlapping and self-intersecting outlines decide what is inside. evenOdd alternates with * each crossing, so a shape inside a shape becomes a hole; nonZero counts winding direction, so * overlaps stay filled; positive and negative keep only regions with winding of that sign. If an * imported outline fills wrongly, this is the setting to change first. */ enum fillRuleEnum { evenOdd = "EvenOdd", nonZero = "NonZero", positive = "Positive", negative = "Negative" } /** * How an offset fills the outside of a corner: square cuts it off flat, round arcs around it, * miter extends both sides to a sharp point, bevel cuts a chamfer. Miter can produce very long * spikes at tight angles, which is why square or round is the safer default. */ enum manifoldJoinTypeEnum { square = "Square", round = "Round", miter = "Miter", bevel = "Bevel" } /** * A Manifold solid taken apart into plain arrays - vertex properties, triangle indices and the * run structure that groups them. The form the kernel hands back when geometry has to cross out of * WebAssembly for rendering or export. */ class DecomposedManifoldMeshDto { /** * How many numbers each vertex carries in `vertProperties`; the position takes the first three. */ numProp: number; /** * All vertex properties in one flat list, `numProp` numbers per vertex, position first. */ vertProperties: Float32Array; /** * The triangles as a flat list of vertex indexes, three per triangle. */ triVerts: Uint32Array; /** * For each merged vertex, the index of the property vertex that is merged away; pairs with * `mergeToVert`. * @optional true */ mergeFromVert?: Uint32Array | undefined; /** * For each merged vertex, the index of the property vertex it is merged into; pairs with * `mergeFromVert`. * @optional true */ mergeToVert?: Uint32Array | undefined; /** * Where each triangle run starts in `triVerts`, one entry per run plus a final end marker. * @optional true */ runIndex?: Uint32Array | undefined; /** * The id of the original shape each run of triangles came from, one per run. * @optional true */ runOriginalID?: Uint32Array | undefined; /** * The placement of each run as 12 numbers of a column-major 3x4 matrix, one per run. * @optional true */ runTransform?: Float32Array | undefined; /** * For each triangle, the id of the flat face it belongs to, so coplanar triangles can be * grouped. * @optional true */ faceID?: Uint32Array | undefined; /** * The smoothing tangent of each half-edge as four numbers, direction and weight, when the solid * was smoothed. * @optional true */ halfedgeTangent?: Float32Array | undefined; } /** * A solid or cross-section and how to draw it, for the renderer packages: face color, opacity and * material for a solid, line color and width for a cross-section. */ class DrawManifoldOrCrossSectionDto { /** * Provide options without default values */ constructor(manifoldOrCrossSection?: T, faceOpacity?: number, faceMaterial?: M, faceColour?: Base.Color, crossSectionColour?: Base.Color, crossSectionWidth?: number, crossSectionOpacity?: number, computeNormals?: boolean, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number); /** * The solid or cross-section to draw. * @default undefined * @optional true */ manifoldOrCrossSection?: T | undefined; /** * How opaque the faces are, from 0 for invisible to 1 for solid. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity: number; /** * A material for the faces from the rendering engine; when given it replaces the face color. * @default undefined * @optional true */ faceMaterial?: M | undefined; /** * The color of the faces as a hex string such as `#ff0000`. * @default #ff0000 */ faceColour: Base.Color; /** * The color of a cross-section's lines as a hex string. * @default #ff00ff */ crossSectionColour: Base.Color; /** * How thick a cross-section's lines are drawn. * @default 2 */ crossSectionWidth: number; /** * How opaque a cross-section's lines are, from 0 to 1. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ crossSectionOpacity: number; /** * When true, normals are computed for the mesh so it shades smoothly. * @default false */ computeNormals: boolean; /** * When true, the back of each face is drawn in its own color, which shows which way faces * point. * @default true */ drawTwoSided: boolean; /** * The color of the back of the faces as a hex string; used only with `drawTwoSided`. * @default #0000ff */ backFaceColour: Base.Color; /** * How opaque the back of the faces is, from 0 to 1; used only with `drawTwoSided`. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; } /** * Solids or cross-sections and how to draw them, for the renderer packages: the same options as * `DrawManifoldOrCrossSectionDto`, applied to every shape in the list. */ class DrawManifoldsOrCrossSectionsDto { /** * Provide options without default values */ constructor(manifoldsOrCrossSections?: T[], faceOpacity?: number, faceMaterial?: M, faceColour?: Base.Color, crossSectionColour?: Base.Color, crossSectionWidth?: number, crossSectionOpacity?: number, computeNormals?: boolean, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number); /** * The solids or cross-sections to draw with the same options. * @default undefined * @optional true */ manifoldsOrCrossSections?: T[] | undefined; /** * A material for the faces from the rendering engine; when given it replaces the face color. * @default undefined * @optional true */ faceMaterial?: M | undefined; /** * The color of the faces as a hex string such as `#ff0000`. * @default #ff0000 */ faceColour: Base.Color; /** * How opaque the faces are, from 0 for invisible to 1 for solid. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity: number; /** * The color of a cross-section's lines as a hex string. * @default #ff00ff */ crossSectionColour: Base.Color; /** * How thick a cross-section's lines are drawn. * @default 2 */ crossSectionWidth: number; /** * How opaque a cross-section's lines are, from 0 to 1. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ crossSectionOpacity: number; /** * When true, normals are computed for the meshes so they shade smoothly. * @default false */ computeNormals: boolean; /** * When true, the back of each face is drawn in its own color, which shows which way faces * point. * @default true */ drawTwoSided: boolean; /** * The color of the back of the faces as a hex string; used only with `drawTwoSided`. * @default #0000ff */ backFaceColour: Base.Color; /** * How opaque the back of the faces is, from 0 to 1; used only with `drawTwoSided`. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; } /** * Mesh data for `manifold.shapes.manifoldFromMesh`, which builds a solid from it. */ class CreateFromMeshDto { constructor(mesh?: DecomposedManifoldMeshDto); /** * The mesh data, in the form `manifoldToMesh` hands out; it must describe a closed, * consistently oriented surface. */ mesh: DecomposedManifoldMeshDto; } /** * Triangles as points for `manifold.shapes.fromPolygonPoints`, which builds a solid from them. */ class FromPolygonPointsDto { constructor(polygonPoints?: Base.Point3[][]); /** * The triangles, each three points, together forming a closed surface. */ polygonPoints: Base.Point3[][]; } /** * One polygon as points and the fill options for `crossSection.crossSectionFromPoints`. */ class CrossSectionFromPolygonPointsDto { constructor(points?: Base.Point3[], fillRule?: fillRuleEnum, removeDuplicates?: boolean, tolerance?: number); /** * The polygon's points in order; only X and Y are used. */ points: Base.Point3[]; /** * Which regions of a self-crossing polygon count as inside: even-odd, non-zero, positive or * negative winding. * @default positive */ fillRule?: fillRuleEnum | undefined; /** * When true, consecutive repeated points, the last and first included, are dropped before * building. * @default false */ removeDuplicates?: boolean | undefined; /** * How close two points must be to count as repeated, in model units. * @default 1e-7 */ tolerance?: number | undefined; } /** * Several polygons as points and the fill options for `crossSection.crossSectionFromPolygons`, for * outlines with holes. */ class CrossSectionFromPolygonsPointsDto { constructor(polygonPoints?: Base.Point3[][], fillRule?: fillRuleEnum, removeDuplicates?: boolean, tolerance?: number); /** * One list of points per polygon; only X and Y are used. */ polygonPoints: Base.Point3[][]; /** * Which regions count as inside where polygons overlap: even-odd, non-zero, positive or * negative winding. * @default positive */ fillRule?: fillRuleEnum | undefined; /** * When true, consecutive repeated points in each polygon, the last and first included, are * dropped before building. * @default false */ removeDuplicates?: boolean | undefined; /** * How close two points must be to count as repeated, in model units. * @default 1e-7 */ tolerance?: number | undefined; } /** * A size and a placement for `manifold.shapes.cube`. */ class CubeDto { constructor(center?: boolean, size?: number); /** * When true, the box is centered on the origin; when false its corner sits there and it extends * along the positive axes. * @default true */ center: boolean; /** * The side length of the cube, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; } /** * Polygons as 2D points and a fill rule for `crossSection.shapes.create`. */ class CreateContourSectionDto { constructor(polygons?: Base.Vector2[][], fillRule?: fillRuleEnum); /** * The polygons, each a list of 2D points; overlapping ones are fused. * @default undefined */ polygons: Base.Vector2[][]; /** * Which regions count as inside where polygons overlap: even-odd, non-zero, positive or * negative winding. * @default EvenOdd */ fillRule: fillRuleEnum; } /** * A side length and a placement for `crossSection.shapes.square`. */ class SquareDto { constructor(center?: boolean, size?: number); /** * When true, the square is centered on the origin; when false its corner sits there. * @default false */ center: boolean; /** * The side length, one number for a square or two for a rectangle along X and Y, in model * units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; } /** * A radius and a segment count for `manifold.shapes.sphere`. */ class SphereDto { constructor(radius?: number, circularSegments?: number); /** * The distance from the center to the surface, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * How many segments go around the sphere; rounded up to a multiple of four. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments: number; } /** * The size and placement of a cylinder or cone for `manifold.shapes.cylinder`, which stands it * along Z. */ class CylinderDto { constructor(height?: number, radiusLow?: number, radiusHigh?: number, circularSegments?: number, center?: boolean); /** * The height along Z, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The radius of the bottom circle, in model units; must be above 0. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusLow: number; /** * The radius of the top circle, in model units: equal to `radiusLow` for a cylinder, smaller * for a truncated cone, 0 for a pointed cone. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusHigh: number; /** * How many flat sides go around the cylinder; more is rounder. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments: number; /** * When true, the cylinder is centered on the origin; when false it stands on the XY plane. * @default true */ center: boolean; } /** * A radius and a segment count for `crossSection.shapes.circle`. */ class CircleDto { constructor(radius?: number, circularSegments?: number); /** * The distance from the center to the outline, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * How many straight sides the circle is drawn with; more is rounder. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments: number; } /** * Two sides and a placement for `crossSection.shapes.rectangle`. */ class RectangleDto { constructor(length?: number, height?: number, center?: boolean); /** * The side along X, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * The side along Y, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * When true, the rectangle is centered on the origin; when false its corner sits there. * @default false */ center: boolean; } /** * One solid for the methods that take nothing else, such as `manifold.evaluate.volume` or * `manifold.operations.hull`. */ class ManifoldDto { constructor(manifold?: T); /** * The solid to work on; it is not changed. */ manifold: T; } /** * A solid, a channel and a sharp angle for `manifold.operations.calculateNormals`. */ class CalculateNormalsDto { constructor(manifold?: T, normalIdx?: number, minSharpAngle?: number); /** * The solid to compute normals for. */ manifold: T; /** * The property channel that receives the X of each normal; Y and Z follow in the next two, and * channels are added as needed. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ normalIdx: number; /** * Edges bent more than this, in degrees, get separate normals on each side and stay crisp; at 0 * every triangle keeps its own normal. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ minSharpAngle: number; } /** * A solid and two channels for `manifold.operations.calculateCurvature`. */ class CalculateCurvatureDto { constructor(manifold?: T); /** * The solid to compute curvature for. */ manifold: T; /** * The property channel that receives the Gaussian curvature, the product of the two principal * curvatures; below 0 skips it. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ gaussianIdx: number; /** * The property channel that receives the mean curvature, the sum of the two principal * curvatures; below 0 skips it. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ meanIdx: number; } /** * A count for `manifold.operations.reserveIds`, which reserves that many mesh ids. */ class CountDto { constructor(count?: number); /** * How many ids to reserve. */ count: number; } /** * Two solids and a search distance for `manifold.evaluate.minGap`. */ class ManifoldsMinGapDto { constructor(manifold1?: T, manifold2?: T, searchLength?: number); /** * The first solid. */ manifold1: T; /** * The second solid. */ manifold2: T; /** * How far apart the solids may be before the search gives up, in model units. * @default 100 * @minimum 0 * @maximum Infinity * @step 10 */ searchLength: number; } /** * A solid and a ray segment for `manifold.evaluate.rayCast`. */ class RayCastDto { constructor(manifold?: T, origin?: Base.Point3, endpoint?: Base.Point3); /** * The solid to cast the ray at. */ manifold: T; /** * Where the ray segment starts. * @default [0,0,0] */ origin: Base.Point3; /** * Where the ray segment ends; nothing beyond it is hit. * @default [0,0,10] */ endpoint: Base.Point3; } /** * One place a ray segment crosses the surface of a solid, as `manifold.evaluate.rayCast` reports * it: the triangle's original face, how far along the segment it lies as a fraction of the * segment's length (0 at the origin, 1 at the endpoint), the point and the surface normal there. */ type RayHit = { faceID: number; distance: number; position: Base.Point3; normal: Base.Vector3; }; /** * A solid and a tolerance for `manifold.operations.refineToTolerance` and * `manifold.operations.setTolerance`. */ class ManifoldRefineToleranceDto { constructor(manifold?: T, tolerance?: number); /** * The solid to work on. */ manifold: T; /** * The largest distance allowed between the triangles and the smooth surface they stand for, in * model units. * @default 1e-6 * @minimum 0 * @maximum Infinity * @step 1e-7 */ tolerance: number; } /** * A solid and an edge length for `manifold.operations.refineToLength`. */ class ManifoldRefineLengthDto { constructor(manifold?: T, length?: number); /** * The solid to refine. */ manifold: T; /** * The rough length every edge is split down to, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; } /** * A solid and a count for `manifold.operations.refine`. */ class ManifoldRefineDto { constructor(manifold?: T, number?: number); /** * The solid to refine. */ manifold: T; /** * How many pieces every edge is split into; must be more than 1 to change anything. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ number: number; } /** * A solid and a normal channel for `manifold.operations.smoothByNormals`. */ class ManifoldSmoothByNormalsDto { constructor(manifold?: T, normalIdx?: number); /** * The solid to mark for smoothing. */ manifold: T; /** * The first of the three property channels holding the normals; the solid must have at least * that many plus three. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ normalIdx: number; } /** * A solid and a tolerance for `manifold.operations.simplify`. */ class ManifoldSimplifyDto { constructor(manifold?: T, tolerance?: number); /** * The solid to simplify. */ manifold: T; /** * How far surfaces may move while vertices are removed, in model units; left out or below the * solid's own tolerance, that tolerance is used. * @default undefined * @minimum 0 * @maximum Infinity * @step 0.001 * @optional true */ tolerance?: number | undefined; } /** * A solid, a property count and a fill function for `manifold.operations.setProperties`. */ class ManifoldSetPropertiesDto { constructor(manifold?: T, numProp?: number, propFunc?: (newProp: number[], position: Base.Vector3, oldProp: number[]) => void); /** * The solid whose vertex properties are rewritten. */ manifold: T; /** * How many properties each vertex has afterwards. * @default 3 * @minimum 3 * @maximum Infinity * @step 1 */ numProp: number; /** * A function that receives the new property array, the vertex position and the old properties, * and fills the new array in place. * @default undefined */ propFunc: (newProp: number[], position: Base.Vector3, oldProp: number[]) => void; } /** * A solid and the smoothing settings for `manifold.operations.smoothOut`. */ class ManifoldSmoothOutDto { constructor(manifold?: T, minSharpAngle?: number, minSmoothness?: number); /** * The solid to mark for smoothing. */ manifold: T; /** * Edges bent more than this, in degrees, stay sharp; the rest are smoothed. At 0 nothing is * smoothed. * @default 60 * @minimum -Infinity * @maximum Infinity * @step 1 */ minSharpAngle: number; /** * How much the sharp edges are rounded, from 0 for a hard edge to 1 for fully smooth. * @default 0 * @minimum 0 * @maximum 1 * @step 0.1 */ minSmoothness: number; } /** * Points and solids for `manifold.operations.hullPoints`, which wraps them all in one convex hull. */ class HullPointsDto { constructor(points?: T); /** * The points and solids to wrap, in any mix. */ points: T; } /** * A solid and a height for `manifold.operations.slice`. */ class SliceDto { constructor(manifold?: T); /** * The solid to cut. */ manifold: T; /** * The Z height of the cutting plane, which is parallel to the XY plane. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; } /** * Mesh data for the methods that read it whole, such as `mesh.evaluate.numTri` and * `mesh.operations.merge`. */ class MeshDto { constructor(mesh?: T); /** * The mesh data, as `manifoldToMesh` hands it out. */ mesh: T; } /** * Mesh data and a vertex index for `mesh.evaluate.position` and `mesh.evaluate.extras`. */ class MeshVertexIndexDto { constructor(mesh?: T, vertexIndex?: number); /** * The mesh data to read. */ mesh: T; /** * The position of the vertex, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ vertexIndex: number; } /** * Mesh data and a run index for `mesh.evaluate.transform`. */ class MeshTriangleRunIndexDto { constructor(mesh?: T, triangleRunIndex?: number); /** * The mesh data to read. */ mesh: T; /** * The position of the triangle run, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ triangleRunIndex: number; } /** * Mesh data and a half-edge index for `mesh.evaluate.tangent`. */ class MeshHalfEdgeIndexDto { constructor(mesh?: T, halfEdgeIndex?: number); /** * The mesh data to read. */ mesh: T; /** * The position of the half-edge, counting from 0: three per triangle, in triangle order. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ halfEdgeIndex: number; } /** * Mesh data and a triangle index for `mesh.evaluate.verts`. */ class MeshTriangleIndexDto { constructor(mesh?: T, triangleIndex?: number); /** * The mesh data to read. */ mesh: T; /** * The position of the triangle, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ triangleIndex: number; } /** * One cross-section for the methods that take nothing else, such as `crossSection.evaluate.area` or * `crossSection.operations.hull`. */ class CrossSectionDto { constructor(crossSection?: T); /** * The cross-section to work on; it is not changed. */ crossSection: T; } /** * Several cross-sections for the methods that take a list, such as `crossSection.booleans.union`. */ class CrossSectionsDto { constructor(crossSections?: T[]); /** * The cross-sections, in the order the method uses them. */ crossSections: T[]; } /** * A cross-section and the sweep settings for `crossSection.operations.extrude`, which grows it * along Z into a solid. */ class ExtrudeDto { constructor(crossSection?: T); /** * The flat outline to extrude. */ crossSection: T; /** * How far the outline is swept along Z, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * How many extra copies of the outline are inserted along the way; more keeps a twist or taper * smooth. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ nDivisions: number; /** * How far the top is turned against the bottom, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ twistDegrees: number; /** * How much the top is scaled along X; 1 keeps it, 0 with `scaleTopY` at 0 makes a cone. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ scaleTopX: number; /** * How much the top is scaled along Y; 1 keeps it, 0 with `scaleTopX` at 0 makes a cone. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ scaleTopY: number; /** * When true, the solid is centered on the XY plane; when false it stands on it. * @default true */ center: boolean; } /** * A cross-section and the turn settings for `crossSection.operations.revolve`, which spins it into * a solid. */ class RevolveDto { constructor(crossSection?: T, revolveDegrees?: number, matchProfile?: boolean, circularSegments?: number); /** * The flat profile to spin; only the part on the positive X side is used. */ crossSection: T; /** * How far to spin, in degrees; 360 gives a full turn. * @default 360 * @minimum 0 * @maximum Infinity * @step 1 */ revolveDegrees: number; /** * When true, the result is turned back to keep the profile's orientation; when false it stands * along Z as the kernel makes it. * @default true */ matchProfile: boolean; /** * How many segments go around the turn; more is rounder. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments: number; } /** * A cross-section and the offset settings for `crossSection.operations.offset`. */ class OffsetDto { constructor(crossSection?: T, delta?: number, joinType?: manifoldJoinTypeEnum, miterLimit?: number, circularSegments?: number); /** * The outline to offset. */ crossSection: T; /** * How far the outline moves, in model units: positive grows outer contours and shrinks holes, * negative does the opposite. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ delta: number; /** * How corners are treated: `round`, `square`, `miter` or `bevel`. * @default round */ joinType: manifoldJoinTypeEnum; /** * For `miter` joins, how far a corner may reach as a multiple of `delta` before it is squared * off; 2 is the smallest allowed. * @default 2 * @minimum 2 * @maximum Infinity * @step 0.1 */ miterLimit: number; /** * For `round` joins, how many segments a full circle of rounding gets. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments: number; } /** * A cross-section and a distance for `crossSection.operations.simplify`. */ class SimplifyDto { constructor(crossSection?: T, epsilon?: number); /** * The outline to simplify. */ crossSection: T; /** * Points closer than this, in model units, to the line between their neighbors are dropped. * @default 1e-6 * @minimum 0 * @maximum Infinity * @step 1e-7 */ epsilon: number; } /** * Cross-sections or polygons for `crossSection.operations.compose`, which packs them into one * cross-section. */ class ComposeDto { constructor(polygons?: T); /** * The cross-sections or polygons to pack together. */ polygons: T; } /** * A cross-section and a direction for `crossSection.transforms.mirror`. */ class MirrorCrossSectionDto { constructor(crossSection?: T, normal?: Base.Vector2); /** * The outline to mirror. */ crossSection: T; /** * The normal of the mirror line through the origin; `[1, 0]` mirrors left to right. * @default [1,0] */ normal: Base.Vector2; } /** * A cross-section and two factors for `crossSection.transforms.scale2D`. */ class Scale2DCrossSectionDto { constructor(crossSection?: T, vector?: Base.Vector2); /** * The outline to scale. */ crossSection: T; /** * The factors along X and Y, about the origin; 1 keeps an axis as it is. * @default [2,2] */ vector: Base.Vector2; } /** * A cross-section and a vector for `crossSection.transforms.translate`. */ class TranslateCrossSectionDto { constructor(crossSection?: T, vector?: Base.Vector2); /** * The outline to move. */ crossSection: T; /** * The 2D vector the outline moves by, in model units. * @default undefined */ vector: Base.Vector2; } /** * A cross-section and an angle for `crossSection.transforms.rotate`. */ class RotateCrossSectionDto { constructor(crossSection?: T, degrees?: number); /** * The outline to rotate. */ crossSection: T; /** * The rotation about the origin, in degrees, counterclockwise. * @default 45 * @minimum -Infinity * @maximum Infinity * @step 1 */ degrees: number; } /** * A cross-section and a factor for `crossSection.transforms.scale`. */ class ScaleCrossSectionDto { constructor(crossSection?: T, factor?: number); /** * The outline to scale. */ crossSection: T; /** * The uniform scale about the origin; 2 doubles every size. * @default 2 */ factor: number; } /** * A cross-section and two distances for `crossSection.transforms.translateXY`. */ class TranslateXYCrossSectionDto { constructor(crossSection?: T, x?: number, y?: number); /** * The outline to move. */ crossSection: T; /** * How far to move along X, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ x: number; /** * How far to move along Y, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ y: number; } /** * A cross-section and a 3x3 matrix for `crossSection.transforms.transform`. */ class TransformCrossSectionDto { constructor(crossSection?: T, transform?: Base.TransformMatrix3x3); /** * The outline to transform. */ crossSection: T; /** * The 3x3 matrix as 9 numbers, any combination of move, turn, scale and shear in the plane. * @default undefined */ transform: Base.TransformMatrix3x3; } /** * A cross-section and a function for `crossSection.transforms.warp`. */ class CrossSectionWarpDto { constructor(crossSection?: T, warpFunc?: (vert: Base.Vector2) => void); /** * The outline to warp. */ crossSection: T; /** * A function that receives each 2D point and changes it in place. * @default undefined */ warpFunc: (vert: Base.Vector2) => void; } /** * A solid and a plane normal for `manifold.transforms.mirror`. */ class MirrorDto { constructor(manifold?: T, normal?: Base.Vector3); /** * The solid to mirror. */ manifold: T; /** * The normal of the mirror plane through the origin; a zero vector gives an empty solid. * @default [1,0,0] */ normal: Base.Vector3; } /** * A solid and three factors for `manifold.transforms.scale3D` and `manifold.transforms.scale`. */ class Scale3DDto { constructor(manifold?: T, vector?: Base.Vector3); /** * The solid to scale. */ manifold: T; /** * The factors along X, Y and Z, about the origin; 1 keeps an axis as it is, 2 doubles it. * @default [2,2,2] */ vector: Base.Vector3; } /** * A solid and a vector for `manifold.transforms.translate`. */ class TranslateDto { constructor(manifold?: T, vector?: Base.Vector3); /** * The solid to move. */ manifold: T; /** * The vector the solid moves by, in model units. * @default undefined */ vector: Base.Vector3; } /** * A solid and several vectors for `manifold.transforms.translateByVectors`, one moved copy per * vector. */ class TranslateByVectorsDto { constructor(manifold?: T, vectors?: Base.Vector3[]); /** * The solid to copy and move. */ manifold: T; /** * One vector per copy, in model units. * @default undefined */ vectors: Base.Vector3[]; } /** * A solid and three angles for `manifold.transforms.rotate`. */ class RotateDto { constructor(manifold?: T, vector?: Base.Vector3); /** * The solid to rotate. */ manifold: T; /** * The Euler angles about X, Y and Z in degrees, applied in that order about the origin. * @default undefined */ vector: Base.Vector3; } /** * A solid and three separate angles for `manifold.transforms.rotateXYZ`. */ class RotateXYZDto { constructor(manifold?: T, x?: number, y?: number, z?: number); /** * The solid to rotate. */ manifold: T; /** * The rotation about the X axis in degrees, applied first. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ x: number; /** * The rotation about the Y axis in degrees, applied second. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ y: number; /** * The rotation about the Z axis in degrees, applied last. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ z: number; } /** * A solid and a factor for uniform scaling; currently unused by the library, which scales through * `Scale3DDto`. */ class ScaleDto { constructor(manifold?: T, factor?: number); /** * The solid to scale. */ manifold: T; /** * The uniform scale about the origin; 2 doubles every size. * @default 2 */ factor: number; } /** * A solid and three distances for `manifold.transforms.translateXYZ`. */ class TranslateXYZDto { constructor(manifold?: T, x?: number, y?: number, z?: number); /** * The solid to move. */ manifold: T; /** * How far to move along X, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ x: number; /** * How far to move along Y, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ y: number; /** * How far to move along Z, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ z: number; } /** * A solid and a 4x4 matrix for `manifold.transforms.transform`. */ class TransformDto { constructor(manifold?: T, transform?: Base.TransformMatrix); /** * The solid to transform. */ manifold: T; /** * The column-major 4x4 matrix of 16 numbers; the translation sits at indexes 12 to 14. * @default undefined */ transform: Base.TransformMatrix; } /** * A solid and several 4x4 matrices for `manifold.transforms.transforms`, applied first to last. */ class TransformsDto { constructor(manifold?: T, transforms?: Base.TransformMatrixes); /** * The solid to transform. */ manifold: T; /** * The column-major matrices, applied one after another; the list must not be empty. * @default undefined */ transforms: Base.TransformMatrixes; } /** * A solid and a function for `manifold.transforms.warp`. */ class ManifoldWarpDto { constructor(manifold?: T, warpFunc?: (vert: Base.Vector3) => void); /** * The solid to warp. */ manifold: T; /** * A function that receives each vertex position and changes it in place. * @default undefined */ warpFunc: (vert: Base.Vector3) => void; } /** * Two cross-sections for the pairwise methods of `crossSection.booleans`. */ class TwoCrossSectionsDto { constructor(crossSection1?: T, crossSection2?: T); /** * The first cross-section; for a subtraction, the one cut from. */ crossSection1: T; /** * The second cross-section; for a subtraction, the one cut with. */ crossSection2: T; } /** * Two solids for the pairwise methods of `manifold.booleans`. */ class TwoManifoldsDto { constructor(manifold1?: T, manifold2?: T); /** * The first solid; for a subtraction, the one cut from. */ manifold1: T; /** * The second solid; for a subtraction, the one cut with. */ manifold2: T; } /** * A solid and a cutter for `manifold.booleans.split`. */ class SplitManifoldsDto { constructor(manifoldToSplit?: T, manifoldCutter?: T); /** * The solid that is cut in two. */ manifoldToSplit: T; /** * The solid that does the cutting; the pieces are what lies inside it and outside it. */ manifoldCutter: T; } /** * A solid and a plane for `manifold.booleans.trimByPlane`, which keeps the part on the normal's * side. */ class TrimByPlaneDto { constructor(manifold?: T, normal?: Base.Vector3, originOffset?: number); /** * The solid to trim. */ manifold: T; /** * The normal of the cutting plane; the kept part lies on the side it points to, and its length * does not matter. * @default [1,0,0] */ normal: Base.Vector3; /** * How far the plane sits from the origin along the normal, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ originOffset: number; } /** * A solid and a plane for `manifold.booleans.splitByPlane`, which keeps both pieces. */ class SplitByPlaneDto { constructor(manifold?: T, normal?: Base.Vector3, originOffset?: number); /** * The solid to split. */ manifold: T; /** * The normal of the cutting plane; the first piece lies on the side it points to, and its * length does not matter. * @default [1,0,0] */ normal: Base.Vector3; /** * How far the plane sits from the origin along the normal, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ originOffset: number; } /** * A solid, a plane normal and several distances for `manifold.booleans.splitByPlaneOnOffsets`, * which cuts the solid into slabs. */ class SplitByPlaneOnOffsetsDto { constructor(manifold?: T, normal?: Base.Vector3, originOffsets?: number[]); /** * The solid to cut into slabs. */ manifold: T; /** * The normal shared by every cutting plane; its length does not matter. * @default [1,0,0] */ normal: Base.Vector3; /** * How far each plane sits from the origin along the normal, in model units, in increasing * order. * @default [0] */ originOffsets: number[]; } /** * Several solids for the methods that take a list, such as `manifold.booleans.union` or * `manifold.operations.compose`. */ class ManifoldsDto { constructor(manifolds?: T[]); /** * The solids, in the order the method uses them. */ manifolds: T[]; } /** * A solid and an optional normal channel for `manifold.manifoldToMesh`. */ class ManifoldToMeshDto { constructor(manifold?: T, normalIdx?: number); /** * The solid to turn into mesh data. */ manifold: T; /** * The property channel holding the normals, when the solid carries them. * @optional true */ normalIdx?: number | undefined; } /** * Several solids and optional normal channels for `manifold.manifoldsToMeshes`. */ class ManifoldsToMeshesDto { constructor(manifolds?: T[], normalIdx?: number[]); /** * The solids to turn into mesh data, one mesh each. */ manifolds: T[]; /** * One normal channel per solid, when they carry normals. * @optional true */ normalIdx?: number[] | undefined; } /** * A solid or cross-section and an optional normal channel for `decomposeManifoldOrCrossSection`. */ class DecomposeManifoldOrCrossSectionDto { constructor(manifoldOrCrossSection?: T, normalIdx?: number); /** * The solid or cross-section to turn into plain data. */ manifoldOrCrossSection: T; /** * The property channel holding the normals of a solid, when it carries them. * @optional true */ normalIdx?: number | undefined; } /** * One solid or cross-section for the methods that accept either. */ class ManifoldOrCrossSectionDto { constructor(manifoldOrCrossSection?: T); /** * The solid or cross-section to work on. */ manifoldOrCrossSection: T; } /** * Several solids or cross-sections for the methods that accept either kind in a list. */ class ManifoldsOrCrossSectionsDto { constructor(manifoldsOrCrossSections?: T[]); /** * The solids or cross-sections, in the order the method uses them. */ manifoldsOrCrossSections: T[]; } /** * Several solids or cross-sections and optional normal channels for * `decomposeManifoldsOrCrossSections`. */ class DecomposeManifoldsOrCrossSectionsDto { constructor(manifoldsOrCrossSections?: T[], normalIdx?: number[]); /** * The solids or cross-sections to turn into plain data, one result each. */ manifoldsOrCrossSections: T[]; /** * One normal channel per shape, for the solids that carry normals. * @optional true */ normalIdx?: number[] | undefined; } } /** * Re-export Base namespace from @bitbybit-dev/base. * OCCT package uses the same foundational types without additions. */ /** * Every parameter object the OpenCascade kernel accepts. The kernel works on a boundary * representation - vertices, edges, wires, faces, shells, solids and compounds - so most DTOs here * carry one or more shape handles plus the numbers that drive the operation: radii, lengths, * directions, tolerances and fillet or chamfer sizes. * * Two things are worth knowing before reading further. Shape arguments are opaque handles returned * by a previous call, not geometry you construct by hand, so operations chain: build a wire, turn it * into a face, extrude the face into a solid. And the names deliberately repeat across kernels - * there is a CircleDto here, another in Inputs.JSCAD, another in Inputs.Manifold and another in * Inputs.Verb - so check the namespace, not just the class name. */ declare namespace OCCT { /** * A 3D geometric curve - the underlying mathematical curve, as opposed to the topological edge * that carries it. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type GeomCurvePointer = { hash: number; type: "occ-shape"; }; /** * A curve in 2D parameter space, used when working on a surface's own UV domain rather than in * world coordinates. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type Geom2dCurvePointer = { hash: number; type: "occ-shape"; }; /** * A geometric surface - the underlying mathematical surface, as opposed to the topological face * bounded by wires that sits on it. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type GeomSurfacePointer = { hash: number; type: "occ-shape"; }; /** * A vertex: a single point in the topological structure, the end of an edge. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type TopoDSVertexPointer = { hash: number; type: "occ-shape"; }; /** * An edge: a bounded piece of a curve between two vertices. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type TopoDSEdgePointer = { hash: number; type: "occ-shape"; }; /** * A wire: a connected sequence of edges. A closed planar wire is what you turn into a face. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type TopoDSWirePointer = { hash: number; type: "occ-shape"; }; /** * A face: a bounded region of a surface, outlined by wires. Extrude, revolve or loft a face to * get a solid. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type TopoDSFacePointer = { hash: number; type: "occ-shape"; }; /** * A shell: a set of faces joined along their edges. Close a shell and it can become a solid. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type TopoDSShellPointer = { hash: number; type: "occ-shape"; }; /** * A solid: a closed, watertight volume, and the shape kind most downstream operations and * exporters expect. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type TopoDSSolidPointer = { hash: number; type: "occ-shape"; }; /** * A compound solid: several solids sharing faces, as in a partitioned volume. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type TopoDSCompSolidPointer = { hash: number; type: "occ-shape"; }; /** * A compound: an arbitrary grouping of shapes of any kind, moved and exported as one while * remaining separate inside. * * A handle to a shape living inside the OpenCascade kernel, not the geometry itself. The kernel * runs as WebAssembly with its own memory, so what crosses back into JavaScript is this small * reference; pass it to the next operation to keep building. It cannot be inspected or edited * directly - use the shapes and query APIs for that - and it stays valid until the kernel's cache * is cleared. */ type TopoDSCompoundPointer = { hash: number; type: "occ-shape"; }; /** * A handle to an OpenCascade document - the container used for assemblies, holding a shape * hierarchy along with names, colors and placements. This is what STEP assembly import and export * work against, as opposed to a single loose shape. */ type TDocStdDocumentPointer = { hash: number; type: "occ-entity"; }; /** * Any shape handle, whatever its kind - vertex, edge, wire, face, shell, solid or compound. * Operations that work on shapes generically take this; ones that need a specific kind take the * specific pointer type instead, which is how the types stop you passing an edge where a solid is * required. */ type TopoDSShapePointer = TopoDSVertexPointer | TopoDSEdgePointer | TopoDSWirePointer | TopoDSFacePointer | TopoDSShellPointer | TopoDSSolidPointer | TopoDSCompoundPointer; /** * How an offset fills the outside of a corner. arc rounds it, intersection extends both sides to * their meeting point and leaves a sharp corner, tangent continues each side tangentially. arc is * the safe default; intersection can fail on tight corners where the extensions do not meet. */ enum joinTypeEnum { arc = "arc", intersection = "intersection", tangent = "tangent" } /** * How an offset treats the original shape. skin offsets the surface and keeps only the new skin, * pipe builds the swept volume between old and new, rectoVerso offsets in both directions at once. */ enum bRepOffsetModeEnum { skin = "skin", pipe = "pipe", rectoVerso = "rectoVerso" } /** * How points are spaced along a curve when it is approximated. approxChordLength spaces by * distance, approxCentripetal reduces overshoot near sharp turns, approxIsoParametric spaces * evenly in parameter space. Centripetal is usually the best behaved for interpolation through * unevenly spaced points. */ enum approxParametrizationTypeEnum { approxChordLength = "approxChordLength", approxCentripetal = "approxCentripetal", approxIsoParametric = "approxIsoParametric" } /** * Which side of the original geometry an operation works on: outside, inside, or centerd on it. */ enum directionEnum { outside = "outside", inside = "inside", middle = "middle" } /** * The CAD interchange format for import and export: STEP or IGES. STEP is the modern choice and * preserves solids and assemblies; IGES is older and surface-oriented. */ enum fileTypeEnum { iges = "iges", step = "step" } /** * A shape's orientation within its parent, in OpenCascade's own terms. forward and reversed decide * which way a face points and therefore which side is material; internal and external mark shapes * that lie inside or outside the volume without bounding it. */ enum topAbsOrientationEnum { forward = "forward", reversed = "reversed", internal = "internal", external = "external" } /** * Where a point or a shape sits relative to another: in, out, on the boundary, or unknown. This is * what classification and containment queries return. */ enum topAbsStateEnum { in = "in", out = "out", on = "on", unknown = "unknown" } /** * The kind of a topological shape - vertex, edge, wire, face, shell, solid, compound solid, * compound, or the generic shape. Used to filter the results of a query and to check what an * operation actually produced. */ enum shapeTypeEnum { unknown = "unknown", vertex = "vertex", edge = "edge", wire = "wire", face = "face", shell = "shell", solid = "solid", compSolid = "compSolid", compound = "compound", shape = "shape" } /** * How a construction constraint qualifies the geometry it references: unqualified, enclosing, * enclosed, outside, or no qualifier. Constrained constructions - a circle tangent to two others - * can have several valid answers, and this narrows which one is wanted. */ enum gccEntPositionEnum { unqualified = "unqualified", enclosing = "enclosing", enclosed = "enclosed", outside = "outside", noqualifier = "noqualifier" } /** * Which of the results of a two-sided construction to keep: the first side, the second, or all of * them. */ enum positionResultEnum { keepSide1 = "keepSide1", keepSide2 = "keepSide2", all = "all" } /** * Whether a construction includes the referenced circle, and if so on which side: none, the first * side, or the second. */ enum circleInclusionEnum { none = "none", keepSide1 = "keepSide1", keepSide2 = "keepSide2" } /** * Which combination of two circles a construction includes: neither, both outside, both inside, or * one of each in either order. */ enum twoCircleInclusionEnum { none = "none", outside = "outside", inside = "inside", outsideInside = "outsideInside", insideOutside = "insideOutside" } /** * Which combination of sides a four-sided construction keeps: outside, inside, or one of the two * mixed orders. */ enum fourSidesStrictEnum { outside = "outside", inside = "inside", outsideInside = "outsideInside", insideOutside = "insideOutside" } /** * Which side of a two-sided construction to keep: outside or inside. */ enum twoSidesStrictEnum { outside = "outside", inside = "inside" } /** * How a list of circles is paired up when building faces between them: every circle with every * other, sequentially in order, or sequentially and then closing back to the first. */ enum combinationCirclesForFaceEnum { allWithAll = "allWithAll", inOrder = "inOrder", inOrderClosed = "inOrderClosed" } /** * What kind of shape a generic operation should return - a curve, an edge, a wire or a face - when * the result could reasonably be expressed as more than one of them. */ enum typeSpecificityEnum { curve = 0, edge = 1, wire = 2, face = 3 } /** * Which projected points to return when a projection has several solutions: all of them, the * closest, the furthest, or both extremes. */ enum pointProjectionTypeEnum { all = "all", closest = "closest", furthest = "furthest", closestAndFurthest = "closestAndFurthest" } /** * How the profile is oriented as it travels along the path in a sweep. This is the setting that * decides whether a swept shape twists. isFrenet follows the path's natural curvature and can flip * at inflection points; isCorrectedFrenet removes that flipping and is the usual choice; isFixed * keeps the profile's orientation constant; the isGuide variants steer the profile using a second * guide curve. */ enum geomFillTrihedronEnum { isCorrectedFrenet = "isCorrectedFrenet", isFixed = "isFixed", isFrenet = "isFrenet", isConstantNormal = "isConstantNormal", isDarboux = "isDarboux", isGuideAC = "isGuideAC", isGuidePlan = "isGuidePlan", isGuideACWithContact = "isGuideACWithContact", isGuidePlanWithContact = "isGuidePlanWithContact", isDiscreteTrihedron = "isDiscreteTrihedron" } /** * How colors are written into a DXF file: ACI index colors, which every DXF reader understands, * or true color, which is exact but less widely supported. */ enum dxfColorFormatEnum { aci = "aci", truecolor = "truecolor" } /** * Which AutoCAD DXF version to write. AC1009 is R12, the most compatible; AC1015 is 2000 and * supports more entity types. */ enum dxfAcadVersionEnum { AC1009 = "AC1009", AC1015 = "AC1015" } /** * How a dimension line terminates: with nothing, or with an arrowhead. */ enum dimensionEndTypeEnum { none = "none", arrow = "arrow" } /** * How a wire is built through a list of points: polyline joins them with straight segments, * interpolated fits a smooth curve that passes through every one. */ enum wireFromPointsTypeEnum { polyline = "polyline", interpolated = "interpolated" } /** * How corners are detected. auto handles any geometry; planarOnly restricts detection to planar * faces, which is faster and avoids false positives on curved surfaces. */ enum cornerModeEnum { auto = "auto", planarOnly = "planarOnly" } /** * The triangle mesh of a shape as `shapeToMesh` returns it: one entry per face with its triangles, * one per edge with its points, and the vertex points, ready for drawing. */ class DecomposedMeshDto { constructor(faceList?: DecomposedFaceDto[], edgeList?: DecomposedEdgeDto[]); /** * One entry per face with its triangulation. */ faceList: DecomposedFaceDto[]; /** * One entry per edge with the points that trace it. */ edgeList: DecomposedEdgeDto[]; /** * The points of the shape's standalone vertices. */ pointsList: Base.Point3[]; /** * Which faces carry which color, keyed by `#rrggbbaa`; present only for meshes made from an * assembly document. * @optional true */ colorGroups?: { [color: string]: number[]; } | undefined; } /** * The triangulation of one face inside a `DecomposedMeshDto`: flat coordinate lists the way * graphics libraries take them, plus optional facts about the face when `computeMetadata` was set. */ class DecomposedFaceDto { /** * The position of the face in the shape, counting from 0 in the order `shapes.face.getFaces` * uses. */ faceIndex: number; /** * The vertex normals as a flat list of x, y, z triples, one per vertex. */ normalCoord: number[]; /** * How many triangles the face was cut into. */ numberOfTriangles: number; /** * The triangles as a flat list of vertex indexes, three per triangle. */ triIndexes: number[]; /** * The vertex positions as a flat list of x, y, z triples. */ vertexCoord: number[]; /** * The same vertex positions as a list of points. */ vertexCoordVec: Base.Vector3[]; /** * A point in the middle of the face's parameter range, on the surface. */ centerPoint: Base.Point3; /** * The surface normal at `centerPoint`. */ centerNormal: Base.Vector3; /** * The texture coordinates as a flat list of u, v pairs, one per vertex. */ uvs: number[]; /** * The surface area of the face in square model units; present only with `computeMetadata`. * @optional true */ area?: number | undefined; /** * The center of mass of the face; present only with `computeMetadata`. * @optional true */ centerOfMass?: Base.Point3 | undefined; /** * The kind of surface the face lies on, such as `Plane`, `Cylinder` or `BSplineSurface`; * present only with `computeMetadata`. * @optional true */ surfaceType?: string | undefined; /** * The geometric tolerance of the face in model units; present only with `computeMetadata`. * @optional true */ tolerance?: number | undefined; /** * The indexes of the faces that share an edge with this one; present only with * `computeMetadata`. * @optional true */ adjacentFaces?: number[] | undefined; /** * The face's stable id in the shape's graph, or -1 when unavailable; present only with * `computeMetadata`. * @optional true */ faceUid?: number | undefined; } /** * One edge inside a `DecomposedMeshDto`: the points that trace it for drawing, plus optional facts * about the edge when `computeMetadata` was set. */ class DecomposedEdgeDto { /** * The position of the edge in the shape, counting from 0 in the order `shapes.edge.getEdges` * uses. */ edgeIndex: number; /** * A point halfway along the edge's parameter range. */ middlePoint: Base.Point3; /** * The points that trace the edge, in order, close enough to draw it as a polyline. */ vertexCoord: Base.Vector3[]; /** * The length of the edge in model units; present only with `computeMetadata`. * @optional true */ length?: number | undefined; /** * The center of mass of the edge; present only with `computeMetadata`. * @optional true */ centerOfMass?: Base.Point3 | undefined; /** * The kind of curve the edge follows, such as `Line`, `Circle` or `BSplineCurve`; present only * with `computeMetadata`. * @optional true */ curveType?: string | undefined; /** * True when the edge has no 3D curve, such as the seam at the pole of a sphere; present only * with `computeMetadata`. * @optional true */ degenerated?: boolean | undefined; /** * The indexes of the faces this edge belongs to; present only with `computeMetadata`. * @optional true */ incidentFaces?: number[] | undefined; /** * The edge's stable id in the shape's graph, or -1 when unavailable; present only with * `computeMetadata`. * @optional true */ edgeUid?: number | undefined; } /** * A list of shapes for the methods that take several at once, such as `shapes.face.getFacesAreas` * or `shapes.wire.getWiresLengths`. */ class ShapesDto { constructor(shapes?: T[]); /** * The shapes to work on, in the order the results should come back. * @default undefined */ shapes: T[]; } /** * One point for `shapes.vertex.vertexFromPoint`, which turns it into a vertex shape. */ class PointDto { constructor(point?: Base.Point3); /** * The position of the vertex, in model units. * @default [0, 0, 0] */ point: Base.Point3; } /** * Three coordinates for `shapes.vertex.vertexFromXYZ`, which turns them into a vertex shape. */ class XYZDto { constructor(x?: number, y?: number, z?: number); /** * The X coordinate, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ x: number; /** * The Y coordinate, in model units; Y is up. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ y: number; /** * The Z coordinate, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ z: number; } /** * A list of points for the methods that build shapes from them, such as * `shapes.vertex.verticesFromPoints`, `shapes.edge.fromPoints` and `shapes.wire.fromPoints`. */ class PointsDto { constructor(points?: Base.Point3[]); /** * The points, in the order the shapes should follow them. * @default undefined */ points: Base.Point3[]; } /** * A circle, a point outside it and the filtering options for * `shapes.edge.constraintTanLinesFromPtToCircle`, which draws the tangent lines from the point to * the circle. */ class ConstraintTanLinesFromPtToCircleDto { constructor(circle?: T, point?: Base.Point3, tolerance?: number, positionResult?: positionResultEnum, circleRemainder?: circleInclusionEnum); /** * The circle edge the lines must touch. * @default undefined */ circle: T; /** * The point the lines start from; it must lie outside the circle. * @default undefined */ point: Base.Point3; /** * How close a line must come to the circle to count as touching it, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; /** * Which lines to keep: those on one side of the circle, the other side, or all of them. * @default all */ positionResult: positionResultEnum; /** * Whether to add the piece of the circle between the touching points on one side or the other; * `none` adds nothing. * @default none */ circleRemainder: circleInclusionEnum; } /** * A circle, two points and the filtering options for * `shapes.edge.constraintTanLinesFromTwoPtsToCircle`, which draws the tangent lines from each point * to the circle. */ class ConstraintTanLinesFromTwoPtsToCircleDto { constructor(circle?: T, point1?: Base.Point3, point2?: Base.Point3, tolerance?: number, positionResult?: positionResultEnum, circleRemainder?: circleInclusionEnum); /** * The circle edge the lines must touch. * @default undefined */ circle: T; /** * The first point the lines start from; it must lie outside the circle. * @default undefined */ point1: Base.Point3; /** * The second point the lines start from; it must lie outside the circle. * @default undefined */ point2: Base.Point3; /** * How close a line must come to the circle to count as touching it, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; /** * Which lines to keep: those on one side of the circle, the other side, or all of them. * @default all */ positionResult: positionResultEnum; /** * Whether to add the piece of the circle between the touching points on one side or the other; * `none` adds nothing. * @default none */ circleRemainder: circleInclusionEnum; } /** * Two circles and the filtering options for `shapes.edge.constraintTanLinesOnTwoCircles` and * `shapes.wire.createWireFromTwoCirclesTan`, which draw the lines that touch both circles. */ class ConstraintTanLinesOnTwoCirclesDto { constructor(circle1?: T, circle2?: T, tolerance?: number, positionResult?: positionResultEnum, circleRemainders?: twoCircleInclusionEnum); /** * The first circle edge the lines must touch. * @default undefined */ circle1: T; /** * The second circle edge the lines must touch. * @default undefined */ circle2: T; /** * How close a line must come to a circle to count as touching it, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; /** * Which lines to keep: the outer pair, the crossing inner pair, or all of them. * @default all */ positionResult: positionResultEnum; /** * Which pieces of the circles between the touching points to add: the outside arcs, the inside * arcs, one of each, or `none`. * @default none */ circleRemainders: twoCircleInclusionEnum; } /** * Two circles and a radius for `shapes.edge.constraintTanCirclesOnTwoCircles`, which draws the * circles of that radius touching both. */ class ConstraintTanCirclesOnTwoCirclesDto { constructor(circle1?: T, circle2?: T, tolerance?: number, radius?: number); /** * The first circle edge the new circles must touch. * @default undefined */ circle1: T; /** * The second circle edge the new circles must touch. * @default undefined */ circle2: T; /** * How close a circle must come to the others to count as touching, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; /** * The radius of the circles to draw, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; } /** * A circle, a point and a radius for `shapes.edge.constraintTanCirclesOnCircleAndPnt`, which draws * the circles of that radius through the point that touch the circle. */ class ConstraintTanCirclesOnCircleAndPntDto { constructor(circle?: T, point?: Base.Point3, tolerance?: number, radius?: number); /** * The circle edge the new circles must touch. * @default undefined */ circle: T; /** * The point the new circles must pass through. * @default undefined */ point: Base.Point3; /** * How close a circle must come to the other to count as touching, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; /** * The radius of the circles to draw, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; } /** * A 2D curve and a surface for `shapes.edge.makeEdgeFromGeom2dCurveAndSurface`, which lays the * curve onto the surface as an edge. */ class CurveAndSurfaceDto { constructor(curve?: T, surface?: U); /** * The 2D curve, drawn in the surface's UV space. * @default undefined */ curve: T; /** * The surface the curve is laid onto. * @default undefined */ surface: U; } /** * Two edges in a plane, the plane and a radius for `fillets.filletTwoEdgesInPlaneIntoAWire`, which * joins them with a rounding arc. */ class FilletTwoEdgesInPlaneDto { constructor(edge1?: T, edge2?: T, planeOrigin?: Base.Point3, planeDirection?: Base.Vector3, radius?: number, solution?: number); /** * The first edge to join. * @default undefined */ edge1: T; /** * The second edge to join. * @default undefined */ edge2: T; /** * A point on the plane the edges lie in; with `solution` at -1 it also picks the arc nearest to * it. * @default [0, 0, 0] */ planeOrigin: Base.Point3; /** * The normal of the plane the edges lie in. * @default [0, 1, 0] */ planeDirection: Base.Vector3; /** * The radius of the rounding arc, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Which arc to use when several fit, counted from 0; -1 takes the one nearest `planeOrigin`. * @default -1 * @optional true */ solution?: number | undefined; } /** * A shape and points for `operations.closestPointsOnShapeFromPoints` and * `operations.distancesToShapeFromPoints`. */ class ClosestPointsOnShapeFromPointsDto { constructor(shape?: T, points?: Base.Point3[]); /** * The shape the closest points are looked for on. * @default undefined */ shape: T; /** * The points to measure from, in the order the results should come back. * @default undefined */ points: Base.Point3[]; } /** * A bounding box description, as `operations.boundingBoxOfShape` returns it, wrapped for passing * on. */ class BoundingBoxDto { constructor(bbox?: BoundingBoxPropsDto); /** * The box as its corners, center and size. * @default undefined * @optional true */ bbox?: BoundingBoxPropsDto | undefined; } /** * The axis-aligned box around a shape, as `operations.boundingBoxOfShape` returns it. */ class BoundingBoxPropsDto { constructor(min?: Base.Point3, max?: Base.Point3, center?: Base.Point3, size?: Base.Vector3); /** * The corner with the smallest X, Y and Z. * @default [0, 0, 0] */ min: Base.Point3; /** * The corner with the largest X, Y and Z. * @default [0, 0, 0] */ max: Base.Point3; /** * The point halfway between the two corners. * @default [0, 0, 0] */ center: Base.Point3; /** * The extent along X, Y and Z, in model units. * @default [0, 0, 0] */ size: Base.Vector3; } /** * The sphere around a shape, as `operations.boundingSphereOfShape` returns it. */ class BoundingSpherePropsDto { constructor(center?: Base.Point3, radius?: number); /** * The center of the sphere, which is the center of the shape's bounding box. * @default [0, 0, 0] */ center: Base.Point3; /** * The distance from the center to the box's corner, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; } /** * A wire and points for `shapes.wire.splitOnPoints`, which cuts the wire at the points. */ class SplitWireOnPointsDto { constructor(shape?: T, points?: Base.Point3[]); /** * The wire to cut into pieces. * @default undefined */ shape: T; /** * Where to cut; each point is moved to the closest place on the wire first. * @default undefined */ points: Base.Point3[]; } /** * Shapes and points for `operations.closestPointsOnShapesFromPoints`, which finds the closest point * on every shape for every point. */ class ClosestPointsOnShapesFromPointsDto { constructor(shapes?: T[], points?: Base.Point3[]); /** * The shapes the closest points are looked for on, in the order the result groups them. * @default undefined */ shapes: T[]; /** * The points to measure from. * @default undefined */ points: Base.Point3[]; } /** * Two shapes for `operations.closestPointsBetweenTwoShapes`, which finds the pair of points where * they come closest. */ class ClosestPointsBetweenTwoShapesDto { constructor(shape1?: T, shape2?: T); /** * The first shape; the first point of the result lies on it. * @default undefined */ shape1: T; /** * The second shape; the second point of the result lies on it. * @default undefined */ shape2: T; } /** * A surface, a wire on it and a side for `shapes.face.faceFromSurfaceAndWire`. */ class FaceFromSurfaceAndWireDto { constructor(surface?: T, wire?: U, inside?: boolean); /** * The surface the face is cut from. * @default undefined */ surface: T; /** * The wire lying on the surface that bounds the face. * @default undefined */ wire: U; /** * When true, the wire is turned so the face is the region it encloses; when false the wire's * own direction decides. * @default true */ inside: boolean; } /** * A flat wire and a face for `shapes.wire.placeWireOnFace`, which maps the wire onto the face's * surface. */ class WireOnFaceDto { constructor(wire?: T, face?: U); /** * The wire drawn on the ground plane; its Z coordinate becomes U and its X coordinate V. * @default undefined */ wire: T; /** * The face whose surface the wire is mapped onto. * @default undefined */ face: U; } /** * A shape and how to draw it, for the renderer packages' shape drawing: colors and opacity of * faces, edges and vertices, what to show, and how finely to mesh the shape. */ class DrawShapeDto { /** * Provide options without default values */ constructor(shape?: T, faceOpacity?: number, edgeOpacity?: number, edgeColour?: Base.Color, faceMaterial?: Base.Material, faceColour?: Base.Color, edgeWidth?: number, drawEdges?: boolean, drawFaces?: boolean, drawVertices?: boolean, vertexColour?: Base.Color, vertexSize?: number, precision?: number, drawEdgeIndexes?: boolean, edgeIndexHeight?: number, edgeIndexColour?: Base.Color, drawFaceIndexes?: boolean, faceIndexHeight?: number, faceIndexColour?: Base.Color, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number, keepMeshData?: boolean, allowQualityDecrease?: boolean, forceFaceDeflection?: boolean); /** * The shape to draw; it is meshed at `precision` first. * @default undefined * @optional true */ shape?: T | undefined; /** * How opaque the faces are, from 0 for invisible to 1 for solid. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity: number; /** * How opaque the edges are, from 0 for invisible to 1 for solid. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ edgeOpacity: number; /** * The color of the edges as a hex string such as `#ffffff`. * @default #ffffff */ edgeColour: Base.Color; /** * A material for the faces from the rendering engine; when given it replaces the face color. * @default undefined * @optional true */ faceMaterial?: Base.Material | undefined; /** * The color of the faces as a hex string such as `#ff0000`. * @default #ff0000 */ faceColour: Base.Color; /** * How thick the edge lines are drawn. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ edgeWidth: number; /** * When false, the edges are not drawn. * @default true */ drawEdges: boolean; /** * When false, the faces are not drawn. * @default true */ drawFaces: boolean; /** * When true, the vertices are drawn as small markers. * @default false */ drawVertices: boolean; /** * The color of the vertex markers as a hex string. * @default #ff00ff */ vertexColour: string; /** * The size of the vertex markers, in model units. * @default 0.03 * @minimum 0 * @maximum Infinity * @step 0.01 */ vertexSize: number; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * with more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.01 */ precision: number; /** * When true, each edge's index is written next to it, handy for picking edges to fillet. * @default false */ drawEdgeIndexes: boolean; /** * The height of the edge index labels, in model units. * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ edgeIndexHeight: number; /** * The color of the edge index labels as a hex string. * @default #ff00ff */ edgeIndexColour: Base.Color; /** * When true, each face's index is written on it, handy for picking faces. * @default false */ drawFaceIndexes: boolean; /** * The height of the face index labels, in model units. * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ faceIndexHeight: number; /** * The color of the face index labels as a hex string. * @default #0000ff */ faceIndexColour: Base.Color; /** * When true, the back of each face is drawn in its own color, which shows which way faces * point. * @default true */ drawTwoSided: boolean; /** * The color of the back of the faces as a hex string; used only with `drawTwoSided`. * @default #0000ff */ backFaceColour: Base.Color; /** * How opaque the back of the faces is, from 0 to 1; used only with `drawTwoSided`. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; /** * When true, the triangulation stays cached on the shape after drawing; when false it is * cleared so memory does not grow across draws. * @default false */ keepMeshData: boolean; /** * When true, a shape already meshed more finely may be remeshed at the coarser precision asked * for. * @default true */ allowQualityDecrease: boolean; /** * When true, every face is remeshed at the requested precision even when a triangulation is * cached. * @default false */ forceFaceDeflection: boolean; } /** * Shapes and how to draw them, for the renderer packages' shape drawing: the same options as * `DrawShapeDto`, applied to every shape in the list. */ class DrawShapesDto { /** * Provide options without default values */ constructor(shapes?: T[], faceOpacity?: number, edgeOpacity?: number, edgeColour?: Base.Color, faceMaterial?: Base.Material, faceColour?: Base.Color, edgeWidth?: number, drawEdges?: boolean, drawFaces?: boolean, drawVertices?: boolean, vertexColour?: Base.Color, vertexSize?: number, precision?: number, drawEdgeIndexes?: boolean, edgeIndexHeight?: number, edgeIndexColour?: Base.Color, drawFaceIndexes?: boolean, faceIndexHeight?: number, faceIndexColour?: Base.Color, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number, keepMeshData?: boolean, allowQualityDecrease?: boolean, forceFaceDeflection?: boolean); /** * The shapes to draw with the same options. * @default undefined */ shapes: T[]; /** * How opaque the faces are, from 0 for invisible to 1 for solid. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity: number; /** * How opaque the edges are, from 0 for invisible to 1 for solid. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ edgeOpacity: number; /** * The color of the edges as a hex string such as `#ffffff`. * @default #ffffff */ edgeColour: Base.Color; /** * A material for the faces from the rendering engine; when given it replaces the face color. * @default undefined * @optional true */ faceMaterial?: Base.Material | undefined; /** * The color of the faces as a hex string such as `#ff0000`. * @default #ff0000 */ faceColour: Base.Color; /** * How thick the edge lines are drawn. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ edgeWidth: number; /** * When false, the edges are not drawn. * @default true */ drawEdges: boolean; /** * When false, the faces are not drawn. * @default true */ drawFaces: boolean; /** * When true, the vertices are drawn as small markers. * @default false */ drawVertices: boolean; /** * The color of the vertex markers as a hex string. * @default #ff00ff */ vertexColour: string; /** * The size of the vertex markers, in model units. * @default 0.03 * @minimum 0 * @maximum Infinity * @step 0.01 */ vertexSize: number; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * with more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.01 */ precision: number; /** * When true, each edge's index is written next to it, handy for picking edges to fillet. * @default false */ drawEdgeIndexes: boolean; /** * The height of the edge index labels, in model units. * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ edgeIndexHeight: number; /** * The color of the edge index labels as a hex string. * @default #ff00ff */ edgeIndexColour: Base.Color; /** * When true, each face's index is written on it, handy for picking faces. * @default false */ drawFaceIndexes: boolean; /** * The height of the face index labels, in model units. * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ faceIndexHeight: number; /** * The color of the face index labels as a hex string. * @default #0000ff */ faceIndexColour: Base.Color; /** * When true, the back of each face is drawn in its own color, which shows which way faces * point. * @default true */ drawTwoSided: boolean; /** * The color of the back of the faces as a hex string; used only with `drawTwoSided`. * @default #0000ff */ backFaceColour: Base.Color; /** * How opaque the back of the faces is, from 0 to 1; used only with `drawTwoSided`. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; /** * When true, the triangulation stays cached on each shape after drawing; when false it is * cleared so memory does not grow across draws. * @default false */ keepMeshData: boolean; /** * When true, a shape already meshed more finely may be remeshed at the coarser precision asked * for. * @default true */ allowQualityDecrease: boolean; /** * When true, every face is remeshed at the requested precision even when a triangulation is * cached. * @default false */ forceFaceDeflection: boolean; } /** * A face and a grid of divisions for `shapes.face.subdivideToPoints`, `subdivideToNormals` and * `subdivideToUV`; the U and V counts set the grid, the shift and removal flags adjust its rows. */ class FaceSubdivisionDto { /** * Provide options without default values */ constructor(shape?: T, nrDivisionsU?: number, nrDivisionsV?: number, shiftHalfStepU?: boolean, removeStartEdgeU?: boolean, removeEndEdgeU?: boolean, shiftHalfStepV?: boolean, removeStartEdgeV?: boolean, removeEndEdgeV?: boolean); /** * The face to lay the grid over. * @default undefined */ shape: T; /** * How many rows of points across the U range, edge to edge. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrDivisionsU: number; /** * How many points along each row across the V range, edge to edge. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrDivisionsV: number; /** * When true, every point moves half a step in U; on a closed face such as a cylinder this keeps * points off the seam. * @default false */ shiftHalfStepU: boolean; /** * When true, the row at the start of the U range is left out. * @default false */ removeStartEdgeU: boolean; /** * When true, the row at the end of the U range is left out. * @default false */ removeEndEdgeU: boolean; /** * When true, every point moves half a step in V; on a closed face such as a cylinder this keeps * points off the seam. * @default false */ shiftHalfStepV: boolean; /** * When true, the points at the start of the V range are left out of every row. * @default false */ removeStartEdgeV: boolean; /** * When true, the points at the end of the V range are left out of every row. * @default false */ removeEndEdgeV: boolean; } /** * A face and a number of divisions for `shapes.face.subdivideToWires`, which draws evenly spaced * wires across the face in one parameter direction. */ class FaceSubdivisionToWiresDto { /** * Provide options without default values */ constructor(shape?: T, nrDivisions?: number, isU?: boolean, shiftHalfStep?: boolean, removeStart?: boolean, removeEnd?: boolean); /** * The face to draw the wires on. * @default undefined */ shape: T; /** * How many steps to divide the range into; one more wire than that is drawn, the two boundary * lines included. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrDivisions: number; /** * When true each wire sits at a fixed U and runs across the V range; when false the roles swap. * @default true */ isU: boolean; /** * When true, every wire moves half a step along the divided direction. * @default false */ shiftHalfStep: boolean; /** * When true, the wire on the start boundary is left out. * @default false */ removeStart: boolean; /** * When true, the wire on the end boundary is left out. * @default false */ removeEnd: boolean; } /** * A face, a grid of cells and optional patterns for `shapes.face.subdivideToRectangleWires`, which * draws one rectangle wire per cell of the face's UV range. The patterns are read cell by cell and * repeat when they run out. */ class FaceSubdivideToRectangleWiresDto { /** * Provide options without default values */ constructor(shape?: T, nrRectanglesU?: number, nrRectanglesV?: number, scalePatternU?: number[], scalePatternV?: number[], filletPattern?: number[], inclusionPattern?: boolean[], offsetFromBorderU?: number, offsetFromBorderV?: number); /** * The face to draw the rectangles on. * @default undefined */ shape: T; /** * How many cells across the U range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrRectanglesU: number; /** * How many cells across the V range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrRectanglesV: number; /** * Sizes of the rectangles along U as fractions of their cell, from 0 to 1, applied in turn; 1 * fills the cell, and leaving the list out means no scaling. * @default undefined * @optional true */ scalePatternU?: number[] | undefined; /** * Sizes of the rectangles along V as fractions of their cell, from 0 to 1, applied in turn; 1 * fills the cell, and leaving the list out means no scaling. * @default undefined * @optional true */ scalePatternV?: number[] | undefined; /** * Corner rounding of the rectangles as fractions from 0 to 1 of half the shorter side, applied * in turn; 0 leaves sharp corners. * @default undefined * @optional true */ filletPattern?: number[] | undefined; /** * Which cells get a rectangle, applied in turn: true draws one, false skips the cell. * @default undefined * @optional true */ inclusionPattern?: boolean[] | undefined; /** * A fraction of the U range trimmed at each end before dividing into cells, so the pattern * keeps clear of the border; keep it below 0.5. * @default 0 * @minimum 0 * @maximum 0.5 * @step 0.01 */ offsetFromBorderU: number; /** * A fraction of the V range trimmed at each end before dividing into cells, so the pattern * keeps clear of the border; keep it below 0.5. * @default 0 * @minimum 0 * @maximum 0.5 * @step 0.01 */ offsetFromBorderV: number; } /** * A face, hexagon counts and optional patterns for `shapes.face.subdivideToHexagonWires`, which * lays a honeycomb of hexagon wires over the face's UV range. The patterns are read hexagon by * hexagon and repeat when they run out. */ class FaceSubdivideToHexagonWiresDto { /** * Provide options without default values */ constructor(shape?: T, nrHexagonsU?: number, nrHexagonsV?: number, flatU?: boolean, scalePatternU?: number[], scalePatternV?: number[], filletPattern?: number[], inclusionPattern?: boolean[], offsetFromBorderU?: number, offsetFromBorderV?: number, extendUUp?: boolean, extendUBottom?: boolean, extendVUp?: boolean, extendVBottom?: boolean); /** * The face to draw the hexagons on. * @default undefined */ shape: T; /** * How many hexagons across the U range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrHexagonsU?: number | undefined; /** * How many hexagons across the V range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrHexagonsV?: number | undefined; /** * When true, the hexagons turn a flat side toward the U direction; when false a corner points * that way. */ flatU: boolean; /** * Sizes of the hexagons along U as fractions of their full size, applied in turn about each * hexagon's center; 1 or no list means no scaling. * @default undefined * @optional true */ scalePatternU?: number[] | undefined; /** * Sizes of the hexagons along V as fractions of their full size, applied in turn about each * hexagon's center; 1 or no list means no scaling. * @default undefined * @optional true */ scalePatternV?: number[] | undefined; /** * Corner rounding of the hexagons as fractions from 0 to 1 of the largest radius that fits, * applied in turn; 0 leaves sharp corners. * @default undefined * @optional true */ filletPattern?: number[] | undefined; /** * Which hexagons are drawn, applied in turn: true draws one, false skips it. * @default undefined * @optional true */ inclusionPattern?: boolean[] | undefined; /** * A fraction of the U range trimmed at each end before laying the grid, so the pattern keeps * clear of the border; keep it below 0.5. * @default 0 * @minimum 0 * @maximum 0.5 * @step 0.01 */ offsetFromBorderU?: number | undefined; /** * A fraction of the V range trimmed at each end before laying the grid, so the pattern keeps * clear of the border; keep it below 0.5. * @default 0 * @minimum 0 * @maximum 0.5 * @step 0.01 */ offsetFromBorderV?: number | undefined; /** * When true, the grid is stretched so the hexagons at the high end of U reach past that border, * covering it without a jagged edge. * @default false */ extendUUp?: boolean | undefined; /** * When true, the grid is stretched so the hexagons at the low end of U reach past that border, * covering it without a jagged edge. * @default false */ extendUBottom?: boolean | undefined; /** * When true, the grid is stretched so the hexagons at the high end of V reach past that border, * covering it without a jagged edge. * @default false */ extendVUp?: boolean | undefined; /** * When true, the grid is stretched so the hexagons at the low end of V reach past that border, * covering it without a jagged edge. * @default false */ extendVBottom?: boolean | undefined; } /** * A face, hexagon counts and optional patterns for `shapes.face.subdivideToHexagonHoles`, which * cuts a honeycomb of hexagonal holes into the face. Without a scale pattern each hole is half the * size of its hexagon. */ class FaceSubdivideToHexagonHolesDto { /** * Provide options without default values */ constructor(shape?: T, nrHexagonsU?: number, nrHexagonsV?: number, flatU?: boolean, holesToFaces?: boolean, scalePatternU?: number[], scalePatternV?: number[], filletPattern?: number[], inclusionPattern?: boolean[], offsetFromBorderU?: number, offsetFromBorderV?: number); /** * The face to cut the holes into. * @default undefined */ shape: T; /** * How many hexagons across the U range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrHexagonsU?: number | undefined; /** * How many hexagons across the V range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrHexagonsV?: number | undefined; /** * When true, the hexagons turn a flat side toward the U direction; when false a corner points * that way. */ flatU: boolean; /** * When true, the result also carries one face per hole after the perforated face. * @default false */ holesToFaces?: boolean | undefined; /** * Sizes of the holes along U as fractions of their hexagon, applied in turn; leaving the list * out uses 0.5. * @default undefined * @optional true */ scalePatternU?: number[] | undefined; /** * Sizes of the holes along V as fractions of their hexagon, applied in turn; leaving the list * out uses 0.5. * @default undefined * @optional true */ scalePatternV?: number[] | undefined; /** * Corner rounding of the holes as fractions from 0 to 1 of the largest radius that fits, * applied in turn; 0 leaves sharp corners. * @default undefined * @optional true */ filletPattern?: number[] | undefined; /** * Which hexagons become holes, applied in turn: true cuts one, false leaves the face whole * there. * @default undefined * @optional true */ inclusionPattern?: boolean[] | undefined; /** * A fraction of the U range trimmed at each end before laying the grid, so the holes keep clear * of the border; keep it below 0.5. * @default 0 * @minimum 0 * @maximum 0.5 * @step 0.01 */ offsetFromBorderU?: number | undefined; /** * A fraction of the V range trimmed at each end before laying the grid, so the holes keep clear * of the border; keep it below 0.5. * @default 0 * @minimum 0 * @maximum 0.5 * @step 0.01 */ offsetFromBorderV?: number | undefined; } /** * A face, a grid of cells and optional patterns for `shapes.face.subdivideToRectangleHoles`, which * cuts a grid of rectangular holes into the face. Without a scale pattern each hole covers half its * cell. */ class FaceSubdivideToRectangleHolesDto { /** * Provide options without default values */ constructor(shape?: T, nrRectanglesU?: number, nrRectanglesV?: number, scalePatternU?: number[], scalePatternV?: number[], filletPattern?: number[], inclusionPattern?: boolean[], holesToFaces?: boolean, offsetFromBorderU?: number, offsetFromBorderV?: number); /** * The face to cut the holes into. * @default undefined */ shape: T; /** * How many cells across the U range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrRectanglesU: number; /** * How many cells across the V range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrRectanglesV: number; /** * Sizes of the holes along U as fractions of their cell, applied in turn; leaving the list out * uses 0.5. * @default undefined * @optional true */ scalePatternU?: number[] | undefined; /** * Sizes of the holes along V as fractions of their cell, applied in turn; leaving the list out * uses 0.5. * @default undefined * @optional true */ scalePatternV?: number[] | undefined; /** * Corner rounding of the holes as fractions from 0 to 1 of half the shorter side, applied in * turn; 0 leaves sharp corners. * @default undefined * @optional true */ filletPattern?: number[] | undefined; /** * Which cells become holes, applied in turn: true cuts one, false leaves the face whole there. * @default undefined * @optional true */ inclusionPattern?: boolean[] | undefined; /** * When true, the result also carries one face per hole after the perforated face. * @default false */ holesToFaces: boolean; /** * A fraction of the U range trimmed at each end before dividing into cells, so the holes keep * clear of the border; keep it below 0.5. * @default 0 * @minimum 0 * @maximum 0.5 * @step 0.01 */ offsetFromBorderU: number; /** * A fraction of the V range trimmed at each end before dividing into cells, so the holes keep * clear of the border; keep it below 0.5. * @default 0 * @minimum 0 * @maximum 0.5 * @step 0.01 */ offsetFromBorderV: number; } /** * A face, a grid of divisions and nth-row rules for `shapes.face.subdivideToPointsControlled`, * which shifts or removes points on every nth row instead of all of them. Each rule pairs an `Nth` * count with an `OffsetN` start; 0 switches it off. */ class FaceSubdivisionControlledDto { /** * Provide options without default values */ constructor(shape?: T, nrDivisionsU?: number, nrDivisionsV?: number, shiftHalfStepNthU?: number, shiftHalfStepUOffsetN?: number, removeStartEdgeNthU?: number, removeStartEdgeUOffsetN?: number, removeEndEdgeNthU?: number, removeEndEdgeUOffsetN?: number, shiftHalfStepNthV?: number, shiftHalfStepVOffsetN?: number, removeStartEdgeNthV?: number, removeStartEdgeVOffsetN?: number, removeEndEdgeNthV?: number, removeEndEdgeVOffsetN?: number); /** * The face to lay the grid over. * @default undefined */ shape: T; /** * How many rows of points across the U range, edge to edge. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrDivisionsU: number; /** * How many points along each row across the V range, edge to edge. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrDivisionsV: number; /** * Every how-manyth V row is pushed half a step in U; 0 shifts none. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ shiftHalfStepNthU: number; /** * Which V row the counting for the U shift starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ shiftHalfStepUOffsetN: number; /** * Every how-manyth point is dropped from the first U row; 0 keeps them all. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeStartEdgeNthU: number; /** * Which point the counting for the first U row removal starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeStartEdgeUOffsetN: number; /** * Every how-manyth point is dropped from the last U row; 0 keeps them all. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeEndEdgeNthU: number; /** * Which point the counting for the last U row removal starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeEndEdgeUOffsetN: number; /** * Every how-manyth U row is pushed half a step in V; 0 shifts none. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ shiftHalfStepNthV: number; /** * Which U row the counting for the V shift starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ shiftHalfStepVOffsetN: number; /** * Every how-manyth point is dropped from the first V row; 0 keeps them all. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeStartEdgeNthV: number; /** * Which point the counting for the first V row removal starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeStartEdgeVOffsetN: number; /** * Every how-manyth point is dropped from the last V row; 0 keeps them all. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeEndEdgeNthV: number; /** * Which point the counting for the last V row removal starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeEndEdgeVOffsetN: number; } /** * A face and one line across its UV range for `shapes.face.subdivideToPointsOnParam` and * `subdivideToUVOnParam`: the line sits at `param` in one direction and `nrPoints` points spread * over the other. */ class FaceLinearSubdivisionDto { /** * Provide options without default values */ constructor(shape?: T, isU?: boolean, param?: number, nrPoints?: number, shiftHalfStep?: boolean, removeStartPoint?: boolean, removeEndPoint?: boolean); /** * The face to place the points on. * @default undefined */ shape: T; /** * When true the line sits at a fixed U and the points spread across the V range; when false the * roles swap. * @default true */ isU: boolean; /** * Where the line sits, as a fraction from 0 to 1 of the fixed direction's range. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ param: number; /** * How many points along the line, edge to edge. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrPoints: number; /** * When true, every point moves half a step along the line; on a closed face this keeps points * off the seam. * @default false */ shiftHalfStep: boolean; /** * When true, the first point is left out. * @default false */ removeStartPoint: boolean; /** * When true, the last point is left out. * @default false */ removeEndPoint: boolean; } /** * A face, a direction and a fraction for `shapes.face.wireAlongParam`, which draws a wire across * the face along one parameter line. */ class WireAlongParamDto { /** * Provide options without default values */ constructor(shape?: T, isU?: boolean, param?: number); /** * The face the wire is drawn on. * @default undefined */ shape: T; /** * When true the wire sits at a fixed U and runs across the V range; when false the roles swap. * @default true */ isU: boolean; /** * Where the wire sits, as a fraction from 0 to 1 of the fixed direction's range. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ param: number; } /** * A face, a direction and several fractions for `shapes.face.wiresAlongParams`, which draws one * wire across the face per fraction. */ class WiresAlongParamsDto { /** * Provide options without default values */ constructor(shape?: T, isU?: boolean, params?: number[]); /** * The face the wires are drawn on. * @default undefined */ shape: T; /** * When true each wire sits at a fixed U and runs across the V range; when false the roles swap. * @default true */ isU: boolean; /** * Where the wires sit, as fractions from 0 to 1 of the fixed direction's range, one wire each. * @default undefined */ params: number[]; } /** * A face and one UV position for `shapes.face.pointOnUV`, `normalOnUV` and `uvOnFace`. */ class DataOnUVDto { /** * Provide options without default values */ constructor(shape?: T, paramU?: number, paramV?: number); /** * The face to evaluate. * @default undefined */ shape: T; /** * The U position as a fraction from 0 to 1 of the face's U range. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ paramU: number; /** * The V position as a fraction from 0 to 1 of the face's V range. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ paramV: number; } /** * A face and several UV positions for `shapes.face.pointsOnUVs` and `normalsOnUVs`. */ class DataOnUVsDto { /** * Provide options without default values */ constructor(shape?: T, paramsUV?: [ number, number ][]); /** * The face to evaluate. * @default undefined */ shape: T; /** * The positions as `[u, v]` pairs, each a fraction from 0 to 1 of the face's range, one result * each. * @default [[0.5, 0.5]] */ paramsUV: [ number, number ][]; } /** * Corner points for `shapes.wire.createPolygonWire`, `shapes.face.createPolygonFace` and * `shapes.edge.fromPoints`, a closed outline through them. */ class PolygonDto { constructor(points?: Base.Point3[]); /** * The corners in order; the outline closes from the last back to the first. * @default undefined */ points: Base.Point3[]; } /** * Several polygon definitions for `shapes.wire.createPolygons`, which builds one closed wire per * polygon. */ class PolygonsDto { constructor(polygons?: PolygonDto[], returnCompound?: boolean); /** * One list of corner points per polygon. * @default undefined */ polygons: PolygonDto[]; /** * When true, the wires are packed into one compound instead of a list. */ returnCompound: boolean; } /** * Points for `shapes.wire.createPolylineWire`, an open chain of straight edges through them. */ class PolylineDto { constructor(points?: Base.Point3[]); /** * The points in order; the chain stays open between the last and the first. * @default undefined */ points: Base.Point3[]; } /** * A polyline object for `shapes.wire.fromBasePolyline` and `shapes.edge.fromBasePolyline`. */ class PolylineBaseDto { constructor(polyline?: Base.Polyline3); /** * The polyline as `{ points, isClosed }`; a closed one also gets the edge back to its first * point. * @default undefined */ polyline: Base.Polyline3; } /** * Several polyline objects, one wire each; currently unused by the library. */ class PolylinesBaseDto { constructor(polylines?: Base.Polyline3[]); /** * The polylines as `{ points, isClosed }` objects. * @default undefined */ polylines: Base.Polyline3[]; } /** * A line object for `shapes.wire.fromBaseLine` and `shapes.edge.fromBaseLine`. */ class LineBaseDto { constructor(line?: Base.Line3); /** * The line as `{ start, end }`. * @default undefined */ line: Base.Line3; } /** * Several line objects for `shapes.wire.fromBaseLines` and `shapes.edge.fromBaseLines`, one result * each. */ class LinesBaseDto { constructor(lines?: Base.Line3[]); /** * The lines as `{ start, end }` objects, in the order the results should come back. * @default undefined */ lines: Base.Line3[]; } /** * A segment, a pair of points, for `shapes.wire.fromBaseSegment` and `shapes.edge.fromBaseSegment`. */ class SegmentBaseDto { constructor(segment?: Base.Segment3); /** * The segment as a pair of points, `[start, end]`. * @default undefined */ segment: Base.Segment3; } /** * Several segments for `shapes.wire.fromBaseSegments` and `shapes.edge.fromBaseSegments`, one * result each. */ class SegmentsBaseDto { constructor(segments?: Base.Segment3[]); /** * The segments as pairs of points, `[start, end]`, in the order the results should come back. * @default undefined */ segments: Base.Segment3[]; } /** * A triangle for `shapes.face.fromBaseTriangle`, `shapes.wire.fromBaseTriangle` and * `shapes.edge.fromBaseTriangle`. */ class TriangleBaseDto { constructor(triangle?: Base.Triangle3); /** * The triangle as its three corner points. * @default undefined */ triangle: Base.Triangle3; } /** * A triangle mesh for `shapes.face.fromBaseMesh`, `shapes.wire.fromBaseMesh` and * `shapes.edge.fromBaseMesh`, one result per triangle. */ class MeshBaseDto { constructor(mesh?: Base.Mesh3); /** * The mesh as a list of triangles, each three corner points. * @default undefined */ mesh: Base.Mesh3; } /** * Several polyline definitions for `shapes.wire.createPolylines`, which builds one open wire per * polyline. */ class PolylinesDto { constructor(polylines?: PolylineDto[], returnCompound?: boolean); /** * One list of points per polyline. * @default undefined */ polylines: PolylineDto[]; /** * When true, the wires are packed into one compound instead of a list. */ returnCompound: boolean; } /** * A side length and a placement for `shapes.wire.createSquareWire` and * `shapes.face.createSquareFace`. */ class SquareDto { constructor(size?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The length of each side, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ size: number; /** * The point the square is centered on. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the square lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * A width, a length and a placement for `shapes.wire.createRectangleWire` and * `shapes.face.createRectangleFace`. */ class RectangleDto { constructor(width?: number, length?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The side along X on the ground plane, in model units, before the rectangle is turned to face * `direction`. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ width: number; /** * The side along Z on the ground plane, in model units, before the rectangle is turned to face * `direction`. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ length: number; /** * The point the rectangle is centered on. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the rectangle lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * The two legs of an L shape and its placement for `shapes.wire.createLPolygonWire` and * `shapes.face.createLPolygonFace`. */ class LPolygonDto { constructor(widthFirst?: number, lengthFirst?: number, widthSecond?: number, lengthSecond?: number, align?: directionEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The thickness of the first leg, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ widthFirst: number; /** * The length of the first leg, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ lengthFirst: number; /** * The thickness of the second leg, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ widthSecond: number; /** * The length of the second leg, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ lengthSecond: number; /** * Where the corner of the L sits relative to the legs: on their outside, their inside or their * middle. * @default outside */ align: directionEnum; /** * How far the shape is turned in its plane, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The point the shape is placed at. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the shape lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * The cross-section of an I-beam, two horizontal flanges joined by a vertical web, for * `shapes.wire.createIBeamProfileWire` and `shapes.face.createIBeamProfileFace`. */ class IBeamProfileDto { constructor(width?: number, height?: number, webThickness?: number, flangeThickness?: number, alignment?: Base.basicAlignmentEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The width of the flanges, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * The total height of the profile, in model units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The thickness of the vertical web, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ webThickness: number; /** * The thickness of each horizontal flange, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.01 */ flangeThickness: number; /** * Which point of the profile's bounding box sits on `center`, such as its middle or its top * left corner. * @default midMid */ alignment: Base.basicAlignmentEnum; /** * How far the profile is turned in its plane, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The point the profile is placed at. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the profile lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * The cross-section of an H-beam, two vertical flanges joined by a horizontal web, for * `shapes.wire.createHBeamProfileWire` and `shapes.face.createHBeamProfileFace`. */ class HBeamProfileDto { constructor(width?: number, height?: number, webThickness?: number, flangeThickness?: number, alignment?: Base.basicAlignmentEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The total width of the profile, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * The height of the flanges, in model units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The thickness of the horizontal web, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ webThickness: number; /** * The thickness of each vertical flange, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.01 */ flangeThickness: number; /** * Which point of the profile's bounding box sits on `center`, such as its middle or its top * left corner. * @default midMid */ alignment: Base.basicAlignmentEnum; /** * How far the profile is turned in its plane, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The point the profile is placed at. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the profile lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * The cross-section of a T-beam, a horizontal flange with a vertical web hanging from its middle, * for `shapes.wire.createTBeamProfileWire` and `shapes.face.createTBeamProfileFace`. */ class TBeamProfileDto { constructor(width?: number, height?: number, webThickness?: number, flangeThickness?: number, alignment?: Base.basicAlignmentEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The width of the flange, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * The total height of the profile, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The thickness of the vertical web, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ webThickness: number; /** * The thickness of the flange, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.01 */ flangeThickness: number; /** * Which point of the profile's bounding box sits on `center`, such as its middle or its top * left corner. * @default midMid */ alignment: Base.basicAlignmentEnum; /** * How far the profile is turned in its plane, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The point the profile is placed at. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the profile lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * The cross-section of a U-beam, a channel with two flanges standing up from a web, for * `shapes.wire.createUBeamProfileWire` and `shapes.face.createUBeamProfileFace`. */ class UBeamProfileDto { constructor(width?: number, height?: number, webThickness?: number, flangeThickness?: number, flangeWidth?: number, alignment?: Base.basicAlignmentEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The total width of the profile, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * The total height of the profile, in model units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The thickness of the web at the back of the channel, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ webThickness: number; /** * The thickness of each flange, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.01 */ flangeThickness: number; /** * How far each flange reaches inward from the side of the channel, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ flangeWidth: number; /** * Which point of the profile's bounding box sits on `center`, such as its middle or its top * left corner. * @default midMid */ alignment: Base.basicAlignmentEnum; /** * How far the profile is turned in its plane, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The point the profile is placed at. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the profile lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * How far a flat profile is extruded each way along its normal, the part the beam profile solid * inputs share. */ class ExtrudedSolidDto { constructor(extrusionLengthFront?: number, extrusionLengthBack?: number, center?: Base.Point3, direction?: Base.Vector3); /** * How far the profile grows along its normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the profile grows against its normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; /** * The point the profile is placed at. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the profile's plane, which is the direction of the extrusion. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * An I-beam profile and the extrusion lengths for `shapes.solid.createIBeamProfileSolid`; at least * one length must be above 0. */ class IBeamProfileSolidDto extends IBeamProfileDto { constructor(width?: number, height?: number, webThickness?: number, flangeThickness?: number, alignment?: Base.basicAlignmentEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the profile grows along its normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the profile grows against its normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * An H-beam profile and the extrusion lengths for `shapes.solid.createHBeamProfileSolid`; at least * one length must be above 0. */ class HBeamProfileSolidDto extends HBeamProfileDto { constructor(width?: number, height?: number, webThickness?: number, flangeThickness?: number, alignment?: Base.basicAlignmentEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the profile grows along its normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the profile grows against its normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * A T-beam profile and the extrusion lengths for `shapes.solid.createTBeamProfileSolid`; at least * one length must be above 0. */ class TBeamProfileSolidDto extends TBeamProfileDto { constructor(width?: number, height?: number, webThickness?: number, flangeThickness?: number, alignment?: Base.basicAlignmentEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the profile grows along its normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the profile grows against its normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * A U-beam profile and the extrusion lengths for `shapes.solid.createUBeamProfileSolid`; at least * one length must be above 0. */ class UBeamProfileSolidDto extends UBeamProfileDto { constructor(width?: number, height?: number, webThickness?: number, flangeThickness?: number, flangeWidth?: number, alignment?: Base.basicAlignmentEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the profile grows along its normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the profile grows against its normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * The three sides of a box and where it sits, for `shapes.solid.createBox`; `width` runs along X, * `height` along Y, which is up, and `length` along Z. */ class BoxDto { constructor(width?: number, length?: number, height?: number, center?: Base.Point3, originOnCenter?: boolean); /** * The side along X, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * The side along Z, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * The side along Y, which is up, in model units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The point the box is centered on, or stands on when `originOnCenter` is false. * @default [0, 0, 0] */ center: Base.Point3; /** * When true, the box is centered on `center`; when false it stands on it, so `center` is the * middle of the bottom face. * @default true */ originOnCenter?: boolean | undefined; } /** * The side of a cube and where it sits, for `shapes.solid.createCube`. */ class CubeDto { constructor(size?: number, center?: Base.Point3, originOnCenter?: boolean); /** * The length of every side, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; /** * The point the cube is centered on, or stands on when `originOnCenter` is false. * @default [0, 0, 0] */ center: Base.Point3; /** * When true, the cube is centered on `center`; when false it stands on it, so `center` is the * middle of the bottom face. * @default true */ originOnCenter?: boolean | undefined; } /** * The three sides of a box and its corner, for `shapes.solid.createBoxFromCorner`, which grows the * box along the positive axes from there. */ class BoxFromCornerDto { constructor(width?: number, length?: number, height?: number, corner?: Base.Point3); /** * The side along X, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * The side along Z, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * The side along Y, which is up, in model units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The corner with the smallest X, Y and Z; the box extends from it along the positive axes. * @default [0, 0, 0] */ corner: Base.Point3; } /** * A radius and a center for `shapes.solid.createSphere`. */ class SphereDto { constructor(radius?: number, center?: Base.Point3); /** * The distance from the center to the surface, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * The point the sphere is centered on. * @default [0, 0, 0] */ center: Base.Point3; } /** * The two radii, height and placement of a cone or truncated cone for `shapes.solid.createCone`. */ class ConeDto { constructor(radius1?: number, radius2?: number, height?: number, angle?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The radius of the base at `center`, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius1: number; /** * The radius at the top, in model units; 0 makes a pointed cone. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius2: number; /** * The distance from the base to the top along `direction`, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * How much of the full round to build, in degrees; less than 360 cuts a wedge out. * @default 360 * @minimum 0 * @maximum 360 * @step 1 */ angle: number; /** * The center of the base. * @default [0, 0, 0] */ center: Base.Point3; /** * The direction from the base to the top. * @default [0, 1, 0] */ direction: Base.Point3; } /** * The two radii and placement of a ring for `shapes.solid.createTorus`. */ class TorusDto { constructor(majorRadius?: number, minorRadius?: number, center?: Base.Point3, direction?: Base.Vector3, angle?: number); /** * The distance from the center of the ring to the middle of its tube, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ majorRadius: number; /** * The radius of the tube itself, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ minorRadius: number; /** * The point the ring is centered on. * @default [0, 0, 0] */ center: Base.Point3; /** * The axis the ring goes around; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; /** * How much of the full ring to build, in degrees; less than 360 gives a partial ring. * @default 360 * @minimum 0 * @maximum 360 * @step 1 */ angle?: number | undefined; } /** * Two points for `shapes.edge.line` and `shapes.wire.createLineWire`, a straight edge or wire * between them. */ class LineDto { constructor(start?: Base.Point3, end?: Base.Point3); /** * The point the line starts at. * @default [0, 0, 0] */ start: Base.Point3; /** * The point the line ends at. * @default [0, 1, 0] */ end: Base.Point3; } /** * Two points and how far to lengthen the line past each for * `shapes.wire.createLineWireWithExtensions`. */ class LineWithExtensionsDto { constructor(start?: Base.Point3, end?: Base.Point3, extensionStart?: number, extensionEnd?: number); /** * The point the line starts at, before the extension. * @default [0, 0, 0] */ start: Base.Point3; /** * The point the line ends at, before the extension. * @default [0, 1, 0] */ end: Base.Point3; /** * How far the line is lengthened past its start, in model units. * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extensionStart: number; /** * How far the line is lengthened past its end, in model units. * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extensionEnd: number; } /** * Several line definitions for `shapes.wire.createLines`, which builds one wire per line. */ class LinesDto { constructor(lines?: LineDto[], returnCompound?: boolean); /** * One start and end point pair per line. * @default undefined */ lines: LineDto[]; /** * When true, the wires are packed into one compound instead of a list. */ returnCompound: boolean; } /** * Two points and a starting direction for `shapes.edge.arcThroughTwoPointsAndTangent`, a circular * arc between the points. */ class ArcEdgeTwoPointsTangentDto { constructor(start?: Base.Point3, tangentVec?: Base.Vector3, end?: Base.Point3); /** * The point the arc begins at, where the tangent applies. * @default [0, 0, 0] */ start: Base.Point3; /** * The direction the arc leaves the start point in; it fixes the plane and radius of the arc. * @default [0, 1, 0] */ tangentVec: Base.Vector3; /** * The point the arc finishes at. * @default [0, 0, 1] */ end: Base.Point3; } /** * A circle edge and two points on it for `shapes.edge.arcFromCircleAndTwoPoints`, which cuts the * arc between them. */ class ArcEdgeCircleTwoPointsDto { constructor(circle?: T, start?: Base.Point3, end?: Base.Point3, sense?: boolean); /** * The circle edge the arc is cut from. * @default undefined */ circle: T; /** * The point on the circle where the arc starts. * @default [0, 0, 0] */ start: Base.Point3; /** * The point on the circle where the arc ends. * @default [0, 0, 1] */ end: Base.Point3; /** * Which way round the circle the arc runs from start to end: true follows the circle's own * direction, false goes the other way. * @default true */ sense: boolean; } /** * A circle edge and two angles for `shapes.edge.arcFromCircleAndTwoAngles`, which cuts the arc * between them. */ class ArcEdgeCircleTwoAnglesDto { constructor(circle?: T, alphaAngle1?: number, alphaAngle2?: number, sense?: boolean); /** * The circle edge the arc is cut from. * @default undefined */ circle: T; /** * The angle where the arc starts, in degrees around the circle from its own start. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ alphaAngle1: number; /** * The angle where the arc ends, in degrees around the circle from its own start. * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ alphaAngle2: number; /** * Which way round the circle the arc runs from the first angle to the second: true follows the * circle's own direction, false goes the other way. * @default true */ sense: boolean; } /** * A circle edge, a point on it and an angle for `shapes.edge.arcFromCirclePointAndAngle`, which * cuts an arc of that angle from the point. */ class ArcEdgeCirclePointAngleDto { constructor(circle?: T, alphaAngle?: number, sense?: boolean); /** * The circle edge the arc is cut from. * @default undefined */ circle: T; /** * The point on the circle where the arc starts. * @default undefined */ point: Base.Point3; /** * How far the arc spans from the point, in degrees. * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ alphaAngle: number; /** * Which way round the circle the arc runs: true follows the circle's own direction, false goes * the other way. * @default true */ sense: boolean; } /** * Three points for `shapes.edge.arcThroughThreePoints`, the circular arc that passes through all * three. */ class ArcEdgeThreePointsDto { constructor(start?: Base.Point3, middle?: Base.Point3, end?: Base.Point3); /** * The point the arc begins at. * @default [0, 0, 0] */ start: Base.Point3; /** * A point the arc passes through on its way; it fixes the plane and radius. * @default [0, 1, 0] */ middle: Base.Point3; /** * The point the arc finishes at. * @default [0, 0, 1] */ end: Base.Point3; } /** * The size and placement of a cylinder for `shapes.solid.createCylinder`, which stands it on a * round base at `center`. */ class CylinderDto { constructor(radius?: number, height?: number, center?: Base.Point3, direction?: Base.Vector3, angle?: number, originOnCenter?: boolean); /** * The radius of the round base, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * How far the cylinder grows from its base along `direction`, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The center of the base, or the middle of the cylinder when `originOnCenter` is true. * @default [0, 0, 0] */ center: Base.Point3; /** * The direction the cylinder grows in; the default stands it up along Y. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * How much of the full round to build, in degrees; less than 360 cuts a wedge out, like a slice * of cake. * @default 360 * @minimum 0 * @maximum Infinity * @step 1 */ angle?: number | undefined; /** * When true, the cylinder is shifted back by half its height so `center` sits in its middle. * @default false */ originOnCenter?: boolean | undefined; } /** * Lines and a radius for `shapes.solid.createCylindersOnLines`, which builds one cylinder along * each line. */ class CylindersOnLinesDto { constructor(radius?: number, lines?: Base.Line3[]); /** * The radius shared by every cylinder, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * The lines the cylinders follow, each from its start to its end. * @default undefined */ lines: Base.Line3[]; } /** * A shape, a radius and optional edge or corner indexes for `fillets.filletEdges` and * `fillets.fillet2d`; `radiusList` pairs with `indexes` when both are given. */ class FilletDto { constructor(shape?: T, radius?: number, radiusList?: number[], indexes?: number[]); /** * The shape whose edges, or whose corners for a flat wire or face, are rounded. * @default undefined */ shape: T; /** * The rounding radius in model units, used for every selected edge unless `radiusList` is * given. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 * @optional true */ radius?: number | undefined; /** * One radius per entry of `indexes`, in the same order; needs `indexes`. * @default undefined * @optional true */ radiusList?: number[] | undefined; /** * Which edges to round, counted from 0 for `filletEdges`, or which corners, counted from 1 for * `fillet2d`; leave it out to round them all. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * Shapes, a radius and optional corner indexes for `fillets.fillet2dShapes`, which rounds each flat * wire or face the same way. */ class FilletShapesDto { constructor(shapes?: T[], radius?: number, radiusList?: number[], indexes?: number[]); /** * The flat wires or faces whose corners are rounded. * @default undefined */ shapes: T[]; /** * The rounding radius in model units, used for every selected corner unless `radiusList` is * given. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 * @optional true */ radius?: number | undefined; /** * One radius per entry of `indexes`, in the same order; needs `indexes`. * @default undefined * @optional true */ radiusList?: number[] | undefined; /** * Which corners to round, counted from 1 along each outline; leave it out to round them all. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, some of its edges and one radius per edge for `fillets.filletEdgesList`. */ class FilletEdgesListDto { constructor(shape?: T, edges?: U[], radiusList?: number[]); /** * The shape the edges belong to. * @default undefined */ shape: T; /** * The edges of the shape to round. * @default undefined */ edges: U[]; /** * One rounding radius per edge in model units, in the same order as `edges`; the lists must * have the same length. * @default undefined */ radiusList: number[]; } /** * A shape, some of its edges and one radius for `fillets.filletEdgesListOneRadius`. */ class FilletEdgesListOneRadiusDto { constructor(shape?: T, edges?: U[], radius?: number); /** * The shape the edges belong to. * @default undefined */ shape: T; /** * The edges of the shape to round. * @default undefined */ edges: U[]; /** * The rounding radius for every edge, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; } /** * A shape, one of its edges and a radius profile for `fillets.filletEdgeVariableRadius`; * `radiusList` and `paramsU` pair up by position. */ class FilletEdgeVariableRadiusDto { constructor(shape?: T, edge?: U, radiusList?: number[], paramsU?: number[]); /** * The shape the edge belongs to. * @default undefined */ shape: T; /** * The edge to round with a changing radius. * @default undefined */ edge: U; /** * The radius in model units at each position in `paramsU`; the lists must have the same length. * @default undefined */ radiusList: number[]; /** * Positions along the edge as fractions from 0 at its start to 1 at its end, one per radius. * @default undefined */ paramsU: number[]; } /** * A shape, some of its edges and a radius profile per edge for `fillets.filletEdgesVariableRadius`; * the three lists pair up by position. */ class FilletEdgesVariableRadiusDto { constructor(shape?: T, edges?: U[], radiusLists?: number[][], paramsULists?: number[][]); /** * The shape the edges belong to. * @default undefined */ shape: T; /** * The edges to round, each with its own radius profile. * @default undefined */ edges: U[]; /** * One list per edge of radii in model units, each pairing with the matching list in * `paramsULists`. * @default undefined */ radiusLists: number[][]; /** * One list per edge of positions as fractions from 0 to 1 along it, each pairing with the * matching list in `radiusLists`. * @default undefined */ paramsULists: number[][]; } /** * A shape, some of its edges and one radius profile shared by all of them for * `fillets.filletEdgesSameVariableRadius`. */ class FilletEdgesSameVariableRadiusDto { constructor(shape?: T, edges?: U[], radiusList?: number[], paramsU?: number[]); /** * The shape the edges belong to. * @default undefined */ shape: T; /** * The edges to round, all with the same radius profile. * @default undefined */ edges: U[]; /** * The radius in model units at each position in `paramsU`; the lists must have the same length. * @default undefined */ radiusList: number[]; /** * Positions along each edge as fractions from 0 at its start to 1 at its end, one per radius. * @default undefined */ paramsU: number[]; } /** * Wires, a radius, optional corner indexes and an extrusion direction for `fillets.fillet3DWires`, * which rounds the corners of wires that do not lie in a plane. */ class Fillet3DWiresDto { constructor(shapes?: T[], radius?: number, direction?: Base.Vector3, radiusList?: number[], indexes?: number[]); /** * The wires whose corners are rounded. * @default undefined */ shapes: T[]; /** * The rounding radius in model units, used for every selected corner unless `radiusList` is * given. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 * @optional true */ radius?: number | undefined; /** * One radius per entry of `indexes`, in the same order; needs `indexes`. * @default undefined * @optional true */ radiusList?: number[] | undefined; /** * Which corners to round, counted from 0 along each wire; leave it out to round them all. * @default undefined * @optional true */ indexes?: number[] | undefined; /** * The direction each wire is extruded along to build the fillets; it must not be parallel to * the wire and must leave room for the radius. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * A wire, a radius, optional corner indexes and an extrusion direction for `fillets.fillet3DWire`, * which rounds the corners of a wire that does not lie in a plane. */ class Fillet3DWireDto { constructor(shape?: T, radius?: number, direction?: Base.Vector3, radiusList?: number[], indexes?: number[]); /** * The wire whose corners are rounded. * @default undefined */ shape: T; /** * The rounding radius in model units, used for every selected corner unless `radiusList` is * given. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 * @optional true */ radius?: number | undefined; /** * One radius per entry of `indexes`, in the same order; needs `indexes`. * @default undefined * @optional true */ radiusList?: number[] | undefined; /** * Which corners to round, counted from 0 along the wire; leave it out to round them all. * @default undefined * @optional true */ indexes?: number[] | undefined; /** * The direction the wire is extruded along to build the fillets; it must not be parallel to the * wire and must leave room for the radius. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * A shape, a distance and optional edge indexes for `fillets.chamferEdges`; `distanceList` pairs * with `indexes` when both are given. */ class ChamferDto { constructor(shape?: T, distance?: number, distanceList?: number[], indexes?: number[]); /** * The shape whose edges are beveled. * @default undefined */ shape: T; /** * How far the bevel cuts back from the edge in model units, used for every selected edge unless * `distanceList` is given. * @default 0.1 * @minimum 0 * @maximum Infinity * @optional true * @step 0.1 */ distance?: number | undefined; /** * One distance per entry of `indexes`, in the same order; needs `indexes`. * @default undefined * @optional true */ distanceList?: number[] | undefined; /** * Which edges to bevel, counted from 0 in the order `shapes.edge.getEdges` lists them; leave it * out to bevel them all. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, some of its edges and one distance per edge for `fillets.chamferEdgesList`. */ class ChamferEdgesListDto { constructor(shape?: T, edges?: U[], distanceList?: number[]); /** * The shape the edges belong to. * @default undefined */ shape: T; /** * The edges of the shape to bevel. * @default undefined */ edges: U[]; /** * One bevel distance per edge in model units, in the same order as `edges`; the lists must have * the same length. * @default undefined */ distanceList: number[]; } /** * A shape, one of its edges, a face at that edge, a distance and an angle for * `fillets.chamferEdgeDistAngle`. */ class ChamferEdgeDistAngleDto { constructor(shape?: T, edge?: U, face?: F, distance?: number, angle?: number); /** * The shape the edge belongs to. * @default undefined */ shape: T; /** * The edge to bevel. * @default undefined */ edge: U; /** * One of the two faces meeting at the edge; the distance is measured on it and the angle from * it. * @default undefined */ face: F; /** * How far from the edge the bevel starts on the face, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ distance: number; /** * The slope of the bevel away from the face, in degrees; 45 gives an even chamfer. * @default 45 * @minimum 0 * @maximum Infinity * @step 1 */ angle: number; } /** * A shape, one of its edges, a face at that edge and two distances for * `fillets.chamferEdgeTwoDistances`, an uneven bevel. */ class ChamferEdgeTwoDistancesDto { constructor(shape?: T, edge?: U, face?: F, distance1?: number, distance2?: number); /** * The shape the edge belongs to. * @default undefined */ shape: T; /** * The edge to bevel. * @default undefined */ edge: U; /** * One of the two faces meeting at the edge; `distance1` is measured on it. * @default undefined */ face: F; /** * How far the bevel reaches from the edge on `face`, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ distance1: number; /** * How far the bevel reaches from the edge on the other face, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ distance2: number; } /** * A shape, some of its edges, one face per edge and two distances per edge for * `fillets.chamferEdgesTwoDistancesLists`; all the lists pair up by position. */ class ChamferEdgesTwoDistancesListsDto { constructor(shape?: T, edges?: U[], faces?: F[], distances1?: number[], distances2?: number[]); /** * The shape the edges belong to. * @default undefined */ shape: T; /** * The edges to bevel. * @default undefined */ edges: U[]; /** * One face per edge, meeting it; the first distance is measured on that face. * @default undefined */ faces: F[]; /** * One distance per edge, in model units, measured on the paired face. * @default undefined */ distances1: number[]; /** * One distance per edge, in model units, measured on the other face. * @default undefined */ distances2: number[]; } /** * A shape, some of its edges, one face per edge and two shared distances for * `fillets.chamferEdgesTwoDistances`; `faces` pairs with `edges` by position. */ class ChamferEdgesTwoDistancesDto { constructor(shape?: T, edges?: U[], faces?: F[], distance1?: number, distance2?: number); /** * The shape the edges belong to. * @default undefined */ shape: T; /** * The edges to bevel. * @default undefined */ edges: U[]; /** * One face per edge, meeting it; `distance1` is measured on that face. * @default undefined */ faces: F[]; /** * How far the bevel reaches from each edge on its paired face, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ distance1: number; /** * How far the bevel reaches from each edge on the other face, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ distance2: number; } /** * A shape, some of its edges, one face, distance and angle per edge for * `fillets.chamferEdgesDistsAngles`; all the lists pair up by position. */ class ChamferEdgesDistsAnglesDto { constructor(shape?: T, edges?: U[], faces?: F[], distances?: number[], angles?: number[]); /** * The shape the edges belong to. * @default undefined */ shape: T; /** * The edges to bevel. * @default undefined */ edges: U[]; /** * One face per edge, meeting it; the distance is measured on that face and the angle from it. * @default undefined */ faces: F[]; /** * One distance per edge, in model units, measured on the paired face. * @default undefined */ distances: number[]; /** * One bevel angle per edge, in degrees, measured from the paired face. * @default undefined */ angles: number[]; } /** * A shape, some of its edges, one face per edge and a shared distance and angle for * `fillets.chamferEdgesDistAngle`; `faces` pairs with `edges` by position. */ class ChamferEdgesDistAngleDto { constructor(shape?: T, edges?: U[], faces?: F[], distance?: number, angle?: number); /** * The shape the edges belong to. * @default undefined */ shape: T; /** * The edges to bevel. * @default undefined */ edges: U[]; /** * One face per edge, meeting it; the distance is measured on that face and the angle from it. * @default undefined */ faces: F[]; /** * How far from each edge the bevel starts on its paired face, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ distance: number; /** * The slope of the bevels away from the paired faces, in degrees; 45 gives an even chamfer. * @default 45 * @minimum 0 * @maximum Infinity * @step 1 */ angle: number; } /** * Points and a closing flag for `shapes.wire.createBSpline`, which fits a smooth curve close to the * points. */ class BSplineDto { constructor(points?: Base.Point3[], closed?: boolean); /** * The points the curve follows closely, in order; it need not pass through them exactly. * @default undefined */ points: Base.Point3[]; /** * When true, the first point is appended again so the ends meet. * @default false */ closed: boolean; } /** * Several B-spline definitions for `shapes.wire.createBSplines`, which builds one wire per * definition. */ class BSplinesDto { constructor(bSplines?: BSplineDto[], returnCompound?: boolean); /** * One definition per curve, as `createBSpline` takes them. * @default undefined */ bSplines: BSplineDto[]; /** * When true, the wires are packed into one compound instead of a list. */ returnCompound: boolean; } /** * Two circles in one plane and which pieces to keep for `shapes.wire.createWireFromTwoCirclesTan`, * a closed outline around both circles. */ class WireFromTwoCirclesTanDto { constructor(circle1?: T, circle2?: T, keepLines?: twoSidesStrictEnum, circleRemainders?: fourSidesStrictEnum, tolerance?: number); /** * The first circle wire; it must consist of a single edge. * @default undefined */ circle1: T; /** * The second circle wire; it must consist of a single edge. * @default undefined */ circle2: T; /** * Which tangent lines join the circles: `outside` gives the belt that does not cross itself, * `inside` the crossing lines. * @default outside */ keepLines: twoSidesStrictEnum; /** * Which arc of each circle stays in the outline: both outside, both inside, or one of each. * @default outside */ circleRemainders: fourSidesStrictEnum; /** * How close a line must come to a circle to count as touching it, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; } /** * Circles in one plane and how to pair them for `shapes.face.createFaceFromMultipleCircleTanWires`, * which joins the pairs with tangent belts. */ class FaceFromMultipleCircleTanWiresDto { constructor(circles?: T[], combination?: combinationCirclesForFaceEnum, unify?: boolean, tolerance?: number); /** * The circle wires to join, each a single edge. * @default undefined */ circles: T[]; /** * Which pairs get a belt: `allWithAll` every circle with every other, `inOrder` neighbors in * the list, `inOrderClosed` also the last with the first. * @default allWithAll */ combination: combinationCirclesForFaceEnum; /** * When true, the belt faces are fused into one shape; when false they come back as a compound, * which is faster. * @default true */ unify: boolean; /** * How close a line must come to a circle to count as touching it, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; } /** * Lists of circles and how to pair them for * `shapes.face.createFaceFromMultipleCircleTanWireCollections`, which joins circles of consecutive * lists with tangent belts. */ class FaceFromMultipleCircleTanWireCollectionsDto { constructor(listsOfCircles?: T[][], combination?: combinationCirclesForFaceEnum, unify?: boolean, tolerance?: number); /** * The lists of circle wires; belts run between one list and the next. * @default undefined */ listsOfCircles: T[][]; /** * Which pairs get a belt: `allWithAll` every circle of a list with every circle of the next, * `inOrder` circles at the same position, `inOrderClosed` also closes each list. * @default allWithAll */ combination: combinationCirclesForFaceEnum; /** * When true, the belt faces are fused into one shape; when false they come back as a compound, * which is faster. * @default true */ unify: boolean; /** * How close a line must come to a circle to count as touching it, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; } /** * Two wires and a bounce count for `shapes.wire.createZigZagBetweenTwoWires`, which draws a * polyline bouncing between them. */ class ZigZagBetweenTwoWiresDto { constructor(wire1?: T, wire2?: T, nrZigZags?: number, inverse?: boolean, divideByEqualDistance?: boolean, zigZagsPerEdge?: boolean); /** * The wire the zig-zag starts on. * @default undefined */ wire1: T; /** * The wire the zig-zag bounces to. * @default undefined */ wire2: T; /** * How many bounces to draw, per edge with `zigZagsPerEdge` or over the whole wire without; one * bounce is two segments meeting at a corner. * @default 20 * @minimum 1 * @maximum Infinity * @step 1 */ nrZigZags: number; /** * When true, the zig-zag starts on the second wire instead of the first. * @default false */ inverse: boolean; /** * When true, the bounce points are spaced by length along the wires; when false they follow the * curves' parameters, which can be uneven. * @default false */ divideByEqualDistance: boolean; /** * When true, each edge of the wires gets `nrZigZags` bounces and the wires need matching edge * counts; when false the count covers the whole wire. * @default true */ zigZagsPerEdge: boolean; } /** * Wires or edges and wire options for * `shapes.wire.createWiresBetweenStartEndPointsOfWiresAndEdges`, which joins their start points * into one wire and their end points into another. */ class WiresBetweenStartEndPointsOfWiresAndEdgesDto { constructor(shapes?: T[], wireType?: wireFromPointsTypeEnum, closed?: boolean, tolerance?: number); /** * Two or more wires or edges, in the order their points are joined. * @default undefined */ shapes: T[]; /** * Whether the points are joined with straight segments or with a smooth interpolated curve. * @default polyline */ wireType?: wireFromPointsTypeEnum | undefined; /** * When true, each new wire loops back to its first point: a polygon, or a periodic curve for * the interpolated kind. * @default false */ closed?: boolean | undefined; /** * How far the interpolated curve may stray from the points, in model units; unused for * polylines. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; } /** * Wires or edges, a division count and wire options for * `shapes.wire.createWiresBetweenSubdividedPointsOfWiresAndEdges`, which connects matching division * points like the rungs of a ladder. */ class WiresBetweenSubdividedPointsOfWiresAndEdgesDto { constructor(shapes?: T[], nrOfDivisions?: number, divideByEqualDistance?: boolean, wireType?: wireFromPointsTypeEnum, closed?: boolean, tolerance?: number); /** * Two or more wires or edges, in the order their points are joined. * @default undefined */ shapes: T[]; /** * How many steps each shape is divided into; one rung more than that is drawn, the ends * included. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrOfDivisions?: number | undefined; /** * When true, the division points are spaced by length along each shape; when false they follow * the curves' parameters, which can be uneven. * @default false */ divideByEqualDistance?: boolean | undefined; /** * Whether each rung is a polyline of straight segments or a smooth interpolated curve. * @default polyline */ wireType?: wireFromPointsTypeEnum | undefined; /** * When true, each rung loops back to its first point: a polygon, or a periodic curve for the * interpolated kind. * @default false */ closed?: boolean | undefined; /** * How far an interpolated rung may stray from its points, in model units; unused for polylines. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; } enum bSplineParametrizationEnum { /** Equal parameter spacing - symmetric for symmetric inputs, but can overshoot on uneven spacing. */ uniform = "uniform", /** Spacing proportional to chord length (OCCT's historic default). */ chordLength = "chordLength", /** Spacing proportional to sqrt(chord) - best general default; resists cusps and overshoot. */ centripetal = "centripetal" } /** * Points and fitting options for `shapes.wire.interpolatePoints`, which draws a smooth curve * through every point. */ class InterpolationDto { constructor(points?: Base.Point3[], periodic?: boolean, tolerance?: number, parametrization?: bSplineParametrizationEnum, startTangent?: Base.Vector3, endTangent?: Base.Vector3, tangents?: (Base.Vector3 | undefined)[]); /** * The points the curve passes through, in order. * @default undefined */ points: Base.Point3[]; /** * When true, the curve closes into a loop that is smooth across the seam. * @default false */ periodic: boolean; /** * How far the curve may stray from the points, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; /** * How the curve is spaced between points: chord length by default, `centripetal` to resist * cusps and overshoot with uneven points, or `uniform`. * @default chordLength */ parametrization?: bSplineParametrizationEnum | undefined; /** * A direction the curve must leave the first point in; only for open curves. * @default undefined * @optional true */ startTangent?: Base.Vector3 | undefined; /** * A direction the curve must arrive at the last point in; only for open curves. * @default undefined * @optional true */ endTangent?: Base.Vector3 | undefined; /** * One direction per point that the curve must follow there, with undefined entries left free; * when given, the start and end tangents are ignored. * @default undefined * @optional true */ tangents?: (Base.Vector3 | undefined)[] | undefined; } /** * Points and a tolerance for `shapes.wire.interpolatePointsSymmetric`, a closed smooth curve that * stays mirror-symmetric when the points are; it works out its own tangents, so nothing else is * needed. */ class InterpolateSymmetricDto { constructor(points?: Base.Point3[], tolerance?: number); /** * At least three points the closed curve passes through, in order. * @default undefined */ points: Base.Point3[]; /** * How far the curve may stray from the points, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; } /** * Several interpolation definitions for `shapes.wire.interpolateWires`, which builds one wire per * definition. */ class InterpolateWiresDto { constructor(interpolations?: InterpolationDto[], returnCompound?: boolean); /** * One definition per curve, as `interpolatePoints` takes them. * @default undefined */ interpolations: InterpolationDto[]; /** * When true, the wires are packed into one compound instead of a list. */ returnCompound: boolean; } /** * Control points and shape options for `shapes.wire.createBezier`, a smooth curve pulled toward its * control points. */ class BezierDto { constructor(points?: Base.Point3[], closed?: boolean, degree?: number, periodic?: boolean); /** * The control points: the curve starts at the first, ends at the last and is pulled toward the * ones between. * @default undefined */ points: Base.Point3[]; /** * When true, the first point is appended again so the ends meet, with a corner at the seam. * @default false */ closed: boolean; /** * How many neighboring control points shape each part of the curve; leave it out for a classic * Bezier, capped at 25 and bounded automatically above 26 points. * @default undefined * @optional true * @minimum 1 * @maximum Infinity * @step 1 */ degree?: number | undefined; /** * When true, the curve closes into a loop that is smooth across the seam, using `degree` or a * default; it overrides `closed`. * @default false * @optional true */ periodic?: boolean | undefined; } /** * Control points with a weight each and shape options for `shapes.wire.createBezierWeights`; the * weights say how strongly each point pulls the curve. */ class BezierWeightsDto { constructor(points?: Base.Point3[], weights?: number[], closed?: boolean, periodic?: boolean, degree?: number); /** * The control points: the curve starts at the first, ends at the last and is pulled toward the * ones between. * @default undefined */ points: Base.Point3[]; /** * One weight per control point, plus one more when `closed` is true and `periodic` false; above * 1 pulls harder, below 1 lets go. * @default undefined */ weights: number[]; /** * When true, the first point is appended again so the ends meet, with a corner at the seam. * @default false */ closed: boolean; /** * When true, the curve closes into a loop that is smooth across the seam and needs exactly one * weight per point; it overrides `closed`. * @default false * @optional true */ periodic?: boolean | undefined; /** * How many neighboring control points shape each part of a periodic curve; ignored otherwise. * @default undefined * @optional true * @minimum 1 * @maximum Infinity * @step 1 */ degree?: number | undefined; } /** * A wire or edge, a degree and a tolerance for `shapes.wire.rebuildWireDegree` and * `shapes.edge.rebuildEdgeDegree`. */ class RebuildCurveDegreeDto { constructor(shape?: T, degree?: number, tolerance?: number); /** * The wire or edge whose curve is rebuilt. * @default undefined */ shape: T; /** * The degree to rebuild to; lowering smooths the curve within the tolerance, raising keeps it * exact, and 3 is the practical minimum. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ degree: number; /** * How far the rebuilt curve may stray from the old one when the degree is lowered, in model * units. * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.0001 */ tolerance: number; } /** * A closed periodic wire or edge and a parameter for `moveWireSeamByParameter` and * `moveEdgeSeamByParameter`. */ class CurveSeamByParameterDto { constructor(shape?: T, parameter?: number); /** * The periodic wire or edge whose seam moves; a non-periodic one comes back unchanged. * @default undefined */ shape: T; /** * The curve parameter where the new seam sits, in the curve's own range. * @default 0 * @step 0.1 */ parameter: number; } /** * A closed periodic wire or edge and a distance for `moveWireSeamByLength` and * `moveEdgeSeamByLength`. */ class CurveSeamByLengthDto { constructor(shape?: T, length?: number); /** * The periodic wire or edge whose seam moves; a non-periodic one comes back unchanged. * @default undefined */ shape: T; /** * How far along the curve from the current start the new seam sits, in model units. * @default 0 * @step 0.1 */ length: number; } /** * A face, target degrees and a tolerance for `shapes.face.rebuildFaceDegree`. */ class RebuildFaceDegreeDto { constructor(shape?: T, uDegree?: number, vDegree?: number, tolerance?: number, keepTrim?: boolean); /** * The face whose surface is rebuilt. * @default undefined */ shape: T; /** * The degree to rebuild to in U; lowering smooths within the tolerance, raising keeps the * surface exact, and 3 is the practical minimum. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ uDegree: number; /** * The degree to rebuild to in V, with the same rules as `uDegree`. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ vDegree: number; /** * How far the rebuilt surface may stray from the old one when a degree is lowered, in model * units. * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.0001 */ tolerance: number; /** * When true, the face keeps its boundary wires, which is reliable when raising; when false it * covers the whole rebuilt surface. * @default false */ keepTrim: boolean; } /** * A face and which flips to apply for `shapes.face.flipFaceUV`. */ class FlipFaceUVDto { constructor(shape?: T, swapUV?: boolean, reverseU?: boolean, reverseV?: boolean); /** * The face whose UV parameters are changed. * @default undefined */ shape: T; /** * When true, U and V change places. * @default false */ swapUV: boolean; /** * When true, U runs the other way. * @default false */ reverseU: boolean; /** * When true, V runs the other way. * @default false */ reverseV: boolean; } /** * A face and fitting options for `shapes.face.normalizeFaceParametrization`, which makes equal * parameter steps into roughly equal distances. */ class NormalizeFaceParametrizationDto { constructor(shape?: T, normalizeU?: boolean, normalizeV?: boolean, samples?: number, tolerance?: number); /** * The face to reparametrize. * @default undefined */ shape: T; /** * When true, the U parameter is evened out by distance. * @default true */ normalizeU: boolean; /** * When true, the V parameter is evened out by distance. * @default true */ normalizeV: boolean; /** * How many points per direction the surface is resampled at; more is closer to the original and * slower. * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ samples: number; /** * How far the refitted surface may stray from the original, in model units. * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.0001 */ tolerance: number; } /** * Several Bezier definitions for `shapes.wire.createBezierWires`, which builds one wire per * definition. */ class BezierWiresDto { constructor(bezierWires?: BezierDto[], returnCompound?: boolean); /** * One definition per curve, as `createBezier` takes them. * @default undefined */ bezierWires: BezierDto[]; /** * When true, the wires are packed into one compound instead of a list. */ returnCompound: boolean; } /** * A wire or edge and a division count for `divideWireByParamsToPoints`, * `divideEdgeByEqualDistanceToPoints` and their siblings in `shapes.wire` and `shapes.edge`. */ class DivideDto { constructor(shape?: T, nrOfDivisions?: number, removeStartPoint?: boolean, removeEndPoint?: boolean); /** * The wire or edge to place points along. * @default undefined */ shape: T; /** * How many steps to divide the curve into; one more point than that is placed, the ends * included. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrOfDivisions?: number | undefined; /** * When true, the point at the start is left out. * @default false */ removeStartPoint?: boolean | undefined; /** * When true, the point at the end is left out. * @default false */ removeEndPoint?: boolean | undefined; } /** * A wire, a shape and a direction for `shapes.wire.project`, which casts the wire onto the shape * along the direction. */ class ProjectWireDto { constructor(wire?: T, shape?: U, direction?: Base.Vector3); /** * The wire to cast onto the shape. * @default undefined */ wire: T; /** * The shape the wire lands on. * @default undefined */ shape: U; /** * The direction the wire is cast along; only its direction matters. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * Points, a shape and a direction for `shapes.vertex.projectPoints`, which casts each point onto * the shape along the direction. */ class ProjectPointsOnShapeDto { constructor(points?: Base.Point3[], shape?: T, direction?: Base.Vector3, projectionType?: pointProjectionTypeEnum); /** * The points to cast onto the shape. * @default undefined */ points: Base.Point3[]; /** * The shape the points land on. * @default undefined */ shape: T; /** * The direction and reach of the cast as one vector, in model units: hits farther away than its * length are not found. * @default [0, 10, 0] */ direction: Base.Vector3; /** * Which hits to keep when a point crosses the shape more than once: all of them, the closest, * the farthest, or both of those. * @default all */ projectionType: pointProjectionTypeEnum; } /** * A shape and deflection settings for `shapes.wire.wiresToPoints`, which traces every wire of the * shape as points. */ class WiresToPointsDto { constructor(shape?: T, angularDeflection?: number, curvatureDeflection?: number, minimumOfPoints?: number, uTolerance?: number, minimumLength?: number); /** * The shape whose wires are traced. * @default undefined */ shape: T; /** * The largest angle, in radians, the polyline may turn between two points; smaller follows * curves more closely. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ angularDeflection: number; /** * The largest distance, in model units, the polyline may stray from the curve; smaller follows * it more closely. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.001 */ curvatureDeflection: number; /** * The fewest points any edge is traced with, however straight. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ minimumOfPoints: number; /** * How close two parameter values must be to count as the same point. * @default 1.0e-9 * @minimum 0 * @maximum Infinity * @step 1.0e-9 */ uTolerance: number; /** * Edges shorter than this, in model units, are traced with the minimum number of points. * @default 1.0e-7 * @minimum 0 * @maximum Infinity * @step 1.0e-7 */ minimumLength: number; } /** * A shape and deflection settings for `shapes.edge.edgesToPoints`, which traces every edge of the * shape as points. */ class EdgesToPointsDto { constructor(shape?: T, angularDeflection?: number, curvatureDeflection?: number, minimumOfPoints?: number, uTolerance?: number, minimumLength?: number); /** * The shape whose edges are traced. * @default undefined */ shape: T; /** * The largest angle, in radians, the polyline may turn between two points; smaller follows * curves more closely. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ angularDeflection: number; /** * The largest distance, in model units, the polyline may stray from the curve; smaller follows * it more closely. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.001 */ curvatureDeflection: number; /** * The fewest points any edge is traced with, however straight. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ minimumOfPoints: number; /** * How close two parameter values must be to count as the same point. * @default 1.0e-9 * @minimum 0 * @maximum Infinity * @step 1.0e-9 */ uTolerance: number; /** * Edges shorter than this, in model units, are traced with the minimum number of points. * @default 1.0e-7 * @minimum 0 * @maximum Infinity * @step 1.0e-7 */ minimumLength: number; } /** * Wires, a shape and a direction for `shapes.wire.projectWires`, which casts each wire onto the * shape along the direction. */ class ProjectWiresDto { constructor(wires?: T[], shape?: U, direction?: Base.Vector3); /** * The wires to cast onto the shape, one result per wire. * @default undefined */ wires: T[]; /** * The shape the wires land on. * @default undefined */ shape: U; /** * The direction the wires are cast along; only its direction matters. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * Wires or edges and a division count for `divideWiresByParamsToPoints`, * `divideEdgesByEqualDistanceToPoints` and their siblings. */ class DivideShapesDto { constructor(shapes: T[], nrOfDivisions?: number, removeStartPoint?: boolean, removeEndPoint?: boolean); /** * The wires or edges to place points along, one list of points per shape. * @default undefined */ shapes: T[]; /** * How many steps to divide each curve into; one more point than that is placed, the ends * included. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrOfDivisions: number; /** * When true, the point at the start of each curve is left out. * @default false */ removeStartPoint: boolean; /** * When true, the point at the end of each curve is left out. * @default false */ removeEndPoint: boolean; } /** * A wire, edge or 2D curve and a parameter for the `...AtParam` methods, such as * `shapes.wire.pointOnWireAtParam` and `shapes.edge.tangentOnEdgeAtParam`. */ class DataOnGeometryAtParamDto { constructor(shape: T, param?: number); /** * The wire, edge or curve to evaluate. * @default undefined */ shape: T; /** * Where to evaluate, as a fraction from 0 at the start to 1 at the end; for a raw 2D curve it * is the curve's own parameter. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ param: number; } /** * Several edges and one parameter for `shapes.edge.pointsOnEdgesAtParam` and * `tangentsOnEdgesAtParam`. */ class DataOnGeometryesAtParamDto { constructor(shapes: T[], param?: number); /** * The edges to evaluate, one result per edge. * @default undefined */ shapes: T[]; /** * Where to evaluate on every edge, as a fraction from 0 at the start to 1 at the end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ param: number; } /** * A wire and a spacing for `shapes.wire.pointsOnWireAtEqualLength`, which places points every * `length` units from the start. */ class PointsOnWireAtEqualLengthDto { constructor(shape: T, length?: number, tryNext?: boolean, includeFirst?: boolean, includeLast?: boolean); /** * The wire to place points along. * @default undefined */ shape: T; /** * The distance between points along the wire, in model units. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ length: number; /** * When true, one more point is asked for a step beyond the last one that fit. * @default false */ tryNext: boolean; /** * When true, the point at the start of the wire is kept. * @default false */ includeFirst: boolean; /** * When true, the end point of the wire is appended whatever the spacing. * @default false */ includeLast: boolean; } /** * A wire and a repeating pattern of gaps for `shapes.wire.pointsOnWireAtPatternOfLengths`. */ class PointsOnWireAtPatternOfLengthsDto { constructor(shape: T, lengths?: number[], tryNext?: boolean, includeFirst?: boolean, includeLast?: boolean); /** * The wire to place points along. * @default undefined */ shape: T; /** * The gaps between points in model units, applied in turn from the start and repeated until the * wire runs out. * @default undefined */ lengths: number[]; /** * When true, one more point is asked for at the next gap beyond the last one that fit. * @default false */ tryNext: boolean; /** * When true, the point at the start of the wire is kept. * @default false */ includeFirst: boolean; /** * When true, the end point of the wire is appended whatever the pattern. * @default false */ includeLast: boolean; } /** * A wire or edge and a distance for the `...AtLength` methods, such as * `shapes.wire.pointOnWireAtLength` and `shapes.edge.tangentOnEdgeAtLength`. */ class DataOnGeometryAtLengthDto { constructor(shape: T, length?: number); /** * The wire or edge to evaluate. * @default undefined */ shape: T; /** * The distance from the start along the curve, in model units. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ length: number; } /** * Several edges and one distance for `shapes.edge.pointsOnEdgesAtLength` and * `tangentsOnEdgesAtLength`. */ class DataOnGeometryesAtLengthDto { constructor(shapes: T[], length?: number); /** * The edges to evaluate, one result per edge. * @default undefined */ shapes: T[]; /** * The distance from the start of each edge along its curve, in model units. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ length: number; } /** * A wire and several distances for `shapes.wire.pointsOnWireAtLengths`. */ class DataOnGeometryAtLengthsDto { constructor(shape: T, lengths?: number[]); /** * The wire to evaluate. * @default undefined */ shape: T; /** * The distances from the start along the wire, in model units, one point each. * @default undefined */ lengths: number[]; } /** * A radius, a center and a plane normal for the circle edge, wire and face methods of `shapes` and * `geom.curves.geomCircleCurve`. */ class CircleDto { constructor(radius?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The distance from the center to the circle, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * The point the circle is centered on. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the circle lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * A rectangle, hexagon counts and optional patterns for `shapes.wire.hexagonsInGrid` and * `shapes.face.hexagonsInGrid`, which fill the rectangle on the ground plane with a honeycomb. */ class HexagonsInGridDto { constructor(width?: number, height?: number, nrHexagonsInHeight?: number, nrHexagonsInWidth?: number, flatTop?: boolean, extendTop?: boolean, extendBottom?: boolean, extendLeft?: boolean, extendRight?: boolean, scalePatternWidth?: number[], scalePatternHeight?: number[], filletPattern?: number[], inclusionPattern?: boolean[]); /** * The width of the rectangle to fill, in model units; the hexagon size follows from it and the * counts. * @default 10 * @minimum 0 * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * The height of the rectangle to fill, in model units. * @default 10 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * How many hexagons fit across the width. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsInWidth?: number | undefined; /** * How many hexagons fit across the height. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsInHeight?: number | undefined; /** * When true, the hexagons have a flat side at the top and bottom; when false a corner points * up. * @default false */ flatTop?: boolean | undefined; /** * When true, the grid is stretched so its top row reaches past the top edge, covering it * without a jagged border. * @default false */ extendTop?: boolean | undefined; /** * When true, the grid is stretched so its bottom row reaches past the bottom edge, covering it * without a jagged border. * @default false */ extendBottom?: boolean | undefined; /** * When true, the grid is stretched so its left column reaches past the left edge, covering it * without a jagged border. * @default false */ extendLeft?: boolean | undefined; /** * When true, the grid is stretched so its right column reaches past the right edge, covering it * without a jagged border. * @default false */ extendRight?: boolean | undefined; /** * Sizes of the hexagons along the width as fractions of their full size, applied in turn; 1 or * no list means no scaling. * @default undefined * @optional true */ scalePatternWidth?: number[] | undefined; /** * Sizes of the hexagons along the height as fractions of their full size, applied in turn; 1 or * no list means no scaling. * @default undefined * @optional true */ scalePatternHeight?: number[] | undefined; /** * Corner rounding of the hexagons as fractions from 0 to 1 of the largest radius that fits, * applied in turn; 0 leaves sharp corners. * @default undefined * @optional true */ filletPattern?: number[] | undefined; /** * Which hexagons are built, applied in turn: true builds one, false skips it. * @default undefined * @optional true */ inclusionPattern?: boolean[] | undefined; } /** * Section wires and a solid flag for `operations.loft`, which stretches a surface through the * sections in list order. */ class LoftDto { constructor(shapes?: T[], makeSolid?: boolean); /** * The section wires, or edges, in the order the surface passes through them. * @default undefined */ shapes: T[]; /** * When true, the loft is capped into a solid; the sections must be closed for that. * @default false */ makeSolid: boolean; } /** * Section wires and fitting options for `operations.loftAdvanced`: ruled or smooth patches, a * closed or periodic loop, end points and the approximation settings. */ class LoftAdvancedDto { constructor(shapes?: T[], makeSolid?: boolean, closed?: boolean, periodic?: boolean, straight?: boolean, nrPeriodicSections?: number, useSmoothing?: boolean, maxUDegree?: number, tolerance?: number, parType?: approxParametrizationTypeEnum, startVertex?: Base.Point3, endVertex?: Base.Point3); /** * The section wires, or edges, in the order the surface passes through them. * @default undefined */ shapes: T[]; /** * When true, the loft is capped into a solid; the sections must be closed for that. * @default false */ makeSolid: boolean; /** * When true, the surface loops from the last section back to the first. * @default false */ closed: boolean; /** * When true, the closed loop is made smooth across the seam by resampling the sections; needs * `closed`. * @default false */ periodic: boolean; /** * When true, the patches between sections are ruled surfaces with straight lines instead of a * smooth blend. * @default false */ straight: boolean; /** * How many points each section is resampled into for a periodic loft. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrPeriodicSections: number; /** * When true, the kernel smooths the fitted surface. * @default false */ useSmoothing: boolean; /** * The highest polynomial degree the surface may use across the sections. * @default 3 */ maxUDegree: number; /** * How far the fitted surface may stray from the sections, in model units. * @default 1.0e-7 * @minimum 0 * @maximum Infinity * @step 0.000001 */ tolerance: number; /** * How the sections are parametrized before fitting: by chord length, centripetal, or * isoparametric; centripetal handles uneven sections best. * @default approxCentripetal */ parType: approxParametrizationTypeEnum; /** * A point the loft closes to before the first section, making a pointed end; leave it out for * an open end. * @default undefined * @optional true */ startVertex?: Base.Point3 | undefined; /** * A point the loft closes to after the last section, making a pointed end; leave it out for an * open end. * @default undefined * @optional true */ endVertex?: Base.Point3 | undefined; } /** * A shape and a distance for `operations.offset`, which moves the shape's boundary outward or * inward with rounded corners. */ class OffsetDto { constructor(shape?: T, face?: U, distance?: number, tolerance?: number); /** * The shape to offset: a wire, edge, face, shell or solid. * @default undefined */ shape: T; /** * For a wire or edge, a face whose surface the offset is drawn on; leave it out to offset in * the wire's own plane. * @default undefined * @optional true */ face?: U | undefined; /** * How far the boundary moves, in model units; negative moves it inward, 0 returns the shape as * it is. * @default 0.2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ distance: number; /** * How close two points must be to count as the same when the offset is built, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ tolerance: number; } /** * A shape, a distance and corner options for `operations.offsetAdv`, which moves the shape's * boundary outward or inward. */ class OffsetAdvancedDto { constructor(shape?: T, face?: U, distance?: number, tolerance?: number, joinType?: joinTypeEnum, removeIntEdges?: boolean); /** * The shape to offset: a wire, edge, face, shell or solid. * @default undefined */ shape: T; /** * For a wire or edge, a face whose surface the offset is drawn on; leave it out to offset in * the wire's own plane. * @default undefined * @optional true */ face?: U | undefined; /** * How far the boundary moves, in model units; negative moves it inward, 0 returns the shape as * it is. * @default 0.2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ distance: number; /** * How close two points must be to count as the same when the offset is built, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ tolerance: number; /** * How the offset pieces meet at corners: `arc` rounds them, `intersection` extends them to a * sharp corner, `tangent` keeps them tangent. * @default arc */ joinType: joinTypeEnum; /** * When true, the internal edges the offset can leave behind are removed from the result. * @default false */ removeIntEdges: boolean; } /** * A profile, an angle and an axis for `operations.revolve`, which spins the profile about the axis * through the origin. */ class RevolveDto { constructor(shape?: T, angle?: number, direction?: Base.Vector3, copy?: boolean); /** * The profile to spin: a wire gives a shell, a face a solid; it must not cross the axis. * @default undefined */ shape: T; /** * How far to spin, in degrees; 360 or more gives a full turn. * @default 360 * @minimum 0 * @maximum 360 * @step 1 */ angle: number; /** * The direction of the axis, which passes through the origin. * @default [0, 1, 0] */ direction: Base.Vector3; /** * When true, the profile's geometry is copied instead of shared with the result. * @default false */ copy: boolean; } /** * A path wire and profile shapes for `operations.pipe`, and generally one shape with a list of * others, as in `shapes.wire.addEdgesAndWiresToWire`. */ class ShapeShapesDto { constructor(shape?: T, shapes?: U[]); /** * The main shape: the path wire for a pipe, the wire to extend when adding edges. * @default undefined */ shape: T; /** * The other shapes: the profiles placed on the path, or the edges and wires to add. * @default undefined */ shapes: U[]; } /** * Flat wires and a face for `shapes.wire.placeWiresOnFace`, which maps the wires onto the face's * surface. */ class WiresOnFaceDto { constructor(wires?: T[], face?: U); /** * The wires drawn on the ground plane; their Z coordinate becomes U and their X coordinate V. * @default undefined */ wires: T[]; /** * The face whose surface the wires are mapped onto. * @default undefined */ face: U; } /** * Path wires, a radius and sweep options for `operations.pipeWiresCylindrical`, which makes a round * tube along each wire. */ class PipeWiresCylindricalDto { constructor(shapes?: T[], radius?: number, makeSolid?: boolean, trihedronEnum?: geomFillTrihedronEnum, forceApproxC1?: boolean); /** * The path wires, one tube per wire. * @default undefined */ shapes: T[]; /** * The radius of the tubes, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 1 */ radius: number; /** * When true, the tubes are solids; when false they are open shells. * @default true */ makeSolid: boolean; /** * How the profile turns as it follows the path; `isConstantNormal` keeps it steady, the Frenet * modes follow the curve's bending. * @default isConstantNormal */ trihedronEnum: geomFillTrihedronEnum; /** * When true, a swept surface that came out with kinks is refitted to be smooth. * @default false */ forceApproxC1: boolean; } /** * A path wire, a radius and sweep options for `operations.pipeWireCylindrical`, which makes a round * tube along the wire. */ class PipeWireCylindricalDto { constructor(shape?: T, radius?: number, makeSolid?: boolean, trihedronEnum?: geomFillTrihedronEnum, forceApproxC1?: boolean); /** * The path wire the tube follows. * @default undefined */ shape: T; /** * The radius of the tube, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 1 */ radius: number; /** * When true, the tube is a solid; when false it is an open shell. * @default true */ makeSolid: boolean; /** * How the profile turns as it follows the path; `isConstantNormal` keeps it steady, the Frenet * modes follow the curve's bending. * @default isConstantNormal */ trihedronEnum: geomFillTrihedronEnum; /** * When true, a swept surface that came out with kinks is refitted to be smooth. * @default false */ forceApproxC1: boolean; } /** * A path wire, a polygon size and sweep options for `operations.pipePolylineWireNGon`, which makes * a tube with flat sides along the wire. */ class PipePolygonWireNGonDto { constructor(shape?: T, radius?: number, nrCorners?: number, makeSolid?: boolean, trihedronEnum?: geomFillTrihedronEnum, forceApproxC1?: boolean); /** * The path wire the tube follows. * @default undefined */ shape: T; /** * The distance from the path to each corner of the polygon, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 1 */ radius: number; /** * How many corners, and so flat sides, the tube has. * @default 6 * @minimum 3 * @maximum Infinity * @step 1 */ nrCorners: number; /** * When true, the tube is a solid; when false it is an open shell. * @default true */ makeSolid: boolean; /** * How the profile turns as it follows the path; `isConstantNormal` keeps it steady, the Frenet * modes follow the curve's bending. * @default isConstantNormal */ trihedronEnum: geomFillTrihedronEnum; /** * When true, a swept surface that came out with kinks is refitted to be smooth. * @default false */ forceApproxC1: boolean; } /** * A shape and a vector for `operations.extrude`, which sweeps the shape in a straight line. */ class ExtrudeDto { constructor(shape?: T, direction?: Base.Vector3); /** * The shape to sweep: a face gives a solid, a wire a shell, an edge a face. * @default undefined */ shape: T; /** * The direction and distance of the sweep as one vector, in model units. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * Shapes and a vector for `operations.extrudeShapes`, which sweeps every shape in the same straight * line. */ class ExtrudeShapesDto { constructor(shapes?: T[], direction?: Base.Vector3); /** * The shapes to sweep, one result per shape. * @default undefined */ shapes: T[]; /** * The direction and distance of the sweep as one vector, in model units. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * A shape and the shapes to cut it with for `operations.splitShapeWithShapes`. */ class SplitDto { constructor(shape?: T, shapes?: T[]); /** * The shape to cut into pieces. * @default undefined */ shape: T; /** * The shapes that do the cutting, such as faces or solids passing through the shape. * @default undefined */ shapes: T[]; /** * How far apart geometry may be and still count as touching, in model units; helps when faces * nearly coincide. * @default 1.0e-4 * @minimum 0 * @maximum Infinity * @step 0.000001 */ localFuzzyTolerance: number; /** * When true, the inputs stay untouched and the result holds the pieces of every shape involved; * when false only the pieces of `shape` come back. * @default true */ nonDestructive: boolean; } /** * Shapes and an edge flag for `booleans.union`, which fuses them into one. */ class UnionDto { constructor(shapes?: T[], keepEdges?: boolean); /** * The shapes to fuse, joined one after another in this order. * @default undefined */ shapes: T[]; /** * When false, faces that end up on one surface are merged and their seams removed; when true * every edge of the inputs stays. * @default false */ keepEdges: boolean; } /** * A main shape and the shapes to cut away from it for `booleans.difference`. */ class DifferenceDto { constructor(shape?: T, shapes?: T[], keepEdges?: boolean); /** * The shape material is removed from. * @default undefined */ shape: T; /** * The shapes whose volume is cut away, one after another. * @default undefined */ shapes: T[]; /** * When false, faces left on one surface are merged and their seams removed; when true every * edge stays. * @default false */ keepEdges: boolean; } /** * Shapes and an edge flag for `booleans.intersection`, which keeps what the first shape shares with * each of the others. */ class IntersectionDto { constructor(shapes?: T[], keepEdges?: boolean); /** * The shapes; the first is intersected with every other one in turn. * @default undefined */ shapes: T[]; /** * When false, faces on one surface are merged and their seams removed; when true every edge * stays. * @default false */ keepEdges: boolean; } /** * One shape for the many methods that take nothing else, such as `shapes.shape.isValid`, * `shapes.face.getFaceArea` or `operations.boundingBoxOfShape`. */ class ShapeDto { constructor(shape?: T); /** * The shape to work on; it is not changed. * @default undefined */ shape: T; } /** * Two shapes and their meshing precisions for `booleans.meshMeshIntersectionWires` and * `meshMeshIntersectionPoints`. */ class MeshMeshIntersectionTwoShapesDto { constructor(shape1?: T, shape2?: T, precision1?: number, precision2?: number); /** * The first shape to intersect. * @default undefined */ shape1: T; /** * The meshing tolerance of the first shape in model units; smaller follows curves more closely * and costs more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.01 */ precision1?: number | undefined; /** * The second shape to intersect. * @default undefined */ shape2: T; /** * The meshing tolerance of the second shape in model units; smaller follows curves more closely * and costs more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.01 */ precision2?: number | undefined; } /** * A main shape, other shapes and their meshing precisions for * `booleans.meshMeshIntersectionOfShapesWires` and `meshMeshIntersectionOfShapesPoints`. */ class MeshMeshesIntersectionOfShapesDto { constructor(shape?: T, shapes?: T[], precision?: number, precisionShapes?: number[]); /** * The main shape every other shape is intersected with. * @default undefined */ shape: T; /** * The meshing tolerance of the main shape in model units; smaller follows curves more closely * and costs more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.01 */ precision?: number | undefined; /** * The other shapes, each intersected with the main one. * @default undefined */ shapes: T[]; /** * One meshing tolerance per other shape; leave it out to mesh them all at `precision`. * @default undefined * @optional true */ precisionShapes?: number[] | undefined; } /** * Two shapes for `shapes.shape.isEqual`, `isNotEqual`, `isSame` and `isPartner`. */ class CompareShapesDto { constructor(shape?: T, otherShape?: T); /** * The first shape of the comparison. * @default undefined */ shape: T; /** * The second shape of the comparison. * @default undefined */ otherShape: T; } /** * A wire and a length for `shapeFix.fixSmallEdgeOnWire`, which removes edges shorter than that. */ class FixSmallEdgesInWireDto { constructor(shape?: T, lockvtx?: boolean, precsmall?: number); /** * The wire to clean up. * @default undefined */ shape: T; /** * When true, the existing vertices are kept in place; when false they may move to close the * gaps. * @default false */ lockvtx: boolean; /** * Edges shorter than this, in model units, are removed; 0 uses the wire's own tolerance. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.0000000001 */ precsmall: number; } /** * A shape and tolerance bounds for `shapeFix.basicShapeRepair`, the kernel's general repair. */ class BasicShapeRepairDto { constructor(shape?: T, precision?: number, maxTolerance?: number, minTolerance?: number); /** * The shape to repair; it stays as it is and a repaired copy comes back. * @default undefined */ shape: T; /** * The size of defect the repair looks for, in model units. * @default 0.001 * @minimum 0 * @maximum Infinity * @step 0.0000000001 */ precision: number; /** * The largest tolerance the repair may give a part of the shape while closing gaps, in model * units; a gap needing more stays open. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.0000000001 */ maxTolerance: number; /** * The smallest tolerance the repair may use, in model units; edges shorter than this are * removed. * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.0000000001 */ minTolerance: number; } /** * A shape and a tolerance for `shapes.face.faceFromSurface`, `shapes.shell.sewFaces` and the other * methods that build within a tolerance. */ class ShapeWithToleranceDto { constructor(shape?: T, tolerance?: number); /** * The shape or surface to work on. * @default undefined */ shape: T; /** * How close geometry must be to count as touching, in model units. * @default 1.0e-7 * @minimum 0 * @maximum Infinity * @step 0.000001 */ tolerance: number; } /** * A shape and a position for `shapes.face.getFace`, `shapes.wire.getWire`, `shapes.solid.getSolid` * and the like. */ class ShapeIndexDto { constructor(shape?: T, index?: number); /** * The shape to pick from. * @default undefined */ shape: T; /** * The position of the wanted part, counting from 0 in the order the kernel walks the shape; * beyond the last one throws. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * A shape and a position for `shapes.edge.getEdge`. */ class EdgeIndexDto { constructor(shape?: T, index?: number); /** * The shape to pick the edge from. * @default undefined */ shape: T; /** * The position of the wanted edge, counting from 0 in the order the kernel walks the shape; * beyond the last one throws. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * A flat profile, a height and a twist for `operations.rotatedExtrude`, which extrudes the profile * up along Y while turning it. */ class RotationExtrudeDto { constructor(shape?: T, height?: number, angle?: number, makeSolid?: boolean); /** * The flat profile to extrude, a wire or a face lying on the ground. * @default undefined */ shape: T; /** * How far the profile is extruded along Y, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * How far the profile turns about the Y axis over the height, in degrees. * @default 360 * @minimum 0 * @maximum 360 * @step 1 */ angle: number; /** * When true, a face profile gives a closed solid; when false the result is a shell. * @default true */ makeSolid: boolean; } /** * A solid, the faces to remove and a wall thickness for `operations.makeThickSolidByJoin`, which * hollows the solid into a shell of that thickness. */ class ThickSolidByJoinDto { constructor(shape?: T, shapes?: T[], offset?: number, tolerance?: number, intersection?: boolean, selfIntersection?: boolean, joinType?: joinTypeEnum, removeIntEdges?: boolean); /** * The solid to hollow out. * @default undefined */ shape: T; /** * The faces of the solid to remove, leaving the openings of the shell. * @default undefined */ shapes: T[]; /** * The wall thickness in model units; negative grows the wall inward. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ offset: number; /** * How close two points must be to count as the same when the offset walls are joined, in model * units. * @default 1.0e-3 * @minimum 0 * @maximum Infinity * @step 0.000001 */ tolerance: number; /** * When true, the offset faces are intersected with each other rather than joined by their * parallels; the kernel's default is false. * @default false */ intersection: boolean; /** * Whether the kernel should look for self-intersections in the result; not implemented by the * kernel, so leave it false. * @default false */ selfIntersection: boolean; /** * How the offset walls meet at corners: `arc` rounds them, `intersection` extends them to a * sharp corner, `tangent` keeps them tangent. * @default arc */ joinType: joinTypeEnum; /** * When true, the internal edges the offset can leave on the walls are removed from the result. * @default false */ removeIntEdges: boolean; } /** * A shape and a scale, rotation and translation for `transforms.transform`, applied in that order * about the origin. */ class TransformDto { constructor(shape?: T, translation?: Base.Vector3, rotationAxis?: Base.Vector3, rotationAngle?: number, scaleFactor?: number); /** * The shape to transform; it stays as it is and a transformed copy comes back. * @default undefined */ shape: T; /** * The vector the shape moves by, in model units, applied last. * @default [0,0,0] */ translation: Base.Vector3; /** * The direction of the rotation axis, which passes through the origin. * @default [0,1,0] */ rotationAxis: Base.Vector3; /** * The rotation about the axis, in degrees, applied after the scale. * @default 0 * @minimum 0 * @maximum 360 * @step 1 */ rotationAngle: number; /** * The uniform scale about the origin, applied first; 1 keeps the size. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ scaleFactor: number; } /** * Shapes and one scale, rotation and translation each for `transforms.transformShapes`; all the * lists must have the same length. */ class TransformShapesDto { constructor(shapes?: T[], translations?: Base.Vector3[], rotationAxes?: Base.Vector3[], rotationAngles?: number[], scaleFactors?: number[]); /** * The shapes to transform; they stay as they are and transformed copies come back in the same * order. * @default undefined */ shapes: T[]; /** * One translation vector per shape, in model units. * @default [[0,0,0]] */ translations: Base.Vector3[]; /** * One rotation axis direction per shape, each through the origin. * @default [[0,1,0]] */ rotationAxes: Base.Vector3[]; /** * One rotation angle per shape, in degrees. * @default [0] */ rotationAngles: number[]; /** * One uniform scale factor per shape, about the origin. * @default [1] */ scaleFactors: number[]; } /** * A shape and a vector for `transforms.translate`. */ class TranslateDto { constructor(shape?: T, translation?: Base.Vector3); /** * The shape to move. * @default undefined */ shape: T; /** * The vector the shape moves by, in model units. * @default [0, 0, 0] */ translation: Base.Vector3; } /** * Shapes and one vector each for `transforms.translateShapes`; the two lists must have the same * length. */ class TranslateShapesDto { constructor(shapes?: T[], translations?: Base.Vector3[]); /** * The shapes to move. * @default undefined */ shapes: T[]; /** * One vector per shape, in model units. * @default [[0, 0, 0]] */ translations: Base.Vector3[]; } /** * A shape and two full frames for `transforms.alignNormAndAxis`: the point, normal and axis the * shape is taken from, and the point, normal and axis it lands on. */ class AlignNormAndAxisDto { constructor(shape?: T, fromOrigin?: Base.Point3, fromNorm?: Base.Vector3, fromAx?: Base.Vector3, toOrigin?: Base.Point3, toNorm?: Base.Vector3, toAx?: Base.Vector3); /** * The shape to move. * @default undefined */ shape: T; /** * The point on the shape that is carried onto `toOrigin`. * @default [0, 0, 0] */ fromOrigin: Base.Point3; /** * The normal direction at the shape's frame, carried onto `toNorm`. * @default [1, 0, 0] */ fromNorm: Base.Vector3; /** * An axis direction in the plane of the normal at the shape's frame, carried onto `toAx`; it * fixes the spin about the normal. * @default [0, 0, 1] */ fromAx: Base.Vector3; /** * The point `fromOrigin` lands on. * @default [0, 1, 0] */ toOrigin: Base.Point3; /** * The direction `fromNorm` lands on. * @default [0, 1, 0] */ toNorm: Base.Vector3; /** * The direction `fromAx` lands on. * @default [0, 0, 1] */ toAx: Base.Vector3; } /** * A shape, a point and direction on it, and the point and direction to land on, for * `transforms.align`. */ class AlignDto { constructor(shape?: T, fromOrigin?: Base.Point3, fromDirection?: Base.Vector3, toOrigin?: Base.Point3, toDirection?: Base.Vector3); /** * The shape to move. * @default undefined */ shape: T; /** * The point on the shape that is carried onto `toOrigin`. * @default [0, 0, 0] */ fromOrigin: Base.Point3; /** * The direction at the shape's frame that is carried onto `toDirection`. * @default [0, 0, 1] */ fromDirection: Base.Vector3; /** * The point `fromOrigin` lands on. * @default [0, 1, 0] */ toOrigin: Base.Point3; /** * The direction `fromDirection` lands on. * @default [0, 1, 0] */ toDirection: Base.Vector3; } /** * Shapes and one from and to frame each for `transforms.alignShapes`; all the lists must have the * same length. */ class AlignShapesDto { constructor(shapes?: T[], fromOrigins?: Base.Vector3[], fromDirections?: Base.Vector3[], toOrigins?: Base.Vector3[], toDirections?: Base.Vector3[]); /** * The shapes to move. * @default undefined */ shapes: T[]; /** * One point per shape that is carried onto the matching `toOrigins` entry. * @default [[0, 0, 0]] */ fromOrigins: Base.Point3[]; /** * One direction per shape that is carried onto the matching `toDirections` entry. * @default [[0, 0, 1]] */ fromDirections: Base.Vector3[]; /** * One point per shape for its `fromOrigins` entry to land on. * @default [[0, 1, 0]] */ toOrigins: Base.Point3[]; /** * One direction per shape for its `fromDirections` entry to land on. * @default [[0, 1, 0]] */ toDirections: Base.Vector3[]; } /** * A shape and an axis for `transforms.mirror`, which mirrors the shape across the line through * `origin` along `direction`. */ class MirrorDto { constructor(shape?: T, origin?: Base.Point3, direction?: Base.Vector3); /** * The shape to mirror; it stays as it is and a mirrored copy comes back. * @default undefined */ shape: T; /** * A point on the mirror axis. * @default [0, 0, 0] */ origin: Base.Point3; /** * The direction of the mirror axis. * @default [0, 0, 1] */ direction: Base.Vector3; } /** * Shapes and one mirror axis each for `transforms.mirrorShapes`; all the lists must have the same * length. */ class MirrorShapesDto { constructor(shapes?: T[], origins?: Base.Point3[], directions?: Base.Vector3[]); /** * The shapes to mirror; they stay as they are and mirrored copies come back in the same order. * @default undefined */ shapes: T[]; /** * One point per shape on its mirror axis. * @default [[0, 0, 0]] */ origins: Base.Point3[]; /** * One mirror axis direction per shape. * @default [[0, 0, 1]] */ directions: Base.Vector3[]; } /** * A shape and a plane for `transforms.mirrorAlongNormal`, which mirrors the shape across the plane * through `origin` with the given normal. */ class MirrorAlongNormalDto { constructor(shape?: T, origin?: Base.Point3, normal?: Base.Vector3); /** * The shape to mirror; it stays as it is and a mirrored copy comes back. * @default undefined */ shape: T; /** * A point on the mirror plane. * @default [0, 0, 0] */ origin: Base.Point3; /** * The normal of the mirror plane. * @default [0, 0, 1] */ normal: Base.Vector3; } /** * Shapes and one mirror plane each for `transforms.mirrorAlongNormalShapes`; all the lists must * have the same length. */ class MirrorAlongNormalShapesDto { constructor(shapes?: T[], origins?: Base.Point3[], normals?: Base.Vector3[]); /** * The shapes to mirror; they stay as they are and mirrored copies come back in the same order. * @default undefined */ shapes: T[]; /** * One point per shape on its mirror plane. * @default [[0, 0, 0]] */ origins: Base.Point3[]; /** * One mirror plane normal per shape. * @default [[0, 0, 1]] */ normals: Base.Vector3[]; } /** * A shape, a direction for its Y axis and a point to move it to, for * `transforms.alignAndTranslate`. */ class AlignAndTranslateDto { constructor(shape?: T, direction?: Base.Vector3, center?: Base.Vector3); /** * The shape to place. * @default undefined */ shape: T; /** * The direction the shape's Y axis should point along after placing. * @default [0, 1, 0] */ direction: Base.Vector3; /** * The point the shape's origin is moved to, in model units. */ center: Base.Vector3; } /** * A shape and what to merge for `shapes.shape.unifySameDomain`, which joins faces and edges that * lie on one surface or curve, as booleans leave behind. */ class UnifySameDomainDto { constructor(shape?: T, unifyEdges?: boolean, unifyFaces?: boolean, concatBSplines?: boolean); /** * The shape to clean up. * @default undefined */ shape: T; /** * When true, edges that continue each other on one curve are merged into one. * @default true */ unifyEdges: boolean; /** * When true, faces that lie on one surface are merged into one. * @default true */ unifyFaces: boolean; /** * When true, neighboring B-spline edges are joined into a single B-spline where possible. * @default true */ concatBSplines: boolean; } /** * Faces, points and which groups to keep for `shapes.face.filterFacesPoints`, which sorts each * point as inside, on the boundary of or outside each face. */ class FilterFacesPointsDto { constructor(shapes?: T[], points?: Base.Point3[], tolerance?: number, useBndBox?: boolean, gapTolerance?: number, keepIn?: boolean, keepOn?: boolean, keepOut?: boolean, keepUnknown?: boolean, flatPointsArray?: boolean); /** * The faces to test the points against. * @default undefined */ shapes: T[]; /** * The points to sort. * @default undefined */ points: Base.Point3[]; /** * How close to a boundary a point may be to count as on it, in model units. * @default 1.0e-4 * @minimum 0 * @maximum Infinity * @step 0.000001 */ tolerance: number; /** * When true, a point outside the face's bounding box, grown by `gapTolerance`, counts as * outside without the exact test; a quick reject for many points far from the face. * @default false */ useBndBox: boolean; /** * How far beyond the bounding box a point may lie and still get the exact test when * `useBndBox` is on, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ gapTolerance: number; /** * When true, points inside a face are kept. * @default true */ keepIn: boolean; /** * When true, points on the boundary of a face are kept. * @default true */ keepOn: boolean; /** * When true, points outside a face are kept. * @default false */ keepOut: boolean; /** * When true, points the kernel cannot place inside, on or outside a face are kept. * @default false */ keepUnknown: boolean; /** * When true, the kept points of all faces come back in one list; when false, one list per face * in the order given. * @default true */ flatPointsArray: boolean; } /** * A face, points and which groups to keep for `shapes.face.filterFacePoints`, which sorts each * point as inside, on the boundary of or outside the face. */ class FilterFacePointsDto { constructor(shape?: T, points?: Base.Point3[], tolerance?: number, useBndBox?: boolean, gapTolerance?: number, keepIn?: boolean, keepOn?: boolean, keepOut?: boolean, keepUnknown?: boolean); /** * The face to test the points against. * @default undefined */ shape: T; /** * The points to sort. * @default undefined */ points: Base.Point3[]; /** * How close to the boundary a point may be to count as on it, in model units. * @default 1.0e-4 * @minimum 0 * @maximum Infinity * @step 0.000001 */ tolerance: number; /** * When true, a point outside the face's bounding box, grown by `gapTolerance`, counts as * outside without the exact test; a quick reject for many points far from the face. * @default false */ useBndBox: boolean; /** * How far beyond the bounding box a point may lie and still get the exact test when * `useBndBox` is on, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ gapTolerance: number; /** * When true, points inside the face are kept. * @default true */ keepIn: boolean; /** * When true, points on the boundary of the face are kept. * @default true */ keepOn: boolean; /** * When true, points outside the face are kept. * @default false */ keepOut: boolean; /** * When true, points the kernel cannot place inside, on or outside the face are kept. * @default false */ keepUnknown: boolean; } /** * A solid, points and which groups to keep for `shapes.solid.filterSolidPoints`, which sorts each * point as inside the solid, on its surface, outside it or unknown. */ class FilterSolidPointsDto { constructor(shape?: T, points?: Base.Point3[], tolerance?: number, keepIn?: boolean, keepOn?: boolean, keepOut?: boolean, keepUnknown?: boolean); /** * The solid to test the points against. * @default undefined */ shape: T; /** * The points to sort. * @default undefined */ points: Base.Point3[]; /** * How close to the surface a point may be to count as on it, in model units. * @default 1.0e-4 * @minimum 0 * @maximum Infinity * @step 0.000001 */ tolerance: number; /** * When true, points inside the solid are kept. * @default true */ keepIn: boolean; /** * When true, points on the surface of the solid are kept. * @default true */ keepOn: boolean; /** * When true, points outside the solid are kept. * @default false */ keepOut: boolean; /** * When true, points the kernel could not classify are kept. * @default false */ keepUnknown: boolean; } /** * Shapes and one direction and point each for `transforms.alignAndTranslateShapes`; all the lists * must have the same length. */ class AlignAndTranslateShapesDto { constructor(shapes?: T[], directions?: Base.Vector3[], centers?: Base.Vector3[]); /** * The shapes to place. * @default undefined */ shapes: T[]; /** * One direction per shape for its Y axis to point along. * @default [[0, 1, 0]] */ directions: Base.Vector3[]; /** * One point per shape for its origin to move to, in model units. */ centers: Base.Vector3[]; } /** * A shape, an axis through the origin and an angle for `transforms.rotate`. */ class RotateDto { constructor(shape?: T, axis?: Base.Vector3, angle?: number); /** * The shape to rotate; it stays as it is and a rotated copy comes back. * @default undefined */ shape: T; /** * The direction of the rotation axis, which passes through the origin. * @default [0, 0, 1] */ axis: Base.Vector3; /** * The rotation in degrees, following the right-hand rule about the axis. * @default 0 * @minimum 0 * @maximum 360 * @step 1 */ angle: number; } /** * A shape, an angle, a center and an axis for `transforms.rotateAroundCenter`, which rotates about * the axis through the center. */ class RotateAroundCenterDto { constructor(shape?: T, angle?: number, center?: Base.Point3, axis?: Base.Vector3); /** * The shape to rotate; it stays as it is and a rotated copy comes back. * @default undefined */ shape: T; /** * The rotation in degrees, following the right-hand rule about the axis. * @default 0 */ angle: number; /** * The point the rotation axis passes through. * @default [0, 0, 0] */ center: Base.Point3; /** * The direction of the rotation axis. * @default [0, 0, 1] */ axis: Base.Vector3; } /** * Shapes and one axis and angle each for `transforms.rotateShapes`; all the lists must have the * same length. */ class RotateShapesDto { constructor(shapes?: T[], axes?: Base.Vector3[], angles?: number[]); /** * The shapes to rotate; they stay as they are and rotated copies come back in the same order. * @default undefined */ shapes: T[]; /** * One rotation axis direction per shape, each through the origin. * @default [[0, 0, 1]] */ axes: Base.Vector3[]; /** * One rotation angle per shape, in degrees. * @default [0] */ angles: number[]; } /** * Shapes and one angle, center and axis each for `transforms.rotateAroundCenterShapes`; all the * lists must have the same length. */ class RotateAroundCenterShapesDto { constructor(shapes?: T[], angles?: number[], centers?: Base.Point3[], axes?: Base.Vector3[]); /** * The shapes to rotate; they stay as they are and rotated copies come back in the same order. * @default undefined */ shapes: T[]; /** * One rotation angle per shape, in degrees. * @default [0] */ angles: number[]; /** * One point per shape for its rotation axis to pass through. * @default [[0, 0, 0]] */ centers: Base.Point3[]; /** * One rotation axis direction per shape. * @default [[0, 0, 1]] */ axes: Base.Vector3[]; } /** * A shape and a factor for `transforms.scale`, which scales uniformly about the origin. */ class ScaleDto { constructor(shape?: T, factor?: number); /** * The shape to scale; it stays as it is and a scaled copy comes back. * @default undefined */ shape: T; /** * The uniform scale factor; 2 doubles every size, 0.5 halves it. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ factor: number; } /** * Shapes and one factor each for `transforms.scaleShapes`; the two lists must have the same length. */ class ScaleShapesDto { constructor(shapes?: T[], factors?: number[]); /** * The shapes to scale; they stay as they are and scaled copies come back in the same order. * @default undefined */ shapes: T[]; /** * One uniform scale factor per shape, about the origin. * @default [1] */ factors: number[]; } /** * A shape, three factors and a center for `transforms.scale3d`, which scales each axis on its own * about the center. */ class Scale3DDto { constructor(shape?: T, scale?: Base.Vector3, center?: Base.Point3); /** * The shape to scale. * @default undefined */ shape: T; /** * The factors along X, Y and Z; unequal factors stretch the shape. * @default [1, 1, 1] */ scale: Base.Vector3; /** * The point that stays in place while everything else scales away from or toward it. * @default [0, 0, 0] */ center: Base.Point3; } /** * Shapes and one factor triple and center each for `transforms.scale3dShapes`; all the lists must * have the same length. */ class Scale3DShapesDto { constructor(shapes?: T[], scales?: Base.Vector3[], centers?: Base.Point3[]); /** * The shapes to scale. * @default undefined */ shapes: T[]; /** * One set of X, Y and Z factors per shape. * @default [[1, 1, 1]] */ scales: Base.Vector3[]; /** * One point per shape that stays in place while it scales. * @default [[0, 0, 0]] */ centers: Base.Point3[]; } /** * A shape and a matrix, or a list of matrices, for `transforms.transformByMatrix`. */ class TransformByMatrixDto { constructor(shape?: T, transformation?: Base.TransformMatrix | Base.TransformMatrixes); /** * The shape to transform; it stays as it is and a transformed copy comes back. * @default undefined */ shape: T; /** * A 4x4 column-major matrix of 16 numbers, or a list of them applied first to last as one * combined move. * @default undefined */ transformation: Base.TransformMatrix | Base.TransformMatrixes; } /** * Shapes and one matrix, or list of matrices, applied to all of them for * `transforms.transformShapesByMatrix`. */ class TransformShapesByMatrixDto { constructor(shapes?: T[], transformation?: Base.TransformMatrix | Base.TransformMatrixes); /** * The shapes to transform, all with the same matrix. * @default undefined */ shapes: T[]; /** * A 4x4 column-major matrix of 16 numbers, or a list of them applied first to last as one * combined move. * @default undefined */ transformation: Base.TransformMatrix | Base.TransformMatrixes; } /** * A shape for `transforms.getShapeTransform`, which reads the placement the shape carries. */ class ShapeTransformQueryDto { constructor(shape?: T); /** * The shape whose placement is read. * @default undefined */ shape: T; } /** * A shape, a factor and a center for `transforms.scaleFromCenter`, which scales uniformly about the * center. */ class ScaleFromCenterDto { constructor(shape?: T, factor?: number, center?: Base.Point3); /** * The shape to scale; it stays as it is and a scaled copy comes back. * @default undefined */ shape: T; /** * The uniform scale factor; 2 doubles every size, 0.5 halves it. * @default 1 * @step 0.1 */ factor: number; /** * The point that stays in place while everything else scales away from or toward it. * @default [0, 0, 0] */ center: Base.Point3; } /** * A shape and a point for `transforms.mirrorAboutPoint`, which mirrors the shape through the point. */ class MirrorAboutPointDto { constructor(shape?: T, point?: Base.Point3); /** * The shape to mirror; it stays as it is and a mirrored copy comes back. * @default undefined */ shape: T; /** * The point every part of the shape is mirrored through. * @default [0, 0, 0] */ point: Base.Point3; } /** * A shape and a quaternion for `transforms.rotateByQuaternion`, which rotates the shape about the * origin. */ class RotateByQuaternionDto { constructor(shape?: T, quaternion?: [ number, number, number, number ]); /** * The shape to rotate; it stays as it is and a rotated copy comes back. * @default undefined */ shape: T; /** * The rotation as `[x, y, z, w]`; it is normalized before use, and `[0, 0, 0, 1]` is no * rotation. * @default [0, 0, 0, 1] */ quaternion: [ number, number, number, number ]; } /** * A translation, Euler rotation and uniform scale for `transforms.composeTransform`, combined into * one matrix as scale, then rotation, then translation. */ class ComposeTransformDto { constructor(translation?: Base.Vector3, rotation?: Base.Vector3, scale?: number); /** * The move as `[x, y, z]`, in model units, applied last. * @default [0, 0, 0] */ translation: Base.Vector3; /** * Euler angles `[rx, ry, rz]` in degrees about the X, Y and Z axes; the Z turn is applied * first, then Y, then X. * @default [0, 0, 0] */ rotation: Base.Vector3; /** * The uniform scale about the origin, applied first; 1 keeps the size. * @default 1 * @step 0.1 */ scale: number; } /** * A matrix, or a list of matrices, for `transforms.multiplyTransforms`, which folds them into one. */ class MultiplyTransformsDto { constructor(transformation?: Base.TransformMatrix | Base.TransformMatrixes); /** * A 4x4 column-major matrix, or a list of them applied first to last; an empty list gives the * identity. * @default undefined */ transformation: Base.TransformMatrix | Base.TransformMatrixes; } /** * A matrix for `transforms.invertTransform`, which builds the transform that undoes it. */ class InvertTransformDto { constructor(transformation?: Base.TransformMatrix); /** * The 4x4 column-major matrix of 16 numbers to invert. * @default undefined */ transformation: Base.TransformMatrix; } /** * A vector for `transforms.translationToMatrix`, which builds the matrix of that move. */ class TranslationToMatrixDto { constructor(translation?: Base.Vector3); /** * The move as `[x, y, z]`, in model units. * @default [0, 0, 0] */ translation: Base.Vector3; } /** * An axis, an angle and an optional center for `transforms.rotationAxisAngleToMatrix`. */ class RotationAxisAngleToMatrixDto { constructor(axis?: Base.Vector3, angle?: number, center?: Base.Point3); /** * The direction of the rotation axis. * @default [0, 0, 1] */ axis: Base.Vector3; /** * The rotation in degrees, following the right-hand rule about the axis. * @default 0 * @step 1 */ angle: number; /** * The point the axis passes through; the origin when left at its default. * @default [0, 0, 0] */ center: Base.Point3; } /** * A factor and an optional center for `transforms.scaleUniformToMatrix`. */ class ScaleUniformToMatrixDto { constructor(factor?: number, center?: Base.Point3); /** * The uniform scale factor; 2 doubles every size, 0.5 halves it. * @default 1 * @step 0.1 */ factor: number; /** * The point that stays in place while everything else scales; the origin when left at its * default. * @default [0, 0, 0] */ center: Base.Point3; } /** * A point for `transforms.mirrorPointToMatrix`, the matrix of a mirror through that point. */ class MirrorPointToMatrixDto { constructor(point?: Base.Point3); /** * The point every part of a shape is mirrored through. * @default [0, 0, 0] */ point: Base.Point3; } /** * An axis for `transforms.mirrorAxisToMatrix`, the matrix of a mirror across the line through * `origin` along `direction`. */ class MirrorAxisToMatrixDto { constructor(origin?: Base.Point3, direction?: Base.Vector3); /** * A point on the mirror axis. * @default [0, 0, 0] */ origin: Base.Point3; /** * The direction of the mirror axis; any length will do, but not a zero vector. * @default [1, 0, 0] */ direction: Base.Vector3; } /** * A plane for `transforms.mirrorPlaneToMatrix`, the matrix of a mirror across the plane through * `origin` with the given normal. */ class MirrorPlaneToMatrixDto { constructor(origin?: Base.Point3, normal?: Base.Vector3); /** * A point on the mirror plane. * @default [0, 0, 0] */ origin: Base.Point3; /** * The normal of the mirror plane; any length will do, but not a zero vector. * @default [0, 0, 1] */ normal: Base.Vector3; } /** * A quaternion for `transforms.quaternionToMatrix`, which builds the matrix of that rotation. */ class QuaternionToMatrixDto { constructor(quaternion?: [ number, number, number, number ]); /** * The rotation as `[x, y, z, w]`; it is normalized before use, and `[0, 0, 0, 1]` is no * rotation. * @default [0, 0, 0, 1] */ quaternion: [ number, number, number, number ]; } /** * Decomposed placement transform of a shape or label. * `matrix` is a flat 16-number 4x4 in column-major order. */ interface ShapeTransformInfo { matrix: Base.TransformMatrix; translation: Base.Point3; quaternion: [ number, number, number, number ]; scale: number; } /** * The kind of node in a boundary-representation graph. Walking a shape produces a graph of * vertices, edges, wires, faces, shells and solids, and this says which one a given node is - the * discriminator you switch on when traversing the result. */ enum brepGraphNodeKindEnum { solid = "solid", shell = "shell", face = "face", wire = "wire", edge = "edge", vertex = "vertex", compound = "compound", compsolid = "compsolid" } /** * A shape and a graph node, by kind and index, for `brepGraph.reconstruct`, which turns the node * back into a real sub-shape. */ class BRepGraphReconstructDto { constructor(shape?: T, kind?: brepGraphNodeKindEnum, index?: number); /** * The shape the graph was built from. * @default undefined */ shape: T; /** * What kind of part the node is: solid, shell, face, wire, edge, vertex, compound or compsolid. * @default solid */ kind: brepGraphNodeKindEnum; /** * The position of the node among the parts of its kind, counting from 0, as the graph queries * report it. * @default 0 * @step 1 */ index: number; } /** * A shape and one of its sub-shapes for `brepGraph.nodeOfShape`, which finds the graph node * standing for the sub-shape. */ class BRepGraphNodeOfShapeDto { constructor(shape?: T, subShape?: T); /** * The shape the graph was built from. * @default undefined */ shape: T; /** * The face, edge or other part of the shape to look up. * @default undefined */ subShape: T; } /** * A shell or solid, points near its corners and rounding settings for * `corners.filletCornerByPoint`, which rounds only the corners picked by the points. */ class FilletCornerByPointDto { constructor(shape?: T, points?: Base.Point3[], radius?: number, taperFactor?: number, snapTolerance?: number, mode?: cornerModeEnum); /** * The shell or solid whose corners are rounded. * @default undefined */ shape: T; /** * Points near the corners to round; the vertex nearest each point is the one treated. * @default [] */ points: Base.Point3[]; /** * The rounding radius, in model units. * @default 1 * @step 0.1 */ radius: number; /** * For 3D corners, how far the rounding reaches along the meeting edges: 0 for the tightest, * almost spherical corner, 1 for the full reach. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ taperFactor: number; /** * How far a point may be from a vertex and still pick it, in model units; 0 or less accepts the * nearest vertex whatever the distance. * @default 0 * @step 0.1 */ snapTolerance: number; /** * `auto` rounds planar corners in place and 3D corners with a taper; `planarOnly` skips 3D * corners. * @default auto */ mode: cornerModeEnum; } /** * A shell or solid, points near its corners and bevel settings for `corners.chamferCornerByPoint`, * which bevels only the corners picked by the points. */ class ChamferCornerByPointDto { constructor(shape?: T, points?: Base.Point3[], distance?: number, angle?: number, snapTolerance?: number, mode?: cornerModeEnum); /** * The shell or solid whose corners are beveled. * @default undefined */ shape: T; /** * Points near the corners to bevel; the vertex nearest each point is the one treated. * @default [] */ points: Base.Point3[]; /** * How far the bevel reaches back from the corner along its edges, in model units. * @default 1 * @step 0.1 */ distance: number; /** * The slope of the bevel in degrees, used for planar corners. * @default 45 * @step 1 */ angle: number; /** * How far a point may be from a vertex and still pick it, in model units; 0 or less accepts the * nearest vertex whatever the distance. * @default 0 * @step 0.1 */ snapTolerance: number; /** * `auto` bevels planar corners in place and 3D corners with a local plane cut; `planarOnly` * skips 3D corners. * @default auto */ mode: cornerModeEnum; } /** * A shell or solid and points near its corners for `corners.classifyCornerByPoint`, which reports * what kind of corner each point picks. */ class ClassifyCornerByPointDto { constructor(shape?: T, points?: Base.Point3[], snapTolerance?: number); /** * The shell or solid whose corners are looked up. * @default undefined */ shape: T; /** * Points near the corners to classify; the vertex nearest each point is the one reported. * @default [] */ points: Base.Point3[]; /** * How far a point may be from a vertex and still pick it, in model units; 0 or less accepts the * nearest vertex whatever the distance. * @default 0 * @step 0.1 */ snapTolerance: number; } /** * A flat wire or face, a distance, an angle and optional corner indexes for * `fillets.chamfer2dVertices`, which bevels the corners. */ class Chamfer2dVertexDto { constructor(shape?: T, distance?: number, angle?: number, indexes?: number[]); /** * The flat wire or face whose corners are beveled. * @default undefined */ shape: T; /** * How far the bevel cuts back from each corner along one edge, in model units. * @default 1 * @step 0.1 */ distance: number; /** * The angle of the bevel to that edge, in degrees; 45 gives an even chamfer. * @default 45 * @step 1 */ angle: number; /** * Which corners to bevel, counted from 1 along the outline; leave it out to bevel them all. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, the faces to tilt and the draft settings for `draft.draftAngle`, which tapers the faces * about a neutral plane. */ class DraftAngleDto { constructor(shape?: T, faces?: U[], direction?: Base.Vector3, angle?: number, neutralPlaneOrigin?: Base.Point3, neutralPlaneDirection?: Base.Vector3, flag?: boolean); /** * The solid whose faces are tilted. * @default undefined */ shape: T; /** * The faces of the shape that get the taper. * @default undefined */ faces: U[]; /** * The pull direction, the way the part leaves the mold; the taper is measured against it. * @default [0, 1, 0] */ direction: Base.Vector3; /** * The draft angle, in degrees. * @default 5 * @step 1 */ angle: number; /** * A point on the neutral plane, the plane that stays where it is while the faces pivot about * it. * @default [0, 0, 0] */ neutralPlaneOrigin: Base.Point3; /** * The normal of the neutral plane. * @default [0, 0, 1] */ neutralPlaneDirection: Base.Vector3; /** * When true, the faces taper on the standard side; false tapers them the other way. * @default true */ flag: boolean; } /** * A wire or shape, a direction, an angle and a length for `draft.makeDraft`, which grows a tapered * skirt from the edges. */ class MakeDraftDto { constructor(shape?: T, direction?: Base.Vector3, angle?: number, lengthMax?: number, internal?: boolean); /** * The wire, face or shape whose edges the skirt grows from. * @default undefined */ shape: T; /** * The direction the skirt grows along, the pull direction of the mold. * @default [0, 1, 0] */ direction: Base.Vector3; /** * How far the skirt leans from the direction, in degrees. * @default 5 * @step 1 */ angle: number; /** * How long the skirt may grow, in model units, measured along the corner edges between its * faces. * @default 10 * @step 0.1 */ lengthMax: number; /** * When true, the skirt leans inward instead of outward. * @default false */ internal: boolean; } /** * A wire or shape, a direction, an angle and a stop shape for `draft.makeDraftToShape`, which grows * a tapered skirt from the edges until it meets the stop shape. */ class MakeDraftToShapeDto { constructor(shape?: T, direction?: Base.Vector3, angle?: number, stopShape?: T, keepOut?: boolean, internal?: boolean); /** * The wire, face or shape whose edges the skirt grows from. * @default undefined */ shape: T; /** * The direction the skirt grows along, the pull direction of the mold. * @default [0, 1, 0] */ direction: Base.Vector3; /** * How far the skirt leans from the direction, in degrees. * @default 5 * @step 1 */ angle: number; /** * The shape the skirt grows up to and stops at. * @default undefined */ stopShape: T; /** * When true, the part of the stop shape outside the skirt is kept in the result. * @default false */ keepOut: boolean; /** * When true, the skirt leans inward instead of outward. * @default false */ internal: boolean; } /** * A shape and meshing settings for `shapeToMesh`, which triangulates the shape for drawing. */ class ShapeToMeshDto { constructor(shape?: T, precision?: number, adjustYtoZ?: boolean, computeMetadata?: boolean, keepMeshData?: boolean, allowQualityDecrease?: boolean, forceFaceDeflection?: boolean); /** * The shape to triangulate. * @default undefined */ shape: T; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * with more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.001 */ precision: number; /** * When true, the mesh is turned so this library's Y-up becomes Z-up, for tools that treat Z as * up. * @default false */ adjustYtoZ: boolean; /** * When true, each face and edge entry also carries its area or length, center of mass, surface * or curve type, tolerance and neighbors, at extra cost. * @default false */ computeMetadata?: boolean | undefined; /** * When true, the triangulation stays cached on the shape; when false it is cleared afterwards * so memory does not grow across calls. * @default false */ keepMeshData?: boolean | undefined; /** * When true, a shape already meshed more finely may be remeshed at the coarser precision asked * for. * @default true */ allowQualityDecrease?: boolean | undefined; /** * When true, every face is remeshed at the requested precision even when a triangulation is * cached. * @default false */ forceFaceDeflection?: boolean | undefined; } /** * A shape and meshing settings for `shapeFacesToPolygonPoints`, which returns every triangle of the * shape as three points. */ class ShapeFacesToPolygonPointsDto { constructor(shape?: T, precision?: number, adjustYtoZ?: boolean, reversedPoints?: boolean); /** * The shape to triangulate. * @default undefined */ shape: T; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * with more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.001 */ precision: number; /** * When true, the points are turned so this library's Y-up becomes Z-up, for tools that treat Z * as up. * @default false */ adjustYtoZ: boolean; /** * When true, the three points of each triangle come in the opposite order, for tools that wind * triangles the other way. * @default false */ reversedPoints: boolean; } /** * Shapes and meshing settings for `shapesToMeshes`, which triangulates each shape with the same * settings. */ class ShapesToMeshesDto { constructor(shapes?: T[], precision?: number, adjustYtoZ?: boolean, computeMetadata?: boolean, keepMeshData?: boolean, allowQualityDecrease?: boolean, forceFaceDeflection?: boolean); /** * The shapes to triangulate, one mesh per shape. * @default undefined */ shapes: T[]; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * with more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.001 */ precision: number; /** * When true, the meshes are turned so this library's Y-up becomes Z-up, for tools that treat Z * as up. * @default false */ adjustYtoZ: boolean; /** * When true, each face and edge entry also carries its area or length, center of mass, surface * or curve type, tolerance and neighbors, at extra cost. * @default false */ computeMetadata?: boolean | undefined; /** * When true, the triangulation stays cached on each shape; when false it is cleared afterwards * so memory does not grow across calls. * @default false */ keepMeshData?: boolean | undefined; /** * When true, a shape already meshed more finely may be remeshed at the coarser precision asked * for. * @default true */ allowQualityDecrease?: boolean | undefined; /** * When true, every face is remeshed at the requested precision even when a triangulation is * cached. * @default false */ forceFaceDeflection?: boolean | undefined; } /** * An assembly document and meshing settings for `docToMesh`, which triangulates its top-level * shapes into one mesh with the document's colors. */ class DocToMeshDto { constructor(document?: U, precision?: number, adjustYtoZ?: boolean, computeMetadata?: boolean, keepMeshData?: boolean, allowQualityDecrease?: boolean, forceFaceDeflection?: boolean); /** * The assembly document whose top-level shapes are meshed together; their face colors end up in * the mesh's color groups. * @default undefined */ document: U; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * with more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.001 */ precision: number; /** * When true, the mesh is turned so this library's Y-up becomes Z-up, for tools that treat Z as * up. * @default false */ adjustYtoZ: boolean; /** * When true, each face and edge entry also carries its area or length, center of mass, surface * or curve type, tolerance, neighbors and ids, at extra cost. * @default false */ computeMetadata?: boolean | undefined; /** * When true, the triangulation stays cached on the shapes; when false it is cleared afterwards * so memory does not grow across calls. * @default false */ keepMeshData?: boolean | undefined; /** * When true, a shape already meshed more finely may be remeshed at the coarser precision asked * for. * @default true */ allowQualityDecrease?: boolean | undefined; /** * When true, every face is remeshed at the requested precision even when a triangulation is * cached. * @default false */ forceFaceDeflection?: boolean | undefined; } /** * An assembly document and meshing settings for `docToMeshes`, which triangulates each top-level * shape into its own mesh with the document's colors. */ class DocToMeshesDto { constructor(document?: U, precision?: number, adjustYtoZ?: boolean, computeMetadata?: boolean, keepMeshData?: boolean, allowQualityDecrease?: boolean, forceFaceDeflection?: boolean); /** * The assembly document whose top-level shapes are meshed one by one; each shape's face colors * end up in its mesh's color groups. * @default undefined */ document: U; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * with more triangles. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.001 */ precision: number; /** * When true, the meshes are turned so this library's Y-up becomes Z-up, for tools that treat Z * as up. * @default false */ adjustYtoZ: boolean; /** * When true, each face and edge entry also carries its area or length, center of mass, surface * or curve type, tolerance, neighbors and ids, at extra cost. * @default false */ computeMetadata?: boolean | undefined; /** * When true, the triangulation stays cached on the shapes; when false it is cleared afterwards * so memory does not grow across calls. * @default false */ keepMeshData?: boolean | undefined; /** * When true, a shape already meshed more finely may be remeshed at the coarser precision asked * for. * @default true */ allowQualityDecrease?: boolean | undefined; /** * When true, every face is remeshed at the requested precision even when a triangulation is * cached. * @default false */ forceFaceDeflection?: boolean | undefined; } /** * A shape, a file name and axis options for `io.saveShapeSTEP`, which writes the shape as a STEP * file. */ class SaveStepDto { constructor(shape?: T, fileName?: string, adjustYtoZ?: boolean, tryDownload?: boolean); /** * The shape written to the file. * @default undefined */ shape: T; /** * The name the downloaded file gets; `.step` is appended when missing. * @default shape.step */ fileName: string; /** * When true, the shape is turned so this library's Y-up becomes STEP's Z-up. * @default false */ adjustYtoZ: boolean; /** * When true, the axis swap skips its mirror step, for shapes that were built in a right-handed * system. * @default false */ fromRightHanded?: boolean | undefined; /** * When true, a browser download of the file is started where that is possible; the kernel * itself only returns the text. * @default true */ tryDownload?: boolean | undefined; } /** * A shape, a file name and meshing options for `io.saveShapeStl`, which triangulates the shape and * writes it as an STL file. */ class SaveStlDto { constructor(shape?: T, fileName?: string, precision?: number, adjustYtoZ?: boolean, tryDownload?: boolean, binary?: boolean); /** * The shape written to the file. * @default undefined */ shape: T; /** * The name the downloaded file gets. * @default shape.stl */ fileName: string; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * and makes a bigger file. * @default 0.01 */ precision: number; /** * When true, the shape is turned so this library's Y-up becomes Z-up. * @default false */ adjustYtoZ: boolean; /** * When true, a browser download of the file is started where that is possible; the kernel * itself only returns the text. * @default true */ tryDownload?: boolean | undefined; /** * When true, the STL is written in its binary form, which is much smaller than the text form. * @default true */ binary?: boolean | undefined; } /** * A shape and deflection settings for `io.shapeToDxfPaths`, which traces the shape's wires into DXF * path records. */ class ShapeToDxfPathsDto { constructor(shape?: T, angularDeflection?: number, curvatureDeflection?: number, minimumOfPoints?: number, uTolerance?: number, minimumLength?: number); /** * The shape whose wires are traced; it must lie flat on the XZ ground plane. * @default undefined */ shape: T; /** * The largest angle, in radians, the traced polyline may turn between two points; smaller * follows curves more closely. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ angularDeflection: number; /** * The largest distance, in model units, the traced polyline may stray from the curve; smaller * follows it more closely. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.001 */ curvatureDeflection: number; /** * The fewest points any edge is traced with, however straight. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ minimumOfPoints: number; /** * How close two parameter values must be to count as the same point. * @default 1.0e-9 * @minimum 0 * @maximum Infinity * @step 1.0e-9 */ uTolerance: number; /** * Edges shorter than this, in model units, are traced with the minimum number of points. * @default 1.0e-7 * @minimum 0 * @maximum Infinity * @step 1.0e-7 */ minimumLength: number; } /** * DXF paths, a layer and a color for `io.dxfPathsWithLayer`, which makes them one part of a DXF * drawing. */ class DxfPathsWithLayerDto { constructor(paths?: IO.DxfPathDto[], layer?: string, color?: Base.Color); /** * The paths from `io.shapeToDxfPaths`. * @default undefined */ paths: IO.DxfPathDto[]; /** * The name of the DXF layer the paths go on. * @default Default */ layer: string; /** * The color of the paths as a hex string such as `#000000`. * @default #000000 */ color: Base.Color; } /** * Layered DXF parts and file options for `io.dxfCreate`, which writes them into one DXF file. */ class DxfPathsPartsListDto { constructor(pathsParts?: IO.DxfPathsPartDto[], colorFormat?: dxfColorFormatEnum, acadVersion?: dxfAcadVersionEnum, tryDownload?: boolean); /** * The parts from `io.dxfPathsWithLayer`, each with its own layer and color. * @default undefined */ pathsParts: IO.DxfPathsPartDto[]; /** * How colors are written: `aci` as AutoCAD's indexed colors, `truecolor` as RGB. * @default aci */ colorFormat: dxfColorFormatEnum; /** * The DXF version to write: `AC1009` is R12, the most widely readable, `AC1015` is 2000. * @default AC1009 */ acadVersion: dxfAcadVersionEnum; /** * The name the downloaded file gets. * @default bitbybit-dev.dxf */ fileName?: string | undefined; /** * When true, a browser download of the file is started where that is possible; the kernel * itself only returns the text. * @default true */ tryDownload?: boolean | undefined; } /** * STEP or IGES text and its kind for the core `occt.io.loadSTEPorIGESFromText`, which reads it into * a shape. */ class ImportStepIgesFromTextDto { constructor(text?: string, fileType?: fileTypeEnum, adjustZtoY?: boolean); /** * The full text of the STEP or IGES file. * @default undefined */ text: string; /** * Whether the text is STEP or IGES. */ fileType: fileTypeEnum; /** * When true, the shape is turned so the file's Z-up becomes this library's Y-up. * @default true */ adjustZtoY: boolean; } /** * A STEP or IGES file for the core `occt.io.loadSTEPorIGES`, which reads it into a shape. */ class ImportStepIgesDto { constructor(assetFile?: File, adjustZtoY?: boolean); /** * The file to read; its extension decides whether it is STEP or IGES. * @default undefined */ assetFile: File; /** * When true, the shape is turned so the file's Z-up becomes this library's Y-up. * @default true */ adjustZtoY: boolean; } /** * File content, a file name and an axis option for `io.loadSTEPorIGES`, which reads STEP or IGES * into a shape. */ class LoadStepOrIgesDto { constructor(filetext?: string | ArrayBuffer, fileName?: string, adjustZtoY?: boolean); /** * The file's text for `.step`, `.stp`, `.iges` and `.igs`, or an ArrayBuffer for the compressed * `.stpz` and `.igz` forms. * @default undefined */ filetext: string | ArrayBuffer; /** * The file name; its extension decides whether it is read as STEP or IGES and whether it is * compressed. * @default shape.step */ fileName: string; /** * When true, the shape is turned so the file's Z-up becomes this library's Y-up. * @default true */ adjustZtoY: boolean; } /** * A STEP file for `io.parseStepToJson`, which reads its assembly structure without building * geometry. */ class ParseStepAssemblyToJsonDto { constructor(stepData?: string | ArrayBuffer | Uint8Array | File | Blob); /** * The STEP file as text, ArrayBuffer, Uint8Array, File or Blob; gzip-compressed `.stpz` content * is unpacked on its own. * @default undefined */ stepData: string | ArrayBuffer | Uint8Array | File | Blob; } /** * A STEP file and meshing settings for `io.convertStepToGltf`, which converts it into a binary * glTF. */ class ConvertStepToGltfDto { constructor(stepData?: string | ArrayBuffer | Uint8Array | File | Blob); /** * The STEP file as text, ArrayBuffer, Uint8Array, File or Blob; gzip-compressed `.stpz` content * is unpacked on its own. * @default undefined */ stepData: string | ArrayBuffer | Uint8Array | File | Blob; /** * How closely triangles follow curved surfaces: with `meshRelative` true a fraction of each * edge's length, otherwise an absolute distance in model units. * @default 0.005 * @minimum 0.0001 * @maximum 10 * @step 0.001 */ meshPrecision: number; /** * The largest angle, in radians, between the normals of neighboring triangles; smaller gives * smoother curves and more triangles. * @default 0.5 * @minimum 0.01 * @maximum 3.14159 * @step 0.05 */ meshAngle: number; /** * When true, `meshPrecision` scales with each part's size, so small fasteners and large * housings both mesh well; when false it is an absolute distance. * @default true */ meshRelative: boolean; /** * When true, extra vertices are added inside curved faces for a closer fit, at the cost of * speed. * @default false */ internalVerticesMode: boolean; /** * When true, an extra pass refines triangles that bulge beyond the precision, at the cost of * speed. * @default false */ controlSurfaceDeflection: boolean; } /** * A STEP file, meshing settings and Draco settings for `io.convertStepToGltfWithDraco`, which * converts it into a Draco-compressed binary glTF. */ class ConvertStepToGltfWithDracoDto extends ConvertStepToGltfDto { constructor(stepData?: string | ArrayBuffer | Uint8Array | File | Blob); /** * When true, the geometry is compressed with Draco. * @default true */ useDraco: boolean; /** * How hard Draco compresses, from 0 for fastest and largest to 10 for slowest and smallest. * @default 7 * @minimum 0 * @maximum 10 * @step 1 */ dracoCompressionLevel: number; /** * How many bits each vertex position keeps; fewer bits mean a smaller file and less precision. * @default 14 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizePositionBits: number; /** * How many bits each normal keeps; fewer bits mean a smaller file and less precision. * @default 10 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeNormalBits: number; /** * How many bits each texture coordinate keeps; fewer bits mean a smaller file and less * precision. * @default 12 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeTexcoordBits: number; /** * How many bits each vertex color keeps; fewer bits mean a smaller file and less precision. * @default 8 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeColorBits: number; /** * How many bits other vertex attributes keep; fewer bits mean a smaller file and less * precision. * @default 12 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeGenericBits: number; /** * When true, one quantization grid is used for every attribute instead of one per attribute. * @default false */ dracoUnifiedQuantization: boolean; } /** * glTF node/mesh naming format options. * Controls how node and mesh names are generated in the output glTF. */ enum gltfNameFormatEnum { /** Omit the name */ empty = "empty", /** Use product name (shared by multiple instances) */ product = "product", /** Use instance name */ instance = "instance", /** Use instance name, fall back to product name */ instanceOrProduct = "instanceOrProduct", /** Use product name, fall back to instance name */ productOrInstance = "productOrInstance", /** Use both product and instance names "Product [Instance]" */ productAndInstance = "productAndInstance", /** Verbose naming combining Product+Instance+OCAF (for debugging) */ productAndInstanceAndOcaf = "productAndInstanceAndOcaf" } /** * glTF transformation format options. * Controls how node transformations are encoded in the output glTF. */ enum gltfTransformFormatEnum { /** Compact format - uses TRS when possible, Mat4 otherwise */ compact = "compact", /** Always use 4x4 matrix format */ mat4 = "mat4", /** Always use Translation-Rotation-Scale format */ trs = "trs" } /** * A STEP file with every reading, meshing and writing option for `io.convertStepToGltfAdvanced`; * switch off what is not needed for a faster conversion. */ class ConvertStepToGltfAdvancedDto { constructor(stepData?: string | ArrayBuffer | Uint8Array | File | Blob); /** * The STEP file as text, ArrayBuffer, Uint8Array, File or Blob; gzip-compressed `.stpz` content * is unpacked on its own. * @default undefined */ stepData: string | ArrayBuffer | Uint8Array | File | Blob; /** * When true, colors are read from the file; needed for a colored glTF. * @default true */ readColors: boolean; /** * When true, part names are read from the file; switch it off for faster parsing when names are * not needed. * @default true */ readNames: boolean; /** * When true, materials are read from the file; needed for material properties in the glTF. * @default true */ readMaterials: boolean; /** * When true, layer information is read from the file; rarely needed for glTF. * @default false */ readLayers: boolean; /** * When true, validation properties are read from the file; rarely needed for glTF. * @default false */ readProps: boolean; /** * How closely triangles follow curved surfaces: with `meshRelative` true a fraction of each * edge's length, otherwise an absolute distance in model units. * @default 0.005 * @minimum 0.0001 * @maximum 10 * @step 0.001 */ meshDeflection: number; /** * The largest angle, in radians, between the normals of neighboring triangles; smaller gives * smoother curves and more triangles. * @default 0.5 * @minimum 0.01 * @maximum 3.14159 * @step 0.1 */ meshAngle: number; /** * When true, faces are meshed on several threads where the build allows it. * @default true */ meshParallel: boolean; /** * Above this many faces the assembly is meshed solid by solid to save memory; -1 meshes * everything in one pass, which is fastest. * @default -1 * @minimum -1 * @maximum 500000 * @step 10000 */ faceCountThreshold: number; /** * When true, `meshDeflection` scales with each part's size, so small fasteners and large * housings both mesh well; when false it is an absolute distance. * @default true */ meshRelative: boolean; /** * When true, extra vertices are added inside curved faces for a closer fit, at the cost of * speed. * @default false */ internalVerticesMode: boolean; /** * When true, an extra pass refines triangles that bulge beyond the precision, at the cost of * speed. * @default false */ controlSurfaceDeflection: boolean; /** * When true, the faces of a part are joined into one mesh, which makes a smaller file. * @default true */ mergeFaces: boolean; /** * When true, merged meshes use 16-bit indexes where they fit, which makes a smaller file. * @default true */ splitIndices16: boolean; /** * When true, the glTF is written on several threads, which helps with large files. * @default true */ parallelWrite: boolean; /** * When true, textures are embedded in the GLB instead of referenced as separate files. * @default true */ embedTextures: boolean; /** * When true, texture coordinates are written even for meshes without textures. * @default false */ forceUVExport: boolean; /** * What the glTF nodes are named after: the instance, the product, a combination, or nothing. * @default instance */ nodeNameFormat: gltfNameFormatEnum; /** * What the glTF meshes are named after: the instance, the product, a combination, or nothing. * @default instance */ meshNameFormat: gltfNameFormatEnum; /** * How node placements are written: `compact` as translation, rotation and scale where possible, * `mat4` always as a matrix, `trs` always as the three parts. * @default compact */ transformFormat: gltfTransformFormatEnum; /** * When true, the file's Z-up is turned into glTF's Y-up; false keeps Z up. * @default true */ adjustZtoY: boolean; /** * A factor applied to the whole model, such as 0.001 to turn millimeters into meters; 1 keeps * the size. * @default 1.0 * @minimum 0.000001 * @maximum 1000000 * @step 0.001 */ scale: number; } /** * A STEP file with every reading, meshing and writing option plus Draco settings for * `io.convertStepToGltfAdvancedWithDraco`. */ class ConvertStepToGltfAdvancedWithDracoDto extends ConvertStepToGltfAdvancedDto { constructor(stepData?: string | ArrayBuffer | Uint8Array | File | Blob); /** * When true, the geometry is compressed with Draco. * @default true */ useDraco: boolean; /** * How hard Draco compresses, from 0 for fastest and largest to 10 for slowest and smallest. * @default 7 * @minimum 0 * @maximum 10 * @step 1 */ dracoCompressionLevel: number; /** * How many bits each vertex position keeps; fewer bits mean a smaller file and less precision. * @default 14 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizePositionBits: number; /** * How many bits each normal keeps; fewer bits mean a smaller file and less precision. * @default 10 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeNormalBits: number; /** * How many bits each texture coordinate keeps; fewer bits mean a smaller file and less * precision. * @default 12 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeTexcoordBits: number; /** * How many bits each vertex color keeps; fewer bits mean a smaller file and less precision. * @default 8 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeColorBits: number; /** * How many bits other vertex attributes keep; fewer bits mean a smaller file and less * precision. * @default 12 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeGenericBits: number; /** * When true, one quantization grid is used for every attribute instead of one per attribute. * @default false */ dracoUnifiedQuantization: boolean; } /** * A structure, an optional document to update and optional source documents for * `assembly.manager.buildAssemblyDocument`. * @typeParam T - Shape type (TopoDS_Shape or pointer) * @typeParam D - Document type (Handle_TDocStd_Document or pointer) */ class BuildAssemblyDocumentDto { constructor(structure?: Models.OCCT.AssemblyStructureDef, existingDocument?: D, sourceDocuments?: D[]); /** * The parts, nodes and updates to build, from `combineStructure`. * @default undefined */ structure: Models.OCCT.AssemblyStructureDef; /** * A document to update in place instead of creating a new one; its removals and part updates * are applied first, then the new parts and nodes added. * @default undefined * @optional true */ existingDocument?: D | undefined; /** * The documents imported parts copy from, indexed by `sourceDocumentIndex`; usually loaded with * `loadStepToDoc`, and left unchanged. * @default undefined * @optional true */ sourceDocuments?: D[] | undefined; } /** * A part definition for `assembly.manager.createPart`: a shape with an id that instance nodes * place, as many times as needed. */ class CreateAssemblyPartDto { constructor(id?: string, shape?: T, name?: string, colorRgba?: Base.ColorRGBA); /** * The id instance nodes refer to the part by; it must be unique among the parts. * @default undefined */ id: string; /** * The geometry of the part, shared by every instance of it. * @default undefined */ shape: T; /** * The name of the part, written into STEP files and shown by viewers. * @default undefined */ name: string; /** * The color of the part as `{ r, g, b, a }` with every channel from 0 to 1; leave it out for * the default gray. * @default {"r":0.5,"g":0.5,"b":0.5,"a":1} * @minimum 0 * @maximum 1 */ colorRgba?: Base.ColorRGBA | undefined; } /** * An assembly node definition for `assembly.manager.createAssemblyNode`: a container that groups * instances and other assemblies. */ class CreateAssemblyNodeDto { constructor(id?: string, name?: string, parentId?: string, colorRgba?: Base.ColorRGBA, matrix?: Base.TransformMatrix | Base.TransformMatrixes); /** * The id child nodes refer to this assembly by; it must be unique among the nodes. * @default undefined */ id: string; /** * The name of the assembly, written into STEP files and shown by viewers. * @default undefined */ name: string; /** * The id of the assembly this one sits in; leave it out for a root. * @default undefined * @optional true */ parentId?: string | undefined; /** * A color for the assembly as `{ r, g, b, a }` with every channel from 0 to 1. * @default {"r":0.5,"g":0.5,"b":0.5,"a":1} * @minimum 0 * @maximum 1 */ colorRgba?: Base.ColorRGBA | undefined; /** * A placement for the whole group as a column-major 4x4 matrix, or a list of them applied first * to last. * @default undefined * @optional true */ matrix?: Base.TransformMatrix | Base.TransformMatrixes | undefined; } /** * An instance node definition for `assembly.manager.createInstanceNode`: one placement of a part, * with a translation, rotation and scale or a matrix. */ class CreateInstanceNodeDto { constructor(id?: string, partId?: string, name?: string, parentId?: string, translation?: Base.Point3, rotation?: Base.Vector3, scale?: number, colorRgba?: Base.ColorRGBA, matrix?: Base.TransformMatrix | Base.TransformMatrixes); /** * The id of this placement; it must be unique among the nodes. * @default undefined */ id: string; /** * The id of the part, or imported part, being placed. * @default undefined */ partId: string; /** * The name of this placement, written into STEP files and shown by viewers. * @default undefined */ name: string; /** * The id of the assembly this placement sits in; leave it out for the root. * @default undefined * @optional true */ parentId?: string | undefined; /** * Where the part is moved to, as `[x, y, z]` in model units. * @default [0, 0, 0] */ translation?: Base.Point3 | undefined; /** * Euler angles `[rx, ry, rz]` in degrees about the X, Y and Z axes; the Z turn is applied * first, then Y, then X. * @default [0, 0, 0] */ rotation?: Base.Vector3 | undefined; /** * A uniform scale of the placed part; 1 keeps its size. * @default 1.0 */ scale?: number | undefined; /** * A color for this placement only, as `{ r, g, b, a }` from 0 to 1, overriding the part's * color. * @default undefined * @optional true */ colorRgba?: Base.ColorRGBA | undefined; /** * The placement as a column-major 4x4 matrix, or a list of them applied first to last; when * given, translation, rotation and scale are ignored. * @default undefined * @optional true */ matrix?: Base.TransformMatrix | Base.TransformMatrixes | undefined; } /** * A change to an existing part for `assembly.manager.createPartUpdate`: a new shape, name or color * for the part at a label. */ class CreatePartUpdateDto { constructor(label?: string, shape?: T, name?: string, colorRgba?: Base.ColorRGBA); /** * The label of the part to change, such as `0:1:1:1`, as `assembly.query.getDocumentParts` * reports it. * @default undefined */ label: string; /** * The new geometry of the part; leave it out to keep the old one. * @default undefined * @optional true */ shape?: T | undefined; /** * The new name of the part; leave it out to keep the old one. * @default undefined * @optional true */ name?: string | undefined; /** * The new color of the part as `{ r, g, b, a }` from 0 to 1; leave it out to keep the old one. * @default undefined * @optional true */ colorRgba?: Base.ColorRGBA | undefined; } /** * Parts, nodes and the update lists for `assembly.manager.combineStructure`, which gathers them * into one structure for `buildAssemblyDocument`; the update lists only matter when an existing * document is updated. */ class CombineAssemblyStructureDto { constructor(parts?: Models.OCCT.AssemblyPartDef[], nodes?: Models.OCCT.AssemblyNodeDef[], removals?: string[], partUpdates?: Models.OCCT.AssemblyPartUpdateDef[], clearDocument?: boolean, loadedParts?: Models.OCCT.AssemblyLoadedPartDef[]); /** * The part definitions from `createPart`, the shapes that instances place. * @default [] */ parts: Models.OCCT.AssemblyPartDef[]; /** * The assembly and instance node definitions that make up the tree. * @default [] */ nodes: Models.OCCT.AssemblyNodeDef[]; /** * Labels of parts, instances or assemblies to remove from an existing document; ignored for a * new one. * @default undefined * @optional true */ removals?: string[] | undefined; /** * Changes to parts of an existing document from `createPartUpdate`; ignored for a new one. * @default undefined * @optional true */ partUpdates?: Models.OCCT.AssemblyPartUpdateDef[] | undefined; /** * When true, an existing document is emptied before the new parts and nodes are added; when * false its content is kept and the removals and updates applied. * @default false */ clearDocument?: boolean | undefined; /** * Imported part definitions from `createImportedPart`, each copying a label tree out of one of * the source documents so instances can place it. * @default undefined * @optional true */ loadedParts?: Models.OCCT.AssemblyLoadedPartDef[] | undefined; } /** * An imported part definition for `assembly.manager.createImportedPart`: a label tree copied from * another document, placed by instances like any part. */ class CreateImportedPartDto { constructor(id?: string, sourceDocumentIndex?: number, sourceLabel?: string, name?: string, colorRgba?: Base.ColorRGBA); /** * The id instance nodes refer to the imported part by; it must be unique among the parts. * @default undefined */ id: string; /** * Which of the `sourceDocuments` given to `buildAssemblyDocument` to copy from, counting from * 0. * @default 0 */ sourceDocumentIndex: number; /** * The label of the sub-tree to copy, such as `0:1:1:1`; leave it out to copy every top-level * shape of the source document. * @default undefined * @optional true */ sourceLabel?: string | undefined; /** * A name for the copied root; leave it out to keep the source's name. * @default undefined * @optional true */ name?: string | undefined; /** * A color for the copied root as `{ r, g, b, a }` from 0 to 1; leave it out to keep the * source's colors. * @default undefined * @optional true */ colorRgba?: Base.ColorRGBA | undefined; } /** * A document, a label and a color for `assembly.manager.setDocLabelColor`. */ class SetDocLabelColorDto { constructor(document?: T, label?: string, r?: number, g?: number, b?: number, a?: number); /** * The document from `buildAssemblyDocument` or `loadStepToDoc`. * @default undefined */ document: T; /** * The label of the part, instance or assembly to color, such as `0:1:1:1`. * @default undefined */ label: string; /** * The red channel, from 0 to 1. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.01 */ r: number; /** * The green channel, from 0 to 1. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.01 */ g: number; /** * The blue channel, from 0 to 1. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.01 */ b: number; /** * The opacity, from 0 for transparent to 1 for opaque. * @default 1.0 * @minimum 0 * @maximum 1 * @step 0.01 */ a: number; } /** * A document, a label and a name for `assembly.manager.setDocLabelName`. */ class SetDocLabelNameDto { constructor(document?: T, label?: string, name?: string); /** * The document from `buildAssemblyDocument` or `loadStepToDoc`. * @default undefined */ document: T; /** * The label of the part, instance or assembly to rename, such as `0:1:1:1`. * @default undefined */ label: string; /** * The new name written to the label. * @default Renamed */ name: string; } /** * A document for the queries that read it whole, such as `assembly.query.getDocumentParts` and * `getAssemblyHierarchy`, and for deleting it. */ class DocumentQueryDto { constructor(document?: T); /** * The document from `buildAssemblyDocument` or `loadStepToDoc`. * @default undefined */ document: T; } /** * A document and one label for the queries that read a single label, such as * `assembly.query.getShapeFromLabel` and `getLabelColor`. */ class DocumentLabelQueryDto { constructor(document?: T, label?: string); /** * The document from `buildAssemblyDocument` or `loadStepToDoc`. * @default undefined */ document: T; /** * The label to read, such as `0:1:1:1`, as `getDocumentParts` reports it. * @default undefined */ label: string; } /** * A STEP file for `assembly.manager.loadStepToDoc`, which reads it into an assembly document. */ class LoadStepToDocDto { constructor(stepData?: string | ArrayBuffer | Uint8Array | File | Blob); /** * The STEP file as text, ArrayBuffer, Uint8Array, File or Blob; gzip-compressed STEP-Z is * unpacked on its own. * @default undefined */ stepData: string | ArrayBuffer | Uint8Array | File | Blob; } /** * A document and file options for `assembly.manager.exportDocumentToStep`. */ class ExportDocumentToStepDto { constructor(document?: T, fileName?: string, author?: string, organization?: string, compress?: boolean, tryDownload?: boolean); /** * The document from `buildAssemblyDocument` or `loadStepToDoc`. * @default undefined */ document: T; /** * The file name written into the STEP header and used for the download. * @default assembly.step */ fileName: string; /** * The author written into the STEP header. * @default Bitbybit user */ author: string; /** * The organization written into the STEP header. * @default Bitbybit */ organization: string; /** * When true, the file is written as gzip-compressed STEP-Z. * @default false */ compress: boolean; /** * When true, a browser download of the file is started where that is possible; the kernel * itself only returns the bytes. * @default false */ tryDownload: boolean; } /** * A document, meshing settings and file options for `assembly.manager.exportDocumentToGltf`. */ class ExportDocumentToGltfDto { constructor(document?: T, meshDeflection?: number, meshAngle?: number, mergeFaces?: boolean, forceUVExport?: boolean, fileName?: string, tryDownload?: boolean); /** * The document from `buildAssemblyDocument` or `loadStepToDoc`. * @default undefined */ document: T; /** * How closely triangles follow curved surfaces, in model units; smaller gives a finer mesh. * @default 0.1 */ meshDeflection: number; /** * The largest angle, in radians, between the normals of neighboring triangles; smaller gives * smoother curves. * @default 0.5 */ meshAngle: number; /** * When true, extra vertices are added inside curved faces for a closer fit, at the cost of * speed. * @default false */ internalVerticesMode: boolean; /** * When true, an extra pass refines triangles that bulge beyond the deflection, at the cost of * speed. * @default false */ controlSurfaceDeflection: boolean; /** * When true, faces with the same material are joined into one mesh; false keeps every face * separate. * @default false */ mergeFaces: boolean; /** * When true, texture coordinates are written even for meshes without textures. * @default false */ forceUVExport: boolean; /** * The name the downloaded file gets; it should end in `.glb`. * @default assembly.glb */ fileName: string; /** * When true, a browser download of the file is started where that is possible; the kernel * itself only returns the bytes. * @default false */ tryDownload: boolean; } /** * A document, meshing settings and Draco settings for * `assembly.manager.exportDocumentToGltfWithDraco`, which writes a Draco-compressed glTF. */ class ExportDocumentToGltfWithDracoDto extends ExportDocumentToGltfDto { constructor(document?: T, meshDeflection?: number, meshAngle?: number, mergeFaces?: boolean, forceUVExport?: boolean, fileName?: string, tryDownload?: boolean); /** * When true, the geometry is compressed with Draco. * @default true */ useDraco: boolean; /** * How hard Draco compresses, from 0 for fastest and largest to 10 for slowest and smallest. * @default 7 * @minimum 0 * @maximum 10 * @step 1 */ dracoCompressionLevel: number; /** * How many bits each vertex position keeps; fewer bits mean a smaller file and less precision. * @default 14 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizePositionBits: number; /** * How many bits each normal keeps; fewer bits mean a smaller file and less precision. * @default 10 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeNormalBits: number; /** * How many bits each texture coordinate keeps; fewer bits mean a smaller file and less * precision. * @default 12 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeTexcoordBits: number; /** * How many bits each vertex color keeps; fewer bits mean a smaller file and less precision. * @default 8 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeColorBits: number; /** * How many bits other vertex attributes keep; fewer bits mean a smaller file and less * precision. * @default 12 * @minimum 0 * @maximum 31 * @step 1 */ dracoQuantizeGenericBits: number; /** * When true, one quantization grid is used for every attribute instead of one per attribute. * @default false */ dracoUnifiedQuantization: boolean; } /** * Shapes for `shapes.compound.makeCompound`, which packs them into one compound without joining * their geometry. */ class CompoundShapesDto { constructor(shapes?: T[]); /** * The shapes to pack together; any kinds may be mixed. * @default undefined */ shapes: T[]; } /** * A face or shell and a thickness for `operations.makeThickSolidSimple`, which turns it into a * solid slab. */ class ThisckSolidSimpleDto { constructor(shape?: T, offset?: number); /** * The face or shell to give a thickness to. * @default undefined */ shape: T; /** * The thickness in model units, along the surface normal for a positive value and the other way * for a negative one. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ offset: number; } /** * A wire, an offset and an extrusion direction for `operations.offset3DWire`, which offsets a wire * that does not lie in one plane. */ class Offset3DWireDto { constructor(shape?: T, offset?: number, direction?: Base.Vector3); /** * The wire to offset; smooth wires work best, so fillet sharp corners first. * @default undefined */ shape: T; /** * The offset distance in model units. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ offset: number; /** * The direction the wire is extruded along to build the offset; it must not be parallel to the * wire. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * A closed wire and a planar flag for `shapes.face.createFaceFromWire`. */ class FaceFromWireDto { constructor(shape?: T, planar?: boolean); /** * The closed wire that becomes the face's boundary. * @default undefined */ shape: T; /** * When true the wire must lie in a plane and the face is flat; when false a smooth surface is * fitted through the wire's edges. * @default false */ planar: boolean; } /** * A wire, a guiding face and a side for `shapes.face.createFaceFromWireOnFace`, which cuts a face * out of the guiding face's surface. */ class FaceFromWireOnFaceDto { constructor(wire?: T, face?: U, inside?: boolean); /** * The wire lying on the guiding face's surface that bounds the new face. * @default undefined */ wire: T; /** * The face whose surface the new face is cut from. * @default undefined */ face: U; /** * When true, the wire is turned so the face is the region it encloses; when false the wire's * own direction decides. * @default true */ inside: boolean; } /** * Wires, a guiding face and a side for `shapes.face.createFacesFromWiresOnFace`, which cuts one * face per wire out of the guiding face's surface. */ class FacesFromWiresOnFaceDto { constructor(wires?: T[], face?: U, inside?: boolean); /** * The wires lying on the guiding face's surface, one face per wire. * @default undefined */ wires: T[]; /** * The face whose surface the new faces are cut from. * @default undefined */ face: U; /** * When true, each wire is turned so its face is the region it encloses; when false the wire's * own direction decides. * @default true */ inside: boolean; } /** * Wires and a planar flag for `shapes.face.createFaceFromWires`, which makes one face with the * first wire as its boundary and the others as holes. */ class FaceFromWiresDto { constructor(shapes?: T[], planar?: boolean); /** * The wires: the first is the outer boundary, every further one cuts a hole. * @default undefined */ shapes: T[]; /** * When true the wires must lie in one plane and the face is flat. * @default false */ planar: boolean; } /** * Wires and a planar flag for `shapes.face.createFacesFromWires`, which makes one face per wire. */ class FacesFromWiresDto { constructor(shapes?: T[], planar?: boolean); /** * The closed wires, one face per wire. * @default undefined */ shapes: T[]; /** * When true each wire must lie in a plane and its face is flat; when false a smooth surface is * fitted through each. * @default false */ planar: boolean; } /** * Wires, a guiding face and a side for `shapes.face.createFaceFromWiresOnFace`, which makes one * face on the guiding surface with holes. */ class FaceFromWiresOnFaceDto { constructor(wires?: T[], face?: U, inside?: boolean); /** * The wires on the guiding surface: the first is the outer boundary, every further one cuts a * hole. * @default undefined */ wires: T[]; /** * The face whose surface the new face is cut from. * @default undefined */ face: U; /** * Applies to the first wire: when true it is turned so the face is the region it encloses; when * false its own direction decides. * @default true */ inside: boolean; } /** * Faces and a tolerance for `shapes.shell.sewFaces`, which stitches faces that share edges into one * shell. */ class SewDto { constructor(shapes?: T[], tolerance?: number); /** * The faces to stitch together; their shared edges must line up within the tolerance. * @default undefined */ shapes: T[]; /** * How far apart two edges may be and still be sewn together, in model units. * @default 1.0e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance: number; } /** * A center, a major axis direction and two radii for `geom.curves.geom2dEllipse`, a 2D construction * curve. */ class Geom2dEllipseDto { constructor(center?: Base.Point2, direction?: Base.Vector2, radiusMinor?: number, radiusMajor?: number, sense?: boolean); /** * The center of the ellipse as a 2D point. * @default [0,0] */ center: Base.Point2; /** * The direction of the major axis in the plane. * @default [1,0] */ direction: Base.Vector2; /** * The half-width across the ellipse's short axis; must not exceed `radiusMajor`. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusMinor: number; /** * The half-width along the ellipse's long axis. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusMajor: number; /** * When true, the curve runs the other way round. * @default false */ sense: boolean; } /** * A center, a start direction and a radius for `geom.curves.geom2dCircle`, a 2D construction curve. */ class Geom2dCircleDto { constructor(center?: Base.Point2, direction?: Base.Vector2, radius?: number, sense?: boolean); /** * The center of the circle as a 2D point. * @default [0,0] */ center: Base.Point2; /** * The direction in the plane where the curve's parameter starts. * @default [1,0] */ direction: Base.Vector2; /** * The distance from the center to the curve. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * When true, the curve runs the other way round. * @default false */ sense: boolean; } /** * The proportions of a stylized Christmas tree for `shapes.wire.createChristmasTreeWire` and * `shapes.face.createChristmasTreeFace`, which stand it in the XY plane by default. */ class ChristmasTreeDto { constructor(height?: number, innerDist?: number, outerDist?: number, nrSkirts?: number, trunkHeight?: number, trunkWidth?: number, half?: boolean, rotation?: number, origin?: Base.Point3, direction?: Base.Vector3); /** * The height of the tree without the trunk, in model units. * @default 6 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * How far the branches reach from the trunk line at the notches of the lowest skirt, in model * units. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ innerDist: number; /** * How far the branches reach from the trunk line at the tips of the lowest skirt, in model * units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ outerDist: number; /** * How many layers of branches, the triangle-like skirts, the tree has. * @default 5 * @minimum 1 * @maximum Infinity * @step 1 */ nrSkirts: number; /** * The height of the trunk below the branches, in model units; 0 leaves the trunk out. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ trunkHeight: number; /** * The width of the trunk, in model units; used only when the trunk height is above 0. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ trunkWidth: number; /** * When true, only one side of the tree is built, as an open wire. * @default false */ half: boolean; /** * How far the tree is spun about its trunk-to-tip axis, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The point at the base of the trunk. * @default [0, 0, 0] */ origin: Base.Point3; /** * The direction from the trunk to the tip; the default stands the tree up along Y. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * The proportions of a star for `shapes.wire.createStarWire` and `shapes.face.createStarFace`, * which lay it flat on the ground unless `direction` says otherwise. */ class StarDto { constructor(outerRadius?: number, innerRadius?: number, numRays?: number, center?: Base.Point3, direction?: Base.Vector3, offsetOuterEdges?: number, half?: boolean); /** * The point the star is centered on. * @default [0,0,0] */ center: Base.Point3; /** * The normal of the plane the star lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; /** * How many points the star has. * @default 7 * @minimum 3 * @maximum Infinity * @step 1 */ numRays: number; /** * The distance from the center to the tip of each ray, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ outerRadius: number; /** * The distance from the center to the notch between two rays, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ innerRadius: number; /** * Lifts the ray tips out of the plane along the normal, in model units, making a 3D star; keep * it 0 for a face. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ offsetOuterEdges?: number | undefined; /** * When true, only the first half of the rays are built, as an open wire. * @default false */ half: boolean; } /** * The size, lean and placement of a parallelogram for `shapes.wire.createParallelogramWire` and * `shapes.face.createParallelogramFace`. */ class ParallelogramDto { constructor(center?: Base.Point3, direction?: Base.Vector3, aroundCenter?: boolean, width?: number, height?: number, angle?: number); /** * The point the shape is centered on, or starts from when `aroundCenter` is false. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the shape lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; /** * When true the shape is centered on `center`; when false it starts there and extends in the * positive directions. * @default true */ aroundCenter: boolean; /** * The width of the shape's bounding rectangle, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * The height of the shape's bounding rectangle, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * How far the sides lean over from a rectangle, in degrees; 0 gives a rectangle. * @default 15 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle: number; } /** * The size and placement of a heart outline for `shapes.wire.createHeartWire` and * `shapes.face.createHeartFace`. */ class Heart2DDto { constructor(center?: Base.Point3, direction?: Base.Vector3, rotation?: number, sizeApprox?: number); /** * The point the heart is centered on. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the heart lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; /** * How far the heart is turned in its plane, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The side of the square the heart roughly fits into, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeApprox: number; } /** * A corner count, a radius and a placement for `shapes.wire.createNGonWire` and * `shapes.face.createNGonFace`, a regular polygon. */ class NGonWireDto { constructor(center?: Base.Point3, direction?: Base.Vector3, nrCorners?: number, radius?: number); /** * The point the polygon is centered on. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the polygon lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; /** * How many corners, and so how many equal sides, the polygon has. * @default 6 * @minimum 3 * @maximum Infinity * @step 1 */ nrCorners: number; /** * The distance from the center to each corner, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; } /** * A center, a plane normal and two radii for the ellipse edge, wire and face methods of `shapes` * and `geom.curves.geomEllipseCurve`. */ class EllipseDto { constructor(center?: Base.Point3, direction?: Base.Vector3, radiusMinor?: number, radiusMajor?: number); /** * The point the ellipse is centered on. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the ellipse lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; /** * The half-width across the ellipse's short axis, in model units; must not exceed * `radiusMajor`. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusMinor: number; /** * The half-width along the ellipse's long axis, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusMajor: number; } /** * The size of a coil for `shapes.wire.createHelixWire`: its radius, how much it climbs per turn and * its total height. */ class HelixWireDto { constructor(radius?: number, pitch?: number, height?: number, center?: Base.Point3, direction?: Base.Vector3, clockwise?: boolean, tolerance?: number); /** * The distance from the axis to the coil, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * How far the coil climbs along the axis in one full turn, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ pitch: number; /** * The total climb of the coil along the axis, in model units. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The point on the axis where the coil starts climbing from. * @default [0, 0, 0] */ center: Base.Point3; /** * The direction of the axis the coil climbs along. * @default [0, 1, 0] */ direction: Base.Vector3; /** * When true, the coil winds clockwise seen from the tip of the axis. * @default false */ clockwise: boolean; /** * How far the fitted curve may stray from the exact helix, in model units. * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.0001 */ tolerance: number; } /** * The size of a coil for `shapes.wire.createHelixWireByTurns`: its radius, how much it climbs per * turn and how many turns it makes. */ class HelixWireByTurnsDto { constructor(radius?: number, pitch?: number, numTurns?: number, center?: Base.Point3, direction?: Base.Vector3, clockwise?: boolean, tolerance?: number); /** * The distance from the axis to the coil, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * How far the coil climbs along the axis in one full turn, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ pitch: number; /** * How many full turns the coil makes; fractions are allowed. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.5 */ numTurns: number; /** * The point on the axis where the coil starts climbing from. * @default [0, 0, 0] */ center: Base.Point3; /** * The direction of the axis the coil climbs along. * @default [0, 1, 0] */ direction: Base.Vector3; /** * When true, the coil winds clockwise seen from the tip of the axis. * @default false */ clockwise: boolean; /** * How far the fitted curve may stray from the exact helix, in model units. * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.0001 */ tolerance: number; } /** * The size of a conical coil for `shapes.wire.createTaperedHelixWire`: the radius at each end, the * climb per turn and the total height. */ class TaperedHelixWireDto { constructor(startRadius?: number, endRadius?: number, pitch?: number, height?: number, center?: Base.Point3, direction?: Base.Vector3, clockwise?: boolean, tolerance?: number); /** * The distance from the axis to the coil at its base, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ startRadius: number; /** * The distance from the axis to the coil at its top, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ endRadius: number; /** * How far the coil climbs along the axis in one full turn, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ pitch: number; /** * The total climb of the coil along the axis, in model units. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The point on the axis where the coil starts climbing from. * @default [0, 0, 0] */ center: Base.Point3; /** * The direction of the axis the coil climbs along. * @default [0, 1, 0] */ direction: Base.Vector3; /** * When true, the coil winds clockwise seen from the tip of the axis. * @default false */ clockwise: boolean; /** * How far the fitted curve may stray from the exact helix, in model units. * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.0001 */ tolerance: number; } /** * The size of a flat spiral for `shapes.wire.createFlatSpiralWire`: the radius at each end and the * number of turns between them. */ class FlatSpiralWireDto { constructor(startRadius?: number, endRadius?: number, numTurns?: number, center?: Base.Point3, direction?: Base.Vector3, clockwise?: boolean, tolerance?: number); /** * The distance from the center where the spiral starts, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ startRadius: number; /** * The distance from the center where the spiral ends, in model units. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.1 */ endRadius: number; /** * How many full turns the spiral makes between the two radii; fractions are allowed. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.5 */ numTurns: number; /** * The point the spiral winds around. * @default [0, 0, 0] */ center: Base.Point3; /** * The normal of the plane the spiral lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; /** * When true, the spiral winds clockwise seen from the tip of the normal. * @default false */ clockwise: boolean; /** * How far the fitted curve may stray from the exact spiral, in model units. * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.0001 */ tolerance: number; } /** * Text and its layout for `shapes.wire.textWires` and `textWiresWithData`, which write it as stroke * wires on the ground plane in the single-line Hershey font. */ class TextWiresDto { constructor(text?: string, xOffset?: number, yOffset?: number, height?: number, lineSpacing?: number, letterSpacing?: number, align?: Base.horizontalAlignEnum, extrudeOffset?: number, centerOnOrigin?: boolean); /** * The text to write; a line break starts a new line. * @default Hello World */ text?: string | undefined; /** * How far the whole block is shifted along X, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset?: number | undefined; /** * How far the whole block is shifted along the second axis of the text plane, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset?: number | undefined; /** * The height of a capital letter, in model units. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The distance between lines as a multiple of the height. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ lineSpacing?: number | undefined; /** * Extra space between characters as a multiple of the height; 0 uses the font's own spacing. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ letterSpacing?: number | undefined; /** * How lines of different length line up: at their left edge, their center or their right edge. * @default left */ align?: Base.horizontalAlignEnum | undefined; /** * A margin in model units taken off the height and split above and below each character, so * extruded text keeps its full size. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extrudeOffset?: number | undefined; /** * When true, the middle of the whole text block is moved to the origin. * @default false */ centerOnOrigin: boolean; } /** * A radius and an axis for `geom.surfaces.cylindricalSurface`, an infinite construction surface. */ class GeomCylindricalSurfaceDto { constructor(radius?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The distance from the axis to the surface, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * A point on the axis of the cylinder. * @default [0, 0, 0] */ center: Base.Point3; /** * The direction of the axis of the cylinder. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * A 2D curve and two parameters for `geom.curves.geom2dTrimmedCurve`, which keeps the piece between * them. */ class Geom2dTrimmedCurveDto { constructor(shape?: T, u1?: number, u2?: number, sense?: boolean, adjustPeriodic?: boolean); /** * The 2D curve to cut a piece out of. * @default undefined */ shape: T; /** * The parameter where the piece starts; the piece runs from `u1` to `u2`, whichever is larger. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ u1: number; /** * The parameter where the piece ends. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ u2: number; /** * On a closed curve, which of the two possible pieces is kept: true keeps the one running the * curve's own way. * @default true */ sense: boolean; /** * When true, the parameters of a periodic curve are brought into its period first. * @default true */ adjustPeriodic: boolean; } /** * Two 2D points for `geom.curves.geom2dSegment`, a straight construction curve between them. */ class Geom2dSegmentDto { constructor(start?: Base.Point2, end?: Base.Point2); /** * The 2D point the segment starts at. * @default [0, 0] */ start: Base.Point2; /** * The 2D point the segment ends at. * @default [1, 0] */ end: Base.Point2; } /** * A solid, a spacing and a direction for `operations.slice`, which cuts it into parallel slices. */ class SliceDto { constructor(shape?: T, step?: number, direction?: Base.Vector3); /** * The solid, or shape holding solids, to slice. * @default undefined */ shape: T; /** * The distance between slices, in model units; must be above 0. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ step: number; /** * The direction the slices are stacked along; each cutting plane is perpendicular to it. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * A solid, a pattern of spacings and a direction for `operations.sliceInStepPattern`, which cuts it * into parallel slices with repeating gaps. */ class SliceInStepPatternDto { constructor(shape?: T, steps?: number[], direction?: Base.Vector3); /** * The solid, or shape holding solids, to slice. * @default undefined */ shape: T; /** * The gaps between slices in model units, applied in turn from the bottom and repeated until * the top is reached. * @default [0.1, 0.2] */ steps: number[]; /** * The direction the slices are stacked along; each cutting plane is perpendicular to it. * @default [0, 1, 0] */ direction: Base.Vector3; } /** * Two points and the drawing settings for `dimensions.simpleLinearLengthDimension`: where the * dimension line sits, how the extension lines, arrows and label look, and how the distance is * written. */ class SimpleLinearLengthDimensionDto { constructor(start?: Base.Point3, end?: Base.Point3, direction?: Base.Vector3, offsetFromPoints?: number, crossingSize?: number, labelSuffix?: string, labelSize?: number, labelOffset?: number, labelRotation?: number, endType?: dimensionEndTypeEnum, arrowSize?: number, arrowAngle?: number, arrowsFlipped?: boolean, labelFlipHorizontal?: boolean, labelFlipVertical?: boolean, labelOverwrite?: string, removeTrailingZeros?: boolean); /** * The first of the two points whose distance is measured. * @default undefined */ start: Base.Point3; /** * The second of the two points whose distance is measured. * @default undefined */ end: Base.Point3; /** * The vector from the measured points to the dimension line; its length is the offset, in model * units, and it must not run along the measured line. * @default undefined */ direction: Base.Vector3; /** * The gap between each measured point and the start of its extension line, in model units, so * the dimension does not touch the geometry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ offsetFromPoints?: number | undefined; /** * How far the lines stick out past their crossings, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ crossingSize?: number | undefined; /** * How many decimals the distance is rounded to in the label. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ decimalPlaces?: number | undefined; /** * Text written after the number, such as a unit; the model has no unit of its own. * @default (cm) */ labelSuffix?: string | undefined; /** * The height of the label's capital letters, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelSize?: number | undefined; /** * How far the label sits from the dimension line, in model units. * @default 0.3 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ labelOffset?: number | undefined; /** * Extra rotation of the label in its plane, in degrees. * @default 0 * @minimum -360 * @maximum 360 * @step 1 */ labelRotation?: number | undefined; /** * What the dimension line ends with: nothing, or an arrowhead. * @default none */ endType?: dimensionEndTypeEnum | undefined; /** * The length of the arrowheads, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ arrowSize?: number | undefined; /** * The full angle between the two lines of an arrowhead, in degrees, up to 90. * @default 30 * @minimum 0 * @maximum 90 * @step 1 */ arrowAngle?: number | undefined; /** * When true, the arrowheads point outward from the dimension instead of inward. * @default false */ arrowsFlipped?: boolean | undefined; /** * When true, the label is mirrored left to right. * @default false */ labelFlipHorizontal?: boolean | undefined; /** * When true, the label is mirrored top to bottom. * @default false */ labelFlipVertical?: boolean | undefined; /** * An expression written instead of the plain number, with `val` standing for the distance, such * as `100*val` or `Length: val mm`. * @default 1*val * @optional true */ labelOverwrite?: string | undefined; /** * When true, zeros at the end of the decimals are dropped, so 2.50 becomes 2.5. * @default false */ removeTrailingZeros?: boolean | undefined; } /** * A center, two directions and the drawing settings for `dimensions.simpleAngularDimension`: the * arc, the extension lines, the arrows and the label with the angle. */ class SimpleAngularDimensionDto { constructor(direction1?: Base.Point3, direction2?: Base.Point3, center?: Base.Point3, radius?: number, offsetFromCenter?: number, extraSize?: number, radians?: boolean, labelSuffix?: string, labelSize?: number, labelOffset?: number, endType?: dimensionEndTypeEnum, arrowSize?: number, arrowAngle?: number, arrowsFlipped?: boolean, labelRotation?: number, labelFlipHorizontal?: boolean, labelFlipVertical?: boolean, labelOverwrite?: string, removeTrailingZeros?: boolean); /** * The direction of the first leg of the angle, from the center. * @default [1, 0, 0] */ direction1: Base.Point3; /** * The direction of the second leg of the angle, from the center. * @default [0, 0, 1] */ direction2: Base.Point3; /** * The point the angle is measured at. * @default [0, 0, 0] */ center: Base.Point3; /** * The distance from the center to the dimension arc, in model units. * @default 4 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * The gap between the center and the start of each extension line, in model units. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ offsetFromCenter: number; /** * How far the extension lines stick out past the arc, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extraSize: number; /** * How many decimals the angle is rounded to in the label. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ decimalPlaces: number; /** * Text written after the number, such as the unit. * @default (deg) */ labelSuffix: string; /** * The height of the label's capital letters, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelSize: number; /** * How far the label sits from the arc, in model units. * @default 0.3 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * When true, the angle is written in radians instead of degrees. * @default false */ radians: boolean; /** * What the arc ends with: nothing, or an arrowhead. * @default none */ endType?: dimensionEndTypeEnum | undefined; /** * The length of the arrowheads, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ arrowSize?: number | undefined; /** * The full angle between the two lines of an arrowhead, in degrees, up to 90. * @default 30 * @minimum 0 * @maximum 90 * @step 1 */ arrowAngle?: number | undefined; /** * When true, the arrowheads point outward from the dimension instead of inward. * @default false */ arrowsFlipped?: boolean | undefined; /** * Extra rotation of the label in its plane, in degrees. * @default 0 * @minimum -360 * @maximum 360 * @step 1 */ labelRotation?: number | undefined; /** * When true, the label is mirrored left to right. * @default false */ labelFlipHorizontal?: boolean | undefined; /** * When true, the label is mirrored top to bottom. * @default false */ labelFlipVertical?: boolean | undefined; /** * An expression written instead of the plain number, with `val` standing for the angle, such as * `100*val` or `Angle: val deg`. * @default 1*val * @optional true */ labelOverwrite?: string | undefined; /** * When true, zeros at the end of the decimals are dropped, so 45.00 becomes 45. * @default false */ removeTrailingZeros?: boolean | undefined; } /** * Two points, a label and the drawing settings for `dimensions.pinWithLabel`, a line pointing at a * spot on a model with text at its end. */ class PinWithLabelDto { constructor(startPoint?: Base.Point3, endPoint?: Base.Point3, direction?: Base.Vector3, offsetFromStart?: number, label?: string, labelOffset?: number, labelSize?: number, endType?: dimensionEndTypeEnum, arrowSize?: number, arrowAngle?: number, arrowsFlipped?: boolean, labelRotation?: number, labelFlipHorizontal?: boolean, labelFlipVertical?: boolean); /** * The spot on the model the pin marks. * @default [0, 0, 0] */ startPoint: Base.Point3; /** * The point the pin line ends at, where the label is written. * @default [0, 5, 2] */ endPoint?: Base.Point3 | undefined; /** * The normal of the plane the label is written in. * @default [0, 0, 1] */ direction?: Base.Vector3 | undefined; /** * The gap between the start point and the beginning of the line, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ offsetFromStart?: number | undefined; /** * The text written at the end of the pin. * @default Pin */ label?: string | undefined; /** * The gap between the end of the line and the label, in model units. * @default 0.3 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ labelOffset?: number | undefined; /** * The height of the label's capital letters, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelSize?: number | undefined; /** * What the pin line ends with at the start point: nothing, or an arrowhead. * @default none */ endType?: dimensionEndTypeEnum | undefined; /** * The length of the arrowhead, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ arrowSize?: number | undefined; /** * The full angle between the two lines of the arrowhead, in degrees, up to 90. * @default 30 * @minimum 0 * @maximum 90 * @step 1 */ arrowAngle?: number | undefined; /** * When true, the arrowhead points away from the start point instead of toward it. * @default false */ arrowsFlipped?: boolean | undefined; /** * Extra rotation of the label in its plane, in degrees. * @default 0 * @minimum -360 * @maximum 360 * @step 1 */ labelRotation?: number | undefined; /** * When true, the label is mirrored left to right. * @default false */ labelFlipHorizontal?: boolean | undefined; /** * When true, the label is mirrored top to bottom. * @default false */ labelFlipVertical?: boolean | undefined; } /** * A star outline and the extrusion lengths for `shapes.solid.createStarSolid`; at least one length * must be above 0. */ class StarSolidDto extends StarDto { constructor(outerRadius?: number, innerRadius?: number, numRays?: number, center?: Base.Point3, direction?: Base.Vector3, offsetOuterEdges?: number, half?: boolean, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the star grows along its plane normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the star grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * A regular polygon and the extrusion lengths for `shapes.solid.createNGonSolid`; at least one * length must be above 0. */ class NGonSolidDto extends NGonWireDto { constructor(center?: Base.Point3, direction?: Base.Vector3, nrCorners?: number, radius?: number, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the polygon grows along its plane normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the polygon grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * A parallelogram and the extrusion lengths for `shapes.solid.createParallelogramSolid`; at least * one length must be above 0. */ class ParallelogramSolidDto extends ParallelogramDto { constructor(center?: Base.Point3, direction?: Base.Vector3, aroundCenter?: boolean, width?: number, height?: number, angle?: number, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the parallelogram grows along its plane normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the parallelogram grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * A heart outline and the extrusion lengths for `shapes.solid.createHeartSolid`; at least one * length must be above 0. */ class HeartSolidDto extends Heart2DDto { constructor(center?: Base.Point3, direction?: Base.Vector3, rotation?: number, sizeApprox?: number, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the heart grows along its plane normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the heart grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * A tree outline and the extrusion lengths for `shapes.solid.createChristmasTreeSolid`; at least * one length must be above 0. */ class ChristmasTreeSolidDto extends ChristmasTreeDto { constructor(height?: number, innerDist?: number, outerDist?: number, nrSkirts?: number, trunkHeight?: number, trunkWidth?: number, half?: boolean, rotation?: number, origin?: Base.Point3, direction?: Base.Vector3, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the tree grows along its plane normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the tree grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * An L shape and the extrusion lengths for `shapes.solid.createLPolygonSolid`; at least one length * must be above 0. */ class LPolygonSolidDto extends LPolygonDto { constructor(widthFirst?: number, lengthFirst?: number, widthSecond?: number, lengthSecond?: number, align?: directionEnum, rotation?: number, center?: Base.Point3, direction?: Base.Vector3, extrusionLengthFront?: number, extrusionLengthBack?: number); /** * How far the L shape grows along its plane normal, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthFront: number; /** * How far the L shape grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack: number; } /** * A straight segment of a path, running from the previous point to `to`. */ class PathLineSegment { constructor(to?: Base.Point2); /** * The segment kind, always `line`. * @default line */ type: "line"; /** * The 2D point the segment ends at. * @default undefined */ to: Base.Point2; } /** * A quadratic Bezier segment of a path: one control point pulls the curve on its way from the * previous point to `to`. */ class PathQuadraticSegment { constructor(c?: Base.Point2, to?: Base.Point2); /** * The segment kind, always `quadratic`. * @default quadratic */ type: "quadratic"; /** * The 2D control point the curve is pulled toward. * @default undefined */ c: Base.Point2; /** * The 2D point the segment ends at. * @default undefined */ to: Base.Point2; } /** * A cubic Bezier segment of a path: two control points shape the curve on its way from the previous * point to `to`. */ class PathCubicSegment { constructor(c1?: Base.Point2, c2?: Base.Point2, to?: Base.Point2); /** * The segment kind, always `cubic`. * @default cubic */ type: "cubic"; /** * The 2D control point that shapes the curve as it leaves the previous point. * @default undefined */ c1: Base.Point2; /** * The 2D control point that shapes the curve as it arrives at `to`. * @default undefined */ c2: Base.Point2; /** * The 2D point the segment ends at. * @default undefined */ to: Base.Point2; } /** * An elliptical arc segment of a path, given by its ellipse's center, radii and rotation and the * angles it sweeps; all angles are in radians. */ class PathArcSegment { constructor(to?: Base.Point2, center?: Base.Point2, rx?: number, ry?: number, xAxisRotation?: number, startAngle?: number, deltaAngle?: number); /** * The segment kind, always `arc`. * @default arc */ type: "arc"; /** * The 2D point the arc ends at. * @default undefined */ to: Base.Point2; /** * The 2D center of the ellipse the arc lies on. * @default undefined */ center: Base.Point2; /** * The half-width of the ellipse along its rotated x axis. * @default 0 */ rx: number; /** * The half-width of the ellipse along its rotated y axis. * @default 0 */ ry: number; /** * How far the ellipse is turned in the plane, in radians, counterclockwise in path space. * @default 0 */ xAxisRotation: number; /** * The angle on the ellipse where the arc starts, in radians. * @default 0 */ startAngle: number; /** * How far the arc sweeps from its start, in radians; negative sweeps clockwise in path space. * @default 0 */ deltaAngle: number; } /** * One segment of an SVG-style path: a line, a quadratic or cubic Bezier, or an arc. A path is a * list of these, which is how imported SVG outlines are represented before they become wires. */ type PathSegment = PathLineSegment | PathQuadraticSegment | PathCubicSegment | PathArcSegment; /** * One continuous run of a path: a start point, its segments in order and whether it closes back on * itself. */ class PathSubpath { constructor(start?: Base.Point2, segments?: PathSegment[], closed?: boolean); /** * The 2D point the first segment starts at. * @default undefined */ start: Base.Point2; /** * The segments in order, each starting where the previous one ended. * @default undefined */ segments: PathSegment[]; /** * When true, the run closes from its last point back to `start`. * @default false */ closed: boolean; } /** * How closed subpaths of a filled element are turned into faces. * - `none`: no faces, only the outline wires. * - `auto`: build faces honoring each element's own SVG fill-rule (nonzero/evenodd). * - `nonzero`: force the non-zero winding rule. * - `evenOdd`: force the even-odd rule. * - `perSubpath`: every closed subpath becomes its own independent face (no holes). */ enum svgFaceStrategyEnum { none = "none", auto = "auto", nonzero = "nonzero", evenOdd = "evenOdd", perSubpath = "perSubpath" } /** * How a 2D path is placed into 3D: scaled, flipped from SVG's downward Y to Y up, and moved to an * origin. The part the path and SVG inputs share. */ class PathPlacementDto { constructor(scale?: number, flipY?: boolean, origin?: Base.Point3); /** * A factor applied to every path coordinate; 1 keeps the size. * @default 1 */ scale: number; /** * When true, Y is negated so a drawing made with Y pointing down, as in SVG, comes out upright. * @default true */ flipY: boolean; /** * The point the scaled and flipped drawing is moved to. * @default [0, 0, 0] */ origin: Base.Point3; } /** * Subpaths and build options for `path.shapeFromPath`, which turns them into wires and, when asked, * faces. */ class ShapeFromPathDto { constructor(subpaths?: PathSubpath[], makeFaces?: boolean, joinSegments?: boolean, tolerance?: number, scale?: number, flipY?: boolean, origin?: Base.Point3); /** * The runs of segments that describe the outline, one wire each. * @default undefined */ subpaths: PathSubpath[]; /** * When true, closed subpaths become faces as well as wires. * @default false */ makeFaces: boolean; /** * When true, consecutive segments of a subpath are merged into a single edge where they can be. * @default true */ joinSegments: boolean; /** * How far apart segment ends may be and still join, in model units. * @default 1e-7 */ tolerance: number; /** * A factor applied to every path coordinate; 1 keeps the size. * @default 1 */ scale: number; /** * When true, Y is negated so a drawing made with Y pointing down comes out upright. * @default true */ flipY: boolean; /** * The point the scaled and flipped drawing is moved to. * @default [0, 0, 0] */ origin: Base.Point3; } /** * SVG text and import options for `svg.loadSVG` and `svg.loadSVGStructured`: which elements to * keep, whether to build faces, and how to scale and place the drawing. */ class LoadSVGDto { constructor(svg?: string, faceStrategy?: svgFaceStrategyEnum, makeRibbons?: boolean, includeInvisible?: boolean, joinSegments?: boolean, tolerance?: number, scale?: number, flipY?: boolean, alignment?: Base.basicAlignmentEnum, direction?: Base.Vector3, center?: Base.Point3); /** * The text of the SVG document. * @default */ svg: string; /** * How filled shapes become faces: `none` keeps only wires, `auto` follows each element's fill * rule, `nonzero` and `evenOdd` force a rule, `perSubpath` makes one face per closed subpath * without holes. * @default none */ faceStrategy: svgFaceStrategyEnum; /** * Reserved for building ribbon faces from stroked paths; not supported yet, stroked paths stay * wires. * @default false */ makeRibbons: boolean; /** * When true, elements hidden by `display: none` or `visibility: hidden` are imported too. * @default false */ includeInvisible: boolean; /** * When true, consecutive segments of a subpath are merged into a single edge where they can be. * @default true */ joinSegments: boolean; /** * How far apart segment ends may be and still join, in model units. * @default 1e-7 */ tolerance: number; /** * A factor applied to the SVG coordinates; 1 keeps the size. * @default 1 */ scale: number; /** * When true, Y is negated so the drawing comes out upright, since SVG has Y pointing down. * @default true */ flipY: boolean; /** * Which point of the drawing's bounding box sits on `center`; `midMid` centers it. * @default midMid */ alignment: Base.basicAlignmentEnum; /** * The normal of the plane the drawing is laid on; the default lays it flat on the ground. * @default [0, 1, 0] */ direction: Base.Vector3; /** * The point the aligned drawing is placed at. * @default [0, 0, 0] */ center: Base.Point3; } /** * One imported SVG element as `svg.loadSVGStructured` returns it: the built shape and the style * resolved for it. An output, not an input. */ class SVGShape { /** * The built shape: a wire, or a face when one was asked for and could be built. */ shape: T; /** * True when `shape` is a face, false when it is a wire. */ isFace: boolean; /** * The SVG tag the shape came from, such as `path`, `rect` or `circle`. */ elementType: string; /** * Whether the element's outline was closed. */ closed: boolean; /** * The fill color that applied to the element, if any. * @optional true */ fill?: string | undefined; /** * The stroke color that applied to the element, if any. * @optional true */ stroke?: string | undefined; /** * The stroke width that applied to the element, if any. * @optional true */ strokeWidth?: number | undefined; /** * The combined opacity of the element from 0 to 1, if any was set. * @optional true */ opacity?: number | undefined; /** * The element's `id` attribute, if any. * @optional true */ id?: string | undefined; /** * The element's `class` attribute, if any. * @optional true */ className?: string | undefined; } /** * What `svg.loadSVGStructured` returns: one shape per drawable element, the view box and any * warnings. An output, not an input. */ class SVGResult { /** * One entry per drawable element, in document order. */ shapes: SVGShape[]; /** * The document's view box as `[minX, minY, width, height]`, when it has one. * @optional true */ viewBox?: [ number, number, number, number ] | undefined; /** * Problems met while parsing or building that did not stop the import. */ warnings: string[]; } } /** * Parameters for cameras: position, target, field of view, near and far clipping planes, and the * settings specific to free, target and arc-rotate cameras. */ declare namespace BabylonCamera { /** * Feeds `babylon.camera.arcRotate.create`: where the orbiting camera starts around its target, * how far it can zoom and orbit, and how fast it reacts. */ class ArcRotateCameraDto { constructor(radius?: number, alpha?: number, beta?: number, lowerRadiusLimit?: number, upperRadiusLimit?: number, lowerAlphaLimit?: number, upperAlphaLimit?: number, lowerBetaLimit?: number, upperBetaLimit?: number, angularSensibilityX?: number, angularSensibilityY?: number, panningSensibility?: number, wheelPrecision?: number, maxZ?: number); /** * Distance from the target the camera starts at, in scene units * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ radius: number; /** * The point the camera looks at and orbits around * @default [0, 0, 0] */ target: Base.Point3; /** * The camera's angle around the vertical axis, in degrees * @default 45 * @minimum -360 * @maximum 360 * @step 1 */ alpha: number; /** * The camera's angle down from straight above, in degrees; 90 is level with the target * @default 70 * @minimum -360 * @maximum 360 * @step 1 */ beta: number; /** * The closest the camera may zoom to the target, in scene units; left out, there is no * limit * @default undefined * @minimum -Infinity * @maximum Infinity * @step 1 * @optional true */ lowerRadiusLimit?: number | undefined; /** * The farthest the camera may zoom from the target, in scene units; left out, there is no * limit * @default undefined * @minimum -Infinity * @maximum Infinity * @step 1 * @optional true */ upperRadiusLimit?: number | undefined; /** * The smallest angle around the vertical axis the camera may orbit to, in degrees; left * out, it orbits freely * @default undefined * @minimum -360 * @maximum 360 * @step 1 * @optional true */ lowerAlphaLimit?: number | undefined; /** * The largest angle around the vertical axis the camera may orbit to, in degrees; left out, * it orbits freely * @default undefined * @minimum -360 * @maximum 360 * @step 1 * @optional true */ upperAlphaLimit?: number | undefined; /** * How close to straight above the camera may go, in degrees down from the top; 0 would look * straight down * @default 1 * @minimum -360 * @maximum 360 * @step 1 */ lowerBetaLimit: number; /** * How close to straight below the camera may go, in degrees down from the top; 180 would * look straight up * @default 179 * @minimum -360 * @maximum 360 * @step 1 */ upperBetaLimit: number; /** * How much pointer movement a horizontal orbit takes; lower turns faster * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ angularSensibilityX: number; /** * How much pointer movement a vertical orbit takes; lower turns faster * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ angularSensibilityY: number; /** * How much pointer movement a pan takes; lower pans faster, so lower it for large models * @default 1000 * @minimum 0 * @maximum Infinity * @step 100 */ panningSensibility: number; /** * How much wheel movement a zoom step takes; lower zooms faster, so lower it for large * models * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ wheelPrecision: number; /** * The farthest distance the camera draws, in scene units; anything beyond is not rendered * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ maxZ: number; } /** * Feeds `babylon.camera.free.create` with where the flying camera starts and what it looks at. */ class FreeCameraDto { constructor(position?: Base.Point3, target?: Base.Point3); /** * Where the camera starts * @default [20, 20, 20] */ position: Base.Point3; /** * The point the camera looks at to begin with * @default [0, 0, 0] */ target: Base.Point3; } /** * Feeds `babylon.camera.target.create` with where the fixed camera sits and what it looks at. */ class TargetCameraDto { constructor(position?: Base.Point3, target?: Base.Point3); /** * Where the camera sits * @default [20, 20, 20] */ position: Base.Point3; /** * The point the camera looks at * @default [0, 0, 0] */ target: Base.Point3; } /** * Feeds `babylon.camera.setPosition` and the camera getters with a camera and the point to move * it to. */ class PositionDto { constructor(camera?: BABYLON.TargetCamera, position?: Base.Point3); /** * The camera to move or read */ camera: BABYLON.TargetCamera; /** * Where to move the camera * @default [20, 20, 20] */ position: Base.Point3; } /** * Feeds `babylon.camera.setSpeed` with a camera and how fast its controls move it. */ class SpeedDto { constructor(camera?: BABYLON.TargetCamera, speed?: number); /** * The camera to change */ camera: BABYLON.TargetCamera; /** * How fast the controls move the camera; 1 is the default pace * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ speed: number; } /** * Feeds `babylon.camera.setTarget` with a camera and the point to look at. */ class TargetDto { constructor(camera?: BABYLON.TargetCamera, target?: Base.Point3); /** * The camera to turn */ camera: BABYLON.TargetCamera; /** * The point the camera is turned to look at * @default [0, 0, 0] */ target: Base.Point3; } /** * Feeds `babylon.camera.setMinZ` with a camera and its near clipping distance. */ class MinZDto { constructor(camera?: BABYLON.Camera, minZ?: number); /** * The camera to change */ camera: BABYLON.Camera; /** * The distance below which nothing is drawn, in scene units; keep it above 0 on large * scenes for depth precision * @default 0 * @minimum 0 * @maximum Infinity * @step 0.01 */ minZ: number; } /** * Feeds `babylon.camera.setMaxZ` with a camera and its far clipping distance. */ class MaxZDto { constructor(camera?: BABYLON.Camera, maxZ?: number); /** * The camera to change */ camera: BABYLON.Camera; /** * The distance beyond which nothing is drawn, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 1 */ maxZ: number; } /** * Feeds `babylon.camera.makeCameraOrthographic` with a camera and the four edges of its flat, * distance-free view. */ class OrthographicDto { constructor(camera?: BABYLON.Camera, orthoLeft?: number, orthoRight?: number, orthoTop?: number, orthoBottom?: number); /** * The camera to switch to orthographic projection */ camera: BABYLON.Camera; /** * The left edge of the view, in scene units from the camera's axis; 0 falls back to -1 * @default -1 * @minimum -Infinity * @maximum Infinity * @step 1 */ orthoLeft: number; /** * The right edge of the view, in scene units from the camera's axis; 0 falls back to 1 * @default 1 * @minimum -Infinity * @maximum Infinity * @step 1 */ orthoRight: number; /** * The bottom edge of the view, in scene units from the camera's axis; 0 falls back to -1 * @default -1 * @minimum -Infinity * @maximum Infinity * @step 1 */ orthoBottom: number; /** * The top edge of the view, in scene units from the camera's axis; 0 falls back to 1 * @default 1 * @minimum -Infinity * @maximum Infinity * @step 1 */ orthoTop: number; } /** * Feeds `babylon.camera.makeCameraPerspective`, `freezeProjectionMatrix` and * `unfreezeProjectionMatrix` with the one camera to change. */ class CameraDto { constructor(camera?: BABYLON.Camera); /** * The camera to change */ camera: BABYLON.Camera; } } /** * Parameters for decals - images projected onto the surface of an existing mesh, following its * curvature. Carries the target mesh, the projection position, direction and size, and the material * used for the projected image. */ declare namespace BabylonDecal { /** * Feeds `babylon.decal.createMeshDecal`: the mesh to stick an image onto, the image, where and * which way it is projected, its size and the rendering details. */ class CreateMeshDecalDto { constructor(sourceMesh?: BABYLON.AbstractMesh, texture?: BABYLON.BaseTexture, position?: Base.Point3, normal?: Base.Vector3, size?: Base.Vector3, angle?: number, cullBackFaces?: boolean, localMode?: boolean, zOffset?: number); /** * Mesh to project the decal onto. The decal is created as a clipped child mesh hugging the surface. * @default undefined */ sourceMesh: BABYLON.AbstractMesh; /** * Image texture to project. Create it via texture image, and keep an alpha channel for cutout decals. * @default undefined */ texture: BABYLON.BaseTexture; /** * Position of the decal projector in world coordinates. Often picked from a ray/pick hit on the mesh. * @default [0, 0, 0] */ position: Base.Point3; /** * Direction the decal is projected along, in world coordinates. Usually the surface normal at the hit point. * @default [0, 1, 0] */ normal: Base.Vector3; /** * Size of the decal box on each axis. The third value is the projection depth. * @default [1, 1, 1] */ size: Base.Vector3; /** * Angle to rotate the decal around the projection direction, in radians. * @default 0 * @step 0.1 */ angle: number; /** * Remove back faces from the decal mesh so it only sticks to faces pointing towards the projector. * @default true */ cullBackFaces: boolean; /** * Compute the decal using the local mesh coordinates instead of world space. Useful when the source mesh is transformed. * @default false */ localMode: boolean; /** * Depth bias used to avoid z-fighting between the decal and the surface. Negative values push the decal towards the camera. * @default -2 * @step 0.5 */ zOffset: number; } /** * Feeds `babylon.decal.enableDecalMap`: the mesh and material to give a decal map, and the * resolution of that map. */ class EnableDecalMapDto { constructor(mesh?: BABYLON.AbstractMesh, material?: BABYLON.Material, width?: number, height?: number); /** * Mesh on which a UV-space decal map should be enabled. The mesh must have proper, non-overlapping UV coordinates. * @default undefined */ mesh: BABYLON.AbstractMesh; /** * Material of the mesh on which the decal map plugin should be turned on so projected decals are blended in the shader. * @default undefined */ material: BABYLON.Material; /** * Width in pixels of the internal decal map render target. * @default 1024 */ width: number; /** * Height in pixels of the internal decal map render target. * @default 1024 */ height: number; } /** * Feeds `babylon.decal.projectDecal`: the decal map to paint into, the image and where, which * way and how big it is projected. */ class ProjectDecalDto { constructor(decalMap?: BABYLON.MeshUVSpaceRenderer, texture?: BABYLON.BaseTexture, position?: Base.Point3, normal?: Base.Vector3, size?: Base.Vector3, angle?: number); /** * Decal map renderer obtained from enabling a decal map on a mesh. Projected decals accumulate into it. * @default undefined */ decalMap: BABYLON.MeshUVSpaceRenderer; /** * Image texture to project into the mesh UV space. * @default undefined */ texture: BABYLON.BaseTexture; /** * Position of the projector in world coordinates. * @default [0, 0, 0] */ position: Base.Point3; /** * Projection direction in world coordinates, usually the surface normal at the projection point. * @default [0, 1, 0] */ normal: Base.Vector3; /** * Size of the projection box on each axis. * @default [1, 1, 1] */ size: Base.Vector3; /** * Angle to rotate the projection around the projection direction, in radians. * @default 0 * @step 0.1 */ angle: number; } /** * Feeds `babylon.decal.clearDecalMap` with the decal map to empty. */ class DecalMapDto { constructor(decalMap?: BABYLON.MeshUVSpaceRenderer); /** * Decal map renderer to operate on. * @default undefined */ decalMap: BABYLON.MeshUVSpaceRenderer; } } /** * Parameters for 3D Gaussian Splatting scenes: the splat file to load and the options that control how * it is positioned, scaled and rendered. This is how photographic scans of real objects are shown * alongside modelled geometry. */ declare namespace BabylonGaussianSplatting { /** * Feeds `babylon.gaussianSplatting.create` with the address of the `.ply` file to load. */ class CreateGaussianSplattingMeshDto { constructor(url?: string); /** * Address of the Gaussian splatting `.ply` file * @default undefined */ url: string; } /** * Feeds `babylon.gaussianSplatting.clone` and `getSplatPositions` with the loaded splatting * mesh to work on. */ class GaussianSplattingMeshDto { constructor(babylonMesh?: BABYLON.GaussianSplattingMesh); /** * The loaded Gaussian splatting mesh */ babylonMesh: BABYLON.GaussianSplattingMesh; } } /** * Parameters for the on-screen manipulators that let a user drag, rotate and scale an object directly: * which axes are enabled, snapping increments, size and color. */ declare namespace BabylonGizmo { enum positionGizmoObservableSelectorEnum { /** Fires an event when any of it's sub gizmos are dragged */ onDragStartObservable = "onDragStartObservable", /** Fires an event when any of it's sub gizmos are being dragged */ onDragObservable = "onDragObservable", /** Fires an event when any of it's sub gizmos are released from dragging */ onDragEndObservable = "onDragEndObservable" } enum rotationGizmoObservableSelectorEnum { /** Fires an event when any of it's sub gizmos are dragged */ onDragStartObservable = "onDragStartObservable", /** Fires an event when any of it's sub gizmos are being dragged */ onDragObservable = "onDragObservable", /** Fires an event when any of it's sub gizmos are released from dragging */ onDragEndObservable = "onDragEndObservable" } enum scaleGizmoObservableSelectorEnum { /** Fires an event when any of it's sub gizmos are dragged */ onDragStartObservable = "onDragStartObservable", /** Fires an event when any of it's sub gizmos are being dragged */ onDragObservable = "onDragObservable", /** Fires an event when any of it's sub gizmos are released from dragging */ onDragEndObservable = "onDragEndObservable" } enum boundingBoxGizmoObservableSelectorEnum { /** * Fired when a rotation anchor or scale box is dragged */ onDragStartObservable = "onDragStartObservable", /** * Fired when a scale box is dragged */ onScaleBoxDragObservable = "onScaleBoxDragObservable", /** * Fired when a scale box drag is ended */ onScaleBoxDragEndObservable = "onScaleBoxDragEndObservable", /** * Fired when a rotation anchor is dragged */ onRotationSphereDragObservable = "onRotationSphereDragObservable", /** * Fired when a rotation anchor drag is ended */ onRotationSphereDragEndObservable = "onRotationSphereDragEndObservable" } /** * Feeds `babylon.gizmo.manager.createGizmoManager`: which gizmos to enable, which meshes they * may attach to, how the pointer attaches them and how large they are drawn. */ class CreateGizmoDto { constructor(positionGizmoEnabled?: boolean, rotationGizmoEnabled?: boolean, scaleGizmoEnabled?: boolean, boundingBoxGizmoEnabled?: boolean, attachableMeshes?: BABYLON.AbstractMesh[], clearGizmoOnEmptyPointerEvent?: boolean, scaleRatio?: number, usePointerToAttachGizmos?: boolean); /** * When true, the arrows that drag the mesh along an axis are shown * @default true */ positionGizmoEnabled: boolean; /** * When true, the rings that turn the mesh around an axis are shown * @default false */ rotationGizmoEnabled: boolean; /** * When true, the handles that stretch the mesh along an axis are shown * @default false */ scaleGizmoEnabled: boolean; /** * When true, the frame with scale and rotate handles around the mesh is shown * @default false */ boundingBoxGizmoEnabled: boolean; /** * When true, clicking a mesh attaches the gizmos to it; when false, attach them with * `attachToMesh` * @default true */ usePointerToAttachGizmos: boolean; /** * When true, clicking into empty space detaches the gizmos * @default false */ clearGizmoOnEmptyPointerEvent: boolean; /** * How large the gizmo handles are drawn; 1 is the default size and 2 doubles it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ scaleRatio: number; /** * The only meshes the pointer may attach the gizmos to; left out or empty, any mesh * qualifies * @default undefined * @optional true */ attachableMeshes?: BABYLON.AbstractMesh[] | undefined; } /** * Feeds `babylon.gizmo.base.getScaleRatio` with the one gizmo to read from, of any kind. */ class GizmoDto { constructor(gizmo?: BABYLON.IGizmo); /** * The gizmo to read from, of any kind * @default undefined */ gizmo: BABYLON.IGizmo; } /** * Feeds `babylon.gizmo.base.scaleRatio` with a gizmo and how large its handles are drawn. */ class SetGizmoScaleRatioDto { constructor(gizmo?: BABYLON.IGizmo, scaleRatio?: number); /** * The gizmo to change, of any kind * @default undefined */ gizmo: BABYLON.IGizmo; /** * How large the handles are drawn; 1 is the default size and 2 doubles it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ scaleRatio: number; } /** * Feeds the `babylon.gizmo.manager` methods that take just the manager: the gizmo getters and * `detachMesh`. */ class GizmoManagerDto { constructor(gizmoManager?: BABYLON.GizmoManager); /** * The gizmo manager, as `createGizmoManager` gave it * @default undefined */ gizmoManager: BABYLON.GizmoManager; } /** * Feeds the `babylon.gizmo.positionGizmo` getters with the position gizmo to read from. */ class PositionGizmoDto { constructor(positionGizmo?: BABYLON.IPositionGizmo); /** * The position gizmo, as `gizmo.manager.getPositionGizmo` reads it * @default undefined */ positionGizmo: BABYLON.IPositionGizmo; } /** * Feeds `babylon.gizmo.positionGizmo.planarGizmoEnabled` with a position gizmo and whether its * plane handles show. */ class SetPlanarGizmoEnabled { constructor(positionGizmo?: BABYLON.IPositionGizmo, planarGizmoEnabled?: boolean); /** * The position gizmo, as `gizmo.manager.getPositionGizmo` reads it * @default undefined */ positionGizmo: BABYLON.IPositionGizmo; /** * When true, the square handles that drag within a plane are shown next to the axis arrows * @default true */ planarGizmoEnabled: boolean; } /** * Feeds `babylon.gizmo.scaleGizmo.snapDistance` with a scale gizmo and the step it scales in. */ class SetScaleGizmoSnapDistanceDto { constructor(scaleGizmo?: BABYLON.IScaleGizmo, snapDistance?: number); /** * The scale gizmo, as `gizmo.manager.getScaleGizmo` reads it * @default undefined */ scaleGizmo: BABYLON.IScaleGizmo; /** * The step the scale changes in while dragged; 0 scales smoothly * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ snapDistance: number; } /** * Feeds `babylon.gizmo.scaleGizmo.setIncrementalSnap` with a scale gizmo and how its snapping * steps combine. */ class SetScaleGizmoIncrementalSnapDto { constructor(scaleGizmo?: BABYLON.IScaleGizmo, incrementalSnap?: boolean); /** * The scale gizmo, as `gizmo.manager.getScaleGizmo` reads it * @default undefined */ scaleGizmo: BABYLON.IScaleGizmo; /** * When true, the steps add up, 1.1 then 1.2; when false, they multiply, 1.1 then 1.21 * @default false */ incrementalSnap: boolean; } /** * Feeds `babylon.gizmo.scaleGizmo.sensitivity` with a scale gizmo and how much a drag scales * the mesh. */ class SetScaleGizmoSensitivityDto { constructor(scaleGizmo?: BABYLON.IScaleGizmo, sensitivity?: number); /** * The scale gizmo, as `gizmo.manager.getScaleGizmo` reads it * @default undefined */ scaleGizmo: BABYLON.IScaleGizmo; /** * How much the scale changes for a given drag; 1 is the default and higher is faster * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ sensitivity: number; } /** * Feeds the `babylon.gizmo.scaleGizmo` getters with the scale gizmo to read from. */ class ScaleGizmoDto { constructor(scaleGizmo?: BABYLON.IScaleGizmo); /** * The scale gizmo, as `gizmo.manager.getScaleGizmo` reads it * @default undefined */ scaleGizmo: BABYLON.IScaleGizmo; } /** * Feeds the `babylon.gizmo.boundingBoxGizmo` getters with the bounding box gizmo to read from. */ class BoundingBoxGizmoDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setRotationSphereSize` with a bounding box gizmo and * the size of its rotation handles. */ class SetBoundingBoxGizmoRotationSphereSizeDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, rotationSphereSize?: number); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * Size of the round rotation handles on the edges, in scene units unless a fixed screen * size is on * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ rotationSphereSize: number; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setFixedDragMeshScreenSize` with a bounding box gizmo * and whether its handles keep a constant screen size. */ class SetBoundingBoxGizmoFixedDragMeshScreenSizeDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, fixedDragMeshScreenSize?: boolean); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * When true, the handles keep the same size on screen whatever the camera distance; it wins * over the bounds size option * @default false */ fixedDragMeshScreenSize: boolean; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setFixedDragMeshBoundsSize` with a bounding box gizmo * and whether its handles scale with the mesh bounds. */ class SetBoundingBoxGizmoFixedDragMeshBoundsSizeDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, fixedDragMeshBoundsSize?: boolean); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * When true, the handles are sized relative to the bounds of the attached mesh rather than * a fixed world size * @default false */ fixedDragMeshBoundsSize: boolean; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setFixedDragMeshScreenSizeDistanceFactor` with a * bounding box gizmo and the camera distance its handles are sized for. */ class SetBoundingBoxGizmoFixedDragMeshScreenSizeDistanceFactorDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, fixedDragMeshScreenSizeDistanceFactor?: number); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * The camera distance at which the handles appear at their world size when the fixed screen * size is on * @default 10 * @minimum 0 * @maximum Infinity * @step 0.1 */ fixedDragMeshScreenSizeDistanceFactor: number; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setScalingSnapDistance` with a bounding box gizmo and * the drag step it scales in. */ class SetBoundingBoxGizmoScalingSnapDistanceDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, scalingSnapDistance?: number); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * The drag distance in scene units between scale steps; 0 scales smoothly * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ scalingSnapDistance: number; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setRotationSnapDistance` with a bounding box gizmo and * the angle step it rotates in. */ class SetBoundingBoxGizmoRotationSnapDistanceDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, rotationSnapDistance?: number); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * The step in radians the mesh turns in while dragged; 0 turns it smoothly * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ rotationSnapDistance: number; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setScaleBoxSize` with a bounding box gizmo and the size * of its scale handles. */ class SetBoundingBoxGizmoScaleBoxSizeDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, scaleBoxSize?: number); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * Size of the square scale handles on the corners, in scene units unless a fixed screen * size is on * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ scaleBoxSize: number; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setIncrementalSnap` with a bounding box gizmo and how * its scale snapping steps combine. */ class SetBoundingBoxGizmoIncrementalSnapDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, incrementalSnap?: boolean); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * When true, the steps add up, 1.1 then 1.2; when false, they multiply, 1.1 then 1.21 * @default false */ incrementalSnap: boolean; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setScalePivot` with a bounding box gizmo and the point * it scales the mesh around. */ class SetBoundingBoxGizmoScalePivotDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, scalePivot?: Base.Vector3); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * The pivot as fractions of the bounds: `[0.5, 0.5, 0.5]` the center, `[0.5, 0, 0.5]` the * bottom; unset, the opposite corner * @default undefined */ scalePivot: Base.Vector3; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setAxisFactor` with a bounding box gizmo and a drag * sensitivity per axis. */ class SetBoundingBoxGizmoAxisFactorDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, axisFactor?: Base.Vector3); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * A factor per axis as `[x, y, z]` that scales how fast dragging changes that axis; 1 is * normal * @default undefined */ axisFactor: Base.Vector3; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.setScaleDragSpeed` with a bounding box gizmo and how * fast a drag scales the mesh. */ class SetBoundingBoxGizmoScaleDragSpeedDto { constructor(boundingBoxGizmo?: BABYLON.BoundingBoxGizmo, scaleDragSpeed?: number); /** * The bounding box gizmo, as `gizmo.manager.getBoundingBoxGizmo` reads it * @default undefined */ boundingBoxGizmo: BABYLON.BoundingBoxGizmo; /** * How fast the scale changes for a given drag; 1 is the default and higher is faster * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ scaleDragSpeed: number; } /** * Feeds `babylon.gizmo.positionGizmo.snapDistance` with a position gizmo and the step it moves * the mesh in. */ class SetPositionGizmoSnapDistanceDto { constructor(positionGizmo?: BABYLON.IPositionGizmo, snapDistance?: number); /** * The position gizmo, as `gizmo.manager.getPositionGizmo` reads it * @default undefined */ positionGizmo: BABYLON.IPositionGizmo; /** * The step in scene units the mesh moves in while dragged; 0 moves it smoothly * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ snapDistance: number; } /** * Feeds `babylon.gizmo.rotationGizmo.snapDistance` with a rotation gizmo and the angle step it * turns in. */ class SetRotationGizmoSnapDistanceDto { constructor(rotationGizmo?: BABYLON.IRotationGizmo, snapDistance?: number); /** * The rotation gizmo, as `gizmo.manager.getRotationGizmo` reads it * @default undefined */ rotationGizmo: BABYLON.IRotationGizmo; /** * The step in radians the mesh turns in while dragged; 0 turns it smoothly * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ snapDistance: number; } /** * Feeds `babylon.gizmo.rotationGizmo.sensitivity` with a rotation gizmo and how far a drag * turns the mesh. */ class SetRotationGizmoSensitivityDto { constructor(rotationGizmo?: BABYLON.IRotationGizmo, sensitivity?: number); /** * The rotation gizmo, as `gizmo.manager.getRotationGizmo` reads it * @default undefined */ rotationGizmo: BABYLON.IRotationGizmo; /** * How far the mesh turns for a given drag; 1 is the default and higher is faster * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ sensitivity: number; } /** * Feeds the `babylon.gizmo.rotationGizmo` getters with the rotation gizmo to read from. */ class RotationGizmoDto { constructor(rotationGizmo?: BABYLON.IRotationGizmo); /** * The rotation gizmo, as `gizmo.manager.getRotationGizmo` reads it * @default undefined */ rotationGizmo: BABYLON.IRotationGizmo; } /** * Feeds `babylon.gizmo.axisScaleGizmo.getIsEnabled` with one axis handle of a scale gizmo. */ class AxisScaleGizmoDto { constructor(axisScaleGizmo?: BABYLON.IAxisScaleGizmo); /** * One axis handle of a scale gizmo, as `scaleGizmo.getXGizmo` and its siblings read it * @default undefined */ axisScaleGizmo: BABYLON.IAxisScaleGizmo; } /** * Feeds `babylon.gizmo.axisScaleGizmo.setIsEnabled` with one axis handle of a scale gizmo and * whether it is shown. */ class SetIsEnabledAxisScaleGizmoDto { constructor(axisScaleGizmo?: BABYLON.IAxisScaleGizmo, isEnabled?: boolean); /** * One axis handle of a scale gizmo, as `scaleGizmo.getXGizmo` and its siblings read it * @default undefined */ axisScaleGizmo: BABYLON.IAxisScaleGizmo; /** * When true, the handle is shown and usable; when false, that axis cannot be scaled * @default true */ isEnabled: boolean; } /** * Feeds `babylon.gizmo.axisDragGizmo.getIsEnabled` with one arrow of a position gizmo. */ class AxisDragGizmoDto { constructor(axisDragGizmo?: BABYLON.IAxisDragGizmo); /** * One arrow of a position gizmo, as `positionGizmo.getXGizmo` and its siblings read it * @default undefined */ axisDragGizmo: BABYLON.IAxisDragGizmo; } /** * Feeds `babylon.gizmo.axisDragGizmo.setIsEnabled` with one arrow of a position gizmo and * whether it is shown. */ class SetIsEnabledAxisDragGizmoDto { constructor(axisDragGizmo?: BABYLON.IAxisDragGizmo, isEnabled?: boolean); /** * One arrow of a position gizmo, as `positionGizmo.getXGizmo` and its siblings read it * @default undefined */ axisDragGizmo: BABYLON.IAxisDragGizmo; /** * When true, the arrow is shown and usable; when false, the mesh cannot be dragged along * that axis * @default true */ isEnabled: boolean; } /** * Feeds `babylon.gizmo.planeRotationGizmo.setIsEnabled` with one ring of a rotation gizmo and * whether it is shown. */ class SetIsEnabledPlaneRotationGizmoDto { constructor(planeRotationGizmo?: BABYLON.IPlaneRotationGizmo, isEnabled?: boolean); /** * One ring of a rotation gizmo, as `rotationGizmo.getXGizmo` and its siblings read it * @default undefined */ planeRotationGizmo: BABYLON.IPlaneRotationGizmo; /** * When true, the ring is shown and usable; when false, the mesh cannot be turned around * that axis * @default true */ isEnabled: boolean; } /** * Feeds `babylon.gizmo.planeDragGizmo.setIsEnabled` with one plane handle of a position gizmo * and whether it is shown. */ class SetIsEnabledPlaneDragGizmoDto { constructor(planeDragGizmo?: BABYLON.IPlaneDragGizmo, isEnabled?: boolean); /** * One plane handle of a position gizmo, as `positionGizmo.getXPlaneGizmo` and its siblings * read it * @default undefined */ planeDragGizmo: BABYLON.IPlaneDragGizmo; /** * When true, the handle is shown and usable; when false, the mesh cannot slide in that * plane * @default true */ isEnabled: boolean; } /** * Feeds `babylon.gizmo.planeDragGizmo.getIsEnabled` with one plane handle of a position gizmo. */ class PlaneDragGizmoDto { constructor(planeDragGizmo?: BABYLON.IPlaneDragGizmo); /** * One plane handle of a position gizmo, as `positionGizmo.getXPlaneGizmo` and its siblings * read it * @default undefined */ planeDragGizmo: BABYLON.IPlaneDragGizmo; } /** * Feeds `babylon.gizmo.planeRotationGizmo.getIsEnabled` with one ring of a rotation gizmo. */ class PlaneRotationGizmoDto { constructor(planeRotationGizmo?: BABYLON.IPlaneRotationGizmo); /** * One ring of a rotation gizmo, as `rotationGizmo.getXGizmo` and its siblings read it * @default undefined */ planeRotationGizmo: BABYLON.IPlaneRotationGizmo; } /** * Feeds `babylon.gizmo.manager.attachToMesh` with the manager and the mesh its gizmos should * appear on. */ class AttachToMeshDto { constructor(mesh: BABYLON.AbstractMesh, gizmoManager: BABYLON.GizmoManager); /** * The mesh the gizmos attach to; the mesh attached before is released */ mesh: BABYLON.AbstractMesh; /** * The gizmo manager, as `createGizmoManager` gave it */ gizmoManager: BABYLON.GizmoManager; } /** * Feeds `babylon.gizmo.positionGizmo.createPositionGizmoObservableSelector` with the name of * the drag event to select. */ class PositionGizmoObservableSelectorDto { constructor(selector: positionGizmoObservableSelectorEnum); /** * Which event: drag start, drag or drag end */ selector: positionGizmoObservableSelectorEnum; } /** * Feeds `babylon.gizmo.boundingBoxGizmo.createBoundingBoxGizmoObservableSelector` with the name * of the handle event to select. */ class BoundingBoxGizmoObservableSelectorDto { constructor(selector: boundingBoxGizmoObservableSelectorEnum); /** * Which event: a drag start, or a scale box or rotation sphere drag and its end */ selector: boundingBoxGizmoObservableSelectorEnum; } /** * Feeds `babylon.gizmo.rotationGizmo.createRotationGizmoObservableSelector` with the name of * the drag event to select. */ class RotationGizmoObservableSelectorDto { constructor(selector: rotationGizmoObservableSelectorEnum); /** * Which event: drag start, drag or drag end */ selector: rotationGizmoObservableSelectorEnum; } /** * Feeds `babylon.gizmo.scaleGizmo.createScaleGizmoObservableSelector` with the name of the drag * event to select. */ class ScaleGizmoObservableSelectorDto { constructor(selector: scaleGizmoObservableSelectorEnum); /** * Which event: drag start, drag or drag end */ selector: scaleGizmoObservableSelectorEnum; } } /** * Parameters for glTF and GLB: the file or URL to import, what to do with its nodes, materials, * textures and animations, and the options that control export back out. */ declare namespace BabylonGltf { /** * Feeds the `babylon.gltf` methods that read a loaded asset container: its root node, meshes * and animation groups. */ class AssetContainerDto { constructor(assetContainer?: BABYLON.AssetContainer); /** * The container a glTF or glb load gave back, holding the meshes, materials, animations and * root node * @default undefined */ assetContainer: BABYLON.AssetContainer; } /** * Feeds the `babylon.gltf` material variant methods with the root node of a loaded glTF asset, * as `getRootNode` reads it. */ class GltfRootNodeDto { constructor(rootNode?: BABYLON.TransformNode); /** * The root transform node of a loaded glTF asset; material variants are looked up from it * @default undefined */ rootNode: BABYLON.TransformNode; } /** * Feeds `babylon.gltf.selectMaterialVariant` with the root node of a loaded glTF asset and the * name of the material variant to switch to. */ class SelectVariantDto { constructor(rootNode?: BABYLON.TransformNode, variantName?: string); /** * The root transform node of a loaded glTF asset that declares material variants * @default undefined */ rootNode: BABYLON.TransformNode; /** * The variant to activate, one of the names `listMaterialVariants` gives * @default undefined */ variantName: string; } /** * Feeds `babylon.gltf.playAnimationGroup` with the animation to start, whether it repeats and * how fast it plays. */ class PlayAnimationGroupDto { constructor(animationGroup?: BABYLON.AnimationGroup, loop?: boolean, speedRatio?: number); /** * The animation from a loaded asset, as `getAnimationGroups` lists them * @default undefined */ animationGroup: BABYLON.AnimationGroup; /** * When true, the animation starts over each time it reaches its end * @default true */ loop: boolean; /** * Playback speed where 1 is normal, 2 twice as fast and 0.5 half speed * @default 1 * @step 0.1 */ speedRatio: number; } /** * Feeds `babylon.gltf.stopAnimationGroup` with the running animation to stop where it is. */ class AnimationGroupDto { constructor(animationGroup?: BABYLON.AnimationGroup); /** * The animation from a loaded asset, as `getAnimationGroups` lists them * @default undefined */ animationGroup: BABYLON.AnimationGroup; } } /** * Parameters for the in-scene 2D interface: buttons, sliders, checkboxes, color pickers, text blocks, * input fields, images and the containers that lay them out. Use it for controls that live inside the * 3D canvas rather than in the surrounding page. */ declare namespace BabylonGui { /** * Horizontal alignment of an in-scene GUI control within its container. */ enum horizontalAlignmentEnum { left = "left", center = "center", right = "right" } /** * Vertical alignment of an in-scene GUI control within its container. */ enum verticalAlignmentEnum { top = "top", center = "center", bottom = "bottom" } enum inputTextObservableSelectorEnum { /** Observable raised when the text changes */ onTextChangedObservable = "onTextChangedObservable", /** Observable raised just before an entered character is to be added */ onBeforeKeyAddObservable = "onBeforeKeyAddObservable", /** Observable raised when the text is highlighted */ onTextHighlightObservable = "onTextHighlightObservable", /** Observable raised when copy event is triggered */ onTextCopyObservable = "onTextCopyObservable", /** Observable raised when cut event is triggered */ onTextCutObservable = "onTextCutObservable", /** Observable raised when paste event is triggered */ onTextPasteObservable = "onTextPasteObservable" } enum sliderObservableSelectorEnum { /** * Raised when the value has changed */ onValueChangedObservable = "onValueChangedObservable" } enum colorPickerObservableSelectorEnum { /** * Raised when the value has changed */ onValueChangedObservable = "onValueChangedObservable" } enum textBlockObservableSelectorEnum { /** * Raised when the text has changed */ onTextChangedObservable = "onTextChangedObservable" } enum checkboxObservableSelectorEnum { /** * Raised when the checkbox is checked or unchecked */ onIsCheckedChangedObservable = "onIsCheckedChangedObservable" } enum radioButtonObservableSelectorEnum { /** * Raised when the radio button is checked or unchecked */ onIsCheckedChangedObservable = "onIsCheckedChangedObservable" } enum controlObservableSelectorEnum { onFocusObservable = "onFocusObservable", onBlurObservable = "onBlurObservable", /** * Observable that fires whenever the accessibility event of the control has changed */ onAccessibilityTagChangedObservable = "onAccessibilityTagChangedObservable", /** * An event triggered when pointer wheel is scrolled */ onWheelObservable = "onWheelObservable", /** * An event triggered when the pointer moves over the control. */ onPointerMoveObservable = "onPointerMoveObservable", /** * An event triggered when the pointer moves out of the control. */ onPointerOutObservable = "onPointerOutObservable", /** * An event triggered when the pointer taps the control */ onPointerDownObservable = "onPointerDownObservable", /** * An event triggered when pointer up */ onPointerUpObservable = "onPointerUpObservable", /** * An event triggered when a control is clicked on */ onPointerClickObservable = "onPointerClickObservable", /** * An event triggered when a control receives an ENTER key down event */ onEnterPressedObservable = "onEnterPressedObservable", /** * An event triggered when pointer enters the control */ onPointerEnterObservable = "onPointerEnterObservable", /** * An event triggered when the control is marked as dirty */ onDirtyObservable = "onDirtyObservable", /** * An event triggered before drawing the control */ onBeforeDrawObservable = "onBeforeDrawObservable", /** * An event triggered after the control was drawn */ onAfterDrawObservable = "onAfterDrawObservable", /** * An event triggered when the control has been disposed */ onDisposeObservable = "onDisposeObservable", /** * An event triggered when the control isVisible is changed */ onIsVisibleChangedObservable = "onIsVisibleChangedObservable" } /** * Feeds `babylon.gui.advancedDynamicTexture.createFullScreenUI`: the name of the full-screen * GUI layer, whether it draws in front of the scene and whether it scales with pixel density. */ class CreateFullScreenUIDto { constructor(name?: string, foreground?: boolean, adaptiveScaling?: boolean); /** * Name the GUI layer is known by in the scene * @default fullscreen */ name: string; /** * When true, the layer is drawn in front of the scene; when false, behind it * @default true */ foreground?: boolean | undefined; /** * When true, the layer scales with the screen's pixel density so controls keep their size * on dense displays * @default false */ adaptiveScaling?: boolean | undefined; } /** * Feeds `babylon.gui.advancedDynamicTexture.createForMesh`: the mesh a GUI texture is wrapped * onto, the texture size and the pointer, alpha, flip and sampling options. */ class CreateForMeshDto { constructor(mesh?: BABYLON.AbstractMesh, width?: number, height?: number, supportPointerMove?: boolean, onlyAlphaTesting?: boolean, invertY?: boolean, sampling?: BabylonTexture.samplingModeEnum); /** * The mesh the GUI is drawn on; it needs texture coordinates, a plane being the usual * choice * @default undefined */ mesh: BABYLON.AbstractMesh; /** * Width of the GUI texture in pixels; left out, the engine chooses * @default undefined * @optional true */ width?: number | undefined; /** * Height of the GUI texture in pixels; left out, the engine chooses * @default undefined * @optional true */ height?: number | undefined; /** * When true, controls on the mesh react to the pointer moving over them, at some extra cost * @default true */ supportPointerMove: boolean; /** * When true, transparent pixels are cut out instead of blended, which avoids sorting * problems * @default false */ onlyAlphaTesting: boolean; /** * When true, the texture is flipped top to bottom; the default is right for most meshes * @default true */ invertY: boolean; /** * How texture pixels are read when scaled: nearest keeps hard pixels, bilinear and * trilinear blend them * @default trilinear */ sampling: BabylonTexture.samplingModeEnum; } /** * Feeds `babylon.gui.stackPanel.createStackPanel`: the name, direction, spacing, optional sizes * and colors of a panel that lines its children up. */ class CreateStackPanelDto { constructor(name?: string, isVertical?: boolean, spacing?: number, width?: number | string, height?: number | string, color?: string, background?: string); /** * Name the panel is known by, which `control.getControlByName` finds it by * @default stackPanel */ name: string; /** * When true, children stack top to bottom; when false, left to right * @default true */ isVertical: boolean; /** * Gap between neighboring children, in pixels * @default 0 */ spacing: number; /** * Width as a pixel string or a fraction; give it for a vertical panel and leave it out for * a horizontal one, which sizes from its children * @default undefined * @optional true */ width?: number | string | undefined; /** * Height as a pixel string or a fraction; give it for a horizontal panel and leave it out * for a vertical one, which sizes from its children * @default undefined * @optional true */ height?: number | string | undefined; /** * CSS color of the panel's text and border; the default is fully transparent * @default #00000000 */ color: string; /** * CSS color behind the children; the default is a translucent black so the panel can be * seen * @default #00000055 */ background: string; } /** * Feeds `babylon.gui.stackPanel.setIsVertical` with a stack panel and its stacking direction. */ class SetStackPanelIsVerticalDto { constructor(stackPanel?: BABYLON.GUI.StackPanel, isVertical?: boolean); /** * The stack panel to change in place * @default undefined */ stackPanel: BABYLON.GUI.StackPanel; /** * When true, children stack top to bottom; when false, left to right * @default true */ isVertical: boolean; } /** * Feeds `babylon.gui.stackPanel.setSpacing` with a stack panel and the gap between its * children. */ class SetStackPanelSpacingDto { constructor(stackPanel?: BABYLON.GUI.StackPanel, spacing?: number); /** * The stack panel to change in place * @default undefined */ stackPanel: BABYLON.GUI.StackPanel; /** * Gap between neighboring children, in pixels * @default 0 */ spacing: number; } /** * Feeds `babylon.gui.stackPanel.setWidth` with a stack panel and its new width. */ class SetStackPanelWidthDto { constructor(stackPanel?: BABYLON.GUI.StackPanel, width?: number | string); /** * The stack panel to change in place * @default undefined */ stackPanel: BABYLON.GUI.StackPanel; /** * Width as a pixel string such as `300px` or a fraction of the parent from 0 to 1 * @default undefined */ width: number | string; } /** * Feeds `babylon.gui.stackPanel.setHeight` with a stack panel and its new height. */ class SetStackPanelHeightDto { constructor(stackPanel?: BABYLON.GUI.StackPanel, height?: number | string); /** * The stack panel to change in place * @default undefined */ stackPanel: BABYLON.GUI.StackPanel; /** * Height as a pixel string such as `300px` or a fraction of the parent from 0 to 1 * @default undefined */ height: number | string; } /** * Feeds the `babylon.gui.stackPanel` getters with the stack panel to read from. */ class StackPanelDto { constructor(stackPanel?: BABYLON.GUI.StackPanel); /** * The stack panel to read from * @default undefined */ stackPanel: BABYLON.GUI.StackPanel; } /** * Feeds the slider observable selector method with the name of the slider event to select. */ class SliderObservableSelectorDto { constructor(selector: sliderObservableSelectorEnum); /** * Which slider event, by its observable name * @default onValueChangedObservable */ selector: sliderObservableSelectorEnum; } /** * Feeds the color picker observable selector method with the name of the color picker event to * select. */ class ColorPickerObservableSelectorDto { constructor(selector: colorPickerObservableSelectorEnum); /** * Which color picker event, by its observable name * @default onValueChangedObservable */ selector: colorPickerObservableSelectorEnum; } /** * Feeds the text field observable selector method with the name of the text field event to * select. */ class InputTextObservableSelectorDto { constructor(selector: inputTextObservableSelectorEnum); /** * Which text field event, by its observable name * @default onTextChangedObservable */ selector: inputTextObservableSelectorEnum; } /** * Feeds the radio button observable selector method with the name of the radio button event to * select. */ class RadioButtonObservableSelectorDto { constructor(selector: radioButtonObservableSelectorEnum); /** * Which radio button event, by its observable name * @default onIsCheckedChangedObservable */ selector: radioButtonObservableSelectorEnum; } /** * Feeds the checkbox observable selector method with the name of the checkbox event to select. */ class CheckboxObservableSelectorDto { constructor(selector: checkboxObservableSelectorEnum); /** * Which checkbox event, by its observable name * @default onIsCheckedChangedObservable */ selector: checkboxObservableSelectorEnum; } /** * Feeds the control observable selector method with the name of the control event to select. */ class ControlObservableSelectorDto { constructor(selector: controlObservableSelectorEnum); /** * Which control event, by its observable name * @default onPointerClickObservable */ selector: controlObservableSelectorEnum; } /** * Feeds the text block observable selector method with the name of the text block event to * select. */ class TextBlockObservableSelectorDto { constructor(selector: textBlockObservableSelectorEnum); /** * Which text block event, by its observable name * @default onTextChangedObservable */ selector: textBlockObservableSelectorEnum; } /** * Feeds the `babylon.gui.container` getters with the container to read from. */ class ContainerDto { constructor(container?: BABYLON.GUI.Container); /** * The container to read from, a stack panel or the root of a GUI texture * @default undefined */ container: BABYLON.GUI.Container; } /** * Feeds `babylon.gui.container.addControls`: the container, the controls to put in it and * whether to empty it first. */ class AddControlsToContainerDto { constructor(container?: BABYLON.GUI.StackPanel, controls?: BABYLON.GUI.Control[], clearControlsFirst?: boolean); /** * The panel or root that receives the controls as its children * @default undefined */ container: BABYLON.GUI.Container; /** * The controls to add, in the order they should appear * @default undefined */ controls: BABYLON.GUI.Control[]; /** * When true, the container is emptied first, so the order is exactly the list's * @default true */ clearControlsFirst: boolean; } /** * Feeds `babylon.gui.control.getControlByName` with the container to search and the name to * look for. */ class GetControlByNameDto { constructor(container?: BABYLON.GUI.Container, name?: string); /** * The container searched, children included * @default undefined */ container: BABYLON.GUI.Container; /** * The name the control was created with * @default controlName */ name: string; } /** * Feeds `babylon.gui.control.setIsVisible` with a control and whether it is shown. */ class SetControlIsVisibleDto { constructor(control?: BABYLON.GUI.Control, isVisible?: boolean); /** * The control to change in place * @default undefined */ control: BABYLON.GUI.Control; /** * When true, the control is shown; when false, hidden while keeping its place in the layout * @default true */ isVisible: boolean; } /** * Feeds `babylon.gui.control.setIsReadonly` with a control and whether it ignores input. */ class SetControlIsReadonlyDto { constructor(control?: BABYLON.GUI.Control, isReadOnly?: boolean); /** * The control to change in place * @default undefined */ control: BABYLON.GUI.Control; /** * When true, the control is shown normally but ignores input * @default false */ isReadOnly: boolean; } /** * Feeds `babylon.gui.control.setIsEnabled` with a control and whether it is active. */ class SetControlIsEnabledDto { constructor(control?: BABYLON.GUI.Control, isEnabled?: boolean); /** * The control to change in place * @default undefined */ control: BABYLON.GUI.Control; /** * When true, the control is active; when false, it is drawn dimmed and ignores input * @default true */ isEnabled: boolean; } /** * Feeds `babylon.gui.image.createImage`: the name, the picture's address, a color and the * optional size of an image control. */ class CreateImageDto { constructor(name?: string, url?: string, color?: string, width?: number | string, height?: number | string); /** * Name the image is known by, which `control.getControlByName` finds it by * @default imageName */ name: string; /** * Address the picture is loaded from * @default undefined */ url: string; /** * CSS color of the control, used for its border * @default black */ color: string; /** * Width, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ width?: number | string | undefined; /** * Height, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ height?: number | string | undefined; } /** * Feeds `babylon.gui.image.setSourceUrl` with an image control and the address of its new * picture. */ class SetImageUrlDto { constructor(image?: BABYLON.GUI.Image, url?: string); /** * The image control to change in place * @default undefined */ image: BABYLON.GUI.Image; /** * Address the new picture is loaded from * @default undefined */ url: string; } /** * Feeds `babylon.gui.image.getSourceUrl` with the image control to read from. */ class ImageDto { constructor(image?: BABYLON.GUI.Image); /** * The image control to read from * @default undefined */ image: BABYLON.GUI.Image; } /** * Feeds `babylon.gui.button.createSimpleButton`: the name, label, colors, optional size and * font size of a button. */ class CreateButtonDto { constructor(name?: string, label?: string, color?: string, background?: string, width?: number | string, height?: number | string, fontSize?: number); /** * Name the button is known by, which `control.getControlByName` finds it by * @default buttonName */ name: string; /** * The text shown on the button * @default Click me! */ label: string; /** * CSS color of the label text * @default black */ color: string; /** * CSS color of the button's face * @default #f0cebb */ background: string; /** * Width, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ width?: number | string | undefined; /** * Height, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ height?: number | string | undefined; /** * Font size of the label, in pixels * @default 24 */ fontSize: number; } /** * Feeds `babylon.gui.button.setButtonText` with a button and its new label. */ class SetButtonTextDto { constructor(button?: BABYLON.GUI.Button, text?: string); /** * The button to change in place * @default undefined */ button: BABYLON.GUI.Button; /** * The text shown on the button from then on * @default Click me! */ text: string; } /** * Feeds `babylon.gui.button.getButtonText` with the button to read from. */ class ButtonDto { constructor(button?: BABYLON.GUI.Button); /** * The button to read from * @default undefined */ button: BABYLON.GUI.Button; } /** * Feeds `babylon.gui.colorPicker.createColorPicker`: the name, starting color and optional * sizes of a color picker. */ class CreateColorPickerDto { constructor(name?: string, defaultColor?: string, color?: string, width?: number | string, height?: number | string, size?: number | string); /** * Name the color picker is known by, which `control.getControlByName` finds it by * @default colorPickerName */ name: string; /** * Hex color the picker starts on * @default #f0cebb */ defaultColor: string; /** * CSS color of the control's border * @default #f0cebb */ color: string; /** * Width as a pixel string or a fraction; left out, 300 pixels * @default undefined * @optional true */ width?: number | string | undefined; /** * Height as a pixel string or a fraction; left out, 300 pixels * @default undefined * @optional true */ height?: number | string | undefined; /** * Width and height together, as a pixel string or a fraction; it overrides both when given * @default 300px * @optional true */ size?: number | string | undefined; } /** * Feeds `babylon.gui.colorPicker.setColorPickerValue` with a color picker and the color to move * it to. */ class SetColorPickerValueDto { constructor(colorPicker?: BABYLON.GUI.ColorPicker, color?: string); /** * The color picker to change in place * @default undefined */ colorPicker: BABYLON.GUI.ColorPicker; /** * Hex color the picker is set to * @default undefined */ color: string; } /** * Feeds `babylon.gui.colorPicker.setColorPickerSize` with a color picker and its new size. */ class SetColorPickerSizeDto { constructor(colorPicker?: BABYLON.GUI.ColorPicker, size?: number | string); /** * The color picker to change in place * @default undefined */ colorPicker: BABYLON.GUI.ColorPicker; /** * Width and height together, as a pixel string or a fraction * @default 300px * @optional true */ size?: number | string | undefined; } /** * Feeds the `babylon.gui.colorPicker` getters with the color picker to read from. */ class ColorPickerDto { constructor(colorPicker?: BABYLON.GUI.ColorPicker); /** * The color picker to read from * @default undefined */ colorPicker: BABYLON.GUI.ColorPicker; } /** * Feeds `babylon.gui.checkbox.createCheckbox`: the name, starting state, mark size, colors and * optional size of a checkbox. */ class CreateCheckboxDto { constructor(name?: string, isChecked?: boolean, checkSizeRatio?: number, color?: string, background?: string, width?: number | string, height?: number | string); /** * Name the checkbox is known by, which `control.getControlByName` finds it by * @default checkboxName */ name: string; /** * When true, the checkbox starts checked * @default false */ isChecked: boolean; /** * How much of the square the inner mark fills, from 0 to 1 * @default 0.8 * @minimum 0 * @maximum 1 * @step 0.05 */ checkSizeRatio: number; /** * CSS color of the mark and the border * @default #f0cebb */ color: string; /** * CSS color of the square behind the mark * @default black */ background: string; /** * Width, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ width?: number | string | undefined; /** * Height, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ height?: number | string | undefined; } /** * Feeds `babylon.gui.control.setFontSize` with a control and the font size of its text. */ class SetControlFontSizeDto { constructor(control?: BABYLON.GUI.Control, fontSize?: number); /** * The control to change in place * @default undefined */ control: BABYLON.GUI.Control; /** * Font size of the control's text, in pixels * @default 24 */ fontSize: number; } /** * Feeds `babylon.gui.control.setHeight` with a control and its new height. */ class SetControlHeightDto { constructor(control?: BABYLON.GUI.Control, height?: number | string); /** * The control to change in place * @default undefined */ control: BABYLON.GUI.Control; /** * Height as a pixel string such as `40px` or a fraction of the parent from 0 to 1 * @default undefined */ height: number | string; } /** * Feeds `babylon.gui.control.setWidth` with a control and its new width. */ class SetControlWidthDto { constructor(control?: BABYLON.GUI.Control, width?: number | string); /** * The control to change in place * @default undefined */ control: BABYLON.GUI.Control; /** * Width as a pixel string such as `200px` or a fraction of the parent from 0 to 1 * @default undefined */ width: number | string; } /** * Feeds `babylon.gui.control.setColor` with a control and its new main color. */ class SetControlColorDto { constructor(control?: BABYLON.GUI.Control, color?: string); /** * The control to change in place * @default undefined */ control: BABYLON.GUI.Control; /** * CSS color of the control's text or fill, depending on its kind * @default #f0cebb */ color: string; } /** * Feeds `babylon.gui.container.setBackground` with a container and its new background color. */ class SetContainerBackgroundDto { constructor(container?: BABYLON.GUI.Container, background?: string); /** * The container to change in place * @default undefined */ container: BABYLON.GUI.Container; /** * CSS color behind the container's children; an eight-digit hex makes it translucent * @default black */ background: string; } /** * Feeds `babylon.gui.container.setIsReadonly` with a container and whether it and its children * ignore input. */ class SetContainerIsReadonlyDto { constructor(container?: BABYLON.GUI.Container, isReadOnly?: boolean); /** * The container to change in place * @default undefined */ container: BABYLON.GUI.Container; /** * When true, the container and everything in it are shown normally but ignore input * @default false */ isReadOnly: boolean; } /** * Feeds `babylon.gui.checkbox.setBackground` with a checkbox and the color of its square. */ class SetCheckboxBackgroundDto { constructor(checkbox?: BABYLON.GUI.Checkbox, background?: string); /** * The checkbox to change in place * @default undefined */ checkbox: BABYLON.GUI.Checkbox; /** * CSS color of the square behind the mark * @default black */ background: string; } /** * Feeds `babylon.gui.checkbox.setCheckSizeRatio` with a checkbox and how large its mark is. */ class SetCheckboxCheckSizeRatioDto { constructor(checkbox?: BABYLON.GUI.Checkbox, checkSizeRatio?: number); /** * The checkbox to change in place * @default undefined */ checkbox: BABYLON.GUI.Checkbox; /** * How much of the square the inner mark fills, from 0 to 1 * @default 0.8 * @minimum 0 * @maximum 1 * @step 0.05 */ checkSizeRatio: number; } /** * Feeds the `babylon.gui.checkbox` getters with the checkbox to read from. */ class CheckboxDto { constructor(checkbox?: BABYLON.GUI.Checkbox); /** * The checkbox to read from * @default undefined */ checkbox: BABYLON.GUI.Checkbox; } /** * Feeds the `babylon.gui.control` getters with the control to read from, of any kind. */ class ControlDto { constructor(control?: BABYLON.GUI.Control); /** * The control to read from, of any kind * @default undefined */ control: BABYLON.GUI.Control; } /** * Feeds `babylon.gui.checkbox.setIsChecked` with a checkbox and its new state. */ class SetCheckboxIsCheckedDto { constructor(checkbox?: BABYLON.GUI.Checkbox, isChecked?: boolean); /** * The checkbox to change in place * @default undefined */ checkbox: BABYLON.GUI.Checkbox; /** * When true, the checkbox becomes checked; the change fires its event like a click * @default false */ isChecked: boolean; } /** * Feeds `babylon.gui.inputText.createInputText`: the name, starting text, placeholder, colors * and optional size of a text field. */ class CreateInputTextDto { constructor(name?: string, color?: string, background?: string, width?: number | string, height?: number | string); /** * Name the text field is known by, which `control.getControlByName` finds it by * @default inputName */ name: string; /** * The text the field starts with; empty shows the placeholder * @default */ text: string; /** * The hint shown while the field is empty * @default */ placeholder: string; /** * CSS color of the typed text * @default #f0cebb */ color: string; /** * CSS color behind the text * @default black */ background: string; /** * Width, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ width?: number | string | undefined; /** * Height, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ height?: number | string | undefined; } /** * Feeds `babylon.gui.inputText.setBackground` with a text field and its new background color. */ class SetInputTextBackgroundDto { constructor(inputText?: BABYLON.GUI.InputText, background?: string); /** * The text field to change in place * @default undefined */ inputText: BABYLON.GUI.InputText; /** * CSS color behind the text * @default black */ background: string; } /** * Feeds `babylon.gui.inputText.setText` with a text field and the text to put in it. */ class SetInputTextTextDto { constructor(inputText?: BABYLON.GUI.InputText, text?: string); /** * The text field to change in place * @default undefined */ inputText: BABYLON.GUI.InputText; /** * The text the field holds from then on; the change fires its event like typing * @default */ text: string; } /** * Feeds `babylon.gui.inputText.setPlaceholder` with a text field and its new hint. */ class SetInputTextPlaceholderDto { constructor(inputText?: BABYLON.GUI.InputText, placeholder?: string); /** * The text field to change in place * @default undefined */ inputText: BABYLON.GUI.InputText; /** * The hint shown while the field is empty * @default */ placeholder: string; } /** * Feeds the `babylon.gui.inputText` getters with the text field to read from. */ class InputTextDto { constructor(inputText?: BABYLON.GUI.InputText); /** * The text field to read from * @default undefined */ inputText: BABYLON.GUI.InputText; } /** * Feeds `babylon.gui.radioButton.createRadioButton`: the name, group, starting state, dot size, * colors and optional size of a radio button. */ class CreateRadioButtonDto { constructor(name?: string, group?: string, isChecked?: boolean, checkSizeRatio?: number, color?: string, background?: string, width?: number | string, height?: number | string); /** * Name the radio button is known by, which `control.getControlByName` finds it by * @default radioBtnName */ name: string; /** * Radio buttons sharing a group let only one of them be checked at a time; left out, the * button is in the unnamed group * @default undefined * @optional true */ group?: string | undefined; /** * When true, the radio button starts checked * @default false */ isChecked: boolean; /** * How much of the circle the inner dot fills, from 0 to 1 * @default 0.8 * @minimum 0 * @maximum 1 * @step 0.05 */ checkSizeRatio: number; /** * CSS color of the dot and the border * @default #f0cebb */ color: string; /** * CSS color of the circle behind the dot * @default black */ background: string; /** * Width, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ width?: number | string | undefined; /** * Height, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ height?: number | string | undefined; } /** * Feeds `babylon.gui.radioButton.setCheckSizeRatio` with a radio button and how large its dot * is. */ class SetRadioButtonCheckSizeRatioDto { constructor(radioButton?: BABYLON.GUI.RadioButton, checkSizeRatio?: number); /** * The radio button to change in place * @default undefined */ radioButton: BABYLON.GUI.RadioButton; /** * How much of the circle the inner dot fills, from 0 to 1 * @default 0.8 * @minimum 0 * @maximum 1 * @step 0.05 */ checkSizeRatio: number; } /** * Feeds `babylon.gui.radioButton.setGroup` with a radio button and the group it joins. */ class SetRadioButtonGroupDto { constructor(radioButton?: BABYLON.GUI.RadioButton, group?: string); /** * The radio button to change in place * @default undefined */ radioButton: BABYLON.GUI.RadioButton; /** * The group joined; only one radio button per group can be checked * @default */ group: string; } /** * Feeds `babylon.gui.radioButton.setBackground` with a radio button and the color of its * circle. */ class SetRadioButtonBackgroundDto { constructor(radioButton?: BABYLON.GUI.RadioButton, background?: string); /** * The radio button to change in place * @default undefined */ radioButton: BABYLON.GUI.RadioButton; /** * CSS color of the circle behind the dot * @default black */ background: string; } /** * Feeds the `babylon.gui.radioButton` getters with the radio button to read from. */ class RadioButtonDto { constructor(radioButton?: BABYLON.GUI.RadioButton); /** * The radio button to read from * @default undefined */ radioButton: BABYLON.GUI.RadioButton; } /** * Feeds `babylon.gui.slider.createSlider`: the name, range, starting value, step, direction, * colors, optional size and thumb of a slider. */ class CreateSliderDto { constructor(name?: string, minimum?: number, maximum?: number, value?: number, step?: number, isVertical?: boolean, color?: string, background?: string, width?: number | string, height?: number | string, displayThumb?: boolean); /** * Name the slider is known by, which `control.getControlByName` finds it by * @default sliderName */ name: string; /** * The value at the left or bottom end * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ minimum: number; /** * The value at the right or top end * @default 10 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ maximum: number; /** * The value the slider starts at, between the minimum and maximum * @default 5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ value: number; /** * The increment the value moves in; 1 gives whole numbers, 0 moves smoothly * @default 0.01 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ step: number; /** * When true, the slider runs bottom to top; when false, left to right * @default false */ isVertical: boolean; /** * CSS color of the filled part of the track * @default #f0cebb */ color: string; /** * CSS color of the unfilled part of the track * @default black */ background: string; /** * Width as a pixel string or a fraction; left out, a horizontal slider fills the parent and * a vertical one is 42 pixels * @default undefined * @optional true */ width?: number | string | undefined; /** * Height as a pixel string or a fraction; left out, a vertical slider fills the parent and * a horizontal one is 42 pixels * @default undefined * @optional true */ height?: number | string | undefined; /** * When true, the draggable thumb is drawn; when false, only the track * @default true */ displayThumb: boolean; } /** * Feeds `babylon.gui.textBlock.createTextBlock`: the name, text, color, optional size and font * size of a text block. */ class CreateTextBlockDto { constructor(name?: string, text?: string, color?: string, width?: number | string, height?: number | string); /** * Name the text block is known by, which `control.getControlByName` finds it by * @default textBlockName */ name: string; /** * The text shown * @default Hello World! */ text: string; /** * CSS color of the text * @default #f0cebb */ color: string; /** * Width, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ width?: number | string | undefined; /** * Height, as a pixel string such as `200px` or a fraction of the parent from 0 to 1; left * out, the engine chooses * @default undefined * @optional true */ height?: number | string | undefined; /** * Font size of the text, in pixels * @default 24 */ fontSize: number; } /** * Feeds `babylon.gui.textBlock.setText` with a text block and its new text. */ class SetTextBlockTextDto { constructor(textBlock?: BABYLON.GUI.TextBlock, text?: string); /** * The text block to change in place * @default undefined */ textBlock: BABYLON.GUI.TextBlock; /** * The text shown from then on * @default undefined */ text: string; } /** * Feeds `babylon.gui.textBlock.setRsizeToFit` with a text block and whether it sizes itself to * its text. */ class SetTextBlockResizeToFitDto { constructor(textBlock?: BABYLON.GUI.TextBlock, resizeToFit?: boolean); /** * The text block to change in place * @default undefined */ textBlock: BABYLON.GUI.TextBlock; /** * When true, the block grows or shrinks to fit its text instead of keeping its set size * @default false */ resizeToFit: boolean; } /** * Feeds `babylon.gui.textBlock.setTextWrapping` with a text block and how it handles text wider * than itself. */ class SetTextBlockTextWrappingDto { constructor(textBlock?: BABYLON.GUI.TextBlock, textWrapping?: boolean); /** * The text block to change in place * @default undefined */ textBlock: BABYLON.GUI.TextBlock; /** * True wraps onto new lines, false clips, or one of the engine's modes such as ellipsis * @default undefined */ textWrapping: boolean | BABYLON.GUI.TextWrapping; } /** * Feeds `babylon.gui.textBlock.setLineSpacing` with a text block and the extra space between * its lines. */ class SetTextBlockLineSpacingDto { constructor(textBlock?: BABYLON.GUI.TextBlock, lineSpacing?: string | number); /** * The text block to change in place * @default undefined */ textBlock: BABYLON.GUI.TextBlock; /** * Extra space between lines, as pixels or a string such as `4px` * @default undefined */ lineSpacing: string | number; } /** * Feeds the `babylon.gui.textBlock` getters with the text block to read from. */ class TextBlockDto { constructor(textBlock?: BABYLON.GUI.TextBlock); /** * The text block to read from * @default undefined */ textBlock: BABYLON.GUI.TextBlock; } /** * Feeds `babylon.gui.slider.changeSliderThumb`: the slider and the shape, color, width, * clamping and visibility of its thumb. */ class SliderThumbDto { constructor(slider?: BABYLON.GUI.Slider, isThumbCircle?: boolean, thumbColor?: string, thumbWidth?: string | number, isThumbClamped?: boolean, displayThumb?: boolean); /** * The slider whose thumb is restyled in place * @default undefined */ slider: BABYLON.GUI.Slider; /** * When true, the thumb is round; when false, square * @default false */ isThumbCircle: boolean; /** * CSS color of the thumb * @default white */ thumbColor: string; /** * Width of the thumb as a pixel string or a fraction; left out, the engine chooses * @default undefined * @optional true */ thumbWidth?: string | number | undefined; /** * When true, the thumb stays inside the track at the ends instead of overhanging it * @default false */ isThumbClamped: boolean; /** * When true, the thumb is drawn; when false, only the track * @default true */ displayThumb: boolean; } /** * Feeds the `babylon.gui.slider` getters with the slider to read from. */ class SliderDto { constructor(slider?: BABYLON.GUI.Slider); /** * The slider to read from * @default undefined */ slider: BABYLON.GUI.Slider; } /** * Feeds `babylon.gui.slider.setBorderColor` with a slider and the color of the line around its * track. */ class SliderBorderColorDto { constructor(slider?: BABYLON.GUI.Slider, borderColor?: string); /** * The slider to change in place * @default undefined */ slider: BABYLON.GUI.Slider; /** * CSS color of the line around the track * @default white */ borderColor: string; } /** * Feeds `babylon.gui.slider.setBackgroundColor` with a slider and the color of the unfilled * track. */ class SliderBackgroundColorDto { constructor(slider?: BABYLON.GUI.Slider, backgroundColor?: string); /** * The slider to change in place * @default undefined */ slider: BABYLON.GUI.Slider; /** * CSS color of the unfilled part of the track * @default black */ backgroundColor: string; } /** * Feeds `babylon.gui.slider.setValue`, `setMinimum`, `setMaximum` and `setStep` with a slider * and the number to set. */ class SetSliderValueDto { constructor(slider?: BABYLON.GUI.Slider, value?: number); /** * The slider to change in place * @default undefined */ slider: BABYLON.GUI.Slider; /** * The number set: the current value, the minimum, the maximum or the step, depending on the * method * @default 5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ value: number; } /** * Feeds `babylon.gui.control.changeControlPadding` with a control and the space kept clear on * each side of it. */ class PaddingLeftRightTopBottomDto { constructor(control?: BABYLON.GUI.Control, paddingLeft?: number | string, paddingRight?: number | string, paddingTop?: number | string, paddingBottom?: number | string); /** * The control to change in place * @default undefined */ control: BABYLON.GUI.Control; /** * Space kept clear on the left, as a pixel string or a fraction; left out, it stays as it * is * @default undefined * @optional true */ paddingLeft?: number | string | undefined; /** * Space kept clear on the right, as a pixel string or a fraction; left out, it stays as it * is * @default undefined * @optional true */ paddingRight?: number | string | undefined; /** * Space kept clear at the top, as a pixel string or a fraction; left out, it stays as it is * @default undefined * @optional true */ paddingTop?: number | string | undefined; /** * Space kept clear at the bottom, as a pixel string or a fraction; left out, it stays as it * is * @default undefined * @optional true */ paddingBottom?: number | string | undefined; } /** * Feeds `babylon.gui.control.cloneControl`: the control to copy, the container the copy goes * into, its name and its host texture. */ class CloneControlDto { constructor(control?: BABYLON.GUI.Control, container?: BABYLON.GUI.Container, name?: string, host?: BABYLON.GUI.AdvancedDynamicTexture); /** * The control to copy; it stays as it is * @default undefined */ control: BABYLON.GUI.Control; /** * The container the copy is added to; left out, the copy is not placed anywhere yet * @default undefined * @optional true */ container?: BABYLON.GUI.Container | undefined; /** * Name the copy is known by * @default clonedControl */ name: string; /** * The GUI texture the copy belongs to; left out, the original's host is used * @default undefined * @optional true */ host?: BABYLON.GUI.AdvancedDynamicTexture | undefined; } /** * Feeds `babylon.gui.control.changeControlAlignment` and `textBlock.alignText` with a control * and where it sits inside its parent. */ class AlignmentDto { constructor(control?: T, horizontalAlignment?: horizontalAlignmentEnum, verticalAlignment?: verticalAlignmentEnum); /** * The control to align in place * @default undefined */ control: T; /** * Left, center or right inside the parent * @default center */ horizontalAlignment: horizontalAlignmentEnum; /** * Top, center or bottom inside the parent * @default center */ verticalAlignment: verticalAlignmentEnum; } /** * Feeds `babylon.gui.textBlock.setTextOutline` with a text block and the width and color of the * outline around its letters. */ class SetTextBlockTextOutlineDto { constructor(textBlock?: BABYLON.GUI.TextBlock, outlineWidth?: number, outlineColor?: string); /** * The text block to change in place * @default undefined */ textBlock: BABYLON.GUI.TextBlock; /** * Width of the outline around the letters, in pixels; 0 removes it * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ outlineWidth: number; /** * CSS color of the outline * @default white */ outlineColor: string; } } /** * Parameters for engine-level import and export: the objects to write, the target format, and the * settings applied when reading a file back into the scene. */ declare namespace BabylonIO { /** * Feeds `babylon.io.exportGLB` with the file name and whether to leave out the skybox and * ground this library adds. */ class ExportSceneGlbDto { constructor(fileName?: string, discardSkyboxAndGrid?: boolean); /** * Name of the downloaded glb file, without the extension * @default bitbybit-scene */ fileName: string; /** * When true, the skybox and ground meshes this library adds are left out of the file * @default false * @optional true */ discardSkyboxAndGrid?: boolean | undefined; } /** * Feeds `babylon.io.exportGLBBytes` with the nodes to write, whether to leave out the skybox and * ground this library adds, and whether to compress the meshes with Draco. */ class ExportSceneGlbBytesDto { constructor(nodes?: BABYLON.Node[], discardSkyboxAndGrid?: boolean, compressWithDraco?: boolean); /** * The nodes to write; every ancestor of a chosen node is written too so it keeps its place, and when omitted the whole scene is written * @optional true */ nodes?: BABYLON.Node[] | undefined; /** * When true, the skybox and ground meshes this library adds are left out of the file * @default false * @optional true */ discardSkyboxAndGrid?: boolean | undefined; /** * When true, the mesh geometry is compressed with Draco, which makes the file smaller and slower to open * @default false * @optional true */ compressWithDraco?: boolean | undefined; } /** * Feeds `babylon.io.exportBabylon` with the name of the downloaded `.babylon` file. */ class ExportSceneDto { constructor(fileName?: string); /** * Name of the downloaded file; `.babylon` is added when missing * @default bitbybit-scene */ fileName: string; } /** * Feeds `babylon.io.exportMeshToStl` with the mesh to write, with its visible children, and the * file name. */ class ExportMeshToStlDto { constructor(mesh?: BABYLON.Mesh, fileName?: string); /** * The mesh written to the file together with its visible child meshes; lines are left out */ mesh: BABYLON.Mesh; /** * Name of the downloaded STL file * @default bitbybit-mesh */ fileName: string; } /** * Feeds `babylon.io.exportMeshesToStl` with the meshes to write into one file and the file * name. */ class ExportMeshesToStlDto { constructor(meshes?: BABYLON.Mesh[], fileName?: string); /** * The meshes written to the file, each with its child meshes; lines are left out */ meshes: BABYLON.Mesh[]; /** * Name of the downloaded STL file * @default bitbybit-mesh */ fileName: string; } } /** * Parameters for lights: direction, position, intensity, color, range and the shadow settings for * point, directional, spot and hemispheric lights. */ declare namespace BabylonLight { /** * Feeds `babylon.lights.shadowLight.setDirectionToTarget` with a light and the point to aim it * at. */ class ShadowLightDirectionToTargetDto { constructor(shadowLight?: BABYLON.ShadowLight, target?: Base.Vector3); /** * The shadow-casting light to aim * @default undefined */ shadowLight: BABYLON.ShadowLight; /** * The point the light is turned to shine at * @default undefined */ target: Base.Vector3; } /** * Feeds `babylon.lights.shadowLight.setPosition` with a light and the point to move it to. */ class ShadowLightPositionDto { constructor(shadowLight?: BABYLON.ShadowLight, position?: Base.Vector3); /** * The shadow-casting light to move * @default undefined */ shadowLight: BABYLON.ShadowLight; /** * The point the light is moved to; for a directional light, where its shadows are computed * from * @default undefined */ position: Base.Vector3; } } /** * Parameters for materials: base color, metallic and roughness, emissive and ambient contributions, * alpha and blending, backface culling, and the texture slots a physically-based material accepts. */ declare namespace BabylonMaterial { /** * Feeds `babylon.material.pbrMetallicRoughness.create`: the name, colors, metallic and * roughness values, opacity, culling and depth offset of a new material. */ class PBRMetallicRoughnessDto { constructor(name?: string, baseColor?: Base.Color, emissiveColor?: Base.Color, metallic?: number, roughness?: number, alpha?: number, backFaceCulling?: boolean, zOffset?: number); /** * Name the material is known by in the scene * @default Custom Material */ name: string; /** * Hex color of the surface under white light * @default #0000ff */ baseColor: Base.Color; /** * Hex color the surface glows with on its own, regardless of lighting; black glows not at * all * @default #000000 */ emissiveColor?: Base.Color | undefined; /** * How metallic the surface is, from 0 for paint or plastic to 1 for bare metal * @default 0.6 * @minimum 0 * @maximum 1 * @step 0.1 */ metallic: number; /** * How rough the surface is, from 0 for a mirror finish to 1 for fully matte * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ roughness: number; /** * Opacity from 0 for invisible to 1 for solid; values between make the surface see-through * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ alpha: number; /** * When true, the back of each face is skipped, which is faster; false shows both sides of * open meshes * @default false */ backFaceCulling: boolean; /** * Depth offset that pulls the surface toward or away from the camera when it fights with * another at the same depth; 0 for none * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ zOffset: number; } /** * Feeds `babylon.material.pbrMetallicRoughness.setBaseColor` with a material and its new base * color. */ class BaseColorDto { constructor(material?: BABYLON.PBRMetallicRoughnessMaterial, baseColor?: Base.Color); /** * The material to change in place * @default undefined */ material: BABYLON.PBRMetallicRoughnessMaterial; /** * Hex color of the surface under white light * @default #0000ff */ baseColor?: Base.Color | undefined; } /** * Feeds the `babylon.material.pbrMetallicRoughness` getters with the one material to read from. */ class MaterialPropDto { constructor(material?: BABYLON.PBRMetallicRoughnessMaterial); /** * The material to read from * @default undefined */ material: BABYLON.PBRMetallicRoughnessMaterial; } /** * Feeds the `babylon.material.skyMaterial` getters with the one sky material to read from. */ class SkyMaterialPropDto { constructor(skyMaterial?: MATERIALS.SkyMaterial); /** * The sky material to read from * @default undefined */ skyMaterial: MATERIALS.SkyMaterial; } /** * Feeds `babylon.material.pbrMetallicRoughness.setMetallic` with a material and its new * metallic value. */ class MetallicDto { constructor(material?: BABYLON.PBRMetallicRoughnessMaterial, metallic?: number); /** * The material to change in place * @default undefined */ material: BABYLON.PBRMetallicRoughnessMaterial; /** * How metallic the surface is, from 0 for paint or plastic to 1 for bare metal * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ metallic?: number | undefined; } /** * Feeds `babylon.material.pbrMetallicRoughness.setRoughness` with a material and its new * roughness. */ class RoughnessDto { constructor(material?: BABYLON.PBRMetallicRoughnessMaterial, roughness?: number); /** * The material to change in place * @default undefined */ material: BABYLON.PBRMetallicRoughnessMaterial; /** * How rough the surface is, from 0 for a mirror finish to 1 for fully matte * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ roughness?: number | undefined; } /** * Feeds `babylon.material.pbrMetallicRoughness.setAlpha` with a material and its new opacity. */ class AlphaDto { constructor(material?: BABYLON.PBRMetallicRoughnessMaterial, alpha?: number); /** * The material to change in place * @default undefined */ material: BABYLON.PBRMetallicRoughnessMaterial; /** * Opacity from 0 for invisible to 1 for solid * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ alpha?: number | undefined; } /** * Feeds `babylon.material.pbrMetallicRoughness.setBackFaceCulling` with a material and whether * back faces are skipped. */ class BackFaceCullingDto { constructor(material?: BABYLON.PBRMetallicRoughnessMaterial, backFaceCulling?: boolean); /** * The material to change in place * @default undefined */ material: BABYLON.PBRMetallicRoughnessMaterial; /** * When true, the back of each face is skipped when drawing; false shows both sides * @default true */ backFaceCulling?: boolean | undefined; } /** * Feeds `babylon.material.pbrMetallicRoughness.setBaseTexture` with a material and the image * texture that replaces its base color. */ class BaseTextureDto { constructor(material?: BABYLON.PBRMetallicRoughnessMaterial, baseTexture?: BABYLON.Texture); /** * The material to change in place * @default undefined */ material: BABYLON.PBRMetallicRoughnessMaterial; /** * The image texture spread over the surface in place of the base color * @default undefined */ baseTexture: BABYLON.Texture; } /** * Feeds `babylon.material.skyMaterial.create`: the atmosphere settings of a procedural sky and * where its sun stands. Values left out keep the engine's defaults. */ class SkyMaterialDto { constructor(luminance?: number, turbidity?: number, rayleigh?: number, mieCoefficient?: number, mieDirectionalG?: number, distance?: number, inclination?: number, azimuth?: number, sunPosition?: Base.Vector3, useSunPosition?: boolean, cameraOffset?: Base.Vector3, up?: Base.Vector3, dithering?: boolean); /** * Overall brightness of the sky, between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.01 */ luminance: number; /** * How hazy the air is; more haze whitens the sky and spreads the glow of the sun * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ turbidity: number; /** * How strongly light scatters the way that makes a clear sky blue; higher is a deeper blue * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ rayleigh: number; /** * How much haze gathers around the sun, between 0 and 0.1; more makes a wider, whiter glow * @default 0.005 * @minimum 0 * @maximum Infinity * @step 0.001 */ mieCoefficient: number; /** * How tightly the haze glow gathers around the sun; near 1 gives a small bright halo, lower * spreads it * @default 0.8 * @minimum 0 * @maximum Infinity * @step 0.1 */ mieDirectionalG: number; /** * How far the sky dome sits from the camera, which changes how the horizon reads * @default 500 * @minimum 0 * @maximum Infinity * @step 10 */ distance: number; /** * How high the sun stands, from -0.5 below the horizon through 0 at the horizon to 0.5 * overhead * @default 0.49 * @minimum -0.5 * @maximum 0.5 * @step 0.01 */ inclination: number; /** * Where around the horizon the sun stands, from 0 to 1 for a full turn * @default 0.25 * @minimum 0 * @maximum 1 * @step 0.01 */ azimuth: number; /** * An explicit direction to the sun, used only while `useSunPosition` is true; otherwise it * is derived from the inclination and azimuth * @default undefined * @optional true */ sunPosition?: Base.Vector3 | undefined; /** * When true, the sun is placed from `sunPosition`; when false, from inclination and azimuth * @default false */ useSunPosition: boolean; /** * An offset vector that shifts the horizon relative to the camera * @default undefined * @optional true */ cameraOffset?: Base.Vector3 | undefined; /** * The direction the sky treats as up; `[0, 1, 0]` for the usual Y-up scene * @default [0, 1, 0] */ up: number[]; /** * When true, fine noise hides color banding in the smooth gradients of the sky * @default false */ dithering: boolean; } /** * Feeds `babylon.material.skyMaterial.setLuminance` with a sky material and its new brightness. */ class LuminanceDto { constructor(material?: MATERIALS.SkyMaterial, luminance?: number); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * Overall brightness of the sky, between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.01 */ luminance?: number | undefined; } /** * Feeds `babylon.material.skyMaterial.setTurbidity` with a sky material and its new haziness. */ class TurbidityDto { constructor(material?: MATERIALS.SkyMaterial, turbidity?: number); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * How hazy the air is; more haze whitens the sky and spreads the glow of the sun * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ turbidity?: number | undefined; } /** * Feeds `babylon.material.skyMaterial.setRayleigh` with a sky material and its new Rayleigh * scattering. */ class RayleighDto { constructor(material?: MATERIALS.SkyMaterial, rayleigh?: number); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * How strongly light scatters the way that makes a clear sky blue; higher is a deeper blue * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ rayleigh?: number | undefined; } /** * Feeds `babylon.material.skyMaterial.setMieCoefficient` with a sky material and how much haze * surrounds its sun. */ class MieCoefficientDto { constructor(material?: MATERIALS.SkyMaterial, mieCoefficient?: number); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * How much haze gathers around the sun, between 0 and 0.1; more makes a wider, whiter glow * @default 0.005 * @minimum 0 * @maximum Infinity * @step 0.001 */ mieCoefficient?: number | undefined; } /** * Feeds `babylon.material.skyMaterial.setMieDirectionalG` with a sky material and how tightly * its haze glow gathers around the sun. */ class MieDirectionalGDto { constructor(material?: MATERIALS.SkyMaterial, mieDirectionalG?: number); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * How tightly the haze glow gathers around the sun; near 1 gives a small bright halo, lower * spreads it * @default 0.8 * @minimum 0 * @maximum Infinity * @step 0.1 */ mieDirectionalG?: number | undefined; } /** * Feeds `babylon.material.skyMaterial.setDistance` with a sky material and how far its dome * sits from the camera. */ class DistanceDto { constructor(material?: MATERIALS.SkyMaterial, distance?: number); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * How far the sky dome sits from the camera, which changes how the horizon reads * @default 500 * @minimum 0 * @maximum Infinity * @step 10 */ distance?: number | undefined; } /** * Feeds `babylon.material.skyMaterial.setInclination` with a sky material and how high its sun * stands. */ class InclinationDto { constructor(material?: MATERIALS.SkyMaterial, inclination?: number); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * How high the sun stands, from -0.5 below the horizon through 0 at the horizon to 0.5 * overhead * @default 0.49 * @minimum -0.5 * @maximum 0.5 * @step 0.01 */ inclination?: number | undefined; } /** * Feeds `babylon.material.skyMaterial.setAzimuth` with a sky material and where around the * horizon its sun stands. */ class AzimuthDto { constructor(material?: MATERIALS.SkyMaterial, azimuth?: number); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * Where around the horizon the sun stands, from 0 to 1 for a full turn * @default 0.25 * @minimum 0 * @maximum 1 * @step 0.01 */ azimuth?: number | undefined; } /** * Feeds `babylon.material.skyMaterial.setSunPosition` with a sky material and an explicit * direction to its sun. */ class SunPositionDto { constructor(material?: MATERIALS.SkyMaterial, sunPosition?: Base.Vector3); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * The direction to the sun as `[x, y, z]`; used only while `useSunPosition` is true, * otherwise inclination and azimuth decide * @default undefined */ sunPosition: Base.Vector3; } /** * Feeds `babylon.material.skyMaterial.setUseSunPosition` with a sky material and which way its * sun is placed. */ class UseSunPositionDto { constructor(material?: MATERIALS.SkyMaterial, useSunPosition?: boolean); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * When true, the sun is placed from `sunPosition`; when false, from inclination and azimuth * @default false */ useSunPosition?: boolean | undefined; } /** * Feeds `babylon.material.skyMaterial.setCameraOffset` with a sky material and the offset that * shifts its horizon. */ class CameraOffsetDto { constructor(material?: MATERIALS.SkyMaterial, cameraOffset?: Base.Vector3); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * An offset vector that shifts the horizon relative to the camera * @default undefined */ cameraOffset: Base.Vector3; } /** * Feeds `babylon.material.skyMaterial.setUp` with a sky material and the direction it treats as * up. */ class UpDto { constructor(material?: MATERIALS.SkyMaterial, up?: Base.Vector3); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * The direction the sky treats as up; `[0, 1, 0]` for the usual Y-up scene * @default undefined */ up: Base.Vector3; } /** * Feeds `babylon.material.skyMaterial.setDithering` with a sky material and whether it dithers * its gradients. */ class DitheringDto { constructor(material?: MATERIALS.SkyMaterial, dithering?: boolean); /** * The sky material to change in place * @default undefined */ material: MATERIALS.SkyMaterial; /** * When true, fine noise hides color banding in the smooth gradients of the sky * @default false */ dithering?: boolean | undefined; } } /** * Parameters for the engine's own mesh primitives - boxes, spheres, cylinders, planes, tubes, ribbons * and the rest. These build display geometry directly, without going through a CAD kernel, which is * the right choice for scene furniture that never has to be manufactured. */ declare namespace BabylonMeshBuilder { /** * Feeds `babylon.meshBuilder.createBox`: the three sizes of a box centered on the origin, plus * the side orientation and shadow flag every builder takes. */ class CreateBoxDto { constructor(width?: number, depth?: number, height?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Full size along X, in scene units * @default 1 */ width: number; /** * Full size along Z, in scene units * @default 1 */ depth: number; /** * Full size along Y, in scene units * @default 1 */ height: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createCube` with the edge length of a cube centered on the origin. */ class CreateCubeDto { constructor(size?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Length of every edge, in scene units * @default 1 */ size: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createSquarePlane` with the side of a flat square in the XY plane. */ class CreateSquarePlaneDto { constructor(size?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Length of each side, in scene units * @default 1 */ size: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createSphere` with the diameter of a sphere centered on the origin * and how finely it is divided. */ class CreateSphereDto { constructor(diameter?: number, segments?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Full width of the sphere, in scene units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ diameter: number; /** * Number of divisions around and over the sphere; more is rounder and heavier * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ segments: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createIcoSphere`: the radius of a triangle-based sphere, optional * per-axis radii, flat shading and how often it is subdivided. */ class CreateIcoSphereDto { constructor(radius?: number, radiusX?: number, radiusY?: number, radiusZ?: number, flat?: boolean, subdivisions?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Radius on every axis, in scene units, unless a per-axis radius overrides it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Radius along X, in scene units; 0 falls back to `radius` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusX: number; /** * Radius along Y, in scene units; 0 falls back to `radius` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusY: number; /** * Radius along Z, in scene units; 0 falls back to `radius` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusZ: number; /** * When true, each triangle is shaded flat, showing facets instead of a smooth surface * @default false */ flat: boolean; /** * How many times the starting icosahedron is subdivided; more is rounder and heavier * @default 4 * @minimum 0 * @maximum Infinity * @step 1 */ subdivisions: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createDisc`: the radius of a flat disc in the XY plane, how many * sides approximate it and how much of the full circle it covers. */ class CreateDiscDto { constructor(radius?: number, tessellation?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Distance from the center to the rim, in scene units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of straight sides around the rim; more is rounder * @default 32 * @minimum 3 * @maximum Infinity * @step 1 */ tessellation: number; /** * How much of the full circle is drawn, from 0 to 1; 0.5 gives a half disc * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ arc: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createRibbon`: the paths a surface is stretched over, how they * close and pair up, and whether the mesh can be updated later. */ class CreateRibbonDto { constructor(pathArray?: Base.Vector3[][], closeArray?: boolean, closePath?: boolean, offset?: number, updatable?: boolean, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * The paths, each a list of points; neighboring paths are joined with triangles */ pathArray: Base.Vector3[][]; /** * When true, the last path is joined back to the first, closing the surface around * @default false */ closeArray: boolean; /** * When true, each path is joined end to start, closing the surface along * @default false */ closePath: boolean; /** * When only one path is given, how many points apart the pairs that form triangles are * taken * @default 0 */ offset: number; /** * When true, the vertices of the mesh can be changed later without rebuilding it * @default false */ updatable: boolean; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createTorus`: the overall diameter of a ring in the XZ plane, the * diameter of its tube and how finely it is divided. */ class CreateTorusDto { constructor(diameter?: number, thickness?: number, tessellation?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Full width of the ring, in scene units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ diameter: number; /** * Diameter of the tube, in scene units * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ thickness: number; /** * Number of divisions around the ring and the tube; more is rounder * @default 32 * @minimum 3 * @maximum Infinity * @step 1 */ tessellation: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createTorusKnot`: the size of a knotted tube, its segment counts * and the two winding numbers that shape the knot. */ class CreateTorusKnotDto { constructor(radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, p?: number, q?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Overall radius of the knot, in scene units * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Radius of the tube, in scene units * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ tube: number; /** * Number of segments along the length of the tube; more is smoother * @default 128 * @minimum 3 * @maximum Infinity * @step 1 */ radialSegments: number; /** * Number of segments around the tube; more is rounder * @default 32 * @minimum 3 * @maximum Infinity * @step 1 */ tubularSegments: number; /** * How many times the tube winds around the axis of the ring; 2 with `q` 3 gives a trefoil * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ p: number; /** * How many times the tube winds through the hole of the ring; 3 with `p` 2 gives a trefoil * @default 3 * @minimum 0 * @maximum Infinity * @step 1 */ q: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createPolygon`: the outline of a flat polygon in the XZ plane, its * holes, an optional thickness and how it is shaded and wrapped. */ class CreatePolygonDto { constructor(shape?: Base.Vector3[], holes?: Base.Vector3[][], depth?: number, smoothingThreshold?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, wrap?: boolean, enableShadows?: boolean); /** * The outline points in order, only X and Z used; the outline must not cross itself */ shape: Base.Vector3[]; /** * Lists of points, one outline per hole cut out of the polygon * @optional true */ holes?: Base.Vector3[][] | undefined; /** * Thickness the polygon is given downward along Y, in scene units; 0 keeps it flat * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ depth: number; /** * How close two face normals must be for the edge between them to be shaded smooth * @default 0.01 * @minimum 0 * @maximum 1 * @step 0.01 */ smoothingThreshold: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the sides of an extruded polygon get texture coordinates that wrap around it * @default false */ wrap: boolean; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.extrudePolygon`: the outline of a flat polygon in the XZ plane, * its holes, and how far it is extruded downward. */ class ExtrudePolygonDto { constructor(shape?: Base.Vector3[], holes?: Base.Vector3[][], depth?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, wrap?: boolean, enableShadows?: boolean); /** * The outline points in order, only X and Z used; the outline must not cross itself */ shape: Base.Vector3[]; /** * Lists of points, one outline per hole through the extrusion * @optional true */ holes?: Base.Vector3[][] | undefined; /** * How far the polygon is extruded downward along Y, in scene units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ depth: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the sides get texture coordinates that wrap around the extrusion * @default false */ wrap: boolean; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createPolyhedron`: which of the built-in polyhedra to build or * custom data for your own, its size per axis and its shading. */ class CreatePolyhedronDto { constructor(size?: number, type?: number, sizeX?: number, sizeY?: number, sizeZ?: number, custom?: number[], flat?: boolean, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Size on every axis, in scene units, unless a per-axis size overrides it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; /** * Which built-in shape, 0 to 14: 0 tetrahedron, 1 octahedron, 2 dodecahedron, 3 * icosahedron, 4 rhombicuboctahedron, then prisms, pyramids, dipyramids and a cupola * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ type: number; /** * Size along X, in scene units; 0 falls back to `size` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeX: number; /** * Size along Y, in scene units; 0 falls back to `size` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeY: number; /** * Size along Z, in scene units; 0 falls back to `size` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeZ: number; /** * Your own polyhedron as the data the engine expects, used instead of `type` when given * @optional true */ custom?: number[] | undefined; /** * When true, each face is shaded flat, showing facets instead of a smooth surface * @default false */ flat: boolean; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createGeodesic`: how finely the twenty faces of the sphere are * subdivided, its size per axis and its shading. */ class CreateGeodesicDto { constructor(m?: number, n?: number, size?: number, sizeX?: number, sizeY?: number, sizeZ?: number, flat?: boolean, subdivisions?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * The first subdivision number; with `n` it sets how many triangles each face is split into * @default 4 * @minimum 0 * @maximum Infinity * @step 1 */ m: number; /** * The second subdivision number; with `m` it sets how many triangles each face is split * into * @default 4 * @minimum 0 * @maximum Infinity * @step 1 */ n: number; /** * Size on every axis, in scene units, unless a per-axis size overrides it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; /** * Size along X, in scene units; 0 falls back to `size` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeX: number; /** * Size along Y, in scene units; 0 falls back to `size` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeY: number; /** * Size along Z, in scene units; 0 falls back to `size` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeZ: number; /** * When true, each triangle is shaded flat, showing facets instead of a smooth surface * @default false */ flat: boolean; /** * Kept for compatibility; the geodesic is built from `m` and `n` * @default 4 * @minimum 0 * @maximum Infinity * @step 1 */ subdivisions: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default frontside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createCapsule`: the axis, length and radii of a cylinder with * rounded ends, and how finely each part is divided. */ class CreateCapsuleDto { constructor(orientation?: Base.Vector3, subdivisions?: number, tessellation?: number, height?: number, radius?: number, capSubdivisions?: number, radiusTop?: number, radiusBottom?: number, topCapSubdivisions?: number, bottomCapSubdivisions?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * The direction the length of the capsule runs along, as `[x, y, z]`; `[0, 1, 0]` stands it * upright */ orientation: Base.Vector3; /** * Number of divisions along the straight middle part * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ subdivisions: number; /** * Number of divisions around the capsule; more is rounder * @default 16 * @minimum 3 * @maximum Infinity * @step 1 */ tessellation: number; /** * Full length from end to end, rounded caps included, in scene units * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Radius of the middle part, in scene units, unless the cap radii override it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of divisions over each rounded end; more is smoother * @default 6 * @minimum 0 * @maximum Infinity * @step 1 */ capSubdivisions: number; /** * Radius of the top end, in scene units * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusTop: number; /** * Radius of the bottom end, in scene units * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusBottom: number; /** * Number of divisions over the top end, overriding `capSubdivisions` * @default 6 * @minimum 0 * @maximum Infinity * @step 1 */ topCapSubdivisions: number; /** * Number of divisions over the bottom end, overriding `capSubdivisions` * @default 6 * @minimum 0 * @maximum Infinity * @step 1 */ bottomCapSubdivisions: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default doubleside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createGoldberg`: how many hexagons the ball is made of and its * size per axis. */ class CreateGoldbergDto { constructor(m?: number, n?: number, size?: number, sizeX?: number, sizeY?: number, sizeZ?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * The first subdivision number; with `n` it sets how many hexagons surround the twelve * pentagons * @default 4 * @minimum 0 * @maximum Infinity * @step 1 */ m: number; /** * The second subdivision number; with `m` it sets how many hexagons surround the twelve * pentagons * @default 4 * @minimum 0 * @maximum Infinity * @step 1 */ n: number; /** * Size on every axis, in scene units, unless a per-axis size overrides it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; /** * Size along X, in scene units; 0 falls back to `size` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeX: number; /** * Size along Y, in scene units; 0 falls back to `size` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeY: number; /** * Size along Z, in scene units; 0 falls back to `size` * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ sizeZ: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default doubleside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createTube`: the path a tube follows, its radius, how round it is, * which ends are capped and how much of its circumference is drawn. */ class CreateTubeDto { constructor(path?: Base.Vector3[], radius?: number, tessellation?: number, cap?: number, arc?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * The points the center line of the tube passes through, in order * @default undefined */ path: Base.Vector3[]; /** * Radius of the tube, in scene units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of sides around the tube; more is rounder * @default 32 * @minimum 3 * @maximum Infinity * @step 1 */ tessellation: number; /** * Which ends are closed: 0 none, 1 the start, 2 the end, 3 both * @default 0 * @minimum 0 * @maximum 3 * @step 1 */ cap: number; /** * How much of the circumference is drawn, from 0 to 1; below 1 the tube is open along its * length * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ arc: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default doubleside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createExtrudedSahpe`: the profile to sweep, the path to sweep it * along, and how it scales, turns and closes on the way. */ class CreateExtrudedShapeDto { constructor(shape?: Base.Vector3[], path?: Base.Vector3[], scale?: number, rotation?: number, cap?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * The profile as points in the XY plane, swept along the path */ shape: Base.Vector3[]; /** * The points the profile travels through, in order */ path: Base.Vector3[]; /** * Factor the profile is scaled by along the path; 1 keeps its size * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ scale: number; /** * How far the profile turns around the path at each step, in radians; 0 keeps it straight * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ rotation: number; /** * When true, the last point of the profile is joined back to its first * @default false */ closeShape: boolean; /** * When true, the last point of the path is joined back to its first * @default false */ closePath: boolean; /** * Which ends are closed: 0 none, 1 the start, 2 the end, 3 both * @default 0 * @minimum 0 * @maximum 3 * @step 1 */ cap: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default doubleside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createCylinder`: the height of a cylinder standing along Y, its * top and bottom diameters and how finely it is divided. */ class CreateCylinderDto { constructor(height?: number, diameterTop?: number, diameterBottom?: number, tessellation?: number, subdivisions?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Full length along Y, in scene units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Diameter of the top end, in scene units; 0 closes it to a point * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ diameterTop: number; /** * Diameter of the bottom end, in scene units; 0 closes it to a point * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ diameterBottom: number; /** * Number of sides around the cylinder; more is rounder * @default 64 * @minimum 3 * @maximum Infinity * @step 1 */ tessellation: number; /** * Number of rings along the height; more than 1 only matters for deforming or shading * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ subdivisions: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default doubleside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createLathe`: the profile to revolve around the Y axis, an outward * offset, how finely and how far it is revolved and whether the ends close. */ class CreateLatheDto { constructor(shape?: Base.Vector3[], radius?: number, tessellation?: number, arc?: number, closed?: boolean, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * The profile as points in the XY plane, X being the distance from the axis, revolved * around Y */ shape: Base.Vector3[]; /** * Extra distance the profile is pushed away from the axis, in scene units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Number of steps in a full turn; more is rounder * @default 64 * @minimum 3 * @maximum Infinity * @step 1 */ tessellation: number; /** * How much of a full turn is revolved, from 0 to 1; below 1 the shape is open * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ arc: number; /** * When true and the arc is full, the seam is closed so the surface has no gap * @default true */ closed: boolean; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default doubleside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createGround`: the size of a flat ground in the XZ plane and how * many cells it is divided into. */ class CreateGroundDto { constructor(width?: number, height?: number, subdivisionsX?: number, subdivisionsY?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Full size along X, in scene units * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ width: number; /** * Full size along Z, in scene units * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ height: number; /** * Number of cells along X; more matters only for deforming or lighting * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ subdivisionsX: number; /** * Number of cells along Z; more matters only for deforming or lighting * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ subdivisionsY: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default doubleside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } /** * Feeds `babylon.meshBuilder.createRectanglePlane` with the sizes of a flat rectangle in the XY * plane. */ class CreateRectanglePlaneDto { constructor(width?: number, height?: number, sideOrientation?: BabylonMesh.sideOrientationEnum, enableShadows?: boolean); /** * Full size along X, in scene units * @default 1 */ width: number; /** * Full size along Y, in scene units * @default 1 */ height: number; /** * Which side of each face is drawn: the front, the back or both; single-sided meshes are * invisible from behind * @default doubleside */ sideOrientation: BabylonMesh.sideOrientationEnum; /** * When true, the mesh casts and receives shadows from the lights that have them enabled * @default true */ enableShadows: boolean; } } /** * Parameters for mesh objects in the scene: visibility, picking, parenting, position, rotation and * scale, material assignment, and the options for cloning, merging and disposing a mesh. */ declare namespace BabylonMesh { /** * Which face of a surface is rendered: the front, the back, or both. Meshes are single-sided by * default, so a surface can look missing when viewed from behind - setting this to double-sided is * the usual fix. */ enum sideOrientationEnum { frontside = "frontside", backside = "backside", doubleside = "doubleside" } /** * Feeds `babylon.mesh.updateDrawn`: a drawn mesh and the placement, rotation in radians, * scaling and colors to apply to it in place. */ class UpdateDrawnBabylonMesh { constructor(babylonMesh?: BABYLON.Mesh, position?: Base.Point3, rotation?: Base.Vector3, scaling?: Base.Vector3, colours?: string | string[]); /** * The drawn mesh to change in place * @default undefined */ babylonMesh: BABYLON.Mesh; /** * Where to place the mesh, relative to its parent * @default undefined */ position: Base.Point3; /** * The rotation angles around X, Y and Z, in radians, replacing the current rotation * @default undefined */ rotation: Base.Vector3; /** * The scale factors along X, Y and Z, 1 being unscaled * @default undefined */ scaling: Base.Vector3; /** * One hex color, or a list with one entry per child mesh or per point or line of a point or * line drawing; other lists use the first entry * @default undefined */ colours: string | string[]; } /** * Feeds `babylon.mesh.setParent` and `babylon.mesh.getParent`: the mesh and the mesh it is * parented to, so it moves with it. */ class SetParentDto { constructor(babylonMesh?: BABYLON.Mesh | BABYLON.InstancedMesh | BABYLON.AbstractMesh, parentMesh?: BABYLON.Mesh | BABYLON.InstancedMesh | BABYLON.AbstractMesh); /** * The mesh whose parent is set or read * @default undefined */ babylonMesh: BABYLON.Mesh | BABYLON.InstancedMesh | BABYLON.AbstractMesh; /** * The mesh to parent to; the child then moves, turns and scales with it * @default undefined */ parentMesh: BABYLON.Mesh | BABYLON.InstancedMesh | BABYLON.AbstractMesh; } /** * Feeds `babylon.mesh.setPosition` with a mesh, or an instance, and the point to place it at * relative to its parent. */ class UpdateDrawnBabylonMeshPositionDto { constructor(babylonMesh?: BABYLON.Mesh | BABYLON.InstancedMesh, position?: Base.Point3); /** * The mesh or instance to move * @default undefined */ babylonMesh: BABYLON.Mesh | BABYLON.InstancedMesh; /** * Where to place it, relative to its parent * @default undefined */ position: Base.Point3; } /** * Feeds `babylon.mesh.setRotation` with a mesh, or an instance, and its new rotation as three * angles in degrees. */ class UpdateDrawnBabylonMeshRotationDto { constructor(babylonMesh?: BABYLON.Mesh | BABYLON.InstancedMesh, rotation?: Base.Vector3); /** * The mesh or instance to turn * @default undefined */ babylonMesh: BABYLON.Mesh | BABYLON.InstancedMesh; /** * The angles around X, Y and Z in degrees, replacing the current rotation * @default undefined */ rotation: Base.Vector3; } /** * Feeds `babylon.mesh.setScale` with a mesh, or an instance, and its new scale factors per * axis. */ class UpdateDrawnBabylonMeshScaleDto { constructor(babylonMesh?: BABYLON.Mesh | BABYLON.InstancedMesh, scale?: Base.Vector3); /** * The mesh or instance to scale * @default undefined */ babylonMesh: BABYLON.Mesh | BABYLON.InstancedMesh; /** * The scale factors along X, Y and Z, 1 being unscaled, replacing the current scale * @default undefined */ scale: Base.Vector3; } /** * Feeds `babylon.mesh.setLocalScale` with a mesh, or an instance, and one factor that * multiplies its current scale on every axis. */ class ScaleInPlaceDto { constructor(babylonMesh?: BABYLON.Mesh | BABYLON.InstancedMesh, scale?: number); /** * The mesh or instance to scale * @default undefined */ babylonMesh: BABYLON.Mesh | BABYLON.InstancedMesh; /** * The factor the current scale is multiplied by on every axis; 2 doubles the size * @default 1 */ scale: number; } /** * Feeds `babylon.mesh.intersectsMesh` with the two meshes to test for overlap and how carefully * to test. */ class IntersectsMeshDto { constructor(babylonMesh?: BABYLON.Mesh | BABYLON.InstancedMesh, babylonMesh2?: BABYLON.Mesh | BABYLON.InstancedMesh, precise?: boolean, includeDescendants?: boolean); /** * The first mesh of the pair * @default undefined */ babylonMesh: BABYLON.Mesh | BABYLON.InstancedMesh; /** * The second mesh of the pair * @default undefined */ babylonMesh2: BABYLON.Mesh | BABYLON.InstancedMesh; /** * When true, boxes that follow each mesh's rotation are tested instead of axis-aligned * ones, a slower but tighter check * @default false */ precise: boolean; /** * When true, the child meshes of both are tested as well * @default false */ includeDescendants: boolean; } /** * Feeds `babylon.mesh.intersectsPoint` with a mesh and the point to test against its bounding * box. */ class IntersectsPointDto { constructor(babylonMesh?: BABYLON.Mesh | BABYLON.InstancedMesh, point?: Base.Point3); /** * The mesh whose bounds are tested * @default undefined */ babylonMesh: BABYLON.Mesh | BABYLON.InstancedMesh; /** * The point tested for lying inside the mesh's bounding box * @default undefined */ point: Base.Point3; } /** * Feeds the `babylon.mesh` methods that take just a mesh: dispose, clone, the getters for * position, rotation, scale, name, material and ids, and the triangle read-out. */ class BabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh); /** * The mesh to act on or read from * @default undefined */ babylonMesh: BABYLON.Mesh; } /** * Feeds `babylon.mesh.cloneToPositions` with the mesh to copy and the points to put the copies * at. */ class CloneToPositionsDto { constructor(babylonMesh?: BABYLON.Mesh, positions?: Base.Point3[]); /** * The mesh to copy; it stays where it is * @default undefined */ babylonMesh: BABYLON.Mesh; /** * One point per copy, in the order the copies come back * @default [] */ positions: Base.Point3[]; } /** * Feeds `babylon.mesh.mergeMeshes` with the meshes to join into one and the merge options of * the engine. */ class MergeMeshesDto { constructor(arrayOfMeshes?: BABYLON.Mesh[], disposeSource?: boolean, allow32BitsIndices?: boolean, meshSubclass?: BABYLON.Mesh, subdivideWithSubMeshes?: boolean, multiMultiMaterials?: boolean); /** * The meshes to join; none of them may be empty * @default undefined */ arrayOfMeshes: BABYLON.Mesh[]; /** * When true, the source meshes are removed once merged * @default true */ disposeSource: boolean; /** * Set true when the meshes together have more than 65 thousand vertices, or the merge fails * @default false */ allow32BitsIndices: boolean; /** * An existing mesh to merge the vertices into instead of creating a new one * @default undefined * @optional true */ meshSubclass?: BABYLON.Mesh | undefined; /** * When true, each source becomes a sub-mesh of the result, keeping their boundaries * @default false */ subdivideWithSubMeshes: boolean; /** * When true, each source keeps its own material in a multi-material result; overrides * `subdivideWithSubMeshes` * @default false */ multiMultiMaterials: boolean; } /** * Feeds `babylon.mesh.enablePointerMoveEvents` and `disablePointerMoveEvents` with a mesh and * whether its children follow. */ class BabylonMeshWithChildrenDto { constructor(babylonMesh?: BABYLON.Mesh); /** * The mesh to change * @default undefined */ babylonMesh: BABYLON.Mesh; /** * When true, the change is applied to the child meshes as well * @default true */ includeChildren: boolean; } /** * Feeds `babylon.mesh.show` and `babylon.mesh.hide` with a mesh and whether its children * follow. */ class ShowHideMeshDto { constructor(babylonMesh?: BABYLON.Mesh, includeChildren?: boolean); /** * The mesh whose visibility is switched * @default undefined */ babylonMesh: BABYLON.Mesh; /** * When true, the child meshes are shown or hidden too * @default true */ includeChildren: boolean; } /** * A mesh to copy; `babylon.mesh.clone` reads the plainer `BabylonMeshDto`, so this class is * here for symmetry. */ class CloneBabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh); /** * The mesh to copy * @default undefined */ babylonMesh: BABYLON.Mesh; } /** * Feeds `babylon.mesh.getChildMeshes` with a mesh and whether to list only its direct children. */ class ChildMeshesBabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh, directDescendantsOnly?: boolean); /** * The mesh whose children are listed * @default undefined */ babylonMesh: BABYLON.Mesh; /** * When true, only the direct children are listed; when false, every descendant * @default false */ directDescendantsOnly: boolean; } /** * Feeds the `babylon.mesh.move` methods with a mesh and how far to move it along its own axis. */ class TranslateBabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh, distance?: number); /** * The mesh to move * @default undefined */ babylonMesh: BABYLON.Mesh; /** * How far to move, in scene units; negative moves the other way * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ distance: number; } /** * Feeds `babylon.mesh.setName` with a mesh, the name to give it and whether its children get it * too. */ class NameBabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh, name?: string, includeChildren?: boolean); /** * The mesh to rename * @default undefined */ babylonMesh: BABYLON.Mesh; /** * The new name, which `getMeshesWhereNameContains` searches * @default undefined */ name: string; /** * When true, the child meshes get the same name * @default false */ includeChildren?: boolean | undefined; } /** * Feeds `babylon.mesh.getMeshesWhereNameContains` with the text to look for in mesh names. */ class ByNameBabylonMeshDto { constructor(name?: string); /** * The text a mesh's name must contain, case-sensitive * @default undefined */ name: string; } /** * Feeds `babylon.mesh.setMaterial` with a mesh, the material to give it and whether its * children get it too. */ class MaterialBabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh, material?: BABYLON.Material, includeChildren?: boolean); /** * The mesh whose material is set * @default undefined */ babylonMesh: BABYLON.Mesh; /** * The material the faces are drawn with from then on * @default undefined */ material: BABYLON.Material; /** * When true, the child meshes get the same material * @default false */ includeChildren: boolean; } /** * Feeds `babylon.mesh.setId` and `babylon.mesh.getId` with a mesh and the id, a label that need * not be unique. */ class IdBabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh, id?: string); /** * The mesh whose id is set or read * @default undefined */ babylonMesh: BABYLON.Mesh; /** * The id to set; several meshes may share one * @default undefined */ id: string; } /** * Feeds `babylon.mesh.getMeshOfId` and `babylon.mesh.getMeshesOfId` with the id to look for in * the scene. */ class ByIdBabylonMeshDto { constructor(id?: string); /** * The id a mesh must have exactly * @default undefined */ id: string; } /** * Feeds `babylon.mesh.getMeshOfUniqueId` with the number the scene gave a mesh, as * `getUniqueId` reads it. */ class UniqueIdBabylonMeshDto { constructor(uniqueId?: number); /** * The unique number of the mesh to find * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ uniqueId: number; } /** * Feeds `babylon.mesh.setPickable` with a mesh, whether it answers to pointer picking and * whether its children follow. */ class PickableBabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh, pickable?: boolean, includeChildren?: boolean); /** * The mesh to change * @default undefined */ babylonMesh: BABYLON.Mesh; /** * When true, clicks and rays can pick the mesh; when false, they pass through it * @default false */ pickable: boolean; /** * When true, the child meshes get the same setting * @default false */ includeChildren: boolean; } /** * Feeds `babylon.mesh.setCheckCollisions` and `getCheckCollisions` with a mesh, the collision * flag and whether its children follow. */ class CheckCollisionsBabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh, checkCollisions?: boolean, includeChildren?: boolean); /** * The mesh to change or read * @default undefined */ babylonMesh: BABYLON.Mesh; /** * When true, colliders such as a camera with collisions on cannot pass through the mesh * @default false */ checkCollisions: boolean; /** * When true, the child meshes get the same setting * @default false */ includeChildren: boolean; } /** * Feeds `babylon.mesh.yaw`, `pitch` and `roll` with a mesh and the angle to turn it by. */ class RotateBabylonMeshDto { constructor(babylonMesh?: BABYLON.Mesh, rotate?: number); /** * The mesh to turn * @default undefined */ babylonMesh: BABYLON.Mesh; /** * The angle in degrees added to the current rotation; negative turns the other way * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ rotate: number; } /** * Feeds `babylon.mesh.setVisibility` with a mesh, how visible it is from 0 to 1 and whether its * children follow. */ class SetMeshVisibilityDto { constructor(babylonMesh?: BABYLON.Mesh, visibility?: number, includeChildren?: boolean); /** * The mesh to change * @default undefined */ babylonMesh: BABYLON.Mesh; /** * From 0 for fully transparent to 1 for fully shown; values between fade the mesh * @default 0 * @minimum 0 * @maximum 1 * @step 0.1 */ visibility: number; /** * When true, the child meshes get the same visibility * @default false */ includeChildren: boolean; } /** * Feeds `babylon.mesh.createMeshInstanceAndTransform`: the mesh to instance and where to place * the instance. */ class MeshInstanceAndTransformDto { constructor(mesh?: BABYLON.Mesh, position?: Base.Point3, rotation?: Base.Vector3, scaling?: Base.Vector3); /** * The mesh to make an instance of; it is hidden once instanced * @default undefined */ mesh: BABYLON.Mesh; /** * Where the instance is placed * @default undefined */ position: Base.Point3; /** * The instance's rotation angles around X, Y and Z, in degrees * @default undefined */ rotation: Base.Vector3; /** * The instance's scale factors along X, Y and Z, 1 being unscaled * @default undefined */ scaling: Base.Vector3; } /** * Feeds `babylon.mesh.createMeshInstance` with the mesh to make a lightweight instance of. */ class MeshInstanceDto { constructor(mesh?: BABYLON.Mesh); /** * The mesh to make an instance of; its children are instanced one by one * @default undefined */ mesh: BABYLON.Mesh; } /** * Feeds `babylon.mesh.rotateAroundAxisWithPosition`: the mesh, a point and an axis through it, * and the angle to orbit by. */ class RotateAroundAxisNodeDto { constructor(mesh?: BABYLON.Mesh, position?: Base.Point3, axis?: Base.Vector3, angle?: number); /** * The mesh to turn around the axis * @default undefined */ mesh: BABYLON.Mesh; /** * A point the axis passes through */ position: Base.Point3; /** * The direction of the axis; any length will do, but not a zero vector */ axis: Base.Vector3; /** * How far to turn, in degrees; positive follows the right-hand rule around the axis */ angle: number; } } /** * Parameters for picking: turning a pointer position into the object, face and point under it, with * control over which objects are pickable and what the result reports. */ declare namespace BabylonPick { /** * Feeds `babylon.pick.pickWithRay` with the ray to shoot into the scene to find what it hits. */ class RayDto { constructor(ray?: BABYLON.Ray); /** * The ray shot into the scene, as the `babylon.ray` methods build it */ ray: BABYLON.Ray; } /** * Feeds the `babylon.pick` getters with a picking result, as `pickWithRay` or * `pickWithPickingRay` give it. */ class PickInfo { constructor(pickInfo?: BABYLON.PickingInfo); /** * The picking result to read from; check `hit` before reading the mesh, point or distance */ pickInfo: BABYLON.PickingInfo; } } /** * Parameters for rays: origin, direction and length, and the options for casting one at the scene and * reading back what it hit. */ declare namespace BabylonRay { /** * Feeds `babylon.ray.createRay` with where a ray starts, which way it points and, optionally, * how far it reaches. */ class BaseRayDto { constructor(origin?: Base.Point3, direction?: Base.Vector3, length?: number); /** * The point the ray starts from */ origin: Base.Point3; /** * The way the ray points, as `[x, y, z]` */ direction: Base.Vector3; /** * How far the ray reaches, in scene units; 0 or left out makes it unlimited * @optional true */ length?: number | undefined; } /** * Feeds the `babylon.ray` getters with the ray whose origin, direction or length is read. */ class RayDto { constructor(ray?: BABYLON.Ray); /** * The ray whose origin, direction or length is read */ ray: BABYLON.Ray; } /** * Feeds `babylon.ray.createRayFromTo` with the two points a ray runs between. */ class FromToDto { constructor(from?: Base.Point3, to?: Base.Point3); /** * The point the ray starts from */ from: Base.Point3; /** * The point the ray ends at; the ray is exactly this far long */ to: Base.Point3; } } /** * Result object returned by initBabylonJS helper function. */ interface InitBabylonJSResult { /** The BabylonJS scene */ scene: BABYLON.Scene; /** The BabylonJS engine */ engine: BABYLON.Engine; /** The hemispheric light */ hemisphericLight: BABYLON.HemisphericLight; /** The directional light (for shadows) */ directionalLight: BABYLON.DirectionalLight; /** The ground mesh (if enabled) */ ground: BABYLON.Mesh | null; /** The arc rotate camera (if enabled) */ arcRotateCamera: BABYLON.ArcRotateCamera | null; /** Start the render loop */ startRenderLoop: (onRender?: () => void) => void; /** Cleanup function to remove resize listener and dispose resources */ dispose: () => void; } /** * Higher-level scene setup parameters: the composed configurations that build a working scene - * camera, lights, environment and ground - in one call rather than piece by piece. */ declare namespace BabylonJSScene { /** * Feeds the `initBabylonJS` helper that sets up a whole scene in one call: the canvas, * background, ground, lights, shadows and the default orbiting camera, sized from `sceneSize`. */ class InitBabylonJSDto { constructor(canvasId?: string, sceneSize?: number, backgroundColor?: string, enableShadows?: boolean, enableGround?: boolean, groundCenter?: Base.Point3, groundScaleFactor?: number, groundColor?: string, groundOpacity?: number, hemisphereLightSkyColor?: string, hemisphereLightGroundColor?: string, hemisphereLightIntensity?: number, directionalLightColor?: string, directionalLightIntensity?: number, shadowMapSize?: number); /** * The ID of the canvas element to render to. If not provided, a new canvas will be created and appended to document.body. * @default undefined * @optional true */ canvasId?: string | undefined; /** * The size of the scene in world units. This determines ground size, light positions, and shadow bounds. * @default 20 * @minimum 1 * @maximum Infinity * @step 10 */ sceneSize: number; /** * Background color of the scene in hex format. * @default "#1a1c1f" */ backgroundColor: string; /** * Enable shadow mapping for realistic shadows. * @default true */ enableShadows: boolean; /** * Enable the ground plane. * @default true */ enableGround: boolean; /** * Center position of the ground plane [x, y, z]. * @default [0, 0, 0] */ groundCenter: Base.Point3; /** * Scale factor for the ground size relative to scene size. Values greater than 1 make the ground larger than the scene size. * @default 2 * @minimum 0.5 * @maximum 10 * @step 0.5 */ groundScaleFactor: number; /** * Color of the ground plane in hex format. * @default "#333333" */ groundColor: string; /** * Opacity of the ground plane (0 = fully transparent, 1 = fully opaque). * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ groundOpacity: number; /** * Sky color for the hemisphere light (illumination from above). * @default "#ffffff" */ hemisphereLightSkyColor: string; /** * Ground color for the hemisphere light (illumination from below). * @default "#444444" */ hemisphereLightGroundColor: string; /** * Brightness of the soft light from above and below, 1 being full strength * @default 1 * @minimum 0 * @maximum 10 * @step 0.1 */ hemisphereLightIntensity: number; /** * Color of the directional light (sun light). * @default "#ffffff" */ directionalLightColor: string; /** * Brightness of the sun-like light that casts the shadows, 1 being full strength * @default 1.5 * @minimum 0 * @maximum 10 * @step 0.1 */ directionalLightIntensity: number; /** * Size of the shadow map in pixels (higher = sharper shadows but more GPU intensive). * @default 2048 * @minimum 256 * @maximum 8192 * @step 256 */ shadowMapSize: number; /** * Enable automatic creation of an arc rotate camera. * @default true */ enableArcRotateCamera: boolean; /** * Settings for the orbiting camera, the same as `babylon.camera.arcRotate.create` takes; * left out, defaults sized from `sceneSize` are used * @optional true */ arcRotateCameraOptions?: BabylonCamera.ArcRotateCameraDto | undefined; } } /** * Parameters for textures: the image source, UV scaling and offset, wrapping mode, and the sampling * settings that decide how a texture is filtered. */ declare namespace BabylonTexture { /** * How a texture is filtered when magnified or minified - nearest keeps pixels crisp and blocky, * the linear and trilinear modes smooth them, and the mipmap variants trade sharpness for stability * in the distance. */ enum samplingModeEnum { nearest = "nearest", bilinear = "bilinear", trilinear = "trilinear" } /** * Feeds `babylon.texture.createSimple`: the image address of a texture for material slots, how * it tiles, shifts and turns over the surface, and how it is filtered. */ class TextureSimpleDto { constructor(name?: string, url?: string, invertY?: boolean, invertZ?: boolean, wAng?: number, uScale?: number, vScale?: number, uOffset?: number, vOffset?: number, samplingMode?: samplingModeEnum); /** * Name the texture is known by in the scene * @default Custom Texture */ name: string; /** * Address of the image; for an uploaded file, make an object URL with * `asset.createObjectURL` first * @default undefined */ url: string; /** * When true, the image is flipped top to bottom; use it when a texture appears upside down * @default false */ invertY: boolean; /** * When true, the image is flipped along the third texture axis, which matters for volume * textures only * @default false */ invertZ: boolean; /** * How far the image is turned over the surface, in radians * @default 0 */ wAng: number; /** * How many times the image repeats across the surface horizontally; 2 tiles it twice * @default 1 */ uScale: number; /** * How many times the image repeats across the surface vertically; 2 tiles it twice * @default 1 */ vScale: number; /** * How far the image is shifted horizontally, as a fraction of its width * @default 0 */ uOffset: number; /** * How far the image is shifted vertically, as a fraction of its height * @default 0 */ vOffset: number; /** * How pixels are read when the image is scaled: nearest keeps hard pixels, bilinear and * trilinear blend them * @default nearest */ samplingMode: samplingModeEnum; } /** * Feeds `babylon.texture.createImage`: the address of an image for decals and projections, with * its transparency kept and no tiling. */ class TextureImageDto { constructor(name?: string, url?: string, hasAlpha?: boolean, invertY?: boolean, samplingMode?: samplingModeEnum); /** * Name the texture is known by in the scene * @default Image Texture */ name: string; /** * Address of the image: a public URL, a data URL or an object URL made from an uploaded * file * @default undefined */ url: string; /** * When true, transparent pixels of the image stay transparent, which cut-out decals need * @default true */ hasAlpha: boolean; /** * When true, the image is flipped top to bottom; use it when a decal appears upside down * @default false */ invertY: boolean; /** * How pixels are read when the image is scaled: nearest keeps hard pixels, bilinear and * trilinear blend them * @default trilinear */ samplingMode: samplingModeEnum; } } /** * Parameters for engine utilities: screenshots, canvas sizing, color conversion and the other helpers * that sit around the scene rather than inside it. */ declare namespace BabylonTools { /** * Feeds `babylon.tools.createScreenshot` and `createScreenshotAndDownload`: the camera to * render through, the image size, format and quality. */ class ScreenshotDto { constructor(camera?: BABYLON.Camera, width?: number, height?: number, mimeType?: string, quality?: number); /** * The camera to render through; left out, the active camera is used * @default undefined * @optional true */ camera?: BABYLON.Camera | undefined; /** * Pixel width of the image * @default 1920 * @minimum 0 * @maximum Infinity * @step 1 */ width: number; /** * Pixel height of the image * @default 1080 * @minimum 0 * @maximum Infinity * @step 1 */ height: number; /** * Image format as a MIME type, such as `image/png` or `image/jpeg` * @default image/png */ mimeType: string; /** * Compression quality from 0 to 1 for lossy formats such as JPEG; PNG ignores it * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ quality: number; } } /** * Parameters for moving objects in the scene: translation, rotation around an axis or a pivot, and * scaling, applied to a mesh or a node rather than to the underlying geometry. */ declare namespace BabylonTransforms { /** * Feeds `babylon.transforms.rotationCenterAxis`: the angle, the axis direction and the point * the axis passes through. */ class RotationCenterAxisDto { constructor(angle?: number, axis?: Base.Vector3, center?: Base.Point3); /** * How far to turn, in degrees; positive follows the right-hand rule around the axis * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle: number; /** * The direction of the axis, as `[x, y, z]` * @default [0, 1, 0] */ axis: Base.Vector3; /** * A point the axis passes through; it stays where it is * @default [0, 0, 0] */ center: Base.Point3; } /** * A mesh and the matrix, or matrices, to apply to it; kept for scripts that transform meshes * with the base `transforms` results. */ class TransformBabylonMeshDto { constructor(mesh?: BABYLON.Mesh, transformation?: Base.TransformMatrixes); /** * The mesh the matrices are applied to * @default undefined */ mesh: BABYLON.Mesh; /** * One 4x4 matrix or a list applied in order, as the `transforms` methods produce * @default undefined */ transformation: Base.TransformMatrixes; } /** * Feeds `babylon.transforms.rotationCenterX`, `rotationCenterY` and `rotationCenterZ` with the * angle and the point the axis passes through. */ class RotationCenterDto { constructor(angle?: number, center?: Base.Point3); /** * How far to turn, in degrees; positive follows the right-hand rule around the axis * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle: number; /** * A point the axis passes through; it stays where it is * @default [0, 0, 0] */ center: Base.Point3; } /** * Feeds `babylon.transforms.rotationCenterYawPitchRoll` with three angles and the point they * turn around. */ class RotationCenterYawPitchRollDto { constructor(yaw?: number, pitch?: number, roll?: number, center?: Base.Point3); /** * The turn around the Y axis, in degrees * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ yaw: number; /** * The turn around the X axis, in degrees * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ pitch: number; /** * The turn around the Z axis, in degrees * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ roll: number; /** * The point the rotation is applied around; it stays where it is * @default [0, 0, 0] */ center: Base.Point3; } /** * Feeds `babylon.transforms.scaleXYZ` with a scale factor per axis, measured from the origin. */ class ScaleXYZDto { constructor(scaleXyz?: Base.Vector3); /** * The factors along X, Y and Z: `[1, 2, 1]` doubles Y and keeps X and Z * @default [1, 1, 1] */ scaleXyz: Base.Vector3; } /** * Feeds `babylon.transforms.scaleCenterXYZ` with a scale factor per axis and the point that * stays in place. */ class ScaleCenterXYZDto { constructor(center?: Base.Point3, scaleXyz?: Base.Vector3); /** * The point the scaling is measured from; it stays where it is * @default [0, 0, 0] */ center: Base.Point3; /** * The factors along X, Y and Z: `[1, 2, 1]` doubles Y and keeps X and Z * @default [1, 1, 1] */ scaleXyz: Base.Vector3; } /** * Feeds `babylon.transforms.uniformScale` with one factor for every axis, measured from the * origin. */ class UniformScaleDto { constructor(scale?: number); /** * The factor on every axis; 1 keeps the size, 2 doubles it * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ scale: number; } /** * Feeds `babylon.transforms.uniformScaleFromCenter` with one factor for every axis and the * point that stays in place. */ class UniformScaleFromCenterDto { constructor(scale?: number, center?: Base.Point3); /** * The factor on every axis; 1 keeps the size, 2 doubles it * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ scale: number; /** * The point the scaling is measured from; it stays where it is * @default [0, 0, 0] */ center: Base.Point3; } /** * Feeds `babylon.transforms.translationXYZ` with the vector to move by. */ class TranslationXYZDto { constructor(translation?: Base.Vector3); /** * The distances to move along X, Y and Z, in scene units * @default [0, 0, 0] */ translation: Base.Vector3; } /** * Feeds `babylon.transforms.translationsXYZ` with several vectors, one move each. */ class TranslationsXYZDto { constructor(translations?: Base.Vector3[]); /** * One `[x, y, z]` move per result, in the same order * @default undefined */ translations: Base.Vector3[]; } } /** * Parameters for WebXR: entering virtual or augmented reality, the reference space to use, and the * options for controllers, teleportation and hit testing. */ declare namespace BabylonWebXR { /** * Feeds `babylon.webXr.base.createDefaultXRExperienceAsync` with the engine's options for a * WebXR session: which features to start, the floor meshes for teleporting, and per-feature * settings. */ class WebXRDefaultExperienceOptions { constructor(disableDefaultUI?: boolean); /** * Enable or disable default UI to enter XR * @optional true */ disableDefaultUI?: boolean | undefined; /** * Should pointer selection not initialize. * Note that disabling pointer selection also disables teleportation. * Defaults to false. * @optional true */ disablePointerSelection?: boolean | undefined; /** * Should teleportation not initialize. Defaults to false. * @optional true */ disableTeleportation?: boolean | undefined; /** * Should nearInteraction not initialize. Defaults to false. * @optional true */ disableNearInteraction?: boolean | undefined; /** * Should hand tracking be disabled. Defaults to false. * @optional true */ disableHandTracking?: boolean | undefined; /** * Floor meshes that will be used for teleport * @optional true */ floorMeshes?: BABYLON.AbstractMesh[] | undefined; /** * When true, the first frame does not reset the position from the previous camera; mainly * for AR * @optional true */ ignoreNativeCameraTransformation?: boolean | undefined; /** * Optional configuration for the XR input object * @optional true */ inputOptions?: Partial | undefined; /** * optional configuration for pointer selection * @optional true */ pointerSelectionOptions?: Partial | undefined; /** * optional configuration for near interaction * @optional true */ nearInteractionOptions?: Partial | undefined; /** * optional configuration for hand tracking * @optional true */ handSupportOptions?: Partial | undefined; /** * optional configuration for teleportation * @optional true */ teleportationOptions?: Partial | undefined; /** * optional configuration for the output canvas * @optional true */ outputCanvasOptions?: BABYLON.WebXRManagedOutputCanvasOptions | undefined; /** * optional UI options. This can be used among other to change session mode and reference space type * @optional true */ uiOptions?: Partial | undefined; /** * When loading teleportation and pointer select, use stable versions instead of latest. * @optional true */ useStablePlugins?: boolean | undefined; /** * An optional rendering group id that will be set globally for teleportation, pointer selection and default controller meshes * @optional true */ renderingGroupId?: number | undefined; /** * A list of optional features to init the session with * If set to true, all features we support will be added * @optional true */ optionalFeatures?: boolean | string[] | undefined; } /** * Feeds the `babylon.webXr.simple` teleportation experiences with the meshes the user can * teleport onto. */ class DefaultWebXRWithTeleportationDto { constructor(groundMeshes?: BABYLON.Mesh[]); /** * The meshes the user may teleport onto, normally the floor */ groundMeshes: BABYLON.Mesh[]; } /** * Feeds `babylon.webXr.base.getBaseExperience` with the default XR experience to read from. */ class WebXRDefaultExperienceDto { constructor(webXRDefaultExperience?: BABYLON.WebXRDefaultExperience); /** * The default XR experience a create method gave back */ webXRDefaultExperience: BABYLON.WebXRDefaultExperience; } /** * Feeds `babylon.webXr.base.getFeatureManager` with the base experience to read the feature * manager from. */ class WebXRExperienceHelperDto { constructor(baseExperience?: BABYLON.WebXRExperienceHelper); /** * The base experience helper, as `getBaseExperience` reads it from the default experience */ baseExperience: BABYLON.WebXRExperienceHelper; } } /** * Re-export Base namespace from @bitbybit-dev/core and extend with BabylonJS-specific types. * This includes the base types + core extensions (VerbCurve, VerbSurface, colorMapStrategyEnum, etc.) */ /** * The BabylonJS build's re-export of the shared primitive types, so engine-specific code sees Point3, * Vector3, colors and the shared enumerations from one place. */ /** * Options for drawing geometry into a BabylonJS scene: color, opacity, size, whether the result is * pickable, and the per-kind settings that control how points, lines, polylines, meshes, surfaces and * kernel shapes are turned into renderer objects. Passing an existing drawn object back in updates it * in place instead of creating a second one, which is what makes animation cheap. */ declare namespace Draw { /** * The union of every option shape a draw call accepts. Which one applies depends on what is being * drawn - basic geometry, a Manifold solid or cross section, an OCCT shape, or a node - and the * draw API picks the right one from the entity you pass. Reach for the specific option class when * you want type checking on the fields. */ type DrawOptions = DrawBasicGeometryOptions | DrawManifoldOrCrossSectionOptions | DrawOcctShapeOptions | DrawOcctShapeSimpleOptions | DrawOcctShapeMaterialOptions | DrawNodeOptions; /** * Everything a draw call will accept: points, lines, segments and polylines; Verb curves and * surfaces; the handles the OCCT, Manifold and JSCAD kernels return; tags; a BabylonJS node, which draws as an axis triad; whatever a layer * above these packages has taught the call to draw; and a list of any one of them. This union is * what makes one draw call able to render anything these packages produce without you having to * say which kind it is. * * The list arms are one per kind rather than a single list of the union, because that is what is * true: drawing a list applies one set of options to one kind of thing, and every plural handler * reads its list as homogeneous. A mixed list is not something this call can draw, and saying so * here is what stops one being written. * * `Base.Vector3` is not listed and is still accepted: it is the same type as `Base.Point3`. * * `number[]` and `number[][]` are listed, and are the loosest members here on purpose. A point is * the tuple `Base.Point3`, but the vector services are honestly `number[]` - they operate on a * vector of any length - so every result of `vector.add`, `cross`, `lerp` and their siblings is a * `number[]`, and drawing one is ordinary. Dropping these arms would narrow the union at the cost * of making the library's own output undrawable without a cast. */ type Entity = number[] | Base.Point3 | Base.Line3 | Base.Segment3 | Base.Polyline3 | Base.VerbCurve | Base.VerbSurface | Inputs.OCCT.TopoDSShapePointer | Inputs.OCCT.DecomposedMeshDto | Inputs.Manifold.ManifoldPointer | Inputs.Manifold.CrossSectionPointer | Inputs.JSCAD.JSCADEntity | Inputs.Tag.TagDto | CustomGeometryDrawable | CustomOverlayDrawable | BABYLON.TransformNode | number[][] | Base.Point3[] | Base.Line3[] | Base.Segment3[] | Base.Polyline3[] | Base.VerbCurve[] | Base.VerbSurface[] | Inputs.OCCT.TopoDSShapePointer[] | Inputs.OCCT.DecomposedMeshDto[] | Inputs.Manifold.ManifoldPointer[] | Inputs.Manifold.CrossSectionPointer[] | Inputs.JSCAD.JSCADEntity[] | Inputs.Tag.TagDto[] | BABYLON.TransformNode[]; /** * Metadata a drawn tag carries so that handing it back updates it in place. */ interface DrawnTagMeta { type: drawingTypes; /** Whatever options the draw was given. Drawing a tag without any records only updatability. */ options: DrawOptions | { updatable: boolean; }; } /** * A drawn tag. Drawing a tag produces the tag itself rather than a mesh, because a tag is rendered * as an HTML overlay positioned from the scene rather than as geometry in it. The drawing entry * points still declare a mesh, which is the type every drawable output is described by, so a drawn * tag reaches a caller through that declaration. */ interface DrawnTag extends Inputs.Tag.TagDto { metadata?: DrawnTagMeta | undefined; } /** * A list of drawn tags. The list itself carries the metadata as well as each tag does, because an * update is driven by handing back what drawing returned, which for a list of tags is the list. */ type DrawnTags = DrawnTag[] & { metadata?: DrawnTagMeta | undefined; }; /** * What every drawn output has in common: it can be released. A layer above these packages that * draws an overlay - a label, a dimension, a marker - hands back one of these rather than a * mesh, because positioning something from the scene is not the same as being geometry in it. */ interface DrawnOverlay { dispose(): void; } /** * A drawable a layer above these packages taught the draw call to render, drawn as geometry. * `type` is the discriminant it is matched on, the same convention the kernels already follow * at runtime with "occ-shape" and "manifold-shape". */ interface CustomGeometryDrawable { readonly type: string; readonly name: string; } /** The same, for a drawable that draws an overlay rather than geometry. */ interface CustomOverlayDrawable { readonly type: string; readonly entityName: string; } /** * Everything drawing can produce, for the dispatch that runs before the kind is known. A caller * does know, and gets the one arm that applies through `Drawn`. * * The node arm is not the mesh arm: drawing a node draws an axis triad, which is a * `TransformNode` and not geometry, and saying so is what lets that path return what it builds * instead of asserting it is a mesh. */ type DrawnAny = T | BABYLON.TransformNode | BABYLON.TransformNode[] | DrawnTag | DrawnTags | DrawnOverlay | undefined; /** * What drawing a particular entity resolves to. * * One call draws a dozen kinds of thing, and what comes back depends on which kind went in: a * tag becomes the tag itself, because it renders as an HTML overlay positioned from the scene * rather than as geometry in it; an overlay a host application resolves becomes a handle that * only knows how to dispose itself; a node becomes the node, because drawing one draws an axis * triad parented to it rather than replacing it with geometry; everything else becomes a mesh. * Spelling that out here is what lets a caller use what it gets back without first narrowing a * union it already knows the answer to. * * A mesh is matched before a node in the single-entity arms so that handing a drawn mesh back to * update it in place still resolves to a mesh - `Mesh` extends `TransformNode`, so the node arm * would otherwise swallow it and hand back the wider type. The list arms do not repeat that: * there is no update path that takes a list, so a list of meshes is drawn as the list of nodes * it is, and claiming a single mesh there would describe a result nothing can produce. * * An `E` that is not known - the whole `Entity` union, or an `any` - resolves to the union of * every branch, which is the honest answer for a caller that does not know either. * * The empty-list arm is not decoration. `{ entity: [] }` infers `E` as `never[]`, and `never` * satisfies every other branch, so without it a literal empty list types as drawn tags. */ type Drawn = E extends readonly unknown[] ? ([ E[number] ] extends [ never ] ? undefined : E[number] extends Inputs.Tag.TagDto ? DrawnTags : E[number] extends BABYLON.TransformNode ? BABYLON.TransformNode[] : T) : E extends Inputs.Tag.TagDto ? DrawnTag : E extends CustomOverlayDrawable ? DrawnOverlay : E extends BABYLON.Mesh ? T : E extends BABYLON.TransformNode ? BABYLON.TransformNode : T; /** * Feeds `draw.drawAnyAsync` and `drawAny`: the entity to draw, the options for its kind and, * when redrawing, the scene object from the previous draw. */ class DrawAny { constructor(entity?: E, options?: DrawOptions, babylonMesh?: BABYLON.Mesh | BABYLON.LinesMesh); /** * Entity to be drawn - can be a single or multiple points, lines, polylines, verb curves, verb surfaces, jscad meshes, jscad polygons, jscad paths, occt shapes, tags, nodes * @default undefined */ entity: E; /** * How the drawing looks, matched to the entity: basic options for points, lines, polylines * and JSCAD meshes, OCCT options for shapes, and so on; left out, defaults are used * @default undefined * @optional true */ options?: DrawOptions | undefined; /** * Entity to be used when updating already drawn mesh in the render loop * @default undefined * @optional true */ babylonMesh?: BABYLON.Mesh | BABYLON.LinesMesh | undefined; } /** * Feeds `draw.drawGridMesh`: the size of the ground grid, how its lines are spaced and * weighted, and its colors and opacity. */ class SceneDrawGridMeshDto { constructor(width?: number, height?: number, subdivisions?: number, majorUnitFrequency?: number, minorUnitVisibility?: number, gridRatio?: number, opacity?: number, backFaceCulling?: boolean, mainColor?: Base.Color, secondaryColor?: Base.Color); /** * Full size of the grid along X, in scene units * @default 400 * @minimum 0 * @maximum Infinity * @step 10 */ width: number; /** * Height of the ground * @default 400 * @minimum 0 * @maximum Infinity * @step 10 */ height: number; /** * Number of cells the ground mesh is divided into along each side * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ subdivisions: number; /** * The frequency of thicker lines. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ majorUnitFrequency: number; /** * How strongly the thin lines between the thick ones show, from 0 for hidden to 1 for full * @default 0.45 * @minimum 0 * @maximum 1 * @step 0.1 */ minorUnitVisibility: number; /** * The scale of the grid compared to unit. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ gridRatio: number; /** * The grid opacity outside of the lines. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity: number; /** * Cull the back faces * @default false */ backFaceCulling: boolean; /** * Main color of the grid (e.g. between lines) * @default #ffffff */ mainColor: Base.Color; /** * Color of the grid lines. * @default #ffffff */ secondaryColor: Base.Color; } /** * Draw options for basic geometry types like points, lines, polylines, surfaces and jscad meshes */ class DrawBasicGeometryOptions { constructor(colours?: string | string[], size?: number, opacity?: number, updatable?: boolean, hidden?: boolean, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number, colorMapStrategy?: Base.colorMapStrategyEnum, arrowSize?: number, arrowAngle?: number); /** * Basic geometry colors to use for lines, points, polylines, surfaces, jscad meshes. * @default #ff0000 */ colours: string | string[]; /** * How colors are spread over more entities than colors: first color for all, the last color * for the remainder, colors repeating, or colors bouncing back and forth * @default lastColorRemainder */ colorMapStrategy: Base.colorMapStrategyEnum; /** * Size affect how big the drawn points are and how wide lines are. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; /** * Opacity of the point 0 to 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity: number; /** * If geometry needs to be updated later * @default false */ updatable: boolean; /** * When true, the entity is drawn but not shown until it is made visible * @default false */ hidden: boolean; /** * Draw two-sided faces with different colors for front and back. This helps visualize face orientation. Only applies to surfaces. * @default true */ drawTwoSided: boolean; /** * Hex color string for back face color (negative side of the face). Only used when drawTwoSided is true and drawing surfaces. * @default #0000ff */ backFaceColour: Base.Color; /** * Back face opacity value between 0 and 1. Only used when drawTwoSided is true and drawing surfaces. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; /** * Size of the arrow head at the end of lines and polylines. Set to 0 to disable arrows. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.01 */ arrowSize: number; /** * Angle of the arrow head in degrees. Controls how wide the arrow head spreads. * @default 15 * @minimum 0 * @maximum 90 * @step 1 */ arrowAngle: number; } /** * Feeds `draw.optionsBabylonNode`: the color of each axis line a drawn node gets and how long * the lines are. */ class DrawNodeOptions { constructor(colorX?: Base.Color, colorY?: Base.Color, colorZ?: Base.Color, size?: number); /** * X Axis color * @default #ff0000 */ colorX: Base.Color; /** * Y Axis color * @default #00ff00 */ colorY: Base.Color; /** * Z Axis color * @default #0000ff */ colorZ: Base.Color; /** * Length of the node axis * @default 2 * @minimum 0 * @maximum Infinity */ size: number; } /** * Feeds `draw.optionsManifoldShapeMaterial`: the face color or material of a Manifold solid, * the line style of a cross-section, normals and the two-sided rendering. */ class DrawManifoldOrCrossSectionOptions { /** * Provide options without default values */ constructor(faceOpacity?: number, faceMaterial?: Base.Material, faceColour?: Base.Color, crossSectionColour?: Base.Color, crossSectionWidth?: number, crossSectionOpacity?: number, computeNormals?: boolean, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number); /** * Face opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity: number; /** * Hex color string for face color * @default #ff0000 */ faceColour: Base.Color; /** * An engine material for the faces, used instead of `faceColour` when given * @default undefined * @optional true */ faceMaterial?: Base.Material | undefined; /** * Hex color string for cross section drawing * @default #ff00ff */ crossSectionColour: Base.Color; /** * Width of cross section lines * @default 2 */ crossSectionWidth: number; /** * Cross section opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ crossSectionOpacity: number; /** * Compute normals for the shape * @default false */ computeNormals: boolean; /** * Whether to draw two-sided geometry with back face rendering * @default true */ drawTwoSided: boolean; /** * Hex color string for the back face when drawing two-sided geometry * @default #0000ff */ backFaceColour: Base.Color; /** * Opacity of the back face when drawing two-sided geometry * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; } /** * Feeds `draw.optionsOcctShape`: everything about how an OCCT shape is drawn, from meshing * precision to face, edge and vertex colors, index labels, arrows and the triangulation cache. */ class DrawOcctShapeOptions { /** * Provide options without default values */ constructor(faceOpacity?: number, edgeOpacity?: number, edgeColour?: Base.Color, faceMaterial?: Base.Material, faceColour?: Base.Color, edgeWidth?: number, drawEdges?: boolean, drawFaces?: boolean, drawVertices?: boolean, vertexColour?: Base.Color, vertexSize?: number, precision?: number, drawEdgeIndexes?: boolean, edgeIndexHeight?: number, edgeIndexColour?: Base.Color, drawFaceIndexes?: boolean, faceIndexHeight?: number, faceIndexColour?: Base.Color, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number, edgeArrowSize?: number, edgeArrowAngle?: number, keepMeshData?: boolean, allowQualityDecrease?: boolean, forceFaceDeflection?: boolean); /** * Face opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity: number; /** * Edge opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ edgeOpacity: number; /** * Hex color string for the edges * @default #ffffff */ edgeColour: Base.Color; /** * Hex color string for face color * @default #ff0000 */ faceColour: Base.Color; /** * Color of the vertices that will be drawn * @default #ff00ff */ vertexColour: Base.Color; /** * An engine material for the faces, used instead of `faceColour` when given * @default undefined * @optional true */ faceMaterial?: Base.Material | undefined; /** * Thickness of the drawn edge lines * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ edgeWidth: number; /** * The size of a vertices that will be drawn * @default 0.03 * @minimum 0 * @maximum Infinity * @step 0.01 */ vertexSize: number; /** * You can turn off drawing of edges via this property * @default true */ drawEdges: boolean; /** * You can turn off drawing of faces via this property * @default true */ drawFaces: boolean; /** * You can turn off drawing of vertexes via this property * @default false */ drawVertices: boolean; /** * Precision of the mesh that will be generated for the shape, lower number will mean more triangles * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.01 */ precision: number; /** * Draw index of edges in space * @default false */ drawEdgeIndexes: boolean; /** * Indicates the edge index height if they are drawn * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ edgeIndexHeight: number; /** * Edge index color if the edges are drawn * @default #ff00ff */ edgeIndexColour: Base.Color; /** * Draw indexes of faces in space * @default false */ drawFaceIndexes: boolean; /** * Indicates the edge index height if they are drawn * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ faceIndexHeight: number; /** * Edge index color if the edges are drawn * @default #0000ff */ faceIndexColour: Base.Color; /** * Draw two-sided faces with different colors for front and back. This helps visualize face orientation. * @default true */ drawTwoSided: boolean; /** * Hex color string for back face color (negative side of the face). Only used when drawTwoSided is true. * @default #0000ff */ backFaceColour: Base.Color; /** * Back face opacity value between 0 and 1. Only used when drawTwoSided is true. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; /** * Size of arrow heads at the end of edges to indicate edge/wire orientation. Set to 0 to disable arrows. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.01 */ edgeArrowSize: number; /** * Angle of the arrow head in degrees. Controls how wide the arrow head spreads. * @default 15 * @minimum 0 * @maximum 90 * @step 1 */ edgeArrowAngle: number; /** * Keep the cached triangulation on the shape after meshing. When false (default) the mesh data * is flushed so it does not accumulate in memory across draws. * @default false */ keepMeshData: boolean; /** * Allow re-meshing to a lower resolution triangulation than one already cached on the shape. * @default true */ allowQualityDecrease: boolean; /** * Force every face to be re-meshed to the requested precision regardless of cached triangulation. * @default false */ forceFaceDeflection: boolean; } /** * Feeds `draw.optionsOcctShapeSimple`: the most used OCCT drawing options, precision, face and * edge colors and the two-sided rendering, without the rest. */ class DrawOcctShapeSimpleOptions { constructor(precision?: number, drawFaces?: boolean, faceColour?: Base.Color, drawEdges?: boolean, edgeColour?: Base.Color, edgeWidth?: number, drawTwoSided?: boolean, backFaceColour?: Base.Color, backFaceOpacity?: number); /** * How closely the triangles follow the curved surfaces, in model units; lower is finer and * heavier * @default 0.01 * @minimum 0 * @maximum Infinity */ precision: number; /** * You can turn off drawing of faces via this property * @default true */ drawFaces: boolean; /** * Hex color string for face color * @default #ff0000 */ faceColour?: Base.Color | undefined; /** * You can turn off drawing of edges via this property * @default true */ drawEdges: boolean; /** * Hex color string for the edges * @default #ffffff */ edgeColour: Base.Color; /** * Thickness of the drawn edge lines * @default 2 * @minimum 0 * @maximum Infinity */ edgeWidth: number; /** * Whether to draw two-sided geometry with back face rendering * @default true */ drawTwoSided: boolean; /** * Hex color string for the back face when drawing two-sided geometry * @default #0000ff */ backFaceColour: Base.Color; /** * Opacity of the back face when drawing two-sided geometry * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; } /** * Feeds `draw.optionsOcctShapeMaterial`: an OCCT shape drawn with a full engine material on its * faces, plus the precision and the edge style. */ class DrawOcctShapeMaterialOptions { constructor(precision?: number, faceMaterial?: any, drawEdges?: boolean, edgeColour?: Base.Color, edgeWidth?: number); /** * How closely the triangles follow the curved surfaces, in model units; lower is finer and * heavier * @default 0.01 * @minimum 0 * @maximum Infinity */ precision: number; /** * The engine material the faces are drawn with * @default undefined */ faceMaterial: any; /** * You can turn off drawing of edges via this property * @default true */ drawEdges: boolean; /** * Hex color string for the edges * @default #ffffff */ edgeColour: Base.Color; /** * Thickness of the drawn edge lines * @default 2 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * Texture filtering mode - how the texture is sampled when scaled */ enum samplingModeEnum { nearest = "nearest", bilinear = "bilinear", trilinear = "trilinear" } /** * Generic texture creation options that work across all supported game engines. * These options are mapped to engine-specific texture properties. */ class GenericTextureDto { constructor(url?: string, name?: string, uScale?: number, vScale?: number, uOffset?: number, vOffset?: number, wAng?: number, invertY?: boolean, invertZ?: boolean, samplingMode?: samplingModeEnum); /** * URL of the texture image. Can be a local path or remote URL. * @default undefined */ url: string; /** * Name identifier for the texture * @default Texture */ name: string; /** * Horizontal (U) scale/tiling of the texture * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ uScale: number; /** * Vertical (V) scale/tiling of the texture * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ vScale: number; /** * Horizontal (U) offset of the texture * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ uOffset: number; /** * Vertical (V) offset of the texture * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ vOffset: number; /** * Rotation angle of the texture in radians around the W axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ wAng: number; /** * Invert the texture on the Y axis * @default false */ invertY: boolean; /** * Invert the texture on the Z axis * @default false */ invertZ: boolean; /** * Texture sampling/filtering mode * @default nearest */ samplingMode: samplingModeEnum; } /** * Alpha/blend modes that determine how transparent materials are rendered */ enum alphaModeEnum { opaque = "opaque", mask = "mask", blend = "blend" } /** * Generic PBR (Physically Based Rendering) material creation options. * These properties represent the common subset available across BabylonJS, ThreeJS, and PlayCanvas. * Property names follow BabylonJS conventions and are mapped to equivalent properties in other engines. */ class GenericPBRMaterialDto { constructor(name?: string, baseColor?: Base.Color, metallic?: number, roughness?: number, alpha?: number, emissiveColor?: Base.Color, emissiveIntensity?: number, zOffset?: number, zOffsetUnits?: number, baseColorTexture?: Base.Texture, metallicRoughnessTexture?: Base.Texture, normalTexture?: Base.Texture, emissiveTexture?: Base.Texture, occlusionTexture?: Base.Texture, alphaMode?: alphaModeEnum, alphaCutoff?: number, doubleSided?: boolean, wireframe?: boolean, unlit?: boolean); /** * Name identifier for the material * @default PBRMaterial */ name: string; /** * Base/albedo color of the material in hex format * @default #0000ff */ baseColor: Base.Color; /** * Metallic factor (0 = dielectric, 1 = metallic) * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ metallic: number; /** * Roughness factor (0 = smooth/mirror, 1 = rough/diffuse) * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ roughness: number; /** * Overall opacity/transparency of the material (0 = fully transparent, 1 = fully opaque) * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ alpha: number; /** * Emissive color - the color the material appears to emit (glow) * @default #000000 */ emissiveColor?: Base.Color | undefined; /** * Intensity multiplier for the emissive color * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ emissiveIntensity: number; /** * Z-buffer depth offset factor to help with z-fighting on coplanar surfaces * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ zOffset: number; /** * Z-buffer depth offset units for fine-tuned z-fighting control * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ zOffsetUnits: number; /** * Texture to use for base/albedo color * @default undefined * @optional true */ baseColorTexture?: Base.Texture | undefined; /** * Combined metallic-roughness texture (metallic in B channel, roughness in G channel) * @default undefined * @optional true */ metallicRoughnessTexture?: Base.Texture | undefined; /** * Normal/bump map texture for surface detail * @default undefined * @optional true */ normalTexture?: Base.Texture | undefined; /** * Texture for emissive/glow areas * @default undefined * @optional true */ emissiveTexture?: Base.Texture | undefined; /** * Ambient occlusion texture for soft shadows in crevices * @default undefined * @optional true */ occlusionTexture?: Base.Texture | undefined; /** * Alpha/transparency mode: opaque, mask (cutout), or blend (translucent) * @default opaque */ alphaMode: alphaModeEnum; /** * Alpha threshold for mask mode (pixels below this are fully transparent) * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.05 */ alphaCutoff: number; /** * Render both sides of faces (equivalent to disabling backFaceCulling) * @default false */ doubleSided: boolean; /** * Render material as wireframe * @default false */ wireframe: boolean; /** * Disable lighting calculations and render flat/unlit * @default false */ unlit: boolean; } /** * The kind of geometry a draw call detected, in singular and plural forms - point, line, node, * polyline, Verb curve and surface, JSCAD mesh, and so on. Written onto a drawn object so that * handing it back finds the handler that made it, and readable so you can tell what a handle * refers to when updating or disposing it. * * The values are strings rather than ordinals, and the membership is the same in every renderer. * As ordinals they were neither: the three renderers listed different kinds, so the same number * meant a Manifold solid in one and a list of OCCT shapes in another, and a value written by one * renderer read as a different kind in the next. A string says what it is wherever it is read. */ enum drawingTypes { point = "point", points = "points", line = "line", lines = "lines", node = "node", nodes = "nodes", polyline = "polyline", polylines = "polylines", verbCurve = "verbCurve", verbCurves = "verbCurves", verbSurface = "verbSurface", verbSurfaces = "verbSurfaces", jscadMesh = "jscadMesh", jscadMeshes = "jscadMeshes", jscadPath = "jscadPath", jscadPaths = "jscadPaths", occt = "occt", occtShapes = "occtShapes", manifold = "manifold", tag = "tag", tags = "tags" } } /** * Parameters for transform nodes: the invisible parents used to group and move several objects * together, and the queries that walk a node hierarchy. */ declare namespace BabylonNode { /** * Feeds the `babylon.node` getters with the one transform node to read from. */ class NodeDto { constructor(node?: BABYLON.TransformNode); /** * The transform node to read from */ node: BABYLON.TransformNode; } /** * Feeds `babylon.node.translate` with a node, the direction in its own axes and how far to move * it. */ class NodeTranslationDto { constructor(node?: BABYLON.TransformNode, direction?: Base.Vector3, distance?: number); /** * The transform node to move; its children follow */ node: BABYLON.TransformNode; /** * The direction to move in, in the node's own local axes */ direction: Base.Vector3; /** * How far to move along the direction, in scene units */ distance: number; } /** * Feeds `babylon.node.setParent` with a node and the node to parent it to. */ class NodeParentDto { constructor(node?: BABYLON.TransformNode, parentNode?: BABYLON.TransformNode); /** * The transform node to reparent; it keeps its place in the world */ node: BABYLON.TransformNode; /** * The node it moves with from then on */ parentNode: BABYLON.TransformNode; } /** * Feeds `babylon.node.setDirection` with a node and the direction its local Z axis should point * along. */ class NodeDirectionDto { constructor(node?: BABYLON.TransformNode, direction?: Base.Vector3); /** * The transform node to turn; its children follow */ node: BABYLON.TransformNode; /** * The direction the node's local Z axis is turned to, as `[x, y, z]` */ direction: number[]; } /** * Feeds `babylon.node.setAbsolutePosition` with a node and the world point to move it to. */ class NodePositionDto { constructor(node?: BABYLON.TransformNode, position?: Base.Point3); /** * The transform node to move; its children follow */ node: BABYLON.TransformNode; /** * The point in world space to move the node to, whatever its parents */ position: Base.Point3; } /** * Feeds `babylon.node.rotate` with a node, an axis through its origin and the angle to turn by. */ class RotateNodeDto { constructor(node?: BABYLON.TransformNode, axis?: Base.Vector3, angle?: number); /** * The transform node to turn; its children follow */ node: BABYLON.TransformNode; /** * The axis direction through the node's origin, as `[x, y, z]` */ axis: Base.Vector3; /** * How far to turn, in degrees, added to the current rotation */ angle: number; } /** * Feeds `babylon.node.rotateAroundAxisWithPosition`: the node, a point and an axis through it, * and the angle to orbit by. */ class RotateAroundAxisNodeDto { constructor(node?: BABYLON.TransformNode, position?: Base.Point3, axis?: Base.Vector3, angle?: number); /** * The transform node to turn around the axis; its children follow */ node: BABYLON.TransformNode; /** * A point the axis passes through */ position: Base.Point3; /** * The direction of the axis, as `[x, y, z]`; not a zero vector */ axis: Base.Vector3; /** * How far to turn, in degrees; positive follows the right-hand rule around the axis */ angle: number; } /** * Feeds `babylon.node.createNodeFromRotation`: the optional parent, where the node sits and how * it is turned. */ class CreateNodeFromRotationDto { constructor(parent?: BABYLON.TransformNode, origin?: Base.Point3, rotation?: Base.Vector3); /** * The node to parent the new one to, or null for a top-level node */ parent: BABYLON.TransformNode | null; /** * Where the node sits, relative to its parent */ origin: Base.Point3; /** * The angles around X, Y and Z in degrees the node is turned by */ rotation: Base.Vector3; } /** * Feeds `babylon.node.drawNode` with the node to draw axes for, the color of each axis and * their length. */ class DrawNodeDto { constructor(node?: BABYLON.TransformNode, colorX?: string, colorY?: string, colorZ?: string, size?: number); /** * The transform node the axis lines are parented to */ node: BABYLON.TransformNode; /** * Hex color of the line along the node's X axis */ colorX: string; /** * Hex color of the line along the node's Y axis */ colorY: string; /** * Hex color of the line along the node's Z axis */ colorZ: string; /** * Length of each axis line, in scene units */ size: number; } /** * Feeds `babylon.node.drawNodes` with the nodes to draw axes for, the color of each axis and * their length. */ class DrawNodesDto { constructor(nodes?: BABYLON.TransformNode[], colorX?: string, colorY?: string, colorZ?: string, size?: number); /** * The transform nodes, each getting its own set of axis lines */ nodes: BABYLON.TransformNode[]; /** * Hex color of the lines along the X axes */ colorX: string; /** * Hex color of the lines along the Y axes */ colorY: string; /** * Hex color of the lines along the Z axes */ colorZ: string; /** * Length of each axis line, in scene units */ size: number; } } /** * Parameters for the scene itself: background and clear color, fog, environment and skybox settings, * active camera, and the scene-level options that affect everything drawn into it. */ declare namespace BabylonScene { /** * Feeds `babylon.scene.backgroundColour` with the one plain color to fill the background with. */ class SceneBackgroundColourDto { /** * Provide options without default values */ constructor(colour?: string); /** * Hex color the whole background is painted in * @default #ffffff */ colour: Base.Color; } /** * Feeds `babylon.scene.setAndAttachScene` with the scene this library should draw into from * then on. */ class SceneDto { /** * Provide scene */ constructor(scene?: BABYLON.Scene); /** * The scene to draw into; it gets the shadow bookkeeping and root node this library expects * @default undefined */ scene: BABYLON.Scene; } /** * Feeds `babylon.scene.enablePhysics` with the gravity that bodies fall under. */ class EnablePhysicsDto { constructor(vector?: Base.Vector3); /** * The gravity as a vector, `[0, -9.81, 0]` being Earth's pull downward along Y * @default [0, -9.81, 0] */ vector: Base.Vector3; } /** * Feeds `babylon.scene.drawPointLight`: where the bulb sits, its colors and brightness, the * size of its visible sphere and the shadow settings. */ class PointLightDto { constructor(position?: Base.Point3, intensity?: number, diffuse?: Base.Color, specular?: Base.Color, radius?: number, shadowGeneratorMapSize?: number, enableShadows?: boolean, shadowDarkness?: number, transparencyShadow?: boolean, shadowUsePercentageCloserFiltering?: boolean, shadowContactHardeningLightSizeUVRatio?: number, shadowBias?: number, shadowNormalBias?: number, shadowMaxZ?: number, shadowMinZ?: number, shadowRefreshRate?: number); /** * Where the light shines from * @default [0, 0, 0] */ position: Base.Point3; /** * Brightness as luminous power, so values in the thousands are normal; 0 gives no light * @default 2000 * @minimum 0 * @maximum Infinity * @step 500 */ intensity: number; /** * Hex color of the light on surfaces * @default #ffffff */ diffuse: Base.Color; /** * Hex color of the highlights the light makes on shiny surfaces * @default #ffffff */ specular: Base.Color; /** * Radius of the glowing sphere drawn at the light's position, in scene units; 0 draws none * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Resolution of the shadow map in pixels; higher gives sharper shadows at more GPU cost * @default 1024 * @minimum 0 * @maximum Infinity * @step 1 */ shadowGeneratorMapSize?: number | undefined; /** * When true, the light casts shadows from every mesh in the scene * @default true */ enableShadows?: boolean | undefined; /** * How light the shadows are, from 0 for fully dark to 1 for invisible * @default 0 * @minimum 0 * @maximum 1 * @step 0.1 */ shadowDarkness?: number | undefined; /** * When true, transparent parts of meshes let light through the shadow, which Gaussian * splats need * @default false */ transparencyShadow: boolean; /** * When true, shadow edges are softened by sampling the map several times * @default true */ shadowUsePercentageCloserFiltering: boolean; /** * How much shadow edges blur with distance from the caster when filtering is on; larger * blurs more * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ shadowContactHardeningLightSizeUVRatio: number; /** * Small depth offset that stops surfaces from shadowing themselves in stripes; raise it if * stripes appear * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.00001 */ shadowBias: number; /** * Extra offset along surface normals against self-shadowing, in scene units * @default 0.002 * @minimum 0 * @maximum Infinity * @step 0.0001 */ shadowNormalBias: number; /** * The farthest distance from the light that shadows are computed for, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 50 */ shadowMaxZ: number; /** * The nearest distance from the light that shadows are computed for, in scene units * @default 0.1 * @minimum 0 * @maximum Infinity * @step 50 */ shadowMinZ: number; /** * How often the shadow map is redrawn: 1 every frame, 0 once only, 2 every second frame * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ shadowRefreshRate: number; } /** * Feeds `babylon.scene.activateCamera` with the camera the scene should render through. */ class ActiveCameraDto { constructor(camera?: BABYLON.Camera); /** * The camera that becomes active * @default undefined */ camera: BABYLON.Camera; } /** * Feeds `babylon.scene.useRightHandedSystem` with the choice between the two coordinate * handednesses. */ class UseRightHandedSystemDto { constructor(use?: boolean); /** * When true, the scene uses the right-handed system of most CAD tools and glTF; when false, * the engine's default left-handed one * @default true */ use: boolean; } /** * Feeds `babylon.scene.drawDirectionalLight`: the direction the sun-like light shines in, its * colors and brightness and the shadow settings. */ class DirectionalLightDto { constructor(direction?: Base.Vector3, intensity?: number, diffuse?: Base.Color, specular?: Base.Color, shadowGeneratorMapSize?: number, enableShadows?: boolean, shadowDarkness?: number, shadowUsePercentageCloserFiltering?: boolean, shadowContactHardeningLightSizeUVRatio?: number, shadowBias?: number, shadowNormalBias?: number, shadowMaxZ?: number, shadowMinZ?: number, shadowRefreshRate?: number); /** * The direction the light travels in; `[-100, -100, -100]` shines down and diagonally, and * only the direction matters, not the length * @default [-100, -100, -100] */ direction: Base.Vector3; /** * Brightness as a plain factor, 1 being full strength * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ intensity: number; /** * Hex color of the light on surfaces * @default #ffffff */ diffuse: Base.Color; /** * Hex color of the highlights the light makes on shiny surfaces * @default #ffffff */ specular: Base.Color; /** * Resolution of the shadow map in pixels; higher gives sharper shadows at more GPU cost * @default 1024 * @minimum 0 * @maximum Infinity * @step 1 */ shadowGeneratorMapSize?: number | undefined; /** * When true, the light casts shadows from every mesh in the scene * @default true */ enableShadows?: boolean | undefined; /** * How light the shadows are, from 0 for fully dark to 1 for invisible * @default 0 * @minimum 0 * @maximum 1 * @step 0.1 */ shadowDarkness?: number | undefined; /** * When true, shadow edges are softened by sampling the map several times * @default true */ shadowUsePercentageCloserFiltering: boolean; /** * When true, transparent parts of meshes let light through the shadow, which Gaussian * splats need * @default false */ transparencyShadow: boolean; /** * How much shadow edges blur with distance from the caster when filtering is on; larger * blurs more * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ shadowContactHardeningLightSizeUVRatio: number; /** * Small depth offset that stops surfaces from shadowing themselves in stripes; raise it if * stripes appear * @default 0.0001 * @minimum 0 * @maximum Infinity * @step 0.00001 */ shadowBias: number; /** * Extra offset along surface normals against self-shadowing, in scene units * @default 0.002 * @minimum 0 * @maximum Infinity * @step 0.0001 */ shadowNormalBias: number; /** * The farthest distance from the light that shadows are computed for, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 50 */ shadowMaxZ: number; /** * The nearest distance from the light that shadows are computed for, in scene units * @default 0 * @minimum 0 * @maximum Infinity * @step 50 */ shadowMinZ: number; /** * How often the shadow map is redrawn: 1 every frame, 0 once only, 2 every second frame * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ shadowRefreshRate: number; } /** * Feeds `babylon.scene.adjustActiveArcRotateCamera`: where the default orbiting camera goes, * what it looks at, and its optional limits and sensitivities. */ class CameraConfigurationDto { constructor(position?: Base.Point3, lookAt?: Base.Point3, lowerRadiusLimit?: number, upperRadiusLimit?: number, lowerAlphaLimit?: number, upperAlphaLimit?: number, lowerBetaLimit?: number, upperBetaLimit?: number, angularSensibilityX?: number, angularSensibilityY?: number, maxZ?: number, panningSensibility?: number, wheelPrecision?: number); /** * Where the camera is placed; its orbit radius becomes the distance to `lookAt` * @default [10, 10, 10] */ position: Base.Point3; /** * The point the camera looks at and orbits around */ lookAt: Base.Point3; /** * The closest the camera may zoom to the target, in scene units; left out, it is not * changed * @default undefined * @minimum -Infinity * @maximum Infinity * @step 1 * @optional true */ lowerRadiusLimit?: number | undefined; /** * The farthest the camera may zoom from the target, in scene units; left out, it is not * changed * @default undefined * @minimum -Infinity * @maximum Infinity * @step 1 * @optional true */ upperRadiusLimit?: number | undefined; /** * The smallest angle around the vertical axis the camera may orbit to, in degrees; left * out, it is not changed * @default undefined * @minimum -360 * @maximum 360 * @step 1 * @optional true */ lowerAlphaLimit?: number | undefined; /** * The largest angle around the vertical axis the camera may orbit to, in degrees; left out, * it is not changed * @default undefined * @minimum -360 * @maximum 360 * @step 1 * @optional true */ upperAlphaLimit?: number | undefined; /** * How close to straight above the camera may go, in degrees down from the top; 0 would look * straight down * @default 1 * @minimum -360 * @maximum 360 * @step 1 */ lowerBetaLimit: number; /** * How close to straight below the camera may go, in degrees down from the top; 180 would * look straight up * @default 179 * @minimum -360 * @maximum 360 * @step 1 */ upperBetaLimit: number; /** * How much pointer movement a horizontal orbit takes; lower turns faster * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ angularSensibilityX: number; /** * How much pointer movement a vertical orbit takes; lower turns faster * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ angularSensibilityY: number; /** * The farthest distance the camera draws, in scene units; anything beyond is not rendered * @default 1000 * @minimum 0 * @maximum Infinity * @step 1 */ maxZ: number; /** * How much pointer movement a pan takes; lower pans faster, so lower it for large models * @default 1000 * @minimum 0 * @maximum Infinity * @step 0.1 */ panningSensibility: number; /** * How much wheel movement a zoom step takes; lower zooms faster, so lower it for large * models * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ wheelPrecision: number; } /** * Feeds `babylon.scene.enableSkybox`: which built-in sky to use, how big and blurred it is, how * much it lights the scene and whether it is shown. */ class SkyboxDto { constructor(skybox?: Base.skyboxEnum, size?: number, blur?: number, environmentIntensity?: number, hideSkybox?: boolean, enableGroundProjection?: boolean, projectedGroundRadius?: number, projectedGroundHeight?: number); /** * The built-in sky to surround the scene with * @default clearSky */ skybox: Base.skyboxEnum; /** * Edge length of the sky cube, in scene units; make it larger than the scene so nothing * pokes through * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ size: number; /** * How much the visible sky is blurred, from 0 for sharp to 1 for fully soft; the lighting * is unaffected * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ blur: number; /** * How strongly the sky lights the scene through reflections and ambient light; 1 is full * strength * @default 0.7 * @minimum 0 * @maximum Infinity * @step 0.1 */ environmentIntensity: number; /** * When true, the sky is not drawn but still lights the scene * @default false */ hideSkybox?: boolean | undefined; /** * When true, the lower sky is projected onto a flat ground at height 0, so the model seems * to stand on the environment and casts shadows onto it * @default false */ enableGroundProjection?: boolean | undefined; /** * Radius of the projected ground and of the sky dome around it, in scene units; keep the * camera inside it * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ projectedGroundRadius?: number | undefined; /** * Height the environment was captured at, above the floor, in scene units; the floor itself * is always at height 0 * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ projectedGroundHeight?: number | undefined; } /** * Feeds `babylon.scene.enableSkyboxCustomTexture`: your own sky texture by URL, its size, and * the same size, blur, intensity and visibility options as the built-in skies. */ class SkyboxCustomTextureDto { constructor(textureUrl?: string, textureSize?: number, size?: number, blur?: number, environmentIntensity?: number, hideSkybox?: boolean, enableGroundProjection?: boolean, projectedGroundRadius?: number, projectedGroundHeight?: number); /** * Address of an `.hdr` file, an `.env` file or the root of six cube face images; nothing * happens without it * @default undefined * @optional true */ textureUrl?: string | undefined; /** * Resolution the sky texture is loaded at, in pixels per face; used for `.hdr` files * @default 512 * @optional true */ textureSize?: number | undefined; /** * Edge length of the sky cube, in scene units; make it larger than the scene so nothing * pokes through * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ size: number; /** * How much the visible sky is blurred, from 0 for sharp to 1 for fully soft; the lighting * is unaffected * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ blur: number; /** * How strongly the sky lights the scene through reflections and ambient light; 1 is full * strength * @default 0.7 * @minimum 0 * @maximum Infinity * @step 0.1 */ environmentIntensity: number; /** * When true, the sky is not drawn but still lights the scene * @default false */ hideSkybox?: boolean | undefined; /** * When true, the lower sky is projected onto a flat ground at height 0, so the model seems * to stand on the environment and casts shadows onto it * @default false */ enableGroundProjection?: boolean | undefined; /** * Radius of the projected ground and of the sky dome around it, in scene units; keep the * camera inside it * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ projectedGroundRadius?: number | undefined; /** * Height the environment was captured at, above the floor, in scene units; the floor itself * is always at height 0 * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ projectedGroundHeight?: number | undefined; } /** * Feeds `babylon.scene.enableSkyboxFromTexture`: a cube texture you already loaded, and the same * size, blur, intensity, visibility and ground projection options as the built-in skies. */ class SkyboxFromTextureDto { constructor(texture?: BABYLON.BaseTexture, size?: number, blur?: number, environmentIntensity?: number, hideSkybox?: boolean, enableGroundProjection?: boolean, projectedGroundRadius?: number, projectedGroundHeight?: number); /** * Cube texture to surround the scene with and light it by, such as one loaded from an * `.hdr` or `.env` file * @default undefined */ texture: BABYLON.BaseTexture; /** * Edge length of the sky cube, in scene units; make it larger than the scene so nothing * pokes through * @default 1000 * @minimum 0 * @maximum Infinity * @step 10 */ size: number; /** * How much the visible sky is blurred, from 0 for sharp to 1 for fully soft; the lighting * is unaffected * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ blur: number; /** * How strongly the sky lights the scene through reflections and ambient light; 1 is full * strength * @default 0.7 * @minimum 0 * @maximum Infinity * @step 0.1 */ environmentIntensity: number; /** * When true, the sky is not drawn but still lights the scene * @default false */ hideSkybox?: boolean | undefined; /** * When true, the lower sky is projected onto a flat ground at height 0, so the model seems * to stand on the environment and casts shadows onto it * @default false */ enableGroundProjection?: boolean | undefined; /** * Radius of the projected ground and of the sky dome around it, in scene units; keep the * camera inside it * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ projectedGroundRadius?: number | undefined; /** * Height the environment was captured at, above the floor, in scene units; the floor itself * is always at height 0 * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ projectedGroundHeight?: number | undefined; } /** * Feeds `babylon.scene.onPointerDown`, `onPointerUp` and `onPointerMove` with the function to * run on that pointer event. */ class PointerDto { /** * The function to run each time the event happens; it takes no arguments */ statement_update: () => void; } /** * Feeds `babylon.scene.fog`: the fog mode, its color, how dense it is and, for linear fog, * where it starts and ends. */ class FogDto { constructor(mode?: Base.fogModeEnum, color?: Base.Color, density?: number, start?: number, end?: number); /** * `none` turns fog off, `linear` fades between `start` and `end`, `exponential` and * `exponentialSquared` fade by `density` * @default none */ mode: Base.fogModeEnum; /** * Hex color distant geometry fades into, normally the background color * @default #ffffff */ color: Base.Color; /** * How quickly the exponential modes thicken with distance; ignored by linear fog * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ density: number; /** * Distance from the camera where linear fog begins, in scene units * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ start: number; /** * Distance from the camera where linear fog hides everything, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 1 */ end: number; } /** * Feeds `babylon.scene.canvasCSSBackgroundImage` with any CSS background image value to paint * behind the scene. */ class SceneCanvasCSSBackgroundImageDto { /** * Provide options without default values */ constructor(cssBackgroundImage?: string); /** * A CSS `background-image` value, such as a gradient function or `url(...)` * @default linear-gradient(to top, #1a1c1f 0%, #93aacd 100%) */ cssBackgroundImage: string; } /** * Feeds `babylon.scene.twoColorLinearGradientBackground`: the two colors, the direction the * gradient runs in and where each color stops. */ class SceneTwoColorLinearGradientDto { constructor(colorFrom?: Base.Color, colorTo?: Base.Color, direction?: Base.gradientDirectionEnum, stopFrom?: number, stopTo?: number); /** * Hex color the gradient starts with * @default #1a1c1f */ colorFrom: Base.Color; /** * Hex color the gradient ends with * @default #93aacd */ colorTo: Base.Color; /** * Which way the gradient runs, such as to the top or to the bottom right * @default toBottom */ direction: Base.gradientDirectionEnum; /** * Where the first color is still pure, as a percentage along the gradient * @default 0 * @minimum 0 * @maximum 100 * @step 1 */ stopFrom: number; /** * Where the second color becomes pure, as a percentage along the gradient * @default 100 * @minimum 0 * @maximum 100 * @step 1 */ stopTo: number; } /** * Feeds `babylon.scene.twoColorRadialGradientBackground`: the two colors, where the gradient * spreads from, its shape and where each color stops. */ class SceneTwoColorRadialGradientDto { constructor(colorFrom?: Base.Color, colorTo?: Base.Color, position?: Base.gradientPositionEnum, stopFrom?: number, stopTo?: number, shape?: Base.gradientShapeEnum); /** * Hex color at the center of the gradient * @default #1a1c1f */ colorFrom: Base.Color; /** * Hex color at the outer edge of the gradient * @default #93aacd */ colorTo: Base.Color; /** * Where the center of the gradient sits on the canvas * @default center */ position: Base.gradientPositionEnum; /** * How far from the center the first color is still pure, as a percentage * @default 0 * @minimum 0 * @maximum 100 * @step 1 */ stopFrom: number; /** * How far from the center the second color becomes pure, as a percentage * @default 100 * @minimum 0 * @maximum 100 * @step 1 */ stopTo: number; /** * Whether the gradient spreads as a circle or stretches into an ellipse with the canvas * @default circle */ shape: Base.gradientShapeEnum; } /** * Feeds `babylon.scene.multiColorLinearGradientBackground`: the colors, one stop each, and the * direction the gradient runs in. */ class SceneMultiColorLinearGradientDto { constructor(colors?: Base.Color[], stops?: number[], direction?: Base.gradientDirectionEnum); /** * The hex colors in order; the list must be as long as `stops` * @default ["#1a1c1f", "#93aacd"] */ colors: Base.Color[]; /** * Where each color is pure, as percentages along the gradient, one per color * @default [0, 100] */ stops: number[]; /** * Which way the gradient runs, such as to the top or to the bottom right * @default toTop */ direction: Base.gradientDirectionEnum; } /** * Feeds `babylon.scene.multiColorRadialGradientBackground`: the colors, one stop each, where * the gradient spreads from and its shape. */ class SceneMultiColorRadialGradientDto { constructor(colors?: Base.Color[], stops?: number[], position?: Base.gradientPositionEnum, shape?: Base.gradientShapeEnum); /** * The hex colors from the center outward; the list must be as long as `stops` * @default ["#1a1c1f", "#93aacd"] */ colors: Base.Color[]; /** * How far from the center each color is pure, as percentages, one per color * @default [0, 100] */ stops: number[]; /** * Where the center of the gradient sits on the canvas * @default center */ position: Base.gradientPositionEnum; /** * Whether the gradient spreads as a circle or stretches into an ellipse with the canvas * @default circle */ shape: Base.gradientShapeEnum; } /** * Feeds `babylon.scene.canvasBackgroundImage`: the image to show behind the scene and the CSS * options for how it repeats, scales, sits and scrolls. */ class SceneCanvasBackgroundImageDto { constructor(imageUrl?: string, repeat?: Base.backgroundRepeatEnum, size?: Base.backgroundSizeEnum, position?: Base.gradientPositionEnum, attachment?: Base.backgroundAttachmentEnum, origin?: Base.backgroundOriginClipEnum, clip?: Base.backgroundOriginClipEnum); /** * Address of the image to show behind the scene * @default undefined * @optional true */ imageUrl?: string | undefined; /** * Whether the image tiles across the canvas, in one direction or not at all * @default noRepeat */ repeat: Base.backgroundRepeatEnum; /** * How the image is scaled: cover fills the canvas, contain shows all of it, or a CSS size * such as `100px 50px` * @default cover */ size: Base.backgroundSizeEnum; /** * Where the image sits on the canvas, such as the center or a corner, or a CSS position * such as `50% 50%` * @default center */ position: Base.gradientPositionEnum; /** * Whether the image scrolls with the page or stays fixed to the viewport * @default scroll */ attachment: Base.backgroundAttachmentEnum; /** * Which box of the canvas the image is positioned against: its padding, border or content * box * @default paddingBox */ origin: Base.backgroundOriginClipEnum; /** * Which box of the canvas the image is clipped to: its padding, border or content box * @default borderBox */ clip: Base.backgroundOriginClipEnum; } } /** * Base namespace containing foundational types and enums used across all bitbybit packages. * This is the single source of truth - other packages extend this via module augmentation. */ /** * Parameters for color handling: hex, RGB and HSL values, the components to combine or extract, and * the settings for blending, inverting and generating ranges of colors. */ declare namespace Color { /** * A hex color for `color.hexColor` and `color.hexToRgb`. */ class HexDto { constructor(color?: Base.Color); /** * The color as a hex text such as `#ff5733`, with or without the `#`. * @default #0000ff */ color: Base.Color; } /** * An `{ r, g, b }` color with channels from 0 to 255, for `color.rgb255Color`. */ class Rgb255Dto { constructor(colorRgb?: Base.ColorRGB); /** * The color object; each channel from 0 to 255. * @default { "r": 0, "g": 0, "b": 255 } * @minimum 0 * @maximum 255 */ colorRgb: Base.ColorRGB; } /** * An `{ r, g, b }` color with channels from 0 to 1, for `color.rgb1Color`. */ class Rgb1Dto { constructor(colorRgb?: Base.ColorRGB); /** * The color object; each channel from 0 to 1. * @default { "r": 0, "g": 0, "b": 1 } * @minimum 0 * @maximum 1 */ colorRgb: Base.ColorRGB; } /** * An `{ r, g, b, a }` color with color channels from 0 to 255 and opacity from 0 to 1, for * `color.rgba255Color`. */ class Rgba255Dto { constructor(colorRgba?: Base.ColorRGBA); /** * The color object; `r`, `g` and `b` from 0 to 255 and `a` from 0 (transparent) to 1 * (opaque). * @default { "r": 0, "g": 0, "b": 255, "a": 1 } * @minimum 0 * @maximum 255 */ colorRgba: Base.ColorRGBA; } /** * An `{ r, g, b, a }` color with every channel from 0 to 1, for `color.rgba1Color`. */ class Rgba1Dto { constructor(colorRgba?: Base.ColorRGBA); /** * The color object; every channel from 0 to 1, `a` being 0 for transparent and 1 for * opaque. * @default { "r": 0, "g": 0, "b": 1, "a": 1 } * @minimum 0 * @maximum 1 */ colorRgba: Base.ColorRGBA; } /** * Separate red, green and blue values from 0 to 255, for color.rgbAtomic255Color. */ class RgbAttomic255Dto { constructor(r?: number, g?: number, b?: number); /** * The red channel, from 0 to 255. * @default 0 * @minimum 0 * @maximum 255 */ r: number; /** * The green channel, from 0 to 255. * @default 0 * @minimum 0 * @maximum 255 */ g: number; /** * The blue channel, from 0 to 255. * @default 255 * @minimum 0 * @maximum 255 */ b: number; } /** * Separate red, green, blue and alpha values from 0 to 255, for building a color. */ class RgbaAttomic255Dto { constructor(r?: number, g?: number, b?: number, a?: number); /** * The red channel, from 0 to 255. * @default 0 * @minimum 0 * @maximum 255 */ r: number; /** * The green channel, from 0 to 255. * @default 0 * @minimum 0 * @maximum 255 */ g: number; /** * The blue channel, from 0 to 255. * @default 255 * @minimum 0 * @maximum 255 */ b: number; /** * The opacity, from 0 (transparent) to 1 (opaque). * @default 1 * @minimum 0 * @maximum 1 */ a: number; } /** * Separate red, green and blue values from 0 to 1, for color.rgbAtomic1Color. */ class RgbAttomic1Dto { constructor(r?: number, g?: number, b?: number); /** * The red channel, from 0 to 1. * @default 0 * @minimum 0 * @maximum 1 */ r: number; /** * The green channel, from 0 to 1. * @default 0 * @minimum 0 * @maximum 1 */ g: number; /** * The blue channel, from 0 to 1. * @default 1 * @minimum 0 * @maximum 1 */ b: number; } /** * Separate red, green, blue and alpha values from 0 to 1, for building a color. */ class RgbaAttomic1Dto { constructor(r?: number, g?: number, b?: number, a?: number); /** * The red channel, from 0 to 1. * @default 0 * @minimum 0 * @maximum 1 */ r: number; /** * The green channel, from 0 to 1. * @default 0 * @minimum 0 * @maximum 1 */ g: number; /** * The blue channel, from 0 to 1. * @default 1 * @minimum 0 * @maximum 1 */ b: number; /** * The opacity, from 0 (transparent) to 1 (opaque). * @default 1 * @minimum 0 * @maximum 1 */ a: number; } /** * A hex color and a mode for `color.invert`. */ class InvertHexDto { constructor(color?: Base.Color); /** * The color to invert, as a hex text such as `#ff5733`. * @default #0000ff */ color: Base.Color; /** * When true, the result is black for a light color and white for a dark one instead of the * exact inverse; useful for readable text. */ blackAndWhite: boolean; } /** * A hex color and a target range for `color.hexToRgbMapped`, `color.getRedParam`, * `color.getGreenParam` and `color.getBlueParam`. */ class HexDtoMapped { constructor(color?: Base.Color, from?: number, to?: number); /** * The color as a hex text such as `#ff5733`. * @default #0000ff */ color: Base.Color; /** * The value a channel of 0 maps to. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ from: number; /** * The value a channel of 255 maps to; 1 gives channels from 0 to 1. * @default 255 * @minimum -Infinity * @maximum Infinity * @step 1 */ to: number; } /** * An `{ r, g, b }` color and the range its channels use, for `color.rgbObjToHex`. */ class RGBObjectMaxDto { constructor(rgb?: Base.ColorRGB, max?: number); /** * The color object to convert. * @default undefined */ rgb: Base.ColorRGB; /** * The lowest value a channel can have in this object, usually 0. * @default 0 * @minimum 0 * @maximum 255 * @step 0.1 */ min: number; /** * The highest value a channel can have in this object: 255 or 1; anything else is remapped * to 0 to 255 first. * @default 255 * @minimum 0 * @maximum 255 * @step 0.1 */ max: number; } /** * Three channel values and the range they use, for `color.rgbToHex`. */ class RGBMinMaxDto { constructor(r?: number, g?: number, b?: number, min?: number, max?: number); /** * The red channel, within `min` to `max`. * @default 255 * @minimum 0 * @maximum 255 * @step 1 */ r: number; /** * The green channel, within `min` to `max`. * @default 255 * @minimum 0 * @maximum 255 * @step 1 */ g: number; /** * The blue channel, within `min` to `max`. * @default 255 * @minimum 0 * @maximum 255 * @step 1 */ b: number; /** * The lowest value a channel can have, usually 0. * @default 0 * @minimum 0 * @maximum 255 * @step 0.1 */ min: number; /** * The highest value a channel can have: 255 or 1; anything else is remapped to 0 to 255 * first. * @default 255 * @minimum 0 * @maximum 255 * @step 0.1 */ max: number; } /** * An `{ r, g, b }` color for `color.rgbToRed`, `color.rgbToGreen` and `color.rgbToBlue`. */ class RGBObjectDto { constructor(rgb?: Base.ColorRGB); /** * The color object to read a channel from. * @default undefined */ rgb: Base.ColorRGB; } } /** * Parameters for date and time values: the date to act on, the unit and amount for arithmetic, and the * format and locale used when parsing or printing one. */ declare namespace Dates { /** * One date for the reading and formatting methods of `dates`: `getYear`, `getMonth`, * `toISOString` and the rest. */ class DateDto { constructor(date?: Date); /** * The date to read or format. * @default undefined */ date: Date; } /** * A date written as text for `dates.parseDate`. */ class DateStringDto { constructor(dateString?: string); /** * The text to read, ideally in ISO 8601 form such as `2024-01-15T14:30:00Z`. * @default undefined */ dateString: string; } /** * A date and a new value for its seconds, for `dates.setSeconds` and `dates.setUTCSeconds`. */ class DateSecondsDto { constructor(date?: Date, seconds?: number); /** * The date to copy; it is not changed. * @default undefined */ date: Date; /** * The new seconds from 0 to 59; a value outside the range rolls the date over. * @default 30 * @minimum 0 * @maximum Infinity * @step 1 */ seconds: number; } /** * A date and a new value for its day, for `dates.setDayOfMonth` and `dates.setUTCDay`. */ class DateDayDto { constructor(date?: Date, day?: number); /** * The date to copy; it is not changed. * @default undefined */ date: Date; /** * The new day of the month, from 1 to 31; a value outside the range rolls the date over. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ day: number; } /** * A date and a new value for its year, for `dates.setYear` and `dates.setUTCYear`. */ class DateYearDto { constructor(date?: Date, year?: number); /** * The date to copy; it is not changed. * @default undefined */ date: Date; /** * The new year as a full number such as 2024; a value outside the range rolls the date * over. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ year: number; } /** * A date and a new value for its month, for `dates.setMonth` and `dates.setUTCMonth`. */ class DateMonthDto { constructor(date?: Date, month?: number); /** * The date to copy; it is not changed. * @default undefined */ date: Date; /** * The new month counting from 0: 0 is January, 11 December; a value outside the range rolls * the date over. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ month: number; } /** * A date and a new value for its hours, for `dates.setHours` and `dates.setUTCHours`. */ class DateHoursDto { constructor(date?: Date, hours?: number); /** * The date to copy; it is not changed. * @default undefined */ date: Date; /** * The new hours from 0 to 23; a value outside the range rolls the date over. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ hours: number; } /** * A date and a new value for its minutes, for `dates.setMinutes` and `dates.setUTCMinutes`. */ class DateMinutesDto { constructor(date?: Date, minutes?: number); /** * The date to copy; it is not changed. * @default undefined */ date: Date; /** * The new minutes from 0 to 59; a value outside the range rolls the date over. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ minutes: number; } /** * A date and a new value for its milliseconds, for `dates.setMilliseconds` and * `dates.setUTCMilliseconds`. */ class DateMillisecondsDto { constructor(date?: Date, milliseconds?: number); /** * The date to copy; it is not changed. * @default undefined */ date: Date; /** * The new milliseconds from 0 to 999; a value outside the range rolls the date over. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ milliseconds: number; } /** * A date and a Unix timestamp for `dates.setTime`. */ class DateTimeDto { constructor(date?: Date, time?: number); /** * The date to copy; it is not changed. * @default undefined */ date: Date; /** * The new moment as milliseconds since 1 January 1970 at 00:00 UTC. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ time: number; } /** * A Unix timestamp for `dates.createFromUnixTimeStamp`, which turns it into a date. */ class CreateFromUnixTimeStampDto { constructor(unixTimeStamp?: number); /** * Milliseconds since 1 January 1970 at 00:00 UTC. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ unixTimeStamp: number; } /** * The parts of a date for `dates.createDate` and `dates.createDateUTC`; a part outside its * range rolls the date over. */ class CreateDateDto { constructor(year?: number, month?: number, day?: number, hours?: number, minutes?: number, seconds?: number, milliseconds?: number); /** * The full year, such as 2024. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ year: number; /** * The month counting from 0: 0 is January, 11 December. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ month: number; /** * The day of the month, from 1 to 31. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ day: number; /** * The hour, from 0 to 23. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ hours: number; /** * The minutes, from 0 to 59. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ minutes: number; /** * The seconds, from 0 to 59. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ seconds: number; /** * The milliseconds, from 0 to 999. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ milliseconds: number; } } /** * Parameters for reading and writing files: the data or shape to export, the target format and its * options, the file name, and the settings that control how imported content is interpreted. */ declare namespace IO { /** * Line segment defined by start and end points */ class DxfLineSegmentDto { constructor(start?: Base.Point2, end?: Base.Point2); /** * Start point of the line * @default undefined */ start: Base.Point2; /** * End point of the line * @default undefined */ end: Base.Point2; } /** * Arc segment defined by center, radius, and start/end angles in degrees */ class DxfArcSegmentDto { constructor(center?: Base.Point2, radius?: number, startAngle?: number, endAngle?: number); /** * Center point of the arc * @default undefined */ center: Base.Point2; /** * Distance from the center to the arc, in drawing units. * @default undefined */ radius: number; /** * Start angle in degrees * @default undefined */ startAngle: number; /** * End angle in degrees (counter-clockwise from start angle) * @default undefined */ endAngle: number; } /** * A full circle in a DXF path, given by its center and radius. */ class DxfCircleSegmentDto { constructor(center?: Base.Point2, radius?: number); /** * Center point of the circle * @default undefined */ center: Base.Point2; /** * Distance from the center to the circle, in drawing units. * @default undefined */ radius: number; } /** * Polyline segment defined by multiple points * Can include bulge values to create arc segments between vertices */ class DxfPolylineSegmentDto { constructor(points?: Base.Point2[], closed?: boolean, bulges?: number[]); /** * Points defining the polyline vertices * @default undefined */ points: Base.Point2[]; /** * Whether the polyline is closed * @default false */ closed?: boolean | undefined; /** * One bulge per vertex to bend the segment after it into an arc: 0 keeps it straight, * positive bends counter-clockwise, negative clockwise. Leave it out for straight segments * only. * @default undefined * @optional true */ bulges?: number[] | undefined; } /** * Spline/B-spline segment defined by control points and degree */ class DxfSplineSegmentDto { constructor(controlPoints?: Base.Point2[], degree?: number, closed?: boolean); /** * Control points defining the spline * @default undefined */ controlPoints: Base.Point2[]; /** * Degree of the spline (typically 2 or 3) * @default 3 */ degree?: number | undefined; /** * Whether the spline is closed * @default false */ closed?: boolean | undefined; } /** * A path can contain multiple segments of different types (lines, arcs, polylines, circles, splines) * Similar to OCCT wires that can combine different edge types */ class DxfPathDto { constructor(segments?: (DxfLineSegmentDto | DxfArcSegmentDto | DxfCircleSegmentDto | DxfPolylineSegmentDto | DxfSplineSegmentDto)[]); /** * Array of segments that make up this path * Can include lines, arcs, circles, polylines, and splines * @default undefined */ segments: (DxfLineSegmentDto | DxfArcSegmentDto | DxfCircleSegmentDto | DxfPolylineSegmentDto | DxfSplineSegmentDto)[]; } /** * A part containing multiple paths on the same layer with the same color */ class DxfPathsPartDto { constructor(layer?: string, color?: Base.Color, paths?: DxfPathDto[]); /** * Layer name for all paths in this part * @default Default */ layer: string; /** * Color for all paths in this part * @default #000000 */ color: Base.Color; /** * Array of paths, each containing multiple segments * @default undefined */ paths: DxfPathDto[]; } /** * A whole DXF drawing: its path parts by layer and color, and the color and version format to * write. */ class DxfModelDto { constructor(dxfPathsParts?: DxfPathsPartDto[], colorFormat?: "aci" | "truecolor", acadVersion?: "AC1009" | "AC1015"); /** * Array of path parts, each containing paths with segments * @default undefined */ dxfPathsParts: DxfPathsPartDto[]; /** * How colors are written: `aci`, the AutoCAD color index from 1 to 255 that older * software reads, or `truecolor`, full 24-bit RGB for newer software. * @default aci */ colorFormat?: "aci" | "truecolor" | undefined; /** * The DXF version to write: `AC1009` (AutoCAD R12) for the widest compatibility, or * `AC1015` (AutoCAD 2000) for the newer features. * @default AC1009 */ acadVersion?: "AC1009" | "AC1015" | undefined; } } /** * Parameters for straight line segments: the start and end points that define one, the options for * creating many at once from point lists, and the settings for measuring, reversing, transforming and * converting them into polylines or kernel edges. */ declare namespace Line { /** * A line as a plain object: where it starts and where it ends. Also the input of `line.create` * and `line.createSegment`. */ class LinePointsDto { /** * Provide options without default values */ constructor(start?: Base.Point3, end?: Base.Point3); /** * The first point of the line, where it begins. * @default undefined */ start: Base.Point3; /** * The second point of the line, where it finishes; the direction runs from start to end. * @default undefined */ end: Base.Point3; } /** * Two matching lists of points for `line.linesBetweenStartAndEndPoints`. */ class LineStartEndPointsDto { /** * Provide options without default values */ constructor(startPoints?: Base.Point3[], endPoints?: Base.Point3[]); /** * The start of each line, in order. * @default undefined */ startPoints: Base.Point3[]; /** * The end of each line, in the same order as the starts. * @default undefined */ endPoints: Base.Point3[]; } /** * One line and how to draw it: its width, color and opacity, and whether the drawn mesh will * be updated later. */ class DrawLineDto { /** * Provide options without default values */ constructor(line?: LinePointsDto, opacity?: number, colours?: string | string[], size?: number, updatable?: boolean, lineMesh?: T); /** * The line to draw, with its start and end. * @default undefined */ line: LinePointsDto; /** * How opaque the line is, from 0 (invisible) to 1 (solid). * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity?: number | undefined; /** * Color of the line as a hex text such as `#ff0000`; a list of texts is also accepted. * @default #444444 */ colours?: string | string[] | undefined; /** * Width of the drawn line. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; /** * When true, the drawn mesh is built so its ends can be moved later without redrawing. * @default false */ updatable?: boolean | undefined; /** * A mesh drawn earlier for this line; when given it is updated in place instead of a new * one being made. * @default undefined * @optional true */ lineMesh?: T | undefined; } /** * A list of lines and how to draw them: their width, colors and opacity, and whether the drawn * mesh will be updated later. */ class DrawLinesDto { /** * Provide options without default values */ constructor(lines?: LinePointsDto[], opacity?: number, colours?: string | string[], size?: number, updatable?: boolean, linesMesh?: T); /** * The lines to draw, each with its start and end. * @default undefined */ lines: LinePointsDto[]; /** * How opaque the lines are, from 0 (invisible) to 1 (solid). * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity?: number | undefined; /** * One hex color text for all lines, or one text per line. * @default #444444 */ colours?: string | string[] | undefined; /** * Width of the drawn lines. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; /** * When true, the drawn mesh is built so the ends can be moved later without redrawing. * @default false */ updatable?: boolean | undefined; /** * A mesh drawn earlier for these lines; when given it is updated in place instead of a new * one being made. * @default undefined * @optional true */ linesMesh?: T | undefined; } /** * Points in order for `line.linesBetweenPoints`, which joins each to the next. */ class PointsLinesDto { constructor(points?: Base.Point3[]); /** * The points to join, in order along the chain. * @default undefined */ points: Base.Point3[]; } /** * One line for the methods that read or convert it: `line.length`, `line.reverse`, * `line.lineToSegment` and the others. */ class LineDto { constructor(line?: LinePointsDto); /** * The line object with its start and end. * @default undefined */ line: LinePointsDto; } /** * One segment, a pair of points, for `line.segmentToLine`. */ class SegmentDto { constructor(segment?: Base.Segment3); /** * The segment as `[start, end]`. * @default undefined */ segment: Base.Segment3; } /** * Several segments, each a pair of points, for `line.segmentsToLines`. */ class SegmentsDto { constructor(segments?: Base.Segment3[]); /** * The segments, each `[start, end]`. * @default undefined */ segments: Base.Segment3[]; } /** * Several line objects for `line.linesToSegments`, which converts each to its pair-of-points * form. */ class LinesDto { constructor(lines?: LinePointsDto[]); /** * The line objects to convert. * @default undefined */ lines: LinePointsDto[]; } /** * Two lines and the rules for `line.lineLineIntersection`. */ class LineLineIntersectionDto { constructor(line1?: LinePointsDto, line2?: LinePointsDto, tolerance?: number); /** * The first line. * @default undefined */ line1: LinePointsDto; /** * The second line. * @default undefined */ line2: LinePointsDto; /** * When true, the crossing must lie within both segments; when false the lines are extended * without end. * @default true */ checkSegmentsOnly?: boolean | undefined; /** * How close, in model units, two lines must come to count as meeting; also the distance * below which a line counts as having no length. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.1 */ tolerance?: number | undefined; } /** * A line and a fraction along it for `line.getPointOnLine`. */ class PointOnLineDto { constructor(line?: LinePointsDto, param?: number); /** * The line to place the point on. * @default undefined */ line: LinePointsDto; /** * How far along the line, from 0 at the start to 1 at the end; values outside that range * continue past the ends. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ param?: number | undefined; } /** * A line and the transformation `line.transformLine` applies to both its ends. */ class TransformLineDto { constructor(line?: LinePointsDto, transformation?: Base.TransformMatrixes); /** * The line to transform; a new line is returned. * @default undefined */ line: LinePointsDto; /** * A transformation matrix, or a list of them applied in order. * @default undefined */ transformation: Base.TransformMatrixes; } /** * Lines and one transformation per line for `line.transformsForLines`. */ class TransformsLinesDto { constructor(lines?: LinePointsDto[], transformation?: Base.TransformMatrixes[]); /** * The lines to transform, as many as there are transformations. * @default undefined */ lines: LinePointsDto[]; /** * One transformation per line, in the same order; each may be a matrix or a list of * matrices applied in order. * @default undefined */ transformation: Base.TransformMatrixes[]; } /** * Lines and the one transformation applied to all of them. */ class TransformLinesDto { constructor(lines?: LinePointsDto[], transformation?: Base.TransformMatrixes); /** * The lines to transform; the result keeps their order. * @default undefined */ lines: LinePointsDto[]; /** * A transformation matrix, or a list of them applied in order, used for every line. * @default undefined */ transformation: Base.TransformMatrixes; } } /** * Parameters for array handling: the list to act on plus the index, count, depth, comparison or * grouping key an operation needs. Geometry calls take and return lists constantly, so these turn up * between almost every pair of geometry operations. */ declare namespace Lists { /** * Which end of a list to act on: the first item or the last. */ enum firstLastEnum { first = "first", last = "last" } /** * A list and a position for `lists.getItem`. */ class ListItemDto { constructor(list?: T[], index?: number, clone?: boolean); /** * The list to read from. * @default undefined */ list: T[]; /** * Position of the item, counting from 0; outside the list it throws. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; /** * When true, the item is deep-copied so the caller cannot change the list through it; an * item that cannot be copied, such as one with circular references, throws. * @default true */ clone?: boolean | undefined; } /** * A list and a range of positions for `lists.getSubList`. */ class SubListDto { constructor(list?: T[], indexStart?: number, indexEnd?: number, clone?: boolean); /** * The list to cut from. * @default undefined */ list: T[]; /** * Position of the first item to take, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ indexStart: number; /** * Position just after the last item to take; it is not included. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ indexEnd: number; /** * When true, the items are deep-copied so the caller cannot change the list through them; * an item that cannot be copied throws. * @default true */ clone?: boolean | undefined; } /** * A list for the methods that read or reshape it whole: `lists.reverse`, `lists.shuffle`, * `lists.flipLists`, `lists.getFirstItem` and the others. */ class ListCloneDto { constructor(list?: T[], clone?: boolean); /** * The list to work on. * @default undefined */ list: T[]; /** * When true, the list is deep-copied first so the input is never changed; when false the * modifying methods work in place. Circular data cannot be copied and throws. * @default true */ clone?: boolean | undefined; } /** * A pattern and a length for `lists.repeatInPattern`, which repeats the pattern until the list * is that long. */ class RepeatInPatternDto { constructor(list?: T[]); /** * The items to repeat, in order. * @default undefined */ list: T[]; /** * When true, the pattern is deep-copied first so the input is never changed. Data with * circular references cannot be copied and throws. * @default true */ clone?: boolean | undefined; /** * The length of the result; the pattern is cut off there. * @default 100 * @minimum 1 * @maximum Infinity * @step 1 */ lengthLimit: number; } /** * A list and a direction for `lists.sortNumber` and `lists.sortTexts`. */ class SortDto { constructor(list?: T[], clone?: boolean, orderAsc?: boolean); /** * The numbers or texts to sort. * @default undefined */ list: T[]; /** * When true, the list is deep-copied first so the input stays in its old order; when false * it is sorted in place. * @default true */ clone?: boolean | undefined; /** * When true, the smallest or alphabetically first item comes first; when false the order is * reversed. * @default true */ orderAsc: boolean; } /** * Objects, the property to compare and a direction for `lists.sortByPropValue`. */ class SortJsonDto { constructor(list?: T[], clone?: boolean, orderAsc?: boolean); /** * The objects to sort; each should carry the property. * @default undefined */ list: T[]; /** * When true, the list is deep-copied first so the input stays in its old order; when false * it is sorted in place. * @default true */ clone?: boolean | undefined; /** * When true, the object with the smallest value comes first; when false the largest. * @default true */ orderAsc: boolean; /** * Name of the property whose numeric value decides the order. * @default propName */ property: string; } /** * A list for `lists.removeAllItems`, which empties it in place. */ class ListDto { constructor(list?: T[]); /** * The list to empty. * @default undefined */ list: T[]; } /** * A list and a group size for `lists.groupNth`. */ class GroupListDto { constructor(list?: T[], nrElements?: number, keepRemainder?: boolean); /** * The items to split into groups, in order. * @default undefined */ list: T[]; /** * How many items go in each group. * @default 2 * @minimum 1 * @maximum Infinity * @step 1 */ nrElements: number; /** * When true, the items left over at the end form a shorter last group; when false they are * dropped. * @default false */ keepRemainder: boolean; } /** * An item and a count for `lists.repeat`. */ class MultiplyItemDto { constructor(item?: T, times?: number); /** * The item to repeat; every entry of the result is this same item. * @default undefined */ item: T; /** * How many entries the result has. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ times: number; } /** * A list, an item and a position for `lists.addItemAtIndex`. */ class AddItemAtIndexDto { constructor(list?: T[], item?: T, index?: number, clone?: boolean); /** * The list to insert into. * @default undefined */ list: T[]; /** * The item to insert. * @default undefined */ item: T; /** * The position the item takes, counting from 0; the item there and everything after it * shift up by one. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; /** * When true, the list is deep-copied first so the input is never changed; when false the * item is inserted in place. * @default true */ clone?: boolean | undefined; } /** * A list, an item and several positions for `lists.addItemAtIndexes`. */ class AddItemAtIndexesDto { constructor(list?: T[], item?: T, indexes?: number[], clone?: boolean); /** * The list to insert into. * @default undefined */ list: T[]; /** * The item to insert at every position. * @default undefined */ item: T; /** * The positions, counted on the list as it was before any insertion; positions outside the * list are ignored. * @default [0] */ indexes: number[]; /** * When true, the list is deep-copied first so the input is never changed; when false the * items are inserted in place. * @default true */ clone?: boolean | undefined; } /** * A list, several items and one position per item for `lists.addItemsAtIndexes`. */ class AddItemsAtIndexesDto { constructor(list?: T[], items?: T[], indexes?: number[], clone?: boolean); /** * The list to insert into. * @default undefined */ list: T[]; /** * The items to insert, one per index, in the same order. * @default undefined */ items: T[]; /** * One position per item, in ascending order, counted on the list as it was before any * insertion; a wrong count or order throws. * @default [0] */ indexes: number[]; /** * When true, the list is deep-copied first so the input is never changed; when false the * items are inserted in place. * @default true */ clone?: boolean | undefined; } /** * A list and a position for `lists.removeItemAtIndex` and `lists.removeItemAtIndexFromEnd`. */ class RemoveItemAtIndexDto { constructor(list?: T[], index?: number, clone?: boolean); /** * The list to take the item out of. * @default undefined */ list: T[]; /** * The position to remove, counting from 0 at the start, or from 0 at the end for the * from-end method; outside the list nothing is removed. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; /** * When true, the list is deep-copied first so the input is never changed; when false the * item is removed in place. * @default true */ clone?: boolean | undefined; } /** * A list and several positions for `lists.removeItemsAtIndexes`. */ class RemoveItemsAtIndexesDto { constructor(list?: T[], indexes?: number[], clone?: boolean); /** * The list to take the items out of. * @default undefined */ list: T[]; /** * The positions to remove, counted on the list as it was before any removal; positions * outside the list are ignored. * @default undefined */ indexes: number[]; /** * When true, the list is deep-copied first so the input is never changed; when false the * items are removed in place. * @default true */ clone?: boolean | undefined; } /** * A list, a step and an offset for `lists.removeNthItem`. */ class RemoveNthItemDto { constructor(list?: T[], nth?: number, offset?: number, clone?: boolean); /** * The list to thin out. * @default undefined */ list: T[]; /** * The step: every nth item, counted from the offset, is removed. * @default 2 * @minimum 1 * @maximum Infinity * @step 1 */ nth: number; /** * Position of the first item to remove, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ offset: number; /** * When true, the list is deep-copied first so the input is never changed; when false the * items are removed in place. * @default true */ clone?: boolean | undefined; } /** * A list and a probability for `lists.randomGetThreshold` and `lists.randomRemoveThreshold`. */ class RandomThresholdDto { constructor(list?: T[], threshold?: number, clone?: boolean); /** * The list to pick from. * @default undefined */ list: T[]; /** * The probability, from 0 to 1, that any one item is kept by the get method or dropped by * the remove method. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ threshold: number; /** * When true, the list is deep-copied first so the input is never changed. * @default true */ clone?: boolean | undefined; } /** * A list for `lists.removeDuplicates` and `lists.removeDuplicateNumbers`, which drop repeated * items. */ class RemoveDuplicatesDto { constructor(list?: T[], clone?: boolean); /** * The list to remove repeats from; the first occurrence of each item stays. * @default undefined */ list: T[]; /** * When true, the list is deep-copied first so the input is never changed. * @default true */ clone?: boolean | undefined; } /** * Numbers and a tolerance for `lists.removeDuplicateNumbersTolerance`, which drops * near-repeats. */ class RemoveDuplicatesToleranceDto { constructor(list?: T[], clone?: boolean, tolerance?: number); /** * The numbers to remove near-repeats from; the first of each group stays. * @default undefined */ list: T[]; /** * Numbers closer together than this count as the same. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 1e-7 */ tolerance: number; /** * When true, the list is deep-copied first so the input is never changed. * @default true */ clone?: boolean | undefined; } /** * A list and a repeating pattern for `lists.getByPattern`. */ class GetByPatternDto { constructor(list?: T[], pattern?: boolean[]); /** * The list to filter. * @default undefined */ list: T[]; /** * The pattern of `true` (keep) and `false` (skip) applied item by item and repeated until * the list ends. * @default [true, true, false] */ pattern: boolean[]; } /** * A list, a step and an offset for `lists.getNthItem`. */ class GetNthItemDto { constructor(list?: T[], nth?: number, offset?: number, clone?: boolean); /** * The list to pick from. * @default undefined */ list: T[]; /** * The step: every nth item, counted from the offset, is kept. * @default 2 * @minimum 1 * @maximum Infinity * @step 1 */ nth: number; /** * Position of the first item to keep, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ offset: number; /** * When true, the items are deep-copied so the caller cannot change the list through them. * @default true */ clone?: boolean | undefined; } /** * Several lists for `lists.getLongestListLength`, which measures the longest of them. */ class GetLongestListLength { constructor(lists?: T[]); /** * The lists to measure. * @default undefined */ lists: T[]; } /** * Nested lists and a depth for `lists.mergeElementsOfLists`, which regroups items by position. */ class MergeElementsOfLists { constructor(lists?: T[], level?: number); /** * The lists whose items are regrouped by position. * @default undefined */ lists: T[]; /** * How many levels of nesting to flatten inside each list before regrouping; 0 regroups the * lists as they are. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ level: number; } /** * A list and an item for `lists.addItem` and `lists.prependItem`. */ class AddItemDto { constructor(list?: T[], item?: T, clone?: boolean); /** * The list that receives the item. * @default undefined */ list: T[]; /** * The item to add at the end or the start. * @default undefined */ item: T; /** * When true, the list is deep-copied first so the input is never changed; when false the * item is added in place. * @default true */ clone?: boolean | undefined; } /** * A list, an item and an end for `lists.addItemFirstLast`. */ class AddItemFirstLastDto { constructor(list?: T[], item?: T, position?: firstLastEnum, clone?: boolean); /** * The list that receives the item. * @default undefined */ list: T[]; /** * The item that goes at the chosen end. * @default undefined */ item: T; /** * Whether the item goes at the start (`first`) or the end (`last`). * @default last */ position: firstLastEnum; /** * When true, the list is deep-copied first so the input is never changed; when false the * item is added in place. * @default true */ clone?: boolean | undefined; } /** * Several lists for `lists.concatenate`, joined end to end. */ class ConcatenateDto { constructor(lists?: T[][], clone?: boolean); /** * The lists to join, in the order they should appear. * @default undefined */ lists: T[][]; /** * When true, the lists are deep-copied first so the inputs are never changed. * @default true */ clone?: boolean | undefined; } /** * A list and an item for `lists.includes` and `lists.findIndex`. */ class IncludesDto { constructor(list?: T[], item?: T); /** * The list to search. * @default undefined */ list: T[]; /** * The item to look for; it must be the very same value or object, not just an equal-looking * one. * @default undefined */ item: T; } /** * Several lists for `lists.interleave`, which weaves them together item by item. */ class InterleaveDto { constructor(lists?: T[][], clone?: boolean); /** * The lists to weave; the first item of each comes first, then the second of each, and so * on. * @default undefined */ lists: T[][]; /** * When true, the lists are deep-copied first so the inputs are never changed. * @default true */ clone?: boolean | undefined; } } /** * Parameters for boolean logic and control flow: the operands of comparisons and and/or/not, the * branches of a conditional selection, and the gate values that visual scripts use where code would * use an if statement. */ declare namespace Logic { /** * The comparison used between two values: less than, less or equal, greater, greater or equal, * strict equality and inequality, and their loose equivalents. The strict forms compare type as * well as value and are the safer default; the loose forms coerce, which is occasionally what you * want when comparing a number against text a user typed. */ enum BooleanOperatorsEnum { less = "<", lessOrEqual = "<=", greater = ">", greaterOrEqual = ">=", tripleEqual = "===", tripleNotEqual = "!==", equal = "==", notEqual = "!=" } /** * Two values and an operator for `logic.compare`. */ class ComparisonDto { constructor(first?: T, second?: T, operator?: BooleanOperatorsEnum); /** * The value on the left of the operator. * @default undefined */ first: T; /** * The value on the right of the operator. * @default undefined */ second: T; /** * The comparison: `<`, `<=`, `>`, `>=`, `==`, `!=`, or the strict `===` and `!==`, which do * not convert types. * @default less */ operator: BooleanOperatorsEnum; } /** * One boolean for `logic.boolean` and `logic.not`, which pass it through or flip it. */ class BooleanDto { constructor(boolean?: boolean); /** * The boolean value. * @default false */ boolean: boolean; } /** * A list of booleans for `logic.notList`, which flips every one of them. */ class BooleanListDto { constructor(booleans?: boolean[]); /** * The booleans, in order. * @default undefined */ booleans: boolean[]; } /** * A value and a condition for `logic.valueGate`. */ class ValueGateDto { constructor(value?: T, boolean?: boolean); /** * The value that passes through when the gate is open. * @default undefined */ value: T; /** * When true the gate is open and the value passes; when false the result is undefined. * @default false */ boolean: boolean; } /** * A preferred value and a fallback for `logic.firstDefinedValueGate`. */ class TwoValueGateDto { constructor(value1?: T, value2?: U); /** * The value used when it is defined. * @default undefined * @optional true */ value1?: T | undefined; /** * The value used when the first is undefined. * @default undefined * @optional true */ value2?: U | undefined; } /** * A length and a probability for `logic.randomBooleans`. */ class RandomBooleansDto { constructor(length?: number); /** * How many booleans to draw. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ length: number; /** * The chance of each boolean being true, from 0 (never) to 1 (always). * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ trueThreshold: number; } /** * Numbers, two thresholds and a step count for `logic.twoThresholdRandomGradient`. */ class TwoThresholdRandomGradientDto { /** * The numbers to turn into booleans, one each. * @default undefined */ numbers: number[]; /** * Numbers below this are always true. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ thresholdTotalTrue: number; /** * Numbers above this are always false; between the two thresholds the chance of true fades * from certain to none. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ thresholdTotalFalse: number; /** * How many steps the fade between the thresholds has; more steps make it smoother. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ nrLevels: number; } /** * Numbers and a threshold for `logic.thresholdBooleanList`, which turns them into booleans. */ class ThresholdBooleanListDto { /** * The numbers to turn into booleans, one each. * @default undefined */ numbers: number[]; /** * Numbers below this become true and the rest false, unless `inverse` flips them. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ threshold: number; /** * When true, every result is flipped: true becomes false and false becomes true. * @default false */ inverse: boolean; } /** * Numbers and ranges for `logic.thresholdGapsBooleanList`, which marks the numbers inside any * range. */ class ThresholdGapsBooleanListDto { /** * The numbers to turn into booleans, one each. * @default undefined */ numbers: number[]; /** * The ranges, each `[min, max]` with both ends included; a number inside any of them * becomes true. * @default undefined */ gapThresholds: Base.Vector2[]; /** * When true, every result is flipped: true becomes false and false becomes true. * @default false */ inverse: boolean; } } /** * Parameters for numeric helpers: the operands of arithmetic and trigonometry, the source and target * ranges for remapping a value, rounding and clamping bounds, interpolation factors, and the seed for * reproducible randomness. Remapping is the one that appears in nearly every parametric model, because * it turns a user-facing slider range into the range the geometry needs. */ declare namespace Math { /** * The arithmetic operation applied to two numbers: add, subtract, multiply, divide, power or * modulus. Exists so a visual script can choose the operation at runtime instead of wiring a * different node for each one. */ enum mathTwoNrOperatorEnum { add = "add", subtract = "subtract", multiply = "multiply", divide = "divide", power = "power", modulus = "modulus" } /** * The operation applied to a single number: absolute, negate, natural and base-10 logarithms, * powers of ten, rounding up, down or to nearest, square root, the trigonometric functions and * their inverses, exponential, and conversion between radians and degrees. Note that the * trigonometric functions work in radians - use radToDeg and degToRad at the boundary, because * almost every angle a user types is in degrees. */ enum mathOneNrOperatorEnum { absolute = "absolute", negate = "negate", ln = "ln", log10 = "log10", tenPow = "tenPow", round = "round", floor = "floor", ceil = "ceil", sqrt = "sqrt", sin = "sin", cos = "cos", tan = "tan", asin = "asin", acos = "acos", atan = "atan", log = "log", exp = "exp", radToDeg = "radToDeg", degToRad = "degToRad" } /** * The easing curve applied when interpolating between two values, in the usual in/out/inOut * families - sine, quadratic, cubic, quartic, quintic, exponential and the rest. Governs how an * animated or blended value accelerates: easeInOut starts and ends gently, easeIn only starts * gently, easeOut only ends gently. Linear interpolation, with no easing, is what makes animation * look mechanical. */ enum easeEnum { easeInSine = "easeInSine", easeOutSine = "easeOutSine", easeInOutSine = "easeInOutSine", easeInQuad = "easeInQuad", easeOutQuad = "easeOutQuad", easeInOutQuad = "easeInOutQuad", easeInCubic = "easeInCubic", easeOutCubic = "easeOutCubic", easeInOutCubic = "easeInOutCubic", easeInQuart = "easeInQuart", easeOutQuart = "easeOutQuart", easeInOutQuart = "easeInOutQuart", easeInQuint = "easeInQuint", easeOutQuint = "easeOutQuint", easeInOutQuint = "easeInOutQuint", easeInExpo = "easeInExpo", easeOutExpo = "easeOutExpo", easeInOutExpo = "easeInOutExpo", easeInCirc = "easeInCirc", easeOutCirc = "easeOutCirc", easeInOutCirc = "easeInOutCirc", easeInElastic = "easeInElastic", easeOutElastic = "easeOutElastic", easeInOutElastic = "easeInOutElastic", easeInBack = "easeInBack", easeOutBack = "easeOutBack", easeInOutBack = "easeInOutBack", easeInBounce = "easeInBounce", easeOutBounce = "easeOutBounce", easeInOutBounce = "easeInOutBounce" } /** * A number and a divisor for `math.modulus`, which gives the remainder of the division. */ class ModulusDto { constructor(number?: number, modulus?: number); /** * The number to divide. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ number: number; /** * The number to divide by; the remainder is smaller than it. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ modulus: number; } /** * One number for the single-number methods of `math`: `sqrt`, `abs`, `sin`, `degToRad` and the * rest. */ class NumberDto { constructor(number?: number); /** * The number the method works on; for the trigonometric methods an angle in radians. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ number: number; } /** * A value between 0 and 1, a target range and an easing curve for `math.ease`. */ class EaseDto { constructor(x?: number); /** * The position along the curve, from 0 at `min` to 1 at `max`. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ x: number; /** * The value at the start of the curve. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ min: number; /** * The value at the end of the curve. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ max: number; /** * The easing curve: `easeIn` starts slowly, `easeOut` ends slowly, `easeInOut` does both, * in sine, quadratic, cubic and other strengths. * @default easeInSine */ ease: easeEnum; } /** * A number and a precision for `math.roundToDecimals` and `math.roundAndRemoveTrailingZeros`. */ class RoundToDecimalsDto { constructor(number?: number, decimalPlaces?: number); /** * The number to round; it is not changed, a rounded copy is returned. * @default 1.123456 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ number: number; /** * How many digits to keep after the decimal point; 0 rounds to a whole number. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 1 */ decimalPlaces: number; } /** * Two numbers and the arithmetic operation `math.twoNrOperation` applies to them. */ class ActionOnTwoNumbersDto { constructor(first?: number, second?: number, operation?: mathTwoNrOperatorEnum); /** * The first operand: the number subtracted from, divided, or raised to a power. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ first: number; /** * The second operand: the number subtracted, divided by, or used as the exponent. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ second: number; /** * The operation to apply to `first` and `second`, in that order * @default add */ operation: mathTwoNrOperatorEnum; } /** * Two numbers for `math.add`, `math.subtract`, `math.multiply`, `math.divide` and `math.power`. */ class TwoNumbersDto { constructor(first?: number, second?: number); /** * The first operand: the number subtracted from, divided, or raised to a power. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ first: number; /** * The second operand: the number subtracted, divided by, or used as the exponent. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ second: number; } /** * One number and the operation `math.oneNrOperation` applies to it. */ class ActionOnOneNumberDto { constructor(number?: number, operation?: mathOneNrOperatorEnum); /** * The number the operation works on; for the trigonometric operations an angle in radians. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ number: number; /** * The operation to apply to `number` * @default absolute */ operation: mathOneNrOperatorEnum; } /** * A number, the range it is in and the range `math.remap` maps it to. */ class RemapNumberDto { constructor(number?: number, fromLow?: number, fromHigh?: number, toLow?: number, toHigh?: number); /** * The number to map. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ number: number; /** * The low end of the range the number is in. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ fromLow: number; /** * The high end of the range the number is in. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ fromHigh: number; /** * The low end of the range to map to; `fromLow` lands here. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ toLow: number; /** * The high end of the range to map to; `fromHigh` lands here. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ toHigh: number; } /** * The range `math.randomNumber` picks a value from; `low` can be picked, `high` is never quite * reached. */ class RandomNumberDto { constructor(low?: number, high?: number); /** * The smallest value that can be picked. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ low: number; /** * The top of the range; values get close to it but never reach it. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ high: number; } /** * The range and the count for `math.randomNumbers`; `low` can be picked, `high` is never quite * reached. */ class RandomNumbersDto { constructor(low?: number, high?: number, count?: number); /** * The smallest value that can be picked. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ low: number; /** * The top of the range; values get close to it but never reach it. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ high: number; /** * How many random numbers to produce. * @default 10 * @minimum -Infinity * @maximum Infinity * @step 1 */ count: number; } /** * A number and a precision for `math.toFixed`, which formats it as text. */ class ToFixedDto { constructor(number?: number, decimalPlaces?: number); /** * The number to format. * @default undefined * @minimum -Infinity * @maximum Infinity * @step 0.1 */ number: number; /** * How many digits to show after the decimal point, padding with zeros. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 1 */ decimalPlaces: number; } /** * A number and the range `math.clamp` keeps it within. */ class ClampDto { constructor(number?: number, min?: number, max?: number); /** * The number to limit. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ number: number; /** * The lowest value allowed; anything below becomes this. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ min: number; /** * The highest value allowed; anything above becomes this. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ max: number; } /** * A start, an end and a fraction for `math.lerp`, which blends between them. */ class LerpDto { constructor(start?: number, end?: number, t?: number); /** * The value at fraction 0. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ start: number; /** * The value at fraction 1. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ end: number; /** * How far from start to end, from 0 to 1; values outside that range extrapolate. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ t: number; } /** * A start, an end and a value for `math.inverseLerp`, which finds the value's fraction between * them. */ class InverseLerpDto { constructor(start?: number, end?: number, value?: number); /** * The value that counts as fraction 0. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ start: number; /** * The value that counts as fraction 1. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ end: number; /** * The value to locate between start and end. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ value: number; } /** * A number and the range `math.wrap` cycles it into. */ class WrapDto { constructor(number?: number, min?: number, max?: number); /** * The number to wrap; it may be far outside the range. * @default 1.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ number: number; /** * The start of the range, included in the result. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ min: number; /** * The end of the range, not included: a number reaching it comes back in at `min`. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ max: number; } /** * A running value and a length for `math.pingPong`, which bounces the value between 0 and the * length. */ class PingPongDto { constructor(t?: number, length?: number); /** * The running value, such as elapsed time; it may grow without limit. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ t: number; /** * The turning point: the result rises to it, then falls back to 0. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ length: number; } /** * A current value, a target and a step limit for `math.moveTowards`. */ class MoveTowardsDto { constructor(current?: number, target?: number, maxDelta?: number); /** * The value to move. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ current: number; /** * The value to move toward; it is never overshot. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ target: number; /** * The largest change allowed in one step. * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ maxDelta: number; } /** * An expression written as text for `math.evalArithmetic`. */ class EvalArithmeticDto { constructor(expression?: string); /** * The expression: numbers, `+`, `-`, the multiplication sign, `/`, parentheses and spaces, * such as `(3 + 2) / 4`. * @default 1+1 */ expression: string; } } /** * Parameters for polygonal mesh geometry: vertex, index and normal data, the options for building and * inspecting a mesh, and the settings that control conversion between the mesh representations the * different kernels and the renderer expect. */ declare namespace Mesh { /** * A point and a plane for `mesh.signedDistanceToPlane`. */ class SignedDistanceFromPlaneToPointDto { constructor(point?: Base.Point3, plane?: Base.TrianglePlane3); /** * The point to measure from. * @default undefined */ point: Base.Point3; /** * The plane as a unit normal and its distance from the origin along that normal, such as * `calculateTrianglePlane` gives. * @default undefined */ plane: Base.TrianglePlane3; } /** * One triangle as three points, for methods that read it. */ class TriangleDto { constructor(triangle?: Base.Triangle3); /** * The triangle as three points. * @default undefined */ triangle: Base.Triangle3; } /** * A triangle and a tolerance for `mesh.calculateTrianglePlane`. */ class TriangleToleranceDto { constructor(triangle?: Base.Triangle3); /** * The triangle as three points. * @default undefined */ triangle: Base.Triangle3; /** * A triangle whose normal is shorter than this counts as having no area. * @default 1e-7 * @minimum -Infinity * @maximum Infinity * @step 1e-7 */ tolerance?: number | undefined; } /** * Two triangles and a tolerance for `mesh.triangleTriangleIntersection`. */ class TriangleTriangleToleranceDto { constructor(triangle1?: Base.Triangle3, triangle2?: Base.Triangle3, tolerance?: number); /** * The first triangle as three points. * @default undefined */ triangle1: Base.Triangle3; /** * The second triangle as three points. * @default undefined */ triangle2: Base.Triangle3; /** * Distances below this, in model units, count as zero when deciding whether the triangles * touch. * @default 1e-7 * @minimum -Infinity * @maximum Infinity * @step 1e-7 */ tolerance?: number | undefined; } /** * Two meshes and a tolerance for `mesh.meshMeshIntersectionSegments`, * `mesh.meshMeshIntersectionPolylines` and `mesh.meshMeshIntersectionPoints`. */ class MeshMeshToleranceDto { constructor(mesh1?: Base.Mesh3, mesh2?: Base.Mesh3, tolerance?: number); /** * The first mesh, as a list of triangles. * @default undefined */ mesh1: Base.Mesh3; /** * The second mesh, as a list of triangles. * @default undefined */ mesh2: Base.Mesh3; /** * Distances below this, in model units, count as zero: when deciding whether triangles * touch and when joining segment ends into polylines. * @default 1e-7 * @minimum -Infinity * @maximum Infinity * @step 1e-7 */ tolerance?: number | undefined; } } /** * Parameters for creating and working with points: single points, points spread along a line or a * curve, points in rectangular and hexagonal grids, spirals and other structured sets, plus the * options for transforming, sorting, closest-point queries and distance measurement. Structured point * sets are where most parametric models begin. */ declare namespace Point { /** * One point for `point.getX`, `point.getY` and `point.getZ`. */ class PointDto { constructor(point?: Base.Point3); /** * The point as `[x, y, z]`. * @default undefined */ point: Base.Point3; } /** * The three values `point.pointXYZ` puts together into `[x, y, z]`. */ class PointXYZDto { constructor(x?: number, y?: number, z?: number); /** * The X value, the first entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ x: number; /** * The Y value, the second entry; Y is up. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ y: number; /** * The Z value, the third entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ z: number; } /** * The two values `point.pointXY` puts together into `[x, y]`. */ class PointXYDto { constructor(x?: number, y?: number); /** * The X value, the first entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ x: number; /** * The Y value, the second entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ y: number; } /** * A list of points for the methods that read them together: `point.boundingBoxOfPoints`, * `point.averagePoint` and `point.sortPoints`. */ class PointsDto { constructor(points?: Base.Point3[]); /** * The points, each `[x, y, z]`. * @default undefined */ points: Base.Point3[]; } /** * Two points, for methods that relate one point to another. */ class TwoPointsDto { constructor(point1?: Base.Point3, point2?: Base.Point3); /** * The first point. * @default undefined */ point1: Base.Point3; /** * The second point. * @default undefined */ point2: Base.Point3; } /** * One point and how to draw it: its size, color and opacity, and whether the drawn mesh will * be updated later. */ class DrawPointDto { /** * Provide options without default values */ constructor(point?: Base.Point3, opacity?: number, size?: number, colours?: string | string[], updatable?: boolean, pointMesh?: T); /** * The point to draw, as `[x, y, z]`. * @default undefined */ point: Base.Point3; /** * How opaque the point is, from 0 (invisible) to 1 (solid). * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity: number; /** * Size of the drawn point, in model units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; /** * Color of the point as a hex string such as `#ff0000`; a list of strings is also * accepted. * @default #444444 */ colours: string | string[]; /** * When true, the drawn mesh is built so its position can be changed later without * redrawing. * @default false */ updatable: boolean; /** * A mesh drawn earlier for this point; when given it is updated in place instead of a new * one being made. * @default undefined * @optional true */ pointMesh?: T | undefined; } /** * A list of points and how to draw them: their size, colors and opacity, and whether the drawn * mesh will be updated later. */ class DrawPointsDto { /** * Provide options without default values */ constructor(points?: Base.Point3[], opacity?: number, size?: number, colours?: string | string[], updatable?: boolean, pointsMesh?: T); /** * The points to draw, each `[x, y, z]`. * @default undefined */ points: Base.Point3[]; /** * How opaque the points are, from 0 (invisible) to 1 (solid). * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity: number; /** * Size of each drawn point, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size: number; /** * One hex color string for all points, or one string per point. * @default #444444 */ colours: string | string[]; /** * When true, the drawn mesh is built so the positions can be changed later without * redrawing. * @default false */ updatable: boolean; /** * A mesh drawn earlier for these points; when given it is updated in place instead of a new * one being made. * @default undefined * @optional true */ pointsMesh?: T | undefined; } /** * One point and the transformation `point.transformPoint` applies to it. */ class TransformPointDto { constructor(point?: Base.Point3, transformation?: Base.TransformMatrixes); /** * The point to transform; it is not changed, a new point is returned. * @default undefined */ point: Base.Point3; /** * A transformation matrix, or a list of them applied in order. * @default undefined */ transformation: Base.TransformMatrixes; } /** * Points and the one transformation `point.transformPoints` applies to all of them. */ class TransformPointsDto { constructor(points?: Base.Point3[], transformation?: Base.TransformMatrixes); /** * The points to transform; they are not changed and the result keeps their order. * @default undefined */ points: Base.Point3[]; /** * A transformation matrix, or a list of them applied in order, used for every point. * @default undefined */ transformation: Base.TransformMatrixes; } /** * Points and one vector per point for `point.translatePointsWithVectors`; the two lists must * have the same length. */ class TranslatePointsWithVectorsDto { constructor(points?: Base.Point3[], translations?: Base.Vector3[]); /** * The points to move. * @default undefined */ points: Base.Point3[]; /** * One vector per point, in the same order; the first point moves by the first vector. * @default undefined */ translations: Base.Vector3[]; } /** * Points and the one vector `point.translatePoints` moves them all by. */ class TranslatePointsDto { constructor(points?: Base.Point3[], translation?: Base.Vector3); /** * The points to move. * @default undefined */ points: Base.Point3[]; /** * The vector every point moves by, as `[x, y, z]`. * @default undefined */ translation: Base.Vector3; } /** * Points and the distance along each axis that `point.translateXYZPoints` moves them. */ class TranslateXYZPointsDto { constructor(points?: Base.Point3[], x?: number, y?: number, z?: number); /** * The points to move. * @default undefined */ points: Base.Point3[]; /** * Distance to move along X, in model units. * @default 0 */ x: number; /** * Distance to move along Y, which is up, in model units. * @default 1 */ y: number; /** * Distance to move along Z, in model units. * @default 0 */ z: number; } /** * Points, a center and a factor per axis for `point.scalePointsCenterXYZ`. */ class ScalePointsCenterXYZDto { constructor(points?: Base.Point3[], center?: Base.Point3, scaleXyz?: Base.Vector3); /** * The points to scale; they are not changed and the result keeps their order. * @default undefined */ points: Base.Point3[]; /** * The point that stays in place while the others move away from it or toward it. * @default [0, 0, 0] */ center: Base.Point3; /** * The factor for each axis as `[x, y, z]`: `[1, 2, 1]` doubles distances along Y and leaves * X and Z as they are. * @default [1, 1, 1] */ scaleXyz: Base.Vector3; } /** * Points, a center, a direction and a factor for `point.stretchPointsDirFromCenter`, which * scales only along that direction. */ class StretchPointsDirFromCenterDto { constructor(points?: Base.Point3[], center?: Base.Point3, direction?: Base.Vector3, scale?: number); /** * The points to stretch; they are not changed and the result keeps their order. * @default undefined */ points: Base.Point3[]; /** * The point that stays in place; distances are measured from it. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The direction to stretch along; distances across it do not change. * @default [0, 0, 1] */ direction?: Base.Vector3 | undefined; /** * The factor applied along the direction; 1 leaves the points as they are, 2 doubles their * distance from the center along it. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ scale?: number | undefined; } /** * Points, an axis, a center and an angle for `point.rotatePointsCenterAxis`. */ class RotatePointsCenterAxisDto { constructor(points?: Base.Point3[], angle?: number, axis?: Base.Vector3, center?: Base.Point3); /** * The points to rotate; they are not changed and the result keeps their order. * @default undefined */ points: Base.Point3[]; /** * How far to turn, in degrees; positive is counter-clockwise when the axis points toward * you. * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle: number; /** * The direction of the axis to turn around. * @default [0, 1, 0] */ axis: Base.Vector3; /** * A point the axis passes through. * @default [0, 0, 0] */ center: Base.Point3; } /** * Points and one transformation per point for `point.transformsForPoints`; the two lists must * have the same length. */ class TransformsForPointsDto { constructor(points?: Base.Point3[], transformation?: Base.TransformMatrixes[]); /** * The points to transform, as many as there are transformations; the result keeps their * order. * @default undefined */ points: Base.Point3[]; /** * One transformation per point, in the same order; each may be a matrix or a list of * matrices applied in order. * @default undefined */ transformation: Base.TransformMatrixes[]; } /** * Three points that define a plane, for `point.normalFromThreePoints`. */ class ThreePointsNormalDto { constructor(point1?: Base.Point3, point2?: Base.Point3, point3?: Base.Point3, reverseNormal?: boolean); /** * The first point; the normal is measured from here. * @default undefined */ point1: Base.Point3; /** * The second point. * @default undefined */ point2: Base.Point3; /** * The third point; going from the first to the second to the third counter-clockwise puts * the normal toward you. * @default undefined */ point3: Base.Point3; /** * When true, the normal is flipped to point the other way. * @default false */ reverseNormal: boolean; } /** * A corner for `point.maxFilletRadius` and `point.maxFilletRadiusHalfLine`: the corner point is * `end`, and `start` and `center` are the far ends of the two segments that meet there. */ class ThreePointsToleranceDto { constructor(start?: Base.Point3, center?: Base.Point3, end?: Base.Point3, tolerance?: number); /** * The far end of the first segment. * @default undefined */ start: Base.Point3; /** * The far end of the second segment, not the corner. * @default undefined */ center: Base.Point3; /** * The corner where the two segments meet. * @default undefined */ end: Base.Point3; /** * A segment shorter than this, or an angle within it of straight or folded back, gives a * radius of 0. * @default 1e-7 * @minimum -Infinity * @maximum Infinity * @step 1e-7 */ tolerance: number; } /** * A polyline's points for `point.maxFilletsHalfLine` and `point.safestPointsMaxFilletHalfLine`, * and whether it closes back on itself. */ class PointsMaxFilletsHalfLineDto { constructor(points?: Base.Point3[], checkLastWithFirst?: boolean, tolerance?: number); /** * The points of the polyline, in order; at least three make a corner. * @default undefined */ points: Base.Point3[]; /** * When true, the polyline is closed and the corners at its first and last points are * included. * @default false */ checkLastWithFirst?: boolean | undefined; /** * A segment shorter than this, or an angle within it of straight or folded back, gives a * radius of 0. * @default 1e-7 * @minimum -Infinity * @maximum Infinity * @step 1e-7 */ tolerance?: number | undefined; } /** * Points to filter with `point.removeConsecutiveDuplicates`, and how close two points must be * to count as the same. */ class RemoveConsecutiveDuplicatesDto { constructor(points?: Base.Point3[], tolerance?: number, checkFirstAndLast?: boolean); /** * The points to filter; their order is kept. * @default undefined */ points: Base.Point3[]; /** * Two points count as the same when every coordinate differs by less than this. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 1e-7 */ tolerance?: number | undefined; /** * When true, a last point that repeats the first is dropped as well, which closes a loop * cleanly. */ checkFirstAndLast: boolean; } /** * A point and a list to search for `point.closestPointFromPoints`, * `point.closestPointFromPointsDistance` and `point.closestPointFromPointsIndex`. */ class ClosestPointFromPointsDto { constructor(points?: Base.Point3[], point?: Base.Point3); /** * Points to search through * @default undefined */ points: Base.Point3[]; /** * The point to measure from; the closest of `points` to it is the result * @default undefined */ point: Base.Point3; } /** * Two points and a tolerance for `point.twoPointsAlmostEqual`. */ class TwoPointsToleranceDto { constructor(point1?: Base.Point3, point2?: Base.Point3, tolerance?: number); /** * First point to compare * @default undefined */ point1: Base.Point3; /** * Second point to compare * @default undefined */ point2: Base.Point3; /** * The points count as equal when the distance between them is below this. * @default 1e-7 * @minimum -Infinity * @maximum Infinity * @step 1e-7 */ tolerance?: number | undefined; } /** * Two points for `point.distance`: where a measurement starts and where it ends. */ class StartEndPointsDto { constructor(startPoint?: Base.Point3, endPoint?: Base.Point3); /** * The point the measurement starts from. * @default undefined */ startPoint: Base.Point3; /** * The point the measurement ends at. * @default undefined */ endPoint: Base.Point3; } /** * One start point and many end points for `point.distancesToPoints`. */ class StartEndPointsListDto { constructor(startPoint?: Base.Point3, endPoints?: Base.Point3[]); /** * The point every distance is measured from. * @default undefined */ startPoint: Base.Point3; /** * The points to measure to; the result keeps their order. * @default undefined */ endPoints: Base.Point3[]; } /** * One point and a count for `point.multiplyPoint`, which repeats it. */ class MultiplyPointDto { constructor(point?: Base.Point3, amountOfPoints?: number); /** * The point to repeat. * @default undefined */ point: Base.Point3; /** * How many copies to make. * @default undefined */ amountOfPoints: number; } /** * The shape of the logarithmic spiral `point.spiral` lays out: how many points, how far it * reaches and how quickly it opens. */ class SpiralDto { constructor(radius?: number, numberPoints?: number, widening?: number, factor?: number, phi?: number); /** * Growth ratio of the spiral; values near 1 make a tight spiral, larger values open it * faster. * @default 0.9 * @minimum 0 * @maximum Infinity * @step 0.1 */ phi: number; /** * How many points to place along the spiral. * @default 200 * @minimum 0 * @maximum Infinity * @step 10 */ numberPoints: number; /** * How much the spiral widens per turn; larger values spread the turns further apart. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ widening: number; /** * The distance from the origin the last point reaches, in model units. * @default 6 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius: number; /** * Scales the distance before the angle is computed, which turns the whole spiral; 1 leaves * it as it is. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ factor: number; } /** * The area, counts and orientation for `point.hexGridScaledToFit`, which sizes hexagons so the * given number of them fills the width and height. */ class HexGridScaledToFitDto { constructor(width?: number, height?: number, nrHexagonsInHeight?: number, nrHexagonsInWidth?: number, centerGrid?: boolean, pointsOnGround?: boolean); /** * The total width to fill, in model units; the hexagon size follows from it and * `nrHexagonsInWidth`. * @default 10 * @minimum 0 * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * The total height to fill, in model units. Regular hexagons may not tile it exactly, so * the real height can differ slightly. * @default 10 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * How many hexagons across. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsInWidth?: number | undefined; /** * How many hexagons from top to bottom. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsInHeight?: number | undefined; /** * When true, the hexagons have a flat edge at the top and bottom; when false a corner * points up. * @default false */ flatTop?: boolean | undefined; /** * When true, the grid is stretched so its top row reaches past the top edge, filling the rectangle * without a jagged border there. * @default false */ extendTop?: boolean | undefined; /** * When true, the grid is stretched so its bottom row reaches past the bottom edge, filling the * rectangle without a jagged border there. * @default false */ extendBottom?: boolean | undefined; /** * When true, the grid is stretched so its left column reaches past the left edge, filling the * rectangle without a jagged border there. * @default false */ extendLeft?: boolean | undefined; /** * When true, the grid is stretched so its right column reaches past the right edge, filling the * rectangle without a jagged border there. * @default false */ extendRight?: boolean | undefined; /** * When true, the middle of the grid sits at the origin instead of its corner. * @default false */ centerGrid?: boolean | undefined; /** * When true, the grid lies on the XZ ground plane (Y becomes 0) instead of the XY plane. * @default false */ pointsOnGround?: boolean | undefined; } /** * The hexagon size, the column and row counts and the placement for `point.hexGrid`. */ class HexGridCentersDto { constructor(nrHexagonsX?: number, nrHexagonsY?: number, radiusHexagon?: number, orientOnCenter?: boolean, pointsOnGround?: boolean); /** * How many rows of hexagons along Y. * @default 21 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsY: number; /** * How many columns of hexagons along X. * @default 21 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsX: number; /** * Distance from a hexagon's center to one of its corners, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusHexagon: number; /** * When true, the middle of the grid sits at the origin instead of its corner. * @default false */ orientOnCenter: boolean; /** * When true, the grid lies on the XZ ground plane (Y becomes 0) instead of the XY plane. * @default false */ pointsOnGround: boolean; } } /** * Parameters for connected sequences of line segments: the point list that defines the path, whether * it closes back on itself, and the options for measuring, transforming and converting a polyline into * a kernel wire ready for solid modelling. */ declare namespace Polyline { /** * Points and a closed flag for `polyline.create`. */ class PolylineCreateDto { /** * Provide options without default values */ constructor(points?: Base.Point3[], isClosed?: boolean); /** * The points of the polyline, in order along it. * @default undefined */ points: Base.Point3[]; /** * When true, the polyline joins its last point back to its first. * @default false */ isClosed?: boolean | undefined; } /** * A polyline as a plain object: its points in order, whether it closes back on itself, and an * optional color for drawing. */ class PolylinePropertiesDto { /** * Provide options without default values */ constructor(points?: Base.Point3[], isClosed?: boolean); /** * The points of the polyline, in order along it. * @default undefined */ points: Base.Point3[]; /** * When true, the polyline joins its last point back to its first. * @default false */ isClosed?: boolean | undefined; /** * A color used when the polyline is drawn, as a hex text such as `#ff0000` or as `[r, g, * b]` values from 0 to 1. * @default #444444 */ color?: string | number[] | undefined; } /** * One polyline for the methods that read it: `polyline.length`, `polyline.getPoints`, * `polyline.polylineToSegments` and the rest. */ class PolylineDto { constructor(polyline?: PolylinePropertiesDto); /** * The polyline object with its points. * @default undefined */ polyline: PolylinePropertiesDto; } /** * A list of polylines, for methods that take several at once. */ class PolylinesDto { constructor(polylines?: PolylinePropertiesDto[]); /** * The polyline objects. * @default undefined */ polylines: PolylinePropertiesDto[]; } /** * A polyline and the transformation `polyline.transformPolyline` applies to its points. */ class TransformPolylineDto { constructor(polyline?: PolylinePropertiesDto, transformation?: Base.TransformMatrixes); /** * The polyline whose points are transformed; a new polyline is returned. * @default undefined */ polyline: PolylinePropertiesDto; /** * A transformation matrix, or a list of them applied in order. * @default undefined */ transformation: Base.TransformMatrixes; } /** * One polyline and how to draw it: its width, color and opacity, and whether the drawn mesh * will be updated later. */ class DrawPolylineDto { /** * Provide options without default values */ constructor(polyline?: PolylinePropertiesDto, opacity?: number, colours?: string | string[], size?: number, updatable?: boolean, polylineMesh?: T); /** * The polyline to draw, with its points and closed flag. * @default undefined */ polyline: PolylinePropertiesDto; /** * How opaque the line is, from 0 (invisible) to 1 (solid). * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity?: number | undefined; /** * Color of the line as a hex text such as `#ff0000`; a list of texts is also accepted. * @default #444444 */ colours?: string | string[] | undefined; /** * Width of the drawn line. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; /** * When true, the drawn mesh is built so its points can be changed later without redrawing. * @default false */ updatable?: boolean | undefined; /** * A mesh drawn earlier for this polyline; when given it is updated in place instead of a * new one being made. * @default undefined * @optional true */ polylineMesh?: T | undefined; } /** * A list of polylines and how to draw them: their width, colors and opacity, and whether the * drawn mesh will be updated later. */ class DrawPolylinesDto { /** * Provide options without default values */ constructor(polylines?: PolylinePropertiesDto[], opacity?: number, colours?: string | string[], size?: number, updatable?: boolean, polylinesMesh?: T); /** * The polylines to draw, each with its points and closed flag. * @default undefined */ polylines: PolylinePropertiesDto[]; /** * How opaque the lines are, from 0 (invisible) to 1 (solid). * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity?: number | undefined; /** * One hex color text for all polylines, or one text per polyline. * @default #444444 */ colours?: string | string[] | undefined; /** * Width of the drawn lines. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; /** * When true, the drawn mesh is built so the points can be changed later without redrawing. * @default false */ updatable?: boolean | undefined; /** * A mesh drawn earlier for these polylines; when given it is updated in place instead of a * new one being made. * @default undefined * @optional true */ polylinesMesh?: T | undefined; } /** * Loose segments and a tolerance for `polyline.sortSegmentsIntoPolylines`. */ class SegmentsToleranceDto { constructor(segments?: Base.Segment3[]); /** * The segments to join, each a pair of points, in any order. * @default undefined */ segments: Base.Segment3[]; /** * Two segment ends closer than this, in model units, count as touching. * @default 1e-5 * @minimum -Infinity * @maximum Infinity * @step 1e-5 */ tolerance?: number | undefined; } /** * A polyline and a tolerance for `polyline.polylineSelfIntersection`, * `polyline.maxFilletsHalfLine` and `polyline.safestFilletRadius`. */ class PolylineToleranceDto { constructor(polyline?: PolylinePropertiesDto, tolerance?: number); /** * The polyline to examine. * @default undefined */ polyline: PolylinePropertiesDto; /** * Distance, in model units, below which two points count as the same. * @default 1e-5 * @minimum -Infinity * @maximum Infinity * @step 1e-5 */ tolerance?: number | undefined; } /** * Two polylines and a tolerance for `polyline.twoPolylineIntersection`. */ class TwoPolylinesToleranceDto { constructor(polyline1?: PolylinePropertiesDto, polyline2?: PolylinePropertiesDto, tolerance?: number); /** * The first polyline. * @default undefined */ polyline1: PolylinePropertiesDto; /** * The second polyline. * @default undefined */ polyline2: PolylinePropertiesDto; /** * Crossing points closer together than this, in model units, are reported once. * @default 1e-5 * @minimum -Infinity * @maximum Infinity * @step 1e-5 */ tolerance?: number | undefined; } } /** * Parameters for string handling: the text to act on plus the separator, index, pattern, replacement, * padding or format an operation needs. Used for labels, tags, engraved 3D text and for assembling the * data a script hands back out. */ declare namespace Text { /** * One text for the single-text methods of `text`: `trim`, `toUpperCase`, `reverse`, `length`, * `isEmpty` and the rest. */ class TextDto { constructor(text?: string); /** * The text the method works on; it is not changed, a new text is returned. * @default Hello World */ text: string; } /** * A text and a separator for `text.split`. */ class TextSplitDto { constructor(text?: string, separator?: string); /** * The text to cut into pieces. * @default a,b,c */ text: string; /** * The text that marks a cut; it is dropped from the pieces. * @default , */ separator: string; } /** * A text, what to look for in it and what to put in its place, for `text.replaceAll`. */ class TextReplaceDto { constructor(text?: string, search?: string, replaceWith?: string); /** * The text to make the replacements in. * @default a-c */ text: string; /** * The text to look for; every occurrence is replaced. * @default - */ search: string; /** * The text that takes the place of each occurrence. * @default b */ replaceWith: string; } /** * Texts and a separator for `text.join`, which writes them one after another. */ class TextJoinDto { constructor(list?: string[], separator?: string); /** * The texts to join, in order. * @default undefined */ list: string[]; /** * The text placed between neighbors; an empty text joins them directly. * @default , */ separator: string; } /** * Any value for `text.toString`, which turns it into text the way JavaScript prints it. */ class ToStringDto { constructor(item?: T); /** * The value to turn into text. * @default undefined */ item: T; } /** * A list of values for `text.toStringEach`, which turns each into text the way JavaScript * prints it. */ class ToStringEachDto { constructor(list?: T[]); /** * The values to turn into text, one by one. * @default undefined */ list: T[]; } /** * A text with numbered placeholders and the values for `text.format` to fill in. */ class TextFormatDto { constructor(text?: string, values?: string[]); /** * The text with placeholders such as `{0}` and `{1}`. * @default Hello {0} */ text: string; /** * The values, in placeholder order: the first fills `{0}`, the second `{1}`. * @default ["World"] */ values: string[]; } /** * A text and something to look for in it, for `text.includes`, `text.startsWith`, * `text.endsWith`, `text.indexOf` and `text.lastIndexOf`. */ class TextSearchDto { constructor(text?: string, search?: string); /** * The text to look in. * @default hello world */ text: string; /** * The text to look for, matched exactly, including case. * @default world */ search: string; } /** * A text and a range of positions for `text.substring` and `text.slice`. */ class TextSubstringDto { constructor(text?: string, start?: number, end?: number); /** * The text to take characters from. * @default hello world */ text: string; /** * Position of the first character to take, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ start: number; /** * Position just after the last character to take; leave it out to take everything to the * end. * @default 5 * @minimum 0 * @maximum Infinity * @step 1 */ end?: number | undefined; } /** * A text and a position for `text.charAt`. */ class TextIndexDto { constructor(text?: string, index?: number); /** * The text to read a character from. * @default hello */ text: string; /** * Position of the character, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * A text, a length and a filler for `text.padStart` and `text.padEnd`. */ class TextPadDto { constructor(text?: string, length?: number, padString?: string); /** * The text to lengthen. * @default x */ text: string; /** * The length to reach; a text already that long stays as it is. * @default 3 * @minimum 0 * @maximum Infinity * @step 1 */ length: number; /** * The filler repeated until the length is reached; the last repeat is cut short if needed. * @default a */ padString: string; } /** * A text and a count for `text.repeat`. */ class TextRepeatDto { constructor(text?: string, count?: number); /** * The text that is written out again and again. * @default ha */ text: string; /** * How many times the text appears in the result. * @default 3 * @minimum 0 * @maximum Infinity * @step 1 */ count: number; } /** * Texts for `text.concat`, joined with nothing between them. */ class TextConcatDto { constructor(texts?: string[]); /** * The texts to join, in order. * @default ["hello", " ", "world"] */ texts: string[]; } /** * A text and a regular expression for `text.regexTest`, `text.regexMatch`, `text.regexSearch` * and `text.regexSplit`. */ class TextRegexDto { constructor(text?: string, pattern?: string, flags?: string); /** * The text the pattern is applied to. * @default hello123world */ text: string; /** * The regular expression, written as it would be between the slashes in JavaScript, such as * `[0-9]+`. * @default [0-9]+ */ pattern: string; /** * The regular expression flags: `g` for every match, `i` to ignore case, `m` for * line-by-line anchors, and `s`, `u`, `y` as in JavaScript. * @default g */ flags: string; } /** * A text, a regular expression and a replacement for `text.regexReplace`. */ class TextRegexReplaceDto { constructor(text?: string, pattern?: string, flags?: string, replaceWith?: string); /** * The text to make the replacements in. * @default hello123world456 */ text: string; /** * The regular expression, written as it would be between the slashes in JavaScript, such as * `[0-9]+`. * @default [0-9]+ */ pattern: string; /** * The regular expression flags: `g` replaces every match instead of the first, `i` ignores * case, and `m`, `s`, `u`, `y` work as in JavaScript. * @default g */ flags: string; /** * The text that takes the place of each match; `$1` and the like refer to capture groups, * as in JavaScript. * @default X */ replaceWith: string; } /** * One character and its size and placement for `text.vectorChar`, which draws it as stroke * paths on the XZ plane. */ class VectorCharDto { constructor(char?: string, xOffset?: number, yOffset?: number, height?: number, extrudeOffset?: number); /** * The character to draw; only its first character is used, and an unknown one is drawn as a * question mark. * @default A */ char: string; /** * How far to shift the strokes along X, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset?: number | undefined; /** * How far to shift the strokes along the second axis of the character plane, in model * units. * @minimum -Infinity * @maximum Infinity * @step 0.1 * @optional true */ yOffset?: number | undefined; /** * The height of a capital letter, in model units; the strokes are scaled to it. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * A margin, in model units, taken off the height and split above and below, so an extruded * character keeps its full size. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extrudeOffset?: number | undefined; } /** * A text and its layout for `text.vectorText`, which draws it line by line as stroke paths on * the XZ plane. */ class VectorTextDto { constructor(text?: string, xOffset?: number, yOffset?: number, height?: number, lineSpacing?: number, letterSpacing?: number, align?: Base.horizontalAlignEnum, extrudeOffset?: number, centerOnOrigin?: boolean); /** * The text to draw; a line break starts a new line. * @default Hello World */ text?: string | undefined; /** * How far to shift the whole block along X, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset?: number | undefined; /** * How far to shift the whole block along the second axis of the text plane, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset?: number | undefined; /** * The height of a capital letter, in model units. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The distance between lines as a multiple of the height; 1.4 leaves a little air between * them. * @default 1.4 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ lineSpacing?: number | undefined; /** * Extra space between characters as a multiple of the height; 0 uses the font's own * spacing. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ letterSpacing?: number | undefined; /** * How lines of different length line up: at their left edge, their center or their right * edge. * @default left */ align?: Base.horizontalAlignEnum | undefined; /** * A margin, in model units, taken off the height and split above and below each character, * so extruded text keeps its full size. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extrudeOffset?: number | undefined; /** * When true, the middle of the whole text block is moved to the origin. * @default false */ centerOnOrigin?: boolean | undefined; } } /** * Parameters for building transformation matrices: translations, rotations around an axis or a center, * uniform and non-uniform scaling, and the composition of several transforms into one. The result is a * matrix that any geometry API will accept, so the same transform can be applied to points, curves and * solids alike. */ declare namespace Transforms { /** * An axis, a center and an angle for `transforms.rotationCenterAxis`. */ class RotationCenterAxisDto { constructor(angle?: number, axis?: Base.Vector3, center?: Base.Point3); /** * How far to turn, in degrees; positive is counter-clockwise when the axis points toward * you. * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle: number; /** * The direction of the axis to turn around. * @default [0, 1, 0] */ axis: Base.Vector3; /** * A point the axis passes through; it stays in place. * @default [0, 0, 0] */ center: Base.Point3; } /** * A center and an angle for `transforms.rotationCenterX`, `transforms.rotationCenterY` and * `transforms.rotationCenterZ`. */ class RotationCenterDto { constructor(angle?: number, center?: Base.Point3); /** * How far to turn, in degrees; positive is counter-clockwise when the axis points toward * you. * @default 90 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle: number; /** * The point the axis passes through; it stays in place. * @default [0, 0, 0] */ center: Base.Point3; } /** * Three angles and a center for `transforms.rotationCenterYawPitchRoll`. */ class RotationCenterYawPitchRollDto { constructor(yaw?: number, pitch?: number, roll?: number, center?: Base.Point3); /** * The turn about the Y axis, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ yaw: number; /** * The turn about the X axis, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ pitch: number; /** * The turn about the Z axis, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ roll: number; /** * The point the rotation turns around; it stays in place. * @default [0, 0, 0] */ center: Base.Point3; } /** * A factor per axis for `transforms.scaleXYZ`, measured from the origin. */ class ScaleXYZDto { constructor(scaleXyz?: Base.Vector3); /** * The factor for each axis as `[x, y, z]`: `[1, 2, 1]` doubles distances along Y and leaves * X and Z as they are. * @default [1, 1, 1] */ scaleXyz: Base.Vector3; } /** * A center, a direction and a factor for `transforms.stretchDirFromCenter`. */ class StretchDirCenterDto { constructor(scale?: number, center?: Base.Point3, direction?: Base.Vector3); /** * The point that stays in place; distances are measured from it. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The direction to stretch along; its length does not matter. Distances across it do not * change. * @default [0, 0, 1] */ direction?: Base.Vector3 | undefined; /** * The factor applied along the direction; 1 changes nothing, 2 doubles distances from the * center along it. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ scale?: number | undefined; } /** * A center and a factor per axis for `transforms.scaleCenterXYZ`. */ class ScaleCenterXYZDto { constructor(center?: Base.Point3, scaleXyz?: Base.Vector3); /** * The point that stays in place while everything else moves away from it or toward it. * @default [0, 0, 0] */ center: Base.Point3; /** * The factor for each axis as `[x, y, z]`: `[1, 2, 1]` doubles distances along Y and leaves * X and Z as they are. * @default [1, 1, 1] */ scaleXyz: Base.Vector3; } /** * One factor for `transforms.uniformScale`, applied on every axis from the origin. */ class UniformScaleDto { constructor(scale?: number); /** * The factor on every axis: 1 changes nothing, 2 doubles every size and distance from the * origin. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ scale: number; } /** * One factor and a center for `transforms.uniformScaleFromCenter`. */ class UniformScaleFromCenterDto { constructor(scale?: number, center?: Base.Point3); /** * The factor on every axis: 1 changes nothing, 2 doubles every size and distance from the * center. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ scale: number; /** * The point that stays in place while everything else moves away from it or toward it. * @default [0, 0, 0] */ center: Base.Point3; } /** * A vector for `transforms.translationXYZ`, which builds the matrix that moves by it. */ class TranslationXYZDto { constructor(translation?: Base.Vector3); /** * How far to move along each axis, as `[x, y, z]` in model units. * @default [0, 0, 0] */ translation: Base.Vector3; } /** * Several vectors for `transforms.translationsXYZ`, one transformation each. */ class TranslationsXYZDto { constructor(translations?: Base.Vector3[]); /** * The vectors to move by, each `[x, y, z]` in model units; the result keeps their order. * @default undefined */ translations: Base.Vector3[]; } } /** * Parameters for vector arithmetic: the operands for addition, subtraction, scaling, dot and cross * products, normalization, angle and distance measurement, projection and interpolation. Vectors are * number arrays, so these DTOs mostly carry one or two of them plus a scalar. */ declare namespace Vector { /** * Two vectors for the pairwise operations of `vector`: `add`, `sub`, `dot`, `cross`, `dist`, * `angleBetween` and the rest. Both need the same number of entries; where order matters, * `first` is the left operand. */ class TwoVectorsDto { constructor(first?: number[], second?: number[]); /** * First vector. Where order matters it is the left operand: the one subtracted from in * `sub`, the left side of the product in `cross`. * @default undefined */ first: number[]; /** * Second vector, with the same number of entries as `first`. * @default undefined */ second: number[]; } /** * A list of booleans for `vector.all`, which tells whether every one of them is true. */ class VectorBoolDto { constructor(vector?: boolean[]); /** * The booleans to check. * @default undefined */ vector: boolean[]; } /** * Vectors to filter with `vector.removeAllDuplicateVectors`, and how close two vectors must be * to count as the same. */ class RemoveAllDuplicateVectorsDto { constructor(vectors?: number[][], tolerance?: number); /** * The vectors to filter; their order is kept. * @default undefined */ vectors: number[][]; /** * Two vectors count as the same when every entry differs by less than this. * @default 1e-7 * @minimum 0 * @maximum Infinity */ tolerance: number; } /** * Vectors to filter with `vector.removeConsecutiveDuplicateVectors`: only a vector that repeats * its predecessor is dropped, and optionally a last vector that repeats the first. */ class RemoveConsecutiveDuplicateVectorsDto { constructor(vectors?: number[][], checkFirstAndLast?: boolean, tolerance?: number); /** * The vectors to filter; their order is kept. * @default undefined */ vectors: number[][]; /** * When true, a last vector that repeats the first is dropped as well, which closes a loop * of points cleanly. * @default false */ checkFirstAndLast: boolean; /** * Two vectors count as the same when every entry differs by less than this. * @default 1e-7 * @minimum 0 * @maximum Infinity */ tolerance: number; } /** * Two vectors to compare with `vector.vectorsTheSame`, and how close their entries must be. */ class VectorsTheSameDto { constructor(vec1?: number[], vec2?: number[], tolerance?: number); /** * First vector to compare. * @default undefined */ vec1: number[]; /** * Second vector; a different length means the two are never the same. * @default undefined */ vec2: number[]; /** * Entries count as equal when they differ by less than this. * @default 1e-7 * @minimum 0 * @maximum Infinity */ tolerance: number; } /** * One vector of any length for the single-vector methods of `vector`: `sum`, `min`, `max`, * `norm`, `neg`, `finite`, `isZero` and the others. */ class VectorDto { constructor(vector?: number[]); /** * The vector, as a list of numbers. * @default undefined */ vector: number[]; } /** * A list of number strings for `vector.parseNumbers`, which turns each into a number. */ class VectorStringDto { constructor(vector?: string[]); /** * The strings to parse, such as `["1", "2.5"]`. * @default undefined */ vector: string[]; } /** * One 3D vector for `vector.length`, `vector.lengthSq` and `vector.normalized`. */ class Vector3Dto { constructor(vector?: Base.Vector3); /** * The vector as `[x, y, z]`. * @default undefined */ vector: Base.Vector3; } /** * The end of the range `vector.range` lists, which runs from 0 up to but not including it. */ class RangeMaxDto { constructor(max?: number); /** * The end of the range; it is not included, so 5 gives `[0, 1, 2, 3, 4]`. * @default 10 * @minimum -Infinity * @maximum Infinity * @step 1 */ max: number; } /** * The three values `vector.vectorXYZ` puts together into `[x, y, z]`. */ class VectorXYZDto { constructor(x?: number, y?: number, z?: number); /** * The X value, the first entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.5 */ x: number; /** * The Y value, the second entry; Y is up. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.5 */ y: number; /** * The Z value, the third entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.5 */ z: number; } /** * The two values `vector.vectorXY` puts together into `[x, y]`. */ class VectorXYDto { constructor(x?: number, y?: number); /** * The X value, the first entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.5 */ x: number; /** * The Y value, the second entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.5 */ y: number; } /** * A start, an end and a step for `vector.span`, which lists every number from `min` to `max` in * steps of `step`. */ class SpanDto { constructor(step?: number, min?: number, max?: number); /** * Distance between neighboring numbers; the last number is `max` only when a step lands on * it. * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ step: number; /** * The first number of the span. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ min: number; /** * The end of the span; included when a step lands on it. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 1 */ max: number; } /** * A start, an end, a count and an easing curve for `vector.spanEaseItems`, which spaces the * numbers unevenly along the curve. */ class SpanEaseItemsDto { constructor(nrItems?: number, min?: number, max?: number, ease?: Math.easeEnum); /** * How many numbers to produce, including `min` and `max`; at least 2. * @default 100 * @minimum 2 * @maximum Infinity * @step 1 */ nrItems: number; /** * The first number. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ min: number; /** * The last number. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 1 */ max: number; /** * The easing curve that spaces the numbers: an `easeIn` curve bunches them near `min`, an * `easeOut` curve near `max`, an `easeInOut` curve at both ends. * @default easeInSine */ ease: Math.easeEnum; /** * When true, the result holds the gaps between neighboring numbers instead of the numbers * themselves; the first entry is `min`. * @default false */ intervals: boolean; } /** * A start, an end and a count for `vector.spanLinearItems`, which spaces the numbers evenly. */ class SpanLinearItemsDto { constructor(nrItems?: number, min?: number, max?: number); /** * How many numbers to produce, including `min` and `max`; at least 2. * @default 100 * @minimum 2 * @maximum Infinity * @step 1 */ nrItems: number; /** * The first number. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ min: number; /** * The last number. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 1 */ max: number; } /** * A start point, a direction and a distance for `vector.onRay`, which finds the point that far * along the direction. */ class RayPointDto { constructor(point?: Base.Point3, distance?: number, vector?: number[]); /** * Where the ray starts. * @default undefined */ point: Base.Point3; /** * How far to travel from `point`, in multiples of the direction vector's length; a negative * distance goes backwards. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 1 */ distance: number; /** * The direction to travel in, used as given; a unit vector makes `distance` a length in * model units. * @default undefined */ vector: number[]; } /** * A list of vectors for `vector.addAll`, which adds them entry by entry into one vector. */ class VectorsDto { constructor(vectors?: number[][]); /** * The vectors to add together; the result has as many entries as the first. * @default undefined */ vectors: number[][]; } /** * Two vectors and a fraction for `vector.lerp`, which blends them: 1 gives the first, 0 the * second. */ class FractionTwoVectorsDto { constructor(fraction?: number, first?: Base.Vector3, second?: Base.Vector3); /** * The share of `first` in the blend: 1 gives `first`, 0 gives `second`, 0.5 the midpoint. * Values outside 0 to 1 extrapolate past the ends. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ fraction: number; /** * The vector the blend reaches at fraction 1. * @default undefined */ first: Base.Vector3; /** * The vector the blend reaches at fraction 0. * @default undefined */ second: Base.Vector3; } /** * A vector and one number for `vector.mul` and `vector.div`, which apply the number to every * entry. */ class VectorScalarDto { constructor(scalar?: number, vector?: number[]); /** * The number every entry is multiplied or divided by. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ scalar: number; /** * The vector to scale. * @default undefined */ vector: number[]; } /** * Two vectors and a reference direction for `vector.signedAngleBetween` and * `vector.positiveAngleBetween`, which measure the turn from the first to the second around the * reference. */ class TwoVectorsReferenceDto { constructor(reference?: number[], first?: Base.Vector3, second?: Base.Vector3); /** * The direction to turn around; the angle is counter-clockwise when this vector points * toward you. * @default undefined */ reference: number[]; /** * The vector the turn starts from. * @default undefined */ first: Base.Vector3; /** * The vector the turn ends at. * @default undefined */ second: Base.Vector3; } } /** * Parameters for loading and managing external files - 3D models, textures, fonts and arbitrary data - * from the project's asset store or from a URL. Carries the file name or URL, the expected type, and * the options that control caching and how the loaded content is handed on to the kernels or renderer. */ declare namespace Asset { /** * Feeds `asset.getFile`, `asset.getTextFile`, `asset.getLocalFile` and `asset.getLocalTextFile` * with the name of the asset to load; the running application decides what store the name is * looked up in. */ class GetAssetDto { constructor(fileName?: string); /** * Name of the asset as the running application knows it, extension included * @default undefined */ fileName: string; } /** * Feeds the `asset.fetch` methods with the URL to download from; the server must allow * cross-origin requests for the download to succeed. */ class FetchDto { constructor(url?: string); /** * Full address of the resource to download, on a server that allows cross-origin requests * @default undefined */ url: string; } /** * Feeds the `asset` conversions that take one File or Blob: `createObjectURL`, `toArrayBuffer`, * `toUint8Array` and `fileToBlob`. */ class FileDto { constructor(file?: File | Blob); /** * The File or Blob to convert; it is read, never changed * @default undefined */ file: File | Blob; } /** * Feeds `asset.createObjectURLs` with several Files or Blobs, one URL each in the same order. */ class FilesDto { constructor(files?: (File | Blob)[]); /** * The Files or Blobs to convert, in the order the results come back * @default undefined */ files: (File | Blob)[]; } /** * A model file to load into the scene, as the renderer packages' `io.loadAssetIntoScene` takes * it, and whether it starts hidden; the file's extension decides the loader. */ class AssetFileDto { constructor(assetFile?: File, hidden?: boolean); /** * The model file to load, such as a glTF or glb; its name gives the format * @default undefined */ assetFile: File; /** * When true, the loaded model is added to the scene invisible, to be shown later * @default false */ hidden: boolean; } /** * A model file to load into the scene by address, as the renderer packages' * `io.loadAssetIntoSceneFromRootUrl` takes it: the folder URL, the file name inside it and * whether it starts hidden. */ class AssetFileByUrlDto { constructor(assetFile?: string, rootUrl?: string, hidden?: boolean); /** * Name of the model file inside `rootUrl`, extension included * @default undefined */ assetFile: string; /** * Address of the folder the file is in, ending with a slash; textures next to the model are * resolved from it too * @default undefined */ rootUrl: string; /** * When true, the loaded model is added to the scene invisible, to be shown later * @default false */ hidden: boolean; } /** * Feeds `asset.download`: what to write into the downloaded file, what to call it and which * content type to declare. */ class DownloadDto { constructor(fileName?: string, content?: string | Blob, extension?: string, contentType?: string); /** * Name the browser saves the file under, without the extension, which is added * @default undefined */ fileName: string; /** * What the file holds: text, which is wrapped in a Blob of `contentType`, or a Blob saved * as it is * @default undefined */ content: string | Blob; /** * Extension added to the file name after a dot, such as `txt`, `csv` or `json` * @default txt */ extension: string; /** * MIME type declared for text content, such as `text/plain` or `application/json` * @default text/plain */ contentType: string; } /** * A glb model held as bytes to load into the scene, as the renderer packages' * `io.loadGlbFromArrayBuffer` takes it, for instance the output of the STEP to glTF converters. */ class AssetGlbDataDto { constructor(glbData?: Uint8Array, fileName?: string, hidden?: boolean); /** * The whole glb file as bytes, such as what `occt.io.convertStepToGltf` gives back * @default undefined */ glbData: Uint8Array; /** * Name given to the loaded model, used to tell it apart from others; it does not have to * match a real file * @default model.glb */ fileName: string; /** * When true, the loaded model is added to the scene invisible, to be shown later * @default false */ hidden: boolean; } /** * Feeds `asset.blobToFile`: the Blob to wrap, the name the File gets and, when the Blob's own * type is not right, the MIME type to declare. */ class BlobToFileDto { constructor(blob?: Blob, fileName?: string, mimeType?: string); /** * The bytes the File is made from; they are shared, not copied * @default undefined */ blob: Blob; /** * Name the File carries, extension included * @default file */ fileName: string; /** * MIME type declared on the File, such as `model/gltf-binary`; left out, the Blob's own * type is kept * @default undefined * @optional true */ mimeType?: string | undefined; } /** * Feeds `asset.arrayBufferToUint8Array` with the buffer to view as bytes. */ class ArrayBufferToUint8ArrayDto { constructor(arrayBuffer?: ArrayBuffer); /** * The raw bytes to view as a Uint8Array; no copy is made * @default undefined */ arrayBuffer: ArrayBuffer; } /** * Feeds `asset.uint8ArrayToArrayBuffer` with the byte array to copy into its own buffer. */ class Uint8ArrayToArrayBufferDto { constructor(uint8Array?: Uint8Array); /** * The bytes to copy; only the part this array covers is copied * @default undefined */ uint8Array: Uint8Array; } } /** * Re-export Base namespace from @bitbybit-dev/base and extend with core-specific types. */ /** * The core layer's re-export of the shared primitive types, so a script that only imports the core * package still sees Point3, Vector3 and the rest without reaching into the base package. */ /** * Parameters for reading and writing CSV: the text or rows to act on, the delimiter, whether the first * row is a header, and the type coercion applied to parsed cells. */ declare namespace CSV { /** * Feeds `csv.parseToArray` and `csv.getColumnCount` with the CSV text and the two separators; a * separator can be written as `\n` or `\t` in two characters. */ class ParseToArrayDto { constructor(csv?: string, rowSeparator?: string, columnSeparator?: string); /** * The whole CSV text, rows separated by `rowSeparator` * @default name,age\nJohn,30 */ csv: string; /** * The text between rows, normally a line break; `\n` written as two characters is read as * one * @default \n */ rowSeparator?: string | undefined; /** * The text between cells in a row, normally a comma; `\t` written as two characters is read * as a tab * @default , */ columnSeparator?: string | undefined; } /** * Feeds `csv.parseToJson`: the CSV text, which row holds the headers, where the data starts, * the separators and which columns to read as numbers. */ class ParseToJsonDto { constructor(csv?: string, headerRow?: number, dataStartRow?: number, rowSeparator?: string, columnSeparator?: string, numberColumns?: string[]); /** * The whole CSV text, headers included * @default name,age\nJohn,30\nJane,25 */ csv: string; /** * Index of the row whose cells become the object keys, counting from 0 and skipping blank * lines * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ headerRow?: number | undefined; /** * Index of the first row turned into an object, counting from 0; normally the row after the * headers * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ dataStartRow?: number | undefined; /** * The text between rows, normally a line break; `\n` written as two characters is read as * one * @default \n */ rowSeparator?: string | undefined; /** * The text between cells in a row, normally a comma; `\t` written as two characters is read * as a tab * @default , */ columnSeparator?: string | undefined; /** * Header names whose cells are parsed as numbers; every other cell stays text * @default undefined * @optional true */ numberColumns?: string[] | undefined; } /** * Feeds `csv.parseToJsonWithHeaders`: the CSV text, the header names to use instead of a header * line, where the data starts, the separators and which columns to read as numbers. */ class ParseToJsonWithHeadersDto { constructor(csv?: string, headers?: string[], dataStartRow?: number, rowSeparator?: string, columnSeparator?: string, numberColumns?: string[]); /** * The whole CSV text, normally without a header line * @default John,30\nJane,25 */ csv: string; /** * The object keys, one per column in column order; a row with more cells than keys loses * the extra cells * @default ["name", "age"] */ headers: string[]; /** * Index of the first row turned into an object, counting from 0; set it to 1 to skip a * header line the text does have * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ dataStartRow?: number | undefined; /** * The text between rows, normally a line break; `\n` written as two characters is read as * one * @default \n */ rowSeparator?: string | undefined; /** * The text between cells in a row, normally a comma; `\t` written as two characters is read * as a tab * @default , */ columnSeparator?: string | undefined; /** * Header names whose cells are parsed as numbers; every other cell stays text * @default undefined * @optional true */ numberColumns?: string[] | undefined; } /** * Feeds `csv.queryColumn`: the CSV text, the header name of the column to read, the row layout, * the separators and whether to parse the values as numbers. */ class QueryColumnDto { constructor(csv?: string, column?: string, headerRow?: number, dataStartRow?: number, rowSeparator?: string, columnSeparator?: string, asNumber?: boolean); /** * The whole CSV text, headers included * @default name,age\nJohn,30\nJane,25 */ csv: string; /** * Header name of the column whose values are listed * @default name */ column: string; /** * Index of the row whose cells are the header names, counting from 0 * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ headerRow?: number | undefined; /** * Index of the first row read as data, counting from 0; normally the row after the headers * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ dataStartRow?: number | undefined; /** * The text between rows, normally a line break; `\n` written as two characters is read as * one * @default \n */ rowSeparator?: string | undefined; /** * The text between cells in a row, normally a comma; `\t` written as two characters is read * as a tab * @default , */ columnSeparator?: string | undefined; /** * When true, every value of the column is parsed as a number instead of staying text * @default false */ asNumber?: boolean | undefined; } /** * Feeds `csv.queryRowsByValue`: the CSV text, the column to test and the value it must equal, * the row layout, the separators and the columns read as numbers. */ class QueryRowsByValueDto { constructor(csv?: string, column?: string, value?: string, headerRow?: number, dataStartRow?: number, rowSeparator?: string, columnSeparator?: string, numberColumns?: string[]); /** * The whole CSV text, headers included * @default name,age\nJohn,30\nJane,25 */ csv: string; /** * Header name of the column that is compared with `value` * @default age */ column: string; /** * The text a row's cell must equal to be kept; compared as a number when the column is in * `numberColumns` * @default 30 */ value: string; /** * Index of the row whose cells are the header names, counting from 0 * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ headerRow?: number | undefined; /** * Index of the first row read as data, counting from 0; normally the row after the headers * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ dataStartRow?: number | undefined; /** * The text between rows, normally a line break; `\n` written as two characters is read as * one * @default \n */ rowSeparator?: string | undefined; /** * The text between cells in a row, normally a comma; `\t` written as two characters is read * as a tab * @default , */ columnSeparator?: string | undefined; /** * Header names whose cells are parsed as numbers, in the result and in the comparison * @default undefined * @optional true */ numberColumns?: string[] | undefined; } /** * Feeds `csv.arrayToCsv` with the rows to write, each a list of cells, and the separators to * put between cells and rows. */ class ArrayToCsvDto { constructor(array?: (string | number | boolean | null | undefined)[][], rowSeparator?: string, columnSeparator?: string); /** * The rows, each a list of cells; numbers and booleans are written as text, null and * undefined as empty cells * @default [["name", "age"], ["John", "30"]] */ array: (string | number | boolean | null | undefined)[][]; /** * The text put between rows, normally a line break; `\n` written as two characters is used * as one * @default \n */ rowSeparator?: string | undefined; /** * The text put between cells, normally a comma; a cell containing it is wrapped in quotes * @default , */ columnSeparator?: string | undefined; } /** * Feeds `csv.jsonToCsv`: the objects to write, the property names that become the columns in * order, whether to write a header line and the separators. */ class JsonToCsvDto> { constructor(json?: T[], headers?: string[], includeHeaders?: boolean, rowSeparator?: string, columnSeparator?: string); /** * The objects, one row each, in order; a property an object lacks becomes an empty cell * @default [{"name": "John", "age": "30"}] */ json: T[]; /** * The property names written as columns, in this order; properties not listed are left out * @default ["name", "age"] */ headers: string[]; /** * When true, the first line holds the header names * @default true */ includeHeaders?: boolean | undefined; /** * The text put between rows, normally a line break; `\n` written as two characters is used * as one * @default \n */ rowSeparator?: string | undefined; /** * The text put between cells, normally a comma; a cell containing it is wrapped in quotes * @default , */ columnSeparator?: string | undefined; } /** * Feeds `csv.jsonToCsvAuto`: the objects to write, whose first entry's property names become * the columns, whether to write a header line and the separators. */ class JsonToCsvAutoDto> { constructor(json?: T[], includeHeaders?: boolean, rowSeparator?: string, columnSeparator?: string); /** * The objects, one row each; the property names of the first one are the columns, in their * order * @default [{"name": "John", "age": "30"}] */ json: T[]; /** * When true, the first line holds the header names * @default true */ includeHeaders?: boolean | undefined; /** * The text put between rows, normally a line break; `\n` written as two characters is used * as one * @default \n */ rowSeparator?: string | undefined; /** * The text put between cells, normally a comma; a cell containing it is wrapped in quotes * @default , */ columnSeparator?: string | undefined; } /** * Feeds `csv.getHeaders` with the CSV text, which row holds the header names and the * separators. */ class GetHeadersDto { constructor(csv?: string, headerRow?: number, rowSeparator?: string, columnSeparator?: string); /** * The whole CSV text, headers included * @default name,age\nJohn,30 */ csv: string; /** * Index of the row whose cells are the header names, counting from 0 and skipping blank * lines * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ headerRow?: number | undefined; /** * The text between rows, normally a line break; `\n` written as two characters is read as * one * @default \n */ rowSeparator?: string | undefined; /** * The text between cells in a row, normally a comma; `\t` written as two characters is read * as a tab * @default , */ columnSeparator?: string | undefined; } /** * Feeds `csv.getRowCount` with the CSV text, how many leading rows are not data and the * separators. */ class GetRowCountDto { constructor(csv?: string, hasHeaders?: boolean, dataStartRow?: number, rowSeparator?: string, columnSeparator?: string); /** * The whole CSV text; blank lines are not counted * @default name,age\nJohn,30\nJane,25 */ csv: string; /** * When true, the first row is a header line and is not counted; ignored when `dataStartRow` * is set * @default true */ hasHeaders?: boolean | undefined; /** * Index of the first data row, counting from 0; when set, the rows before it are not * counted and `hasHeaders` is ignored * @minimum 0 * @maximum Infinity * @step 1 * @optional true */ dataStartRow?: number | undefined; /** * The text between rows, normally a line break; `\n` written as two characters is read as * one * @default \n */ rowSeparator?: string | undefined; /** * The text between cells in a row, normally a comma; it does not change the count * @default , */ columnSeparator?: string | undefined; } } /** * Parameters for JSON handling: the value or text to act on, the path to query or edit, and the * formatting options used when stringifying. */ declare namespace JSON { /** * Feeds `json.stringify` with the value to write as JSON text. */ class StringifyDto { constructor(json?: unknown); /** * Any JSON-compatible value: an object, a list, a number, text, a boolean or null * @default undefined */ json: unknown; } /** * Feeds `json.parse` with the JSON text to turn back into a value. */ class ParseDto { constructor(text?: string); /** * Valid JSON text, such as `[0, 0, 0]` or an object in braces; anything else throws an * error * @default "[0, 0, 0]" */ text: string; } /** * Feeds `json.query` with the JSON to search and the JSONPath expression that selects values in * it. */ class QueryDto { constructor(json?: unknown, query?: string); /** * The object or list to search; it is read, never changed * @default undefined */ json: unknown; /** * A JSONPath expression starting at the root `$`, such as `$.parts[*].name` or `$..radius` * @default undefined */ query: string; } /** * Feeds `json.setValueOnProp`: the object to copy and change, the top-level property to set and * the value it gets. */ class SetValueOnPropDto { constructor(json?: unknown, value?: unknown, property?: string); /** * The object to change; it stays as it is and a changed copy comes back * @default undefined */ json: unknown; /** * What the property is set to; any JSON-compatible value * @default undefined */ value: unknown; /** * Name of the top-level property to set; a property that does not exist yet is added * @default propName */ property: string; } /** * Feeds `json.getJsonFromArrayByFirstPropMatch`: the list of objects to search, the property to * look at and the value it must equal. */ class GetJsonFromArrayByFirstPropMatchDto { constructor(jsonArray?: unknown[], property?: string, match?: unknown); /** * The list of objects searched in order; the first match is the result * @default undefined */ jsonArray: unknown[]; /** * Name of the property compared on every object * @default propName */ property: string; /** * The value the property must equal exactly, same type included * @default undefined */ match: unknown; } /** * Feeds `json.getValueOnProp` with the object to read and the top-level property to read from * it. */ class GetValueOnPropDto { constructor(json?: unknown, property?: string); /** * The object to read; it is not changed * @default undefined */ json: unknown; /** * Name of the top-level property whose value comes back; a missing one gives undefined * @default propName */ property: string; } /** * Feeds `json.setValue`: the JSON to copy and change, the JSONPath to the objects to change, * the property to set on each and the value it gets. */ class SetValueDto { constructor(json?: unknown, value?: unknown, path?: string, prop?: string); /** * The object to change; it stays as it is and a changed copy comes back. A value that is * not an object throws an error * @default undefined */ json: unknown; /** * What the property is set to on every matched object; any JSON-compatible value * @default undefined */ value: unknown; /** * A JSONPath expression selecting the parent objects, such as `$.parts[*]`; the property is * set on each of them * @default $.pathToParent */ path: string; /** * Name of the property set on every object the path reaches * @default propertyName */ prop: string; } /** * Feeds `json.setValuesOnPaths`: the JSON to copy and change and three lists of the same * length, where entry `i` of `paths`, `props` and `values` is one change. */ class SetValuesOnPathsDto { constructor(json?: unknown, values?: unknown[], paths?: string[], props?: string[]); /** * The object to change; it stays as it is and a changed copy comes back * @default undefined */ json: unknown; /** * The values to set, one per change, in the same order as `paths` and `props` * @default undefined */ values: unknown[]; /** * One JSONPath expression per change, each selecting the parent objects, such as * `$.parts[*]` * @default undefined */ paths: string[]; /** * One property name per change, set on every object its path reaches * @default undefined */ props: string[]; } /** * Feeds `json.paths` with the JSON to search and the JSONPath expression whose matches are * reported as paths. */ class PathsDto { constructor(json?: unknown, query?: string); /** * The object or list to search; it is read, never changed * @default undefined */ json: unknown; /** * A JSONPath expression starting at the root `$`; the result lists where its matches sit, * not their values * @default undefined */ query: string; } /** * Feeds `json.previewJson` and `json.previewAndSaveJson` with the value to show; an empty value * shows nothing. */ class JsonDto { constructor(json?: unknown); /** * The value to show, normally an object or a list; nothing happens when it is empty * @default undefined */ json: unknown; } } /** * Parameters for 3D text labels: the text, its position in the scene, color, size, offset and whether * it stays screen-facing. Used for dimensions, part numbers, debugging output and any annotation that * should follow the geometry as the camera moves. */ declare namespace Tag { /** * Feeds `tag.drawTag`: the tag to put on screen, whether it may be changed later and, on a * later draw, the tag from before to change in place. */ class DrawTagDto { constructor(tag?: TagDto, updatable?: boolean, tagVariable?: TagDto); /** * The tag description to show, as `tag.create` builds it */ tag: TagDto; /** * When true, a later draw with `tagVariable` changes this tag in place instead of adding * another */ updatable: boolean; /** * The tag an earlier draw gave back, to change in place; used only when `updatable` is true * @optional true */ tagVariable?: TagDto | undefined; } /** * Feeds `tag.drawTags`: the tags to put on screen, whether they may be changed later and, on a * later draw, the tags from before to change in place. */ class DrawTagsDto { constructor(tags?: TagDto[], updatable?: boolean, tagsVariable?: TagDto[]); /** * The tag descriptions to show, as `tag.create` builds them */ tags: TagDto[]; /** * When true, a later draw with `tagsVariable` changes these tags in place, adding and * removing to match the new list */ updatable: boolean; /** * The tags an earlier draw gave back, to change in place; used only when `updatable` is * true * @optional true */ tagsVariable?: TagDto[] | undefined; } /** * A text label pinned to a 3D position, as `tag.create` builds it and `tag.drawTag` shows it: * the text, where it sits, its color and size, and whether it shrinks with distance. `id` and * `needsUpdate` are filled in by drawing. */ class TagDto { constructor(text?: string, position?: Base.Point3, colour?: string, size?: number, adaptDepth?: boolean, needsUpdate?: boolean, id?: string); /** * The label's content, shown as plain text */ text: string; /** * The point in the scene the label is pinned to; it stays over that point as the camera * moves */ position: Base.Point3; /** * Hex color of the label's text */ colour: string; /** * Font size of the label, in pixels */ size: number; /** * When true, a label far from the camera is drawn smaller than one nearby, as if it sat in * the scene */ adaptDepth: boolean; /** * Set by drawing to ask for a refresh of the label on the next frame; not something to set * by hand * @optional true */ needsUpdate?: boolean | undefined; /** * Identifier given to the label when it is drawn, which later updates use to find it; not * something to set by hand * @optional true */ id?: string | undefined; } } /** * Parameters for time and animation: the callback to run each frame and the timing values that drive * animated geometry. */ declare namespace Time { /** * A message to send from a page embedded in an iframe to the page that embeds it, using the * browser's `postMessage`: the data and the origin allowed to receive it. */ class PostFromIframe { constructor(data?: any, targetOrigin?: string); /** * The value to send; it is copied across, so it must be serializable */ data: any; /** * Origin of the page allowed to receive the message, such as `https://example.com`; only a * page from that origin gets it */ targetOrigin: string; } } /** * Parameters for the Verb NURBS library: control points, weights, knots and degree for freeform curves * and surfaces, plus the options for interpolation, lofting, sweeping, intersection and closest-point * queries. Verb geometry converts to kernel geometry when a surface needs to become a solid. */ declare namespace Verb { class CurveDto { constructor(curve?: any); /** * Nurbs curve */ curve: any; } class LineDto { constructor(line?: Base.Line3); /** * Basic line */ line: Base.Line3; } class LinesDto { constructor(lines?: Base.Line3[]); /** * Basic lines */ lines: Base.Line3[]; } class PolylineDto { constructor(polyline?: Base.Polyline3); /** * Basic polyline */ polyline: Base.Polyline3; } class PolylinesDto { constructor(polylines?: Base.Polyline3[]); /** * Basic polyline */ polylines: Base.Polyline3[]; } class CurvesDto { constructor(curves?: any[]); /** * Nurbs curves */ curves: any[]; } class ClosestPointDto { constructor(curve?: any, point?: Base.Point3); /** * Nurbs curve */ curve: any; /** * Point */ point: Base.Point3; } class ClosestPointsDto { constructor(curve?: any, points?: Base.Point3[]); /** * Nurbs curve */ curve: any; /** * Points */ points: Base.Point3[]; } class BezierCurveDto { constructor(points?: Base.Point3[], weights?: number[]); /** * Control points */ points: Base.Point3[]; /** * Weights */ weights: number[]; } class DrawCurveDto { /** * Provide options without default values */ constructor(curve?: any, opacity?: number, colours?: string | string[], size?: number, updatable?: boolean, curveMesh?: T); /** * Nurbs curve */ curve: any; /** * Value between 0 and 1 */ opacity: number; /** * Hex colour string */ colours: string | string[]; /** * Width of the polyline */ size: number; /** * Indicates wether the position of this curve will change in time */ updatable: boolean; /** * Curve mesh variable in case it already exists and needs updating */ curveMesh?: T | undefined; } class CurveParameterDto { constructor(curve?: any, parameter?: number); /** * Nurbs curve */ curve: any; /** * Parameter on the curve */ parameter: number; } class CurvesParameterDto { constructor(curves?: any[], parameter?: number); /** * Nurbs curve */ curves: any; /** * Parameter on the curve */ parameter: number; } class CurveTransformDto { constructor(curve?: any, transformation?: Base.TransformMatrixes); /** * Nurbs curve */ curve: any; /** * Transformation matrixes */ transformation: Base.TransformMatrixes; } class CurvesTransformDto { constructor(curves?: any[], transformation?: Base.TransformMatrixes); /** * Nurbs curve */ curves: any[]; /** * Transformation matrixes */ transformation: Base.TransformMatrixes; } class CurveToleranceDto { constructor(curve?: any, tolerance?: number); /** * Nurbs curve */ curve: any; /** * Optional tolerance */ tolerance: number; } class CurveLengthToleranceDto { constructor(curve?: any, length?: number, tolerance?: number); /** * Nurbs curve */ curve: any; /** * Length on the curve */ length: number; /** * Tolerance */ tolerance: number; } class CurveDerivativesDto { constructor(curve?: any, parameter?: number, numDerivatives?: number); /** * Nurbs curve */ curve: any; /** * Number of derivatives */ numDerivatives: number; /** * Parameter on the curve */ parameter: number; } class CurveSubdivisionsDto { constructor(curve?: any, subdivision?: number); /** * Nurbs curve */ curve: any; /** * Number of subdivisions */ subdivision: number; } class CurvesSubdivisionsDto { constructor(curves?: any[], subdivision?: number); /** * Nurbs curves */ curves: any[]; /** * Number of subdivisions */ subdivision: number; } class CurvesDivideLengthDto { constructor(curves?: any[], length?: number); /** * Nurbs curves */ curves: any[]; /** * Length of subdivisions */ length: number; } class CurveDivideLengthDto { constructor(curve?: any, length?: number); /** * Nurbs curve */ curve: any; /** * Length of subdivisions */ length: number; } class DrawCurvesDto { /** * Provide options without default values */ constructor(curves?: any[], opacity?: number, colours?: string | string[], size?: number, updatable?: boolean, curvesMesh?: T); /** * Nurbs curves */ curves: any[]; /** * Value between 0 and 1 */ opacity: number; /** * Hex colour string */ colours: string | string[]; /** * Width of the polyline */ size: number; /** * Indicates wether the position of this polyline will change in time */ updatable: boolean; /** * Curve mesh variable in case it already exists and needs updating */ curvesMesh?: T | undefined; } class CurveNurbsDataDto { constructor(degree?: number, weights?: number[], knots?: number[], points?: Base.Point3[]); /** * Nurbs curve degree */ degree: number; /** * Weights that identify strength that attracts curve to control points */ weights: number[]; /** * Knots of the Nurbs curve */ knots: number[]; /** * Control points of the nurbs curve */ points: Base.Point3[]; } class CurvePathDataDto { constructor(degree?: number, points?: Base.Point3[]); /** * Nurbs curve degree */ degree: number; /** * Control points of the nurbs curve */ points: Base.Point3[]; } class EllipseDto { constructor(ellipse?: any); /** * Nurbs ellipse */ ellipse: any; } class CircleDto { constructor(circle?: any); /** * Nurbs circle */ circle: any; } class ArcDto { constructor(arc?: any); /** * Nurbs arc */ arc: any; } class EllipseParametersDto { constructor(xAxis?: Base.Vector3, yAxis?: Base.Vector3, center?: Base.Point3); /** * X axis of the circle */ xAxis: Base.Vector3; /** * Y axis of the circle */ yAxis: Base.Vector3; /** * Center of the circle */ center: Base.Point3; } class CircleParametersDto { constructor(xAxis?: Base.Vector3, yAxis?: Base.Vector3, radius?: number, center?: Base.Point3); /** * X axis of the circle */ xAxis: Base.Vector3; /** * Y axis of the circle */ yAxis: Base.Vector3; /** * Radius of the circle */ radius: number; /** * Center of the circle */ center: Base.Point3; } class ArcParametersDto { constructor(minAngle?: number, maxAngle?: number, xAxis?: Base.Vector3, yAxis?: Base.Vector3, radius?: number, center?: Base.Point3); /** * Minimum angle in degrees */ minAngle: number; /** * Maximum angle in degrees */ maxAngle: number; /** * X axis of the circle */ xAxis: Base.Vector3; /** * Y axis of the circle */ yAxis: Base.Vector3; /** * Radius of the circle */ radius: number; /** * Center of the circle */ center: Base.Point3; } class EllipseArcParametersDto { constructor(minAngle?: number, maxAngle?: number, xAxis?: Base.Vector3, yAxis?: Base.Vector3, center?: Base.Point3); /** * Minimum angle in degrees */ minAngle: number; /** * Maximum angle in degrees */ maxAngle: number; /** * X axis of the circle */ xAxis: Base.Vector3; /** * Y axis of the circle */ yAxis: Base.Vector3; /** * Center of the circle */ center: Base.Point3; } class SurfaceDto { constructor(surface?: any); /** * Nurbs surface */ surface: any; } class SurfaceTransformDto { constructor(surface?: any, transformation?: Base.TransformMatrixes); /** * Nurbs surface */ surface: any; /** * Transformations */ transformation: Base.TransformMatrixes; } class SurfaceParameterDto { constructor(surface?: any, parameter?: number, useV?: boolean); /** * Nurbs surface */ surface: any; /** * Parameter on the surface */ parameter: number; /** * Default parameter is on U direction, use V to switch */ useV: boolean; } class IsocurvesParametersDto { constructor(surface?: any, parameters?: number[], useV?: boolean); /** * Nurbs surface */ surface: any; /** * Parameter on the surface */ parameters: number[]; /** * Default parameter is on U direction, use V to switch */ useV: boolean; } class IsocurveSubdivisionDto { /** * Provide undefined options */ constructor(surface?: any, useV?: boolean, includeLast?: boolean, includeFirst?: boolean, isocurveSegments?: number); /** * Nurbs surface */ surface: any; /** * Default parameter is on U direction, use V to switch */ useV: boolean; /** * Check to include the last isocurve */ includeLast: boolean; /** * Check to include the first isocurve */ includeFirst: boolean; /** * Number of segments including surface start and end */ isocurveSegments: number; } class DerivativesDto { constructor(surface?: any, u?: number, v?: number, numDerivatives?: number); /** * Nurbs surface */ surface: any; /** * U coordinate */ u: number; /** * V coordinate */ v: number; /** * Number of derivatives */ numDerivatives: number; } class SurfaceLocationDto { constructor(surface?: any, u?: number, v?: number); /** * Nurbs surface */ surface: any; /** * U coordinate */ u: number; /** * V coordinate */ v: number; } class CornersDto { constructor(point1?: Base.Point3, point2?: Base.Point3, point3?: Base.Point3, point4?: Base.Point3); /** * Corner 1 */ point1: Base.Point3; /** * Corner 2 */ point2: Base.Point3; /** * Corner 3 */ point3: Base.Point3; /** * Corner 4 */ point4: Base.Point3; } class SurfaceParamDto { constructor(surface?: any, point?: Base.Point3); /** * Nurbs surface */ surface: any; /** * Point */ point: Base.Point3; } class KnotsControlPointsWeightsDto { constructor(degreeU?: number, degreeV?: number, knotsU?: number[], knotsV?: number[], points?: Base.Point3[], weights?: number[]); /** * U direction degree */ degreeU: number; /** * V direction degree */ degreeV: number; /** * U direction knots */ knotsU: number[]; /** * V direction knots */ knotsV: number[]; /** * Points */ points: Base.Point3[]; /** * Weights */ weights: number[]; } class LoftCurvesDto { constructor(degreeV?: number, curves?: any[]); /** * V direction degree */ degreeV: number; /** * Nurbs curves */ curves: any[]; } class DrawSurfaceDto { /** * Provide options without default values */ constructor(surface?: any, opacity?: number, colours?: string | string[], updatable?: boolean, hidden?: boolean, surfaceMesh?: T, drawTwoSided?: boolean, backFaceColour?: string, backFaceOpacity?: number); /** * Nurbs surface */ surface: any; /** * Value between 0 and 1 */ opacity: number; /** * Hex colour string */ colours: string | string[]; /** * Indicates wether the position of this surface will change in time */ updatable: boolean; /** * Should be hidden */ hidden: boolean; /** * Surface mesh variable in case it already exists and needs updating */ surfaceMesh?: T | undefined; /** * Draw two-sided faces with different colors for front and back. This helps visualize face orientation. * @default true */ drawTwoSided: boolean; /** * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true. * @default #0000ff */ backFaceColour: string; /** * Back face opacity value between 0 and 1. Only used when drawTwoSided is true. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; } class DrawSurfacesDto { /** * Provide options without default values */ constructor(surfaces?: any[], opacity?: number, colours?: string | string[], updatable?: boolean, hidden?: boolean, surfacesMesh?: T, drawTwoSided?: boolean, backFaceColour?: string, backFaceOpacity?: number); /** * Nurbs surfaces */ surfaces: any[]; /** * Value between 0 and 1 */ opacity: number; /** * Hex colour string */ colours: string | string[]; /** * Indicates wether the position of these surfaces will change in time */ updatable: boolean; /** * Should be hidden */ hidden: boolean; /** * Surfaces mesh variable in case it already exists and needs updating */ surfacesMesh?: T | undefined; /** * Draw two-sided faces with different colors for front and back. This helps visualize face orientation. * @default true */ drawTwoSided: boolean; /** * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true. * @default #0000ff */ backFaceColour: string; /** * Back face opacity value between 0 and 1. Only used when drawTwoSided is true. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; } class DrawSurfacesColoursDto { /** * Provide options without default values */ constructor(surfaces?: any[], colours?: string[], opacity?: number, updatable?: boolean, hidden?: boolean, surfacesMesh?: T, drawTwoSided?: boolean, backFaceColour?: string, backFaceOpacity?: number); /** * Nurbs surfaces */ surfaces: any[]; /** * Value between 0 and 1 */ opacity: number; /** * Hex colour strings, there has to be a colour for every single surface and lengths of arrays need * to match */ colours: string | string[]; /** * Indicates wether the position of these surfaces will change in time */ updatable: boolean; /** * Indicates if surface should be hidden */ hidden: boolean; /** * Surfaces mesh variable in case it already exists and needs updating */ surfacesMesh?: T | undefined; /** * Draw two-sided faces with different colors for front and back. This helps visualize face orientation. * @default true */ drawTwoSided: boolean; /** * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true. * @default #0000ff */ backFaceColour: string; /** * Back face opacity value between 0 and 1. Only used when drawTwoSided is true. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity: number; } class ConeAndCylinderParametersDto { constructor(axis?: Base.Vector3, xAxis?: Base.Vector3, base?: Base.Point3, height?: number, radius?: number); /** * Defines main axis of the cone */ axis: Base.Vector3; /** * X axis of the cone */ xAxis: Base.Vector3; /** * Base point for the cone */ base: Base.Point3; /** * Height of the cone */ height: number; /** * Radius of the cone */ radius: number; } class ConeDto { constructor(cone?: any); /** * Conical Nurbs surface */ cone: any; } class CylinderDto { constructor(cylinder?: any); /** * Cylindrical Nurbs surface */ cylinder: any; } class ExtrusionParametersDto { constructor(profile?: any, direction?: Base.Vector3); /** * Profile Nurbs curve */ profile: any; /** * Direction vector */ direction: Base.Vector3; } class ExtrusionDto { constructor(extrusion?: any); /** * Nurbs surface created through extrusion */ extrusion: any; } class SphericalParametersDto { constructor(radius?: number, center?: number[]); /** * Radius of the sphere */ radius: number; /** * Center point */ center: number[]; } class SphereDto { constructor(sphere?: any); /** * Spherical Nurbs surface */ sphere: any; } class RevolutionParametersDto { constructor(profile?: any, center?: number[], axis?: number[], angle?: number); /** * Profile Nurbs curve */ profile: any; /** * Center point */ center: number[]; /** * Axis around which rotation will happen */ axis: number[]; /** * Angle at which to rotate in degrees */ angle: number; } class RevolutionDto { constructor(revolution?: any); /** * Revolved Nurbs surface */ revolution: any; } class SweepParametersDto { constructor(profile?: any, rail?: any); /** * Profile Nurbs curve */ profile: any; /** * Rail Nurbs curve */ rail: any; } class SweepDto { constructor(sweep?: any); /** * Revolved Nurbs surface */ sweep: any; } class CurveCurveDto { constructor(firstCurve?: any, secondCurve?: any, tolerance?: number); /** * First Nurbs curve */ firstCurve: any; /** * Second Nurbs curve */ secondCurve: number[]; /** * Optional tolerance parameter */ tolerance?: number | undefined; } class CurveSurfaceDto { constructor(curve?: any, surface?: any, tolerance?: number); /** * Nurbs curve */ curve: any; /** * Nurbs surface */ surface: any; /** * Optional tolerance parameter */ tolerance?: number | undefined; } class SurfaceSurfaceDto { constructor(firstSurface?: any, secondSurface?: any, tolerance?: number); /** * Nurbs curve */ firstSurface: any; /** * Nurbs surface */ secondSurface: any; /** * Optional tolerance parameter */ tolerance?: number | undefined; } class CurveCurveIntersectionsDto { constructor(intersections?: BaseTypes.CurveCurveIntersection[]); /** * Curve curve intersections */ intersections: BaseTypes.CurveCurveIntersection[]; } class CurveSurfaceIntersectionsDto { constructor(intersections?: BaseTypes.CurveSurfaceIntersection[]); /** * Curve curve intersections */ intersections: BaseTypes.CurveSurfaceIntersection[]; } } } /** * The shapes and result objects returned to you, as opposed to the parameters you pass in. * Where Inputs describes a request, Models describes the answer: the geometry handle, the report, * the measurement or the decomposed data an operation produced. */ declare namespace Models { /** * Point results - the structured point data the point and pattern operations return. */ declare namespace Point { /** * A generated hexagonal grid: the center point of every hexagon, its corner points, and the * row and column structure that placed them. The layout used for honeycomb patterns, perforations * and panelised surfaces. */ declare class HexGridData { centers: Base.Point3[]; hexagons: Base.Point3[][]; shortestDistEdge: number | undefined; longestDistEdge: number | undefined; maxFilletRadius: number | undefined; } } /** * Text results - the outlines, glyph data and measurements produced by the text and 3D text APIs. */ declare namespace Text { declare class VectorCharData { constructor(width?: number, height?: number, paths?: Base.Point3[][]); /** * The width of the char * @default undefined */ width: number; /** * The height of the char * @default undefined */ height: number; /** * The segments of the char * @default undefined */ paths: Base.Point3[][]; } declare class VectorTextData { constructor(width?: number, height?: number, chars?: VectorCharData[]); /** * The width of the char * @default undefined */ width: number; /** * The height of the char * @default undefined */ height: number; /** * The segments of the char * @default undefined */ chars: VectorCharData[]; } } /** * OCCT results: shape handles, boundary-representation graphs, corner and edge reports, dimension * and measurement output, and the decomposed mesh data the kernel produces when a shape is * tessellated for rendering or export. */ declare namespace OCCT { /** * Sub-shape counts for compounds and assemblies. */ interface SubShapeCounts { /** Number of solid shapes */ solids: number; /** Number of shell shapes */ shells: number; /** Number of face shapes */ faces: number; /** Number of wire shapes */ wires: number; /** Number of edge shapes */ edges: number; } /** * Node in the assembly hierarchy. * Provides comprehensive information about each element in the assembly tree. */ interface AssemblyHierarchyNode { /** Unique node ID (same as label entry) */ id: string; /** Parent node ID (if not root) */ parentId?: string | undefined; /** Depth in hierarchy (0 = root) */ depth: number; /** Label entry string (e.g., "0:1:1:1") */ label: string; /** * Node name as a CAD tree would show it: the label's own name, or for an instance the file * left unnamed the name of the part or assembly it places (see `definitionName`) */ name: string; /** Whether this label IS an assembly container (not just references one) */ isAssembly: boolean; /** Whether this is an instance (reference to a part/assembly) */ isInstance: boolean; /** Definition ID (for instances - the label of the referenced part/assembly) */ definitionId?: string | undefined; /** Definition name (for instances - the name of the referenced part/assembly, empty if it has none) */ definitionName?: string | undefined; /** True if this instance references an assembly (only present for instances) */ refersToAssembly?: boolean | undefined; /** True if this instance references a part (only present for instances) */ refersToPart?: boolean | undefined; /** * Detailed node type: * - "assembly": An assembly container * - "instance-part": An instance referencing a part * - "instance-assembly": An instance referencing an assembly * - "instance": An instance (type unknown) * - "part": An original part definition (not an instance) * - "subshape": A sub-shape of another shape * - "compound": A compound shape * - "unknown": Unknown type */ nodeType: string; /** * Whether this IS an original part definition (not an instance). * An instance is never a part - use refersToPart to check what an instance references. */ isPart: boolean; /** Whether this is a sub-shape of another shape */ isSubShape: boolean; /** Whether this is a free (root-level) shape */ isFreeShape: boolean; /** Whether this is a compound shape */ isCompound: boolean; /** Whether this node has associated geometry */ hasGeometry: boolean; /** Shape type if has geometry: "solid", "compound", "shell", "face", "wire", "edge", "vertex", "shape", "none" */ shapeType?: string | undefined; /** Sub-shape counts (for compounds and assemblies) */ subShapeCounts?: SubShapeCounts | undefined; /** Whether node is visible */ visible: boolean; /** Color if set (RGBA, values 0-1) */ colorRgba?: Base.ColorRGBA | undefined; /** Local transform (4x4 matrix, column-major) */ transform?: Base.TransformMatrix | undefined; } /** * Result from getAssemblyHierarchy. * Provides complete assembly tree traversal with comprehensive node information. */ interface AssemblyHierarchyResult { /** Schema version (currently "2.0") */ version: string; /** Total number of nodes in the hierarchy */ totalNodes: number; /** All nodes in the assembly, in depth-first order */ nodes: AssemblyHierarchyNode[]; } /** * Result from native STEP assembly parsing. * Includes hierarchy and instance/definition tracking. */ interface AssemblyJsonResult { /** Version string (1.1 = with hierarchy & instances) */ version: string; /** Array of assembly nodes in depth-first traversal order */ nodes: AssemblyNodeJson[]; /** Error message (if parsing failed) */ error?: string | undefined; } /** * Imported part definition for cross-document reuse. * * Copies a label (or the full free-shapes root) from a source document into the new * assembly document, preserving sub-assembly hierarchy, names and colors. The copied * root becomes a part referenceable by `partId` from instance nodes, letting a STEP-loaded * assembly be placed multiple times in a new assembly. */ interface AssemblyLoadedPartDef { /** Unique identifier for referencing this part from instance nodes (via partId) */ id: string; /** Index into the sourceDocuments array passed to buildAssemblyDocument */ sourceDocumentIndex: number; /** * OCAF entry string of the label to copy from the source document * (e.g. "0:1:1:1"). If omitted, all free shapes of the source document * are imported (wrapped in a new assembly compound when there are multiple). */ sourceLabel?: string | undefined; /** Optional name override applied to the imported root label */ name?: string | undefined; /** Optional color override applied to the imported root label */ colorRgba?: Base.ColorRGBA | undefined; } /** * Node definition for assembly structure. * Can be either an assembly (container) or an instance (reference to a part). */ interface AssemblyNodeDef { /** Unique identifier for this node */ id: string; /** Node type: 'assembly' for containers, 'instance' for part references */ type: "assembly" | "instance"; /** Display name for this node */ name: string; /** Parent node ID (undefined = root level) */ parentId?: string | undefined; /** Part ID to instance (required for type='instance') */ partId?: string | undefined; /** Translation as [x, y, z] */ translation?: Base.Point3 | undefined; /** Rotation as [rx, ry, rz] Euler angles in degrees (applied Rx * Ry * Rz) */ rotation?: Base.Vector3 | undefined; /** Uniform scale factor (1.0 = no scale) */ scale?: number | undefined; /** * Optional placement matrix (column-major, 16 numbers) or an ordered list of * matrices applied first-to-last. When set, it fully defines the node's placement * and takes precedence over translation/rotation/scale. */ matrix?: Base.TransformMatrix | Base.TransformMatrixes | undefined; /** Optional color override for this instance */ colorRgba?: Base.ColorRGBA | undefined; } /** * Assembly node from native JSON parsing. * Contains id, name, assembly flag, visibility, optional color and transform. * Includes hierarchy information (parentId, depth) and instance/definition tracking. */ interface AssemblyNodeJson { /** Unique path identifier (e.g., "/0:1:1:1/0:1:1:2") */ id: string; /** Parent node ID for hierarchy reconstruction (undefined for root nodes) */ parentId?: string | undefined; /** Depth in the assembly hierarchy (0 = root) */ depth: number; /** Part/assembly name */ name: string; /** True if this is an assembly (has children), false if leaf part */ isAssembly: boolean; /** True if this node is an instance referencing a definition */ isInstance: boolean; /** * Definition ID that this instance refers to (only set if isInstance is true). * Multiple instances with the same definitionId share the same geometry. */ definitionId?: string | undefined; /** Name of the part or assembly this instance places (only set if isInstance is true, empty if it has none) */ definitionName?: string | undefined; /** Visibility flag */ visible: boolean; /** Surface color (if set) */ colorRgba?: Base.ColorRGBA | undefined; /** 4x4 transformation matrix in column-major order (if not identity) */ transform?: Base.TransformMatrix | undefined; } /** * Part definition for assembly structure. * Represents a shape that can be instanced multiple times. */ interface AssemblyPartDef { /** Unique identifier for referencing this part */ id: string; /** The shape for this part */ shape: T; /** Display name for the part */ name: string; /** Optional color for the part */ colorRgba?: Base.ColorRGBA | undefined; } /** * Definition for updating an existing part in a document. * Allows changing the shape, name, and/or color of a part identified by its label. */ interface AssemblyPartUpdateDef { /** * Label of the existing part to update. * This should be a label string like "0:1:1:1" obtained from document queries. */ label: string; /** * New shape to replace the existing shape. * If undefined, the shape is not changed. */ shape?: T | undefined; /** * New name for the part. * If undefined, the name is not changed. */ name?: string | undefined; /** * New color for the part. * If undefined, the color is not changed. */ colorRgba?: Base.ColorRGBA | undefined; } /** * Complete assembly structure definition. * Contains all parts and nodes that make up the assembly. * * When updating an existing document: * - `removals` specifies labels to remove (parts, instances, or subassemblies) * - `partUpdates` specifies updates to existing parts (shape, name, color) * - `parts` and `nodes` specify new elements to add * * Processing order: * 1. Removals are applied first * 2. Part updates are applied second * 3. New parts and nodes are added last */ interface AssemblyStructureDef { /** All part definitions (shapes that can be instanced) */ parts: AssemblyPartDef[]; /** All nodes (assemblies and instances) */ nodes: AssemblyNodeDef[]; /** * Labels to remove from existing document. * Can be part labels, instance labels, or assembly labels. * Ignored when creating a new document. */ removals?: string[] | undefined; /** * Updates to apply to existing parts in the document. * Each update can change the shape, name, and/or color of a part. * Ignored when creating a new document. */ partUpdates?: AssemblyPartUpdateDef[] | undefined; /** * Parts imported from other documents (typically STEP-loaded). * Each entry copies a label tree from a source document into this document, * preserving sub-assembly hierarchy, names and colors. The copied root then * behaves as a regular part: instance nodes can reference it by `partId` and * place it multiple times with different transforms. */ loadedParts?: AssemblyLoadedPartDef[] | undefined; /** * Whether to clear the existing document before adding new content. * Only relevant when an existingDocument is provided. * * - `true`: Clear all existing shapes, then add new parts/nodes (full rebuild) * - `false`: Keep existing shapes, apply removals/updates, add new parts/nodes (incremental) * * @default false */ clearDocument: boolean; } /** * Part/assembly definition info returned from getDocumentParts. * This returns the original definitions (prototypes), not instances. */ interface DocumentPartInfo { /** Label entry string (e.g., "0:1:1:2") */ label: string; /** Part/assembly name */ name: string; /** Type: "part", "assembly", "sub-assembly", "compound", or "unknown" */ type: string; /** Whether this is a free (root-level) shape */ isFree: boolean; /** Color if set */ color?: Base.ColorRGBA | undefined; /** Number of instances that reference this part/assembly */ instanceCount: number; } /** * Color info returned from getLabelColor. */ interface LabelColorInfo { /** Whether color is set on this label */ hasColor: boolean; /** Red component (0-1) */ r: number; /** Green component (0-1) */ g: number; /** Blue component (0-1) */ b: number; /** Alpha component (0-1) */ a: number; } /** * Detailed label info. */ interface LabelInfo { /** Label entry string */ label: string; /** Name attribute */ name: string; /** Type: "part", "assembly", "instance", or "unknown" */ type: string; /** Whether it's a simple shape (not compound/assembly) */ isSimpleShape: boolean; /** Whether it's an assembly */ isAssembly: boolean; /** Whether it's a reference/instance */ isReference: boolean; /** Whether it's a component in an assembly */ isComponent: boolean; /** Whether it's a compound */ isCompound: boolean; /** Whether it's a sub-shape of another shape */ isSubShape: boolean; /** Whether it's a free shape (top-level) */ isFreeShape: boolean; /** Reference label (for instances - the label of the placed part or assembly) */ refLabel?: string | undefined; /** Name of the placed part or assembly (for instances, empty if it has none) */ refName?: string | undefined; /** Child labels (for assemblies) */ children?: string[] | undefined; /** Shape type (vertex, edge, wire, face, shell, solid, compound, etc.) */ shapeType?: string | undefined; } /** * Transform info returned from getLabelTransform. */ interface LabelTransformInfo { /** 4x4 transformation matrix in column-major order */ matrix: number[]; /** Translation [x, y, z] */ translation: Base.Point3; /** Rotation as quaternion [x, y, z, w] */ quaternion: [ number, number, number, number ]; /** Scale factor (uniform) */ scale: number; } /** * The base shape every boundary-representation query returns: whether it succeeded, and the error * if it did not. Check ok before reading the rest - a failed query still returns an object rather * than throwing, so that a batch of queries can report per-item failures. */ interface BRepGraphResult { ok: boolean; error?: string | undefined; } /** * A census of a shape's topology: how many solids, shells, faces, wires, edges, coedges and * vertices it contains, how many distinct surfaces and curves back them, and how many assembly * products and occurrences are present. The quickest way to see what an imported STEP file * actually contains, and to spot the difference between one solid and a compound that merely looks * like one. */ interface BRepGraphAnalysis extends BRepGraphResult { solids: number; shells: number; faces: number; wires: number; edges: number; coedges: number; vertices: number; compounds: number; compSolids: number; surfaces: number; curves3d: number; curves2d: number; nodes: number; products: number; occurrences: number; rootProducts: number; generation: number; } /** * One face and the indices of the faces sharing an edge with it. The building block of * face-adjacency traversal - growing a selection outward from a seed face, or finding the faces * that form a pocket. */ interface BRepGraphFaceAdjacency { index: number; adjacent: number[]; edges: number[]; nbWires: number; outerWire: number; } /** * The face adjacency map for a whole shape: for each face, which faces touch it. */ interface BRepGraphFaceAdjacencyResult extends BRepGraphResult { faces: BRepGraphFaceAdjacency[]; } /** * One edge together with the faces on either side of it. An edge with two faces is interior, one * with a single face is on an open boundary, and one with more than two indicates non-manifold * geometry - which is the usual reason a shape refuses to become a solid. */ interface BRepGraphEdgeFace { index: number; faces: number[]; nbFaces: number; boundary: boolean; manifold: boolean; degenerated: boolean; startVertex: number; endVertex: number; tolerance: number; } /** * The edge-to-face map for a whole shape. Use it to find open boundaries and non-manifold edges * before attempting to sew a shell into a solid. */ interface BRepGraphEdgeFaceMapResult extends BRepGraphResult { edges: BRepGraphEdgeFace[]; } /** * One vertex: its index, its position, and the edges meeting at it. */ interface BRepGraphVertex { index: number; point: Base.Point3; tolerance: number; edges: number[]; } /** * The vertex-to-edge map for a whole shape, giving each vertex's position and the edges that meet * there. The valence - how many edges meet - is what distinguishes an ordinary corner from a * singular point. */ interface BRepGraphVertexEdgeMapResult extends BRepGraphResult { vertices: BRepGraphVertex[]; } /** * What kind of surface backs a face - plane, cylinder, cone, sphere, torus, Bezier, B-spline, and * the rest. Worth checking before an operation that only makes sense on one kind, and useful for * recognising features: a set of cylindrical faces of equal radius is usually a hole pattern. */ type BRepGraphSurfaceType = "Plane" | "Cylinder" | "Cone" | "Sphere" | "Torus" | "BezierSurface" | "BSplineSurface" | "SurfaceOfRevolution" | "SurfaceOfExtrusion" | "OffsetSurface" | "OtherSurface" | "None"; /** * What a face is made of: its surface type, area, orientation, and the parameters of the * underlying surface where they are meaningful - a cylinder's radius and axis, a plane's normal. */ interface BRepGraphFaceGeometry { index: number; surfaceType: BRepGraphSurfaceType; tolerance: number; hasTriangulation: boolean; naturalRestriction: boolean; uvBounds: [ number, number, number, number ]; nbWires: number; uid: number; } /** * Per-face geometry for a whole shape. */ interface BRepGraphFaceInfoResult extends BRepGraphResult { faces: BRepGraphFaceGeometry[]; } /** * What kind of curve backs an edge - line, circle, ellipse, hyperbola, parabola, Bezier, B-spline * and the rest. */ type BRepGraphCurveType = "Line" | "Circle" | "Ellipse" | "Hyperbola" | "Parabola" | "BezierCurve" | "BSplineCurve" | "OffsetCurve" | "OtherCurve" | "None"; /** * How smoothly two pieces of geometry meet, in the standard notation. C0 means they touch, G1 * means tangent directions align, C1 means tangent vectors match, and the G2/C2 and higher grades * add curvature continuity. This is what decides whether a fillet reads as smooth or shows a * visible crease under reflection. */ type BRepGraphContinuity = "C0" | "G1" | "C1" | "G2" | "C2" | "C3" | "CN"; /** * What an edge is made of: its curve type, length, the vertices at its ends, and the parameters of * the underlying curve where they are meaningful - a circle's radius and centre, a line's * direction. */ interface BRepGraphEdgeGeometry { index: number; curveType: BRepGraphCurveType; hasCurve: boolean; degenerated: boolean; sameParameter: boolean; maxContinuity: BRepGraphContinuity; range: [ number, number ] | null; uid: number; } /** * Per-edge geometry for a whole shape. */ interface BRepGraphEdgeInfoResult extends BRepGraphResult { edges: BRepGraphEdgeGeometry[]; } /** * Whether one shape lies inside another, and where the test placed each point that was checked. */ interface BRepGraphContainmentResult extends BRepGraphResult { shellsOfFace: number[][]; solidsOfShell: number[][]; solidsOfFace: number[][]; } /** * One wire: its edges, whether it is closed, and its length. A face's outer wire is its boundary; * any others are its holes. */ interface BRepGraphWire { index: number; closed: boolean; outer: boolean; nbCoEdges: number; nbDistinctEdges: number; face: number; } /** * Per-wire information for a whole shape - which wires are closed, and which face each bounds. */ interface BRepGraphWireInfoResult extends BRepGraphResult { wires: BRepGraphWire[]; } /** * A reference to a node in the graph: its kind and its index. Used wherever one part of a result * points at another without repeating it. */ interface BRepGraphNodeRef { kind: string; index: number; } /** * One product in an assembly - a part definition, named and shaped, that may be placed more than * once. The distinction between a product and an occurrence is what makes assemblies compact: ten * identical screws are one product with ten occurrences. */ interface BRepGraphProduct { index: number; isAssembly: boolean; isPart: boolean; shapeRoot: BRepGraphNodeRef | null; components: number[]; } /** * One placement of a product within an assembly: which product, at which transform, under which * parent. */ interface BRepGraphOccurrence { index: number; product: number; parentProduct: number; matrix: number[]; } /** * The assembly structure of a shape: its products, their occurrences, and which products sit at * the root. This is what STEP assembly import produces, and what you walk to build a tree view. */ interface BRepGraphAssemblyResult extends BRepGraphResult { rootProducts: number[]; products: BRepGraphProduct[]; occurrences: BRepGraphOccurrence[]; } /** * One problem found while validating a shape, with its kind, severity and the node it concerns. */ interface BRepGraphIssue { severity: "error" | "warning"; node: BRepGraphNodeRef; description: string; } /** * The result of validating a shape: whether it is sound, and every issue found. Run it before * exporting for manufacture - self-intersections, open shells and non-manifold edges are all much * cheaper to find here than in a slicer or a CAM package. */ interface BRepGraphValidationResult extends BRepGraphResult { valid: boolean; errors: number; warnings: number; issues: BRepGraphIssue[]; } /** * A solid as it appears in a full structural dump: its index and the shells it contains. */ interface BRepGraphDumpSolid { index: number; uid: number; } /** * A shell as it appears in a full structural dump: its index, its faces, and whether it is closed. */ interface BRepGraphDumpShell { index: number; uid: number; nbFaces: number; closed: boolean; solids: number[]; } /** * A face as it appears in a full structural dump: its index, its wires, its surface, and its * orientation. */ interface BRepGraphDumpFace { index: number; uid: number; surfaceType: BRepGraphSurfaceType; shells: number[]; edges: number[]; } /** * An edge as it appears in a full structural dump: its index, its vertices, its curve, and its * length. */ interface BRepGraphDumpEdge { index: number; uid: number; startVertex: number; endVertex: number; degenerated: boolean; faces: number[]; } /** * A vertex as it appears in a full structural dump: its index and its position. */ interface BRepGraphDumpVertex { index: number; uid: number; point: Base.Point3; edges: number[]; } /** * A complete structural dump of a shape - every solid, shell, face, edge and vertex with the * relationships between them. The heaviest of the graph queries and the one to reach for when you * need to reason about the whole topology at once rather than answer a single question. */ interface BRepGraphDumpResult extends BRepGraphResult { solids: BRepGraphDumpSolid[]; shells: BRepGraphDumpShell[]; faces: BRepGraphDumpFace[]; edges: BRepGraphDumpEdge[]; vertices: BRepGraphDumpVertex[]; } /** * An index from node kind and number back to the node itself, so a result that refers to nodes by * index can be resolved without searching. */ interface BRepGraphNodeLookup { valid: boolean; kind?: string | undefined; index?: number | undefined; uid?: number | undefined; } /** * What kind of corner was found at a point: planar, where the meeting faces are flat; * developable, where the surface can be flattened without stretching; solid3d, a genuine * three-dimensional corner; or one of the three failures - tooFar, noVertex and notFound - meaning * no corner was located near the point given. */ type CornerClassification = "planar" | "developable" | "solid3d" | "tooFar" | "noVertex" | "notFound"; /** * One corner found by a point query: where it is, how far it was from the point you asked about, * how many edges and faces meet there, how it was classified, what was done to it, and whether * that succeeded. Read classification and applied together - a corner can be found and still be * left untouched if its kind does not support the operation. */ interface CornerResult { index: number; point: Base.Point3; snapDistance: number; valence: number; incidentFaces: number; classification: CornerClassification; action: string; taperFactor: number; applied: boolean; message: string; } /** * The result of a corner-by-point operation across several points: whether it succeeded, whether * the shape was actually modified, and one CornerResult per point. modified is false when every * corner was found but none could be treated. */ interface CornerByPointReport { ok: boolean; modified: boolean; results: CornerResult[]; error?: string | undefined; } /** * The name of a curve's underlying type - line, circle, ellipse, hyperbola, parabola, Bezier, * B-spline and the rest - as it appears in a geometry report. */ type CurveTypeName = "line" | "circle" | "ellipse" | "hyperbola" | "parabola" | "bezier" | "bspline" | "offset" | "other"; /** * The name of a surface's underlying type - plane, cylinder, cone, sphere, torus, Bezier, * B-spline and the rest - as it appears in a geometry report. Recognising a run of cylindrical * faces of equal radius is how a hole pattern is found. */ type SurfaceTypeName = "plane" | "cylinder" | "cone" | "sphere" | "torus" | "bezier" | "bspline" | "revolution" | "extrusion" | "offset" | "other"; /** Introspection of an edge's underlying curve (degree, poles, periodicity, range, length, ...). */ interface EdgeDebugInfo { valid: boolean; type?: CurveTypeName | undefined; firstParameter?: number | undefined; lastParameter?: number | undefined; closed?: boolean | undefined; periodic?: boolean | undefined; period?: number | undefined; length?: number | undefined; isLinear?: boolean | undefined; isCircular?: boolean | undefined; degree?: number | undefined; nbPoles?: number | undefined; nbKnots?: number | undefined; rational?: boolean | undefined; start?: Base.Point3 | undefined; end?: Base.Point3 | undefined; } /** Introspection of a wire: edge count, closed flag, total length, plus per-edge debug info. */ interface WireDebugInfo { valid: boolean; nbEdges: number; closed: boolean; totalLength: number; edges: EdgeDebugInfo[]; } /** Introspection of a shell: face/edge counts, total surface area, plus per-face debug info (flat). */ interface ShellDebugInfo { valid: boolean; nbFaces: number; nbEdges: number; area: number; faces: FaceDebugInfo[]; } /** Introspection of a solid: face/edge counts, surface area, volume, plus per-face debug info (flat). */ interface SolidDebugInfo { valid: boolean; nbFaces: number; nbEdges: number; area: number; volume: number; faces: FaceDebugInfo[]; } /** Introspection of a face's underlying surface (U/V degree, poles, periodicity, bounds, area, ...). */ interface FaceDebugInfo { valid: boolean; type?: SurfaceTypeName | undefined; uMin?: number | undefined; uMax?: number | undefined; vMin?: number | undefined; vMax?: number | undefined; uClosed?: boolean | undefined; vClosed?: boolean | undefined; uPeriodic?: boolean | undefined; vPeriodic?: boolean | undefined; isPlanar?: boolean | undefined; uDegree?: number | undefined; vDegree?: number | undefined; nbUPoles?: number | undefined; nbVPoles?: number | undefined; nbUKnots?: number | undefined; nbVKnots?: number | undefined; uRational?: boolean | undefined; vRational?: boolean | undefined; area?: number | undefined; reversed?: boolean | undefined; nbWires?: number | undefined; nbEdges?: number | undefined; } /** * A shape paired with a stable identifier. Operations that return many shapes use it so a * caller can match results back to what produced them - which face a fillet was applied to, which * part a section came from - instead of relying on array order. */ declare class ShapeWithId { id: string; shape: U; } /** * One named object in an assembly or a scene description: what it is, where it sits, and which * shape it refers to. */ declare class ObjectDefinition { compound?: U | undefined; shapes?: ShapeWithId[] | undefined; data?: M | undefined; } /** * The wires of a single character in a text run: the outlines that bound its filled regions, * ready to be turned into faces or extruded. */ declare class TextWiresCharShapePart { id?: string | undefined; shapes?: { compound?: T; }; } /** * The wire outlines of a whole text run, character by character, along with the layout that * positions them. The intermediate stage between a string and 3D text geometry, exposed so you can * intervene - offsetting the outlines, or using them flat rather than extruded. */ declare class TextWiresDataDto { type: string; name: string; compound?: T | undefined; characters?: TextWiresCharShapePart[] | undefined; width: number; height: number; center: Base.Point3; } } } /** * Finished parametric models, ready to use and ready to read. Each one exposes the parameters that * shape it and returns a complete solid, so they double as worked examples of non-trivial parametric * modelling and as products you can put straight into a configurator. Grouped by what they are for: * furniture, 3D printing, laser cutting, architecture and a kids' corner. */ declare namespace Things { /** * Enumerations shared across the finished models - materials, orientations and preset variants. */ declare namespace Enums { declare class LodDto { /** * Level of detail * @default low */ lod: lodEnum; } /** * The level of detail a finished model is built at: low, middle or high. Lower detail means fewer * segments on curved geometry, so the model builds faster and renders lighter, at the cost of * visible faceting. Use low while a customer is dragging a slider and high for the file they * actually download. */ declare enum lodEnum { low = "low", middle = "middle", high = "high" } } /** * Architectural models - buildings and structures whose geometry is generated from their * dimensions rather than modelled by hand. */ declare namespace Architecture { /** * Parametric house models. */ declare namespace Houses { /** * Zen Hideout - a small parametric retreat building. Roof pitch, footprint and opening * positions are all driven by parameters, and the result is a closed solid suitable for * visualisation or for export. */ declare namespace ZenHideout { declare class ZenHideoutData { /** * Type of the object being configured */ type: string; /** * Default name of the object */ name: string; /** * Original inputs */ originalInputs?: ZenHideoutDto; /** * Compounded shape representation of all of the geometric objects of the building */ compound?: T; /** * All the shapes of the building */ shapes?: Models.OCCT.ShapeWithId[]; /** * Representation of zen hideout parts that are useful for drawing the object efficiently */ drawingPart?: ZenHideoutDrawingPart; /** * Sandwitch parts that have inner and outer panels, can have windows and doors */ sandwitchPartsBetweenColumns?: Things.Architecture.SandwitchPart[]; /** * Corner part panels forming 90 degree angle */ cornerParts?: Things.Architecture.CornerPart[]; /** * Column parts of the building */ columnParts?: Things.Architecture.ColumnPart[]; /** * Roof parts of the building. Contain all the upper geometry, together with beams and columns. */ roofParts?: Things.Architecture.RoofPart[]; /** * Entrance corner part of the building, containing interior and exterior panels, staircase, and a * corner window part */ entranceCorner?: Things.Architecture.CornerEntrancePart; /** * Terrace corner of the building, containing interior and exterior panels, staircase, and a corner * window part */ entranceTerrace?: Things.Architecture.CornerEntrancePart; /** * Floor parts of the building */ floors?: Things.Architecture.FloorPart[]; /** * Ceiling parts of the building */ ceilings?: Things.Architecture.CeilingPart[]; } /** * This defines useful compounded objects for representing zen hideout in optimal and fast way. */ declare class ZenHideoutDrawingPartShapes { /** * The representation of all window glass objects in the building */ windowGlassCompound?: T; /** * The representation of all glass frame objects in the building */ glassFramesCompound?: T; /** * The representation of all window frame objects in the building */ windowFrameCompound?: T; /** * The representation of all beam objects in the building */ beamsCompound?: T; /** * The representation of all column objects in the building */ columnsCompound?: T; /** * The representation of all exterior panels on the first floor * of the building */ firstFloorExteriorPanelsCompound?: T; /** * The representation of all interior panels on the first floor * of the building */ firstFloorInteriorPanelsCompound?: T; /** * The representation of all exterior panels on the roof * of the building */ roofExteriorPanelsCompound?: T; /** * The representation of all interior panels on the roof * of the building */ roofInteriorPanelsCompound?: T; /** * The representation of the first roof cover * of the building */ roofCoverFirstCompound?: T; /** * The representation of the second roof cover * of the building */ roofCoverSecondCompound?: T; /** * The representation of the floor * of the building */ floorCompound?: T; /** * The representation of the ceiling * of the building */ ceilingCompound?: T; /** * The representation of stairs */ stairsCompound?: T; } /** * Information needed to draw the part in an optimal way */ declare class ZenHideoutDrawingPart { /** * Shapes that exist in the drawing part, T can represent opancascade geometry, * babylonjs mesh, materials or other things that map to these drawing categories. */ shapes?: ZenHideoutDrawingPartShapes; } /** * The parameter set for the Zen Hideout retreat building. Generic in its value types so the same list can * be expressed for a plain script, where every value is a number, and for a driven model, where a value can * be an expression or a bound input. Concrete DTOs fill those type parameters in; read this class for what * the model is actually shaped by. */ declare class ZenHideoutDtoBase { widthFirstWing: T; lengthFirstWing: T; terraceWidth: T; widthSecondWing: T; lengthSecondWing: T; heightWalls: T; roofAngleFirstWing: T; roofAngleSecondWing: T; roofOffset: T; roofInsideOverhang: T; roofMaxDistAttachmentBeams: T; roofAttachmentBeamWidth: T; roofAttachmentBeamHeight: T; roofOutsideOverhang: T; columnSize: T; ceilingBeamHeight: T; ceilingBeamWidth: T; nrCeilingBeamsBetweenColumns: T; distBetweenColumns: T; floorHeight: T; groundLevel: T; facadePanelThickness: T; windowWidthOffset: T; windowHeightOffset: T; windowFrameThickness: T; windowGlassFrameThickness: T; lod: U; rotation?: T; origin?: V; } declare class ZenHideoutDto implements ZenHideoutDtoBase { constructor(widthFirstWing?: number, lengthFirstWing?: number, terraceWidth?: number, widthSecondWing?: number, lengthSecondWing?: number, heightWalls?: number, roofAngleFirstWing?: number, roofAngleSecondWing?: number, roofOffset?: number, roofInsideOverhang?: number, roofMaxDistAttachmentBeams?: number, roofAttachmentBeamWidth?: number, roofAttachmentBeamHeight?: number, roofOutsideOverhang?: number, columnSize?: number, ceilingBeamHeight?: number, ceilingBeamWidth?: number, nrCeilingBeamsBetweenColumns?: number, distBetweenColumns?: number, floorHeight?: number, groundLevel?: number, facadePanelThickness?: number, windowWidthOffset?: number, windowHeightOffset?: number, windowFrameThickness?: number, windowGlassFrameThickness?: number, lod?: Things.Enums.lodEnum, skinOpacity?: number, rotation?: number, origin?: Inputs.Base.Point3); /** * Width of the first wing of L shaped building * @default 4 * @minimum 3 * @maximum Infinity * @step 0.5 */ widthFirstWing: number; /** * Length of the first wing of L shaped building * @default 10 * @minimum 3 * @maximum Infinity * @step 0.5 */ lengthFirstWing: number; /** * Width of the terrace * @default 3 * @minimum 1 * @maximum Infinity * @step 0.25 */ terraceWidth: number; /** * Width of the second wing of L shaped building * @default 5 * @minimum 3 * @maximum Infinity * @step 0.5 */ widthSecondWing: number; /** * Length of the second wing of L shaped building * @default 10 * @minimum 3 * @maximum Infinity * @step 0.5 */ lengthSecondWing: number; /** * Height of the walls * @default 3 * @minimum 3 * @maximum Infinity * @step 0.1 */ heightWalls: number; /** * Height of the first wing end * @default 15 * @minimum 5 * @maximum Infinity * @step 5 */ roofAngleFirstWing: number; /** * Height of the first wing end * @default 25 * @minimum 5 * @maximum Infinity * @step 5 */ roofAngleSecondWing: number; /** * The offset to be applied to where the roof starts * @default 0.5 * @minimum 0.2 * @maximum Infinity * @step 0.25 */ roofOffset: number; /** * Roof overhang on the inside of the building (where the terrace is) * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.25 */ roofInsideOverhang: number; /** * Roof max distance between top attachment beams * @default 0.8 * @minimum 0.1 * @maximum Infinity * @step 0.25 */ roofMaxDistAttachmentBeams: number; /** * Roof attachment beam width * @default 0.2 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ roofAttachmentBeamWidth: number; /** * Roof attachment beam height * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ roofAttachmentBeamHeight: number; /** * Roof overhang on the inside of the building * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.25 */ roofOutsideOverhang: number; /** * Column size * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ columnSize: number; /** Ceiling beam height * @default 0.25 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ ceilingBeamHeight: number; /** Ceiling beam width * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ ceilingBeamWidth: number; /** Nr ceiling beams between columns * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ nrCeilingBeamsBetweenColumns: number; /** Distance between columns * @default 2 * @minimum 0.5 * @maximum Infinity * @step 0.25 */ distBetweenColumns: number; /** The height of the floor * @default 0.1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ floorHeight: number; /** ground level from the floor * @default 0.6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ groundLevel: number; /** Facade panel thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ facadePanelThickness: number; /** Window width parameter * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowWidthOffset: number; /** Window bottom offset * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowHeightOffset: number; /** Window frame thickness * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowFrameThickness: number; /** Window glass frame thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowGlassFrameThickness: number; /** * Level of detail to compute * @default high */ lod: Things.Enums.lodEnum; /** * The opacity of the skin - only applied if lod is set to high * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ skinOpacity: number; /** * Rotation of the zen hideout * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Origin of the zen hideout * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } } } /** * A structural beam - one named component of an assembled model, carrying its own shapes and any sub-parts * beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class BeamPart { id?: string; name?: string; width?: number; length?: number; height?: number; shapes?: { beam?: T; }; } /** * A ceiling - one named component of an assembled model, carrying its own shapes and any sub-parts * beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class CeilingPart { id?: string; name?: string; area?: number; thickness?: number; polygonPoints?: Inputs.Base.Point3[]; shapes?: { compound?: T; }; } /** * A column - one named component of an assembled model, carrying its own shapes and any sub-parts * beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class ColumnPart { id?: string; name?: string; width?: number; length?: number; height?: number; shapes?: { column?: T; }; } declare class CornerEntranceDto { /** * Width first wing * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ widthFirstWing: number; /** * Width second wing * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ widthSecondWing: number; /** * Length stair first wing * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthStairFirstWing: number; /** * Length stair second wing * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthStairSecondWing: number; /** * Length wall first wing * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthWallFirstWing: number; /** * Length wall second wing * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthWallSecondWing: number; /** Facade panel thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ facadePanelThickness: number; /** Wall thickness * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ wallThickness: number; /** Height of the walls on the exterior side * @default 3 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ wallHeightExterior: number; /** Height of the walls on the interior side * @default 3 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ wallHeightInterior: number; /** Window offset top * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowFrameOffsetTop: number; /** Window frame thickness * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ windowFrameThickness: number; /** Glass frame thickness * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ glassFrameThickness: number; /** Door width * @default 1 * @minimum 0.7 * @maximum Infinity * @step 0.1 */ doorWidth: number; /** Corner Window Width Offset * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowWidthOffset: number; /** Stair total height * @default 1 * @minimum 0.7 * @maximum Infinity * @step 0.1 */ stairTotalHeight: number; /** Create stairs * @default false */ createStair: boolean; /** * Flips the direction - outside things become inside and vice versa * @default false */ flipDirection: boolean; /** * Rotation of the entrance * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin of the stairs * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } /** * A corner entrance - one named component of an assembled model, carrying its own shapes and any sub-parts * beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class CornerEntrancePart { id?: string; name?: string; panelThickness?: number; widthPanelExteriorOne?: number; heightPanelsExterior?: number; stair?: CornerStairPart; window?: WindowCornerPart; shapes?: { compound?: T; panelExterior?: T; panelInterior?: T; }; } declare class CornerPart { /** * Unique id of the corner part */ id?: string; /** * Name of the corner part */ name?: string; /** * Width of the panel */ widthPanel?: number; /** * Height of the panel */ heightPanel?: number; /** * Thickness of the panel */ thicknessPanel?: number; /** * Corner shapes */ shapes?: { corner?: T; }; } declare class CornerStairDto { /** * Inverts the side of the stair from going out to going inside of the L shape. This kind of stair can produce self intersecting result. * @default false */ invert: boolean; /** * Width first wing * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ widthFirstLanding: number; /** * Width second wing * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ widthSecondLanding: number; /** * Length first wing * @default 2 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthFirstWing: number; /** * Length second wing * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthSecondWing: number; /** * Max wished step height * @default 0.25 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ maxWishedStepHeight: number; /** * Max wished step height * @default 0.25 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ stepHeightWidthProportion: number; /** * Total height of the corner stairs * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ totalHeight: number; /** * Rotation of the stairs * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin of the stairs * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } declare class CornerStairPart extends CornerStairDto { id?: string; name?: string; steps?: number; stepWidth?: number; stepHeight?: number; shapes?: { stair?: T; }; } /** * A floor - one named component of an assembled model, carrying its own shapes and any sub-parts * beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class FloorPart { id?: string; name?: string; area?: number; thickness?: number; polygonPoints?: Inputs.Base.Point3[]; shapes?: { compound?: T; }; } declare class ZenHideoutData { /** * Type of the object being configured */ type: string; /** * Default name of the object */ name: string; /** * Original inputs */ originalInputs?: ZenHideoutDto; /** * Compounded shape representation of all of the geometric objects of the building */ compound?: T; /** * All the shapes of the building */ shapes?: Models.OCCT.ShapeWithId[]; /** * Representation of zen hideout parts that are useful for drawing the object efficiently */ drawingPart?: ZenHideoutDrawingPart; /** * Sandwitch parts that have inner and outer panels, can have windows and doors */ sandwitchPartsBetweenColumns?: Things.Architecture.SandwitchPart[]; /** * Corner part panels forming 90 degree angle */ cornerParts?: Things.Architecture.CornerPart[]; /** * Column parts of the building */ columnParts?: Things.Architecture.ColumnPart[]; /** * Roof parts of the building. Contain all the upper geometry, together with beams and columns. */ roofParts?: Things.Architecture.RoofPart[]; /** * Entrance corner part of the building, containing interior and exterior panels, staircase, and a * corner window part */ entranceCorner?: Things.Architecture.CornerEntrancePart; /** * Terrace corner of the building, containing interior and exterior panels, staircase, and a corner * window part */ entranceTerrace?: Things.Architecture.CornerEntrancePart; /** * Floor parts of the building */ floors?: Things.Architecture.FloorPart[]; /** * Ceiling parts of the building */ ceilings?: Things.Architecture.CeilingPart[]; } /** * This defines useful compounded objects for representing zen hideout in optimal and fast way. */ declare class ZenHideoutDrawingPartShapes { /** * The representation of all window glass objects in the building */ windowGlassCompound?: T; /** * The representation of all glass frame objects in the building */ glassFramesCompound?: T; /** * The representation of all window frame objects in the building */ windowFrameCompound?: T; /** * The representation of all beam objects in the building */ beamsCompound?: T; /** * The representation of all column objects in the building */ columnsCompound?: T; /** * The representation of all exterior panels on the first floor * of the building */ firstFloorExteriorPanelsCompound?: T; /** * The representation of all interior panels on the first floor * of the building */ firstFloorInteriorPanelsCompound?: T; /** * The representation of all exterior panels on the roof * of the building */ roofExteriorPanelsCompound?: T; /** * The representation of all interior panels on the roof * of the building */ roofInteriorPanelsCompound?: T; /** * The representation of the first roof cover * of the building */ roofCoverFirstCompound?: T; /** * The representation of the second roof cover * of the building */ roofCoverSecondCompound?: T; /** * The representation of the floor * of the building */ floorCompound?: T; /** * The representation of the ceiling * of the building */ ceilingCompound?: T; /** * The representation of stairs */ stairsCompound?: T; } /** * Information needed to draw the part in an optimal way */ declare class ZenHideoutDrawingPart { /** * Shapes that exist in the drawing part, T can represent opancascade geometry, * babylonjs mesh, materials or other things that map to these drawing categories. */ shapes?: ZenHideoutDrawingPartShapes; } /** * The parameter set for the Zen Hideout retreat building. Generic in its value types so the same list can * be expressed for a plain script, where every value is a number, and for a driven model, where a value can * be an expression or a bound input. Concrete DTOs fill those type parameters in; read this class for what * the model is actually shaped by. */ declare class ZenHideoutDtoBase { widthFirstWing: T; lengthFirstWing: T; terraceWidth: T; widthSecondWing: T; lengthSecondWing: T; heightWalls: T; roofAngleFirstWing: T; roofAngleSecondWing: T; roofOffset: T; roofInsideOverhang: T; roofMaxDistAttachmentBeams: T; roofAttachmentBeamWidth: T; roofAttachmentBeamHeight: T; roofOutsideOverhang: T; columnSize: T; ceilingBeamHeight: T; ceilingBeamWidth: T; nrCeilingBeamsBetweenColumns: T; distBetweenColumns: T; floorHeight: T; groundLevel: T; facadePanelThickness: T; windowWidthOffset: T; windowHeightOffset: T; windowFrameThickness: T; windowGlassFrameThickness: T; lod: U; rotation?: T; origin?: V; } declare class ZenHideoutDto implements ZenHideoutDtoBase { constructor(widthFirstWing?: number, lengthFirstWing?: number, terraceWidth?: number, widthSecondWing?: number, lengthSecondWing?: number, heightWalls?: number, roofAngleFirstWing?: number, roofAngleSecondWing?: number, roofOffset?: number, roofInsideOverhang?: number, roofMaxDistAttachmentBeams?: number, roofAttachmentBeamWidth?: number, roofAttachmentBeamHeight?: number, roofOutsideOverhang?: number, columnSize?: number, ceilingBeamHeight?: number, ceilingBeamWidth?: number, nrCeilingBeamsBetweenColumns?: number, distBetweenColumns?: number, floorHeight?: number, groundLevel?: number, facadePanelThickness?: number, windowWidthOffset?: number, windowHeightOffset?: number, windowFrameThickness?: number, windowGlassFrameThickness?: number, lod?: Things.Enums.lodEnum, skinOpacity?: number, rotation?: number, origin?: Inputs.Base.Point3); /** * Width of the first wing of L shaped building * @default 4 * @minimum 3 * @maximum Infinity * @step 0.5 */ widthFirstWing: number; /** * Length of the first wing of L shaped building * @default 10 * @minimum 3 * @maximum Infinity * @step 0.5 */ lengthFirstWing: number; /** * Width of the terrace * @default 3 * @minimum 1 * @maximum Infinity * @step 0.25 */ terraceWidth: number; /** * Width of the second wing of L shaped building * @default 5 * @minimum 3 * @maximum Infinity * @step 0.5 */ widthSecondWing: number; /** * Length of the second wing of L shaped building * @default 10 * @minimum 3 * @maximum Infinity * @step 0.5 */ lengthSecondWing: number; /** * Height of the walls * @default 3 * @minimum 3 * @maximum Infinity * @step 0.1 */ heightWalls: number; /** * Height of the first wing end * @default 15 * @minimum 5 * @maximum Infinity * @step 5 */ roofAngleFirstWing: number; /** * Height of the first wing end * @default 25 * @minimum 5 * @maximum Infinity * @step 5 */ roofAngleSecondWing: number; /** * The offset to be applied to where the roof starts * @default 0.5 * @minimum 0.2 * @maximum Infinity * @step 0.25 */ roofOffset: number; /** * Roof overhang on the inside of the building (where the terrace is) * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.25 */ roofInsideOverhang: number; /** * Roof max distance between top attachment beams * @default 0.8 * @minimum 0.1 * @maximum Infinity * @step 0.25 */ roofMaxDistAttachmentBeams: number; /** * Roof attachment beam width * @default 0.2 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ roofAttachmentBeamWidth: number; /** * Roof attachment beam height * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ roofAttachmentBeamHeight: number; /** * Roof overhang on the inside of the building * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.25 */ roofOutsideOverhang: number; /** * Column size * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ columnSize: number; /** Ceiling beam height * @default 0.25 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ ceilingBeamHeight: number; /** Ceiling beam width * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ ceilingBeamWidth: number; /** Nr ceiling beams between columns * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ nrCeilingBeamsBetweenColumns: number; /** Distance between columns * @default 2 * @minimum 0.5 * @maximum Infinity * @step 0.25 */ distBetweenColumns: number; /** The height of the floor * @default 0.1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ floorHeight: number; /** ground level from the floor * @default 0.6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ groundLevel: number; /** Facade panel thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ facadePanelThickness: number; /** Window width parameter * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowWidthOffset: number; /** Window bottom offset * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowHeightOffset: number; /** Window frame thickness * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowFrameThickness: number; /** Window glass frame thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowGlassFrameThickness: number; /** * Level of detail to compute * @default high */ lod: Things.Enums.lodEnum; /** * The opacity of the skin - only applied if lod is set to high * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ skinOpacity: number; /** * Rotation of the zen hideout * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Origin of the zen hideout * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } /** * The beams of a roof - one named component of an assembled model, carrying its own shapes and any sub- * parts beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class RoofBeamsPart { beamsCeiling?: BeamPart[]; beamsVerticalHigh?: BeamPart[]; beamsVerticalLow?: BeamPart[]; beamsTop?: BeamPart[]; beamsAttachment: BeamPart[]; shapes?: { compound?: T; }; } declare class RoofCoverOneSidedDto { /** * Roof cover name * @default roof-cover */ name: string; /** * Roof angle * @default 15 * @minimum 0 * @maximum Infinity * @step 5 */ roofAngle: number; /** * Roof length * @default 3 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ roofLength: number; /** * Roof width along the angle part, total width contains roof inside and outside overhangs * @default 3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ roofWidth: number; /** * Roof outside overhang * @default 0.5 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ roofOutsideOverhang: number; /** * Roof inside overhang * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ roofInsideOverhang: number; /** * Roof overhang facade * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ roofOverhangFacade: number; /** * Roof thickness * @default 0.05 * @minimum 0.001 * @maximum Infinity * @step 0.01 */ roofThickness: number; /** * Roof cover height * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ roofCoverHeight: number; /** * Rotation of the window * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Level of detail * @default high */ lod: Things.Enums.lodEnum; /** * Origin of the stairs * @default [0, 0, 0] */ center: Inputs.Base.Point3; /** * Direction of the window * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } declare class RoofCoverPart extends RoofCoverOneSidedDto { id?: string; shapes?: { compound?: T; }; } /** * The panels of a roof - one named component of an assembled model, carrying its own shapes and any sub- * parts beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class RoofPanelPart { id?: string; name?: string; innerPanels?: SandwitchPart[]; innerFillPanels?: SandwitchPart[]; outerPanels?: SandwitchPart[]; outerFillPanels?: SandwitchPart[]; ends?: SandwitchPartFlex[]; shapes?: { compoundInnerExteriorPanels?: T; compoundInnerInteriorPanels?: T; compoundInnerFillExteriorPanels?: T; compoundInnerFillInteriorPanels?: T; compoundOuterExteriorPanels?: T; compoundOuterInteriorPanels?: T; compoundOuterFillExteriorPanels?: T; compoundOuterFillInteriorPanels?: T; compoundEndsInteriorPanels?: T; compoundEndsExteriorPanels?: T; compound?: T; }; } /** * A roof, gathering its beams, panels and covers - one named component of an assembled model, * carrying its own shapes and any sub-parts beneath it. Models return their parts rather than a * single fused solid, so a configurator can produce a cutting list, price components individually, * or show and hide them one at a time. */ declare class RoofPart { id?: string; name?: string; beams: RoofBeamsPart; panels?: RoofPanelPart; covers?: RoofCoverPart[]; shapes?: { compound?: T; }; } declare class SandwitchPanelDto { /** Name of the sandwitch panel * @default sandwitch-panel */ name: string; /** Indicates wether a window should be created * @default true */ createWindow: boolean; /** Indicates wether the inner panel should be created * @default true */ createInnerPanel: boolean; /** Indicates wether the exterior panel should be created * @default true */ createExteriorPanel: boolean; /** Wall thickness * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ wallWidth: number; /** Exterior panel width * @default 0.4 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ exteriorPanelWidth: number; /** Exterior panel height * @default 3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ exteriorPanelHeight: number; /** Exterior panel thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ exteriorPanelThickness: number; /** Exterior panel bottom offset * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ exteriorPanelBottomOffset: number; /** Interior panel width * @default 0.4 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ interiorPanelWidth: number; /** Interior panel height * @default 3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ interiorPanelHeight: number; /** Interior panel thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ interiorPanelThickness: number; /** Interior panel bottom offset * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ interiorPanelBottomOffset: number; /** Window width parameter * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowWidthOffset: number; /** Window bottom offset * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowHeightOffset: number; /** Window frame thickness * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowFrameThickness: number; /** Window glass frame thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowGlassFrameThickness: number; } declare class SandwitchPanelFlexDto { /** Name of the sandwitch panel * @default sandwitch-panel */ name: string; /** Indicates wether a window should be created * @default true */ createInteriorPanel: boolean; /** Indicates wether the exterior panel should be created * @default true */ createExteriorPanel: boolean; /** Wall thickness * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ wallWidth: number; /** Exterior panel thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ exteriorPanelThickness: number; /** Interior panel thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ interiorPanelThickness: number; /** * Interior wall panel polygon points * @default [] */ interiorPanelPolygonPoints: Inputs.Base.Point2[]; /** * Exterior wall panel polygon points * @default [] */ exteriorPanelPolygonPoints: Inputs.Base.Point2[]; } declare class SandwitchPart extends SandwitchPanelDto { id?: string; rotation?: number; center?: Inputs.Base.Point3; direction?: Inputs.Base.Vector3; windows?: WindowRectangularPart[]; shapes?: { panelExterior?: T; panelInterior?: T; compound?: T; }; } declare class SandwitchPartFlex extends SandwitchPanelFlexDto { id?: string; rotation?: number; center?: Inputs.Base.Point3; direction?: Inputs.Base.Vector3; windows?: WindowRectangularPart[]; shapes?: { panelExterior?: T; panelInterior?: T; compound?: T; }; } declare class WindowCornerDto { /** Wall thickness * @default 0.4 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ wallThickness: number; /** Facade panel thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ facadePanelThickness: number; /** Glass frame thickness * @default 0.02 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ glassFrameThickness: number; /** Glass thickness * @default 0.005 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassThickness: number; /** Frame thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ frameThckness: number; /** Window height * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ height: number; /** Length first window * @default 1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ lengthFirst: number; /** Length second window * @default 1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ lengthSecond: number; /** * Rotation of the window * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin of the stairs * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } declare class WindowPartShapes { /** * Cutout of the window - this can be used to make the hole in the wall and usually should not be * visualised */ cutout?: T; /** * Shape of the glass of the window */ glass?: T; /** * Glass frame of the window */ glassFrame?: T; /** * Frame of the window that usually is as thick as the wall and that touches glass frame */ frame?: T; /** * Compounded shape of the window with all other shapes joined together */ compound?: T; } declare class WindowRectangularPart extends WindowRectangularDto { /** * The name of the window part */ name: string; /** * The unique id of the window part */ id?: string; /** * Generic shapes that represent the window part */ shapes?: WindowPartShapes; } declare class WindowCornerPart extends WindowCornerDto { /** * The name of the window part */ name: string; /** * The unique id of the window part */ id?: string; /** * Generic shapes that represent the window part */ shapes?: WindowPartShapes; } declare class WindowRectangularDto { /** Window thickness * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ thickness: number; /** Glass frame thickness * @default 0.02 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ glassFrameThickness: number; /** Glass thickness * @default 0.005 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassThickness: number; /** Frame thickness * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ frameThickness: number; /** Window height * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ height: number; /** Width first window * @default 1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ width: number; /** * Rotation of the window * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin of the stairs * @default [0, 0, 0] */ center: Inputs.Base.Point3; /** * Direction of the window * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } } /** * Models aimed at younger makers and at beginners: simple to understand, quick to print, * and short enough to read end to end as an example. */ declare namespace KidsCorner { /** * Parametric birdhouse models. */ declare namespace BirdHouses { /** * Wingtip Villa - a birdhouse with a swept roof. Entrance diameter, wall thickness and * overall size are parameters, so it can be tuned to a species and to a printer. */ declare namespace WingtipVilla { /** * What building the Wingtip Villa birdhouse returns: a type tag, the model name, the exact inputs it was * built from, and the resulting shapes. Keeping the inputs alongside the geometry is what lets a * configurator rebuild or re-price an order later from the result alone. */ declare class WingtipVillaData { type: string; name: string; compound?: T; roof: { compound: T; shapes: T[]; }; walls: { compound: T; shapes: T[]; }; stick: { shape: T; }; floor: { shape: T; }; chimney: { shape: T; }; basicPoints: { kind: string; point: Inputs.Base.Point3; }[]; } declare class WingtipVillaDto { constructor(interiorWidth?: number, interiorLength?: number, interiorHeight?: number, thickness?: number, holeDiameter?: number, holeDistToBottom?: number, stickLength?: number, stickDiameter?: number, baseAttachmentHeight?: number, roofOverhang?: number, rotation?: number, chimneyHeight?: number, origin?: Inputs.Base.Point3); /** * Width of the house * @default 3 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorWidth: number; /** * Interior length of the house * @default 3 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorLength: number; /** * Interior height that goes from the floor to where the roof starts * @default 5 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorHeight: number; /** * thickness of the house * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ thickness: number; /** * hole diameter of the house * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ holeDiameter: number; /** * hole distance to the bottom of the house * @default 2.5 * @minimum 0 * @maximum Infinity * @step 0.5 */ holeDistToBottom: number; /** * stick length * @default 1.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ stickLength: number; /** * stick diameter * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ stickDiameter: number; /** * base attachment height * @default 2 * @minimum 0 * @maximum Infinity * @step 0.5 */ baseAttachmentHeight: number; /** * roof overhang * @default 1 * @minimum 0 * @maximum Infinity * @step 0.5 */ roofOverhang: number; /** * Rotation of the bird house around the origin. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Chimney height * @default 1 * @minimum 0 * @maximum Infinity * @step 0.5 */ chimneyHeight: number; /** * Origin of the bird house (where the bird house would be attached to the tree or the wall) * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } } /** * Chirpy Chalet - a chalet-style birdhouse with a pitched roof and an overhang, built from * profile curves that are lofted into a solid. */ declare namespace ChirpyChalet { /** * What building the Chirpy Chalet birdhouse returns: a type tag, the model name, the exact inputs it was * built from, and the resulting shapes. Keeping the inputs alongside the geometry is what lets a * configurator rebuild or re-price an order later from the result alone. */ declare class ChirpyChaletData { type: string; name: string; compound?: T; roof: { compound: T; shapes: T[]; }; walls: { compound: T; shapes: T[]; }; stick: { shape: T; }; floor: { shape: T; }; basicPoints: { kind: string; point: Inputs.Base.Point3; }[]; } declare class ChirpyChaletDto { constructor(interiorWidth?: number, interiorLength?: number, interiorHeight?: number, thickness?: number, holeDiameter?: number, holeDistToBottom?: number, stickLength?: number, stickDiameter?: number, baseAttachmentHeight?: number, roofOverhang?: number, roofAngle?: number, rotation?: number, origin?: Inputs.Base.Point3); /** * Width of the house * @default 3 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorWidth: number; /** * Interior length of the house * @default 3 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorLength: number; /** * Interior height that goes from the floor to where the roof starts * @default 5 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorHeight: number; /** * thickness of the house * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ thickness: number; /** * hole diameter of the house * @default 1.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ holeDiameter: number; /** * hole distance to the bottom of the house * @default 2.5 * @minimum 0 * @maximum Infinity * @step 0.5 */ holeDistToBottom: number; /** * stick length * @default 0.9 * @minimum 0 * @maximum Infinity * @step 0.1 */ stickLength: number; /** * stick diameter * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ stickDiameter: number; /** * base attachment height * @default 2 * @minimum 0 * @maximum Infinity * @step 0.5 */ baseAttachmentHeight: number; /** * roof overhang * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.5 */ roofOverhang: number; /** * roof overhang * @default 20 * @minimum 0 * @maximum 80 * @step 5 */ roofAngle: number; /** * Rotation of the bird house around the origin. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Origin of the bird house (where the bird house would be attached to the tree or the wall) * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } } } } /** * Models designed to be printed: closed, watertight solids with wall thicknesses and * overhangs chosen so they slice cleanly. */ declare namespace ThreeDPrinting { /** * Parametric vases. */ declare namespace Vases { /** * Serenity Swirl - a vase whose wall twists as it rises. Height, twist, wall thickness and * the number of lobes are parameters. */ declare namespace SerenitySwirl { /** * What building the Serenity Swirl vase, whose wall twists as it rises returns: a type tag, the model name, * the exact inputs it was built from, and the resulting shapes. Keeping the inputs alongside the geometry * is what lets a configurator rebuild or re-price an order later from the result alone. */ declare class SerenitySwirlData { type: string; name: string; compound?: T; } declare class SerenitySwirlDto { constructor(swirl?: number, nrOfDivisions?: number, addRadiusNarrow?: number, addRadiusWide?: number, addMiddleHeight?: number, addTopHeight?: number, thickness?: number, rotation?: number, origin?: Inputs.Base.Point3); /** * Swirl 0 - no swirl 1 max swirl * @default 0.6 * @minimum 0 * @maximum 1 * @step 0.1 */ swirl: number; /** * Nr of divisions * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrOfDivisions: number; /** * Add to narrow radius * @default 0.4 * @minimum 0 * @maximum Infinity * @step 0.1 */ addRadiusNarrow: number; /** * Add to radius wide * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ addRadiusWide: number; /** * Add to middle height * @default 1.6 * @minimum 0 * @maximum Infinity * @step 0.1 */ addMiddleHeight: number; /** * Add to top height * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ addTopHeight: number; /** * Thickness of the vase on the widest part * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ thickness: number; /** * Rotation of the serenity swirl * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Origin of the vase * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } } /** * Arabic Archway - a vase built from repeated arch profiles, showing how a pattern of * curves becomes a shelled solid. */ declare namespace ArabicArchway { declare class ArabicArchwayData { /** * Type of the object being configured */ type: string; /** * Default name of the object */ name: string; /** * Compound shape of all the parts */ compound?: T; /** * Original inputs */ originalInputs: ArabicArchwayDto; /** * All the shapes of the vase */ shapes?: Models.OCCT.ShapeWithId[]; /** * Representation of arabic archway parts that are useful for drawing the object efficiently */ drawingPart?: ArabicArchwayDrawingPart; } declare class ArabicArchwayDrawingPartShapes { /** * The representation of all objects in the vase */ compound?: T; /** * The representation of all vase part objects in the vase */ vasePartsCompound?: T; /** * The representation of all glass objects in the vase */ glassPartsCompound?: T; /** * The representation of the base of the vase */ vaseBaseCompound?: T; } /** * Information needed to draw the part in an optimal way */ declare class ArabicArchwayDrawingPart { /** * Shapes that exist in the drawing part, T can represent opancascade geometry, * babylonjs mesh, materials or other things that map to these drawing categories. */ shapes?: ArabicArchwayDrawingPartShapes | { [x: string]: T; }; } /** * The parameter set for the Arabic Archway vase, built from repeated arch profiles. Generic in its value * types so the same list can be expressed for a plain script, where every value is a number, and for a * driven model, where a value can be an expression or a bound input. Concrete DTOs fill those type * parameters in; read this class for what the model is actually shaped by. */ declare class ArabicArchwayDtoBase { profilePoints?: P; nrOfSides: T; nrOfVerticalArches: T; thickness: T; edgesThickness: T; archCenterThickness: T; baseHeight: T; patchHoles: B; lod?: U; rotation?: T; direction?: V; scale?: V; origin?: V; } declare class ArabicArchwayDto implements ArabicArchwayDtoBase { constructor(nrOfSides?: number, nrOfVerticalArches?: number, archCenterThickness?: number, edgesThickness?: number, thickness?: number, baseHeight?: number, patchHoles?: boolean, lod?: Things.Enums.lodEnum, rotation?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Point3, scale?: Inputs.Base.Vector3); /** * nr of sides for arabic archway vase * @default [[2, 0, 0],[4, 5, 0],[1.5, 10, 0],[2, 14, 0]] */ profilePoints: Inputs.Base.Point3[]; /** * nr of sides for arabic archway vase * @default 3 * @minimum 3 * @maximum 30 * @step 1 */ nrOfSides: number; /** * nr of vertical arches * @default 6 * @minimum 2 * @maximum 30 * @step 1 */ nrOfVerticalArches: number; /** * Arch center thickness * @default 0.8 * @minimum 0 * @maximum 10 * @step 0.1 */ archCenterThickness: number; /** * Edges thickness * @default 0.2 * @minimum 0 * @maximum 10 * @step 0.1 */ edgesThickness: number; /** * Thickness of the vase on the widest part * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ thickness: number; /** * Indicates how high the base should be, if 0 then no base will be made * @default 0.4 * @minimum 0 * @maximum 10 * @step 0.1 */ baseHeight: number; /** * Indicates whether holes of the vase should be patched * @default true */ patchHoles: boolean; /** * Level of details for the model * @default high */ lod: Things.Enums.lodEnum; /** * Rotation of the serenity swirl * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Origin of the vase * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the vase * @default [0, 1, 0] */ direction: Inputs.Base.Point3; /** * Scale of the vase * @default [1, 1, 1] */ scale: Inputs.Base.Vector3; } } } /** * Parametric cups and mugs. */ declare namespace Cups { /** * Calm Cup - a simple parametric cup. Diameter, height, wall and base thickness are exposed, * and the result is shelled so it holds liquid. */ declare namespace CalmCup { /** * What building the Calm Cup, a shelled parametric cup with handles returns: a type tag, the model name, * the exact inputs it was built from, and the resulting shapes. Keeping the inputs alongside the geometry * is what lets a configurator rebuild or re-price an order later from the result alone. */ declare class CalmCupData { type: string; name: string; originalInputs: CalmCupDto; compound?: T; } /** * The parameter set for the Calm Cup, a shelled parametric cup with handles. Generic in its value types so * the same list can be expressed for a plain script, where every value is a number, and for a driven model, * where a value can be an expression or a bound input. Concrete DTOs fill those type parameters in; read * this class for what the model is actually shaped by. */ declare class CalmCupDtoBase { height: T; radiusBottom: T; radiusTopOffset: T; thickness: T; fillet: T; nrOfHandles: T; handleDist: T; precision: T; rotation?: T; scale?: T; origin?: U; direction?: U; } declare class CalmCupDto implements CalmCupDtoBase { constructor(height?: number, radiusBottom?: number, radiusTopOffset?: number, thickness?: number, fillet?: number, nrOfHandles?: number, handleDist?: number, precision?: number, rotation?: number, scale?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3); /** * Height of the cup * @default 6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ height: number; /** * Radius top offset * @default 4 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusBottom: number; /** * Radius top offset * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusTopOffset: number; /** * Thickness of the cup * @default 0.6 * @minimum 0.05 * @maximum 3 * @step 0.01 */ thickness: number; /** * Fillet of the cup * @default 0.2 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ fillet: number; /** * Nr of handles, 0 will create a cup without handles * @default 1 * @minimum 0 * @maximum 2 * @step 1 */ nrOfHandles: number; /** * Handle distance from the cup * @default 2 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ handleDist: number; /** * Meshing precision of the drawn model. Scale scales precision as well. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Rotation of the cup * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Scale of the cup - affects edge width and precision * @default 1 * @minimum 0 * @maximum Infinity * @step 10 */ scale: number; /** * Origin of the medal * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } } /** * Dragon Cup - a cup with a scaled surface pattern applied to its body, showing how a * pattern is wrapped onto a curved surface and then made solid. */ declare namespace DragonCup { /** * What building the Dragon Cup, a cup carrying a scaled surface pattern returns: a type tag, the model * name, the exact inputs it was built from, and the resulting shapes. Keeping the inputs alongside the * geometry is what lets a configurator rebuild or re-price an order later from the result alone. */ declare class DragonCupData { type: string; name: string; originalInputs: DragonCupDto; compound?: T; } /** * The parameter set for the Dragon Cup, a cup carrying a scaled surface pattern. Generic in its value types * so the same list can be expressed for a plain script, where every value is a number, and for a driven * model, where a value can be an expression or a bound input. Concrete DTOs fill those type parameters in; * read this class for what the model is actually shaped by. */ declare class DragonCupDtoBase { height: T; radiusBottom: T; radiusTopOffset: T; radiusMidOffset: T; rotationMidAngle: T; rotationTopAngle: T; thickness: T; bottomThickness: T; nrSkinCellsHorizontal: T; nrSkinCellsVertical: T; nrSkinCellDivisionsTop: T; nrSkinCellDivisionsBottom: T; skinCellOuterHeight: T; skinCellInnerHeight: T; skinCellBottomHeight: T; skinCellTopHeight: T; precision: T; rotation?: T; scale?: T; origin?: U; direction?: U; } declare class DragonCupDto implements DragonCupDtoBase { constructor(height?: number, radiusBottom?: number, radiusTopOffset?: number, radiusMidOffset?: number, rotationTopAngle?: number, rotationMidAngle?: number, nrSkinCellsVertical?: number, nrSkinCellsHorizontal?: number, nrSkinCellDivisionsTop?: number, nrSkinCellDivisionsBottom?: number, skinCellOuterHeight?: number, skinCellInnerHeight?: number, skinCellBottomHeight?: number, skinCellTopHeight?: number, thickness?: number, bottomThickness?: number, precision?: number, rotation?: number, scale?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3); /** * Height of the cup * @default 6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ height: number; /** * Radius top offset * @default 4 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusBottom: number; /** * Radius top offset * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusTopOffset: number; /** * Radius middle offset * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusMidOffset: number; /** * Rotation of the top from the middle (angle in degrees) * @default 20 * @minimum -90 * @maximum 90 * @step 1 */ rotationTopAngle: number; /** * Rotation of the middle from the bottom (angle in degrees) * @default 20 * @minimum -90 * @maximum 90 * @step 1 */ rotationMidAngle: number; /** * Nr of skin cells along vertical direction * @default 5 * @minimum 1 * @maximum Infinity * @step 1 */ nrSkinCellsVertical: number; /** * Nr of skin cells along horizontal direction * @default 10 * @minimum 3 * @maximum Infinity * @step 1 */ nrSkinCellsHorizontal: number; /** * Nr of skin cell divisions on the top of the cup * @default 1 * @minimum 1 * @maximum Infinity * @step 1 */ nrSkinCellDivisionsTop: number; /** * Nr of skin cell divisions on the bottom of the cup * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ nrSkinCellDivisionsBottom: number; /** * skin cell outer height * @default 0.4 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ skinCellOuterHeight: number; /** * skin cell inner height * @default 0.3 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ skinCellInnerHeight: number; /** * skin cell bottom height * @default 0.4 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ skinCellBottomHeight: number; /** * skin cell top height * @default 0.4 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ skinCellTopHeight: number; /** * Thickness of the cup * @default 0.6 * @minimum 0.05 * @maximum Infinity * @step 0.01 */ thickness: number; /** * Bottom thickness of the cup * @default 1 * @minimum 0.05 * @maximum Infinity * @step 0.01 */ bottomThickness: number; /** * Meshing precision of the drawn model. Scale scales precision as well. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Rotation of the cup * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Scale of the cup - affects edge width and precision * @default 1 * @minimum 0 * @maximum Infinity * @step 10 */ scale: number; /** * Origin of the medal * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } declare class DragonCupModelDto { /** * The model that represents result of the dragon cup * @default undefined */ model: DragonCupData; } } } /** * Parametric boxes and containers. */ declare namespace Boxes { /** * Spicy Box - a small lidded container. Internal dimensions, wall thickness and the lid fit * tolerance are parameters, so it can be tuned to a specific printer. */ declare namespace SpicyBox { /** * What building the Spicy Box, a small lidded container returns: a type tag, the model name, the exact * inputs it was built from, and the resulting shapes. Keeping the inputs alongside the geometry is what * lets a configurator rebuild or re-price an order later from the result alone. */ declare class SpicyBoxData { type: string; name: string; originalInputs: SpicyBoxDto; compound?: T; } /** * The parameter set for the Spicy Box, a small lidded container. Generic in its value types so the same * list can be expressed for a plain script, where every value is a number, and for a driven model, where a * value can be an expression or a bound input. Concrete DTOs fill those type parameters in; read this class * for what the model is actually shaped by. */ declare class SpicyBoxDtoBase { textTop: V; textFront: V; height: T; coverHeight: T; baseHeight: T; radiusBase: T; radiusOffset: T; thickness: T; ornamentalThickness: T; nrOrnamnetsPerSide: T; invertOrnaments: Z; fillet: T; nrSides: T; nrOffsets: T; precision: T; rotation?: T; scale?: T; origin?: U; direction?: U; } declare class SpicyBoxDto implements SpicyBoxDtoBase { constructor(textTop?: string, textFront?: string, nrSides?: number, nrOffsets?: number, height?: number, coverHeight?: number, baseHeight?: number, radiusBottom?: number, radiusTopOffset?: number, thickness?: number, ornamentalThickness?: number, nrOrnamnetsPerSide?: number, invertOrnaments?: boolean, fillet?: number, precision?: number, rotation?: number, scale?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3); /** * Text on the top of the box * @default Pepper */ textTop: string; /** * Text on the front of the box * @default For Your Spicy Needs */ textFront: string; /** * Nr of sides of the box * @default 4 * @minimum 3 * @maximum 16 * @step 1 */ nrSides: number; /** * Nr vertical offsets * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ nrOffsets: number; /** * Height of the cup * @default 6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ height: number; /** * Radius top offset * @default 4 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusBase: number; /** * Radius top offset * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusOffset: number; /** * Cover height * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ coverHeight: number; /** * Base height * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ baseHeight: number; /** * Thickness of the cup * @default 0.6 * @minimum 0.05 * @maximum Infinity * @step 0.01 */ thickness: number; /** * Ornamental thickness * @default 0.1 * @minimum 0.05 * @maximum Infinity * @step 0.01 */ ornamentalThickness: number; /** * Ornamental thickness * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrOrnamnetsPerSide: number; /** * Inverst the ornaments * @default false */ invertOrnaments: boolean; /** * Fillet of the cup * @default 0.2 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ fillet: number; /** * Meshing precision of the drawn model. Scale scales precision as well. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Rotation of the cup * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Scale of the cup - affects edge width and precision * @default 1 * @minimum 0 * @maximum Infinity * @step 10 */ scale: number; /** * Origin of the medal * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } declare class SpicyBoxModelDto { /** * The model that represents result of the spicy box * @default undefined */ model: SpicyBoxData; } } } /** * Parametric medals and coins. */ declare namespace Medals { /** * Eternal Love - a medal with an engraved relief, showing text and pattern engraving on a * curved face. */ declare namespace EternalLove { /** * What building the Eternal Love medal, a disc with an engraved relief returns: a type tag, the model name, * the exact inputs it was built from, and the resulting shapes. Keeping the inputs alongside the geometry * is what lets a configurator rebuild or re-price an order later from the result alone. */ declare class EternalLoveData { type: string; name: string; originalInputs: EternalLoveDto; compound?: T; } /** * The parameter set for the Eternal Love medal, a disc with an engraved relief. Generic in its value types * so the same list can be expressed for a plain script, where every value is a number, and for a driven * model, where a value can be an expression or a bound input. Concrete DTOs fill those type parameters in; * read this class for what the model is actually shaped by. */ declare class EternalLoveDtoBase { textHeading: T; textName: T; fullModel: B; thickness: U; decorationThickness: U; rotation?: U; origin?: V; direction?: V; } declare class EternalLoveDto implements EternalLoveDtoBase { constructor(textHeading?: string, textName?: string, fullModel?: boolean, thickness?: number, decorationThickness?: number, rotation?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3); /** * The head text * @default LOVE YOU */ textHeading: string; /** * Name of the person * @default NORA */ textName: string; /** * Choose whether to produce half of the model (better for 3d printing) or full model with two sides * @default true */ fullModel: boolean; /** * Thickness of the model * @default 6 * @minimum 0.5 * @maximum 20 * @step 0.1 */ thickness: number; /** * Additional thickness of the decorations * @default 1 * @minimum 0.1 * @maximum 3 * @step 0.1 */ decorationThickness: number; /** * Rotation of the erenal love medal * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Origin of the medal * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } } } /** * Desk accessories. */ declare namespace Desktop { /** * Phone Nest - a desk stand whose cradle angle, phone thickness and footprint are parameters, * so it fits a specific device rather than an average one. */ declare namespace PhoneNest { declare class PhoneNestData { type: string; /** * The name of the model */ name: string; /** * Original inputs that were used to create the model */ originalInputs: PhoneNestDto; /** * Compound shape of the table geometry */ compound?: T; /** * Representation of table parts that are useful for drawing the object efficiently */ drawingPart?: PhoneNestDrawingPart; /** * Data that contains information and shapes of the top part of the table */ mainPart?: PhoneNestMainPart; /** * All the shapes of the vase */ shapes?: Models.OCCT.ShapeWithId[]; } declare class PhoneNestDrawDto { /** * Main material * @defaul undefined * @optional true */ mainMaterial?: T; /** * Phone material * @defaul undefined * @optional true */ phoneMaterial?: T; /** * You can turn off drawing of faces via this property * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Hex colour string for the edges * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Edge width * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * This defines useful compounded objects for representing model in optimal and fast way. */ declare class PhoneNestDrawingPartShapes { /** * The representation of main part of the table */ main?: T; /** * The representation of the glass of the table */ phone?: T; } /** * Information needed to draw the part in an optimal way */ declare class PhoneNestDrawingPart extends Part { /** * Shapes that exist in the drawing part, T can represent opancascade geometry, * babylonjs mesh, materials or other things that map to these drawing categories. */ shapes?: PhoneNestDrawingPartShapes; } /** * The parameter set for the Phone Nest desk stand. Generic in its value types so the same list can be * expressed for a plain script, where every value is a number, and for a driven model, where a value can be * an expression or a bound input. Concrete DTOs fill those type parameters in; read this class for what the * model is actually shaped by. */ declare class PhoneNestDtoBase { heightBottom: T; heightTop: T; widthBack: T; widthFront: T; length: T; backOffset: T; thickness: T; filletRadius: T; applyOrnaments: B; phoneHeight: T; phoneWidth: T; phoneThickness: T; precision: T; rotation?: T; scale?: T; origin?: U; direction?: U; } declare class PhoneNestDto implements PhoneNestDtoBase { constructor(heightBottom?: number, heightTop?: number, widthBack?: number, widthFront?: number, length?: number, backOffset?: number, thickness?: number, applyOrnaments?: boolean, filletRadius?: number, phoneHeight?: number, phoneWidth?: number, phoneThickness?: number, precision?: number, drawEdges?: boolean, rotation?: number, scale?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3); /** * Height of the phone holder at the bottom * @default 5 * @minimum 0 * @maximum Infinity * @step 0.01 */ heightBottom: number; /** * Height of the phone holder at the top * @default 16 * @minimum 0 * @maximum Infinity * @step 0.1 */ heightTop: number; /** * Width of the phone holder on the back * @default 25 * @minimum 0 * @maximum Infinity * @step 0.1 */ widthBack: number; /** * Width of the phone holder on the front and holder * @default 10 * @minimum 0 * @maximum Infinity * @step 0.1 */ widthFront: number; /** * Length of the holder base * @default 16 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * The back offset * @default 6 * @minimum 0 * @maximum Infinity * @step 0.1 */ backOffset: number; /** * The thickness of the table * @default 0.4 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ thickness: number; /** * Apply final ornaments * @default false */ applyOrnaments: boolean; /** * The radius of the fillet * @default 2 * @minimum 0.001 * @maximum Infinity * @step 0.1 */ filletRadius: number; /** * The height of the phone * @default 16.8 * @minimum 0 * @maximum Infinitypho * @step 0.01 */ phoneHeight: number; /** * The width of the phone * @default 7.8 * @minimum 0 * @maximum Infinity * @step 0.01 */ phoneWidth: number; /** * The thickness of the phone * @default 0.7 * @minimum 0 * @maximum Infinity * @step 0.01 */ phoneThickness: number; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Rotation of the table in degrees * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Scale of the table * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Origin of the medal * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } declare class PhoneNestModelDto { /** * The model that represents result of the good coffee table create operation * @default undefined */ model: PhoneNestData; } /** * The cradle body of the Phone Nest - one named component of an assembled model, carrying its own shapes * and any sub-parts beneath it. Models return their parts rather than a single fused solid, so a * configurator can produce a cutting list, price components individually, or show and hide them one at a * time. */ declare class PhoneNestMainPart extends Part { shapes?: { phone?: T; main?: T; compound?: T; }; } } } } /** * Models made from flat sheet, produced as 2D cut profiles rather than as printed solids. */ declare namespace LaserCutting { /** * Small laser-cut gadgets. */ declare namespace Gadgets { /** * Droplets Phone Holder - a phone stand assembled from laser-cut flat parts, showing how a * 3D assembly is unfolded into cut profiles with the correct slot tolerances. */ declare namespace DropletsPhoneHolder { declare class DropletsPhoneHolderData { /** * Type of the object being configured */ type: string; /** * Default name of the object */ name: string; /** * Compound shape of all the parts */ compound?: T; /** * Original inputs */ originalInputs: DropletsPhoneHolderDto; /** * All the shapes of the vase */ shapes?: Models.OCCT.ShapeWithId[]; /** * Representation of arabic archway parts that are useful for drawing the object efficiently */ drawingPart?: DropletsPhoneHolderDrawingPart; } declare class DropletsPhoneHolderDrawingPartShapes { /** * The representation of all the objects in the phone holder, including all wires */ compound?: T; /** * The representation of 3D model of the phone holder */ phoneHolderCompound?: T; /** * The representation of all cut wires */ cutWiresCompound?: T; /** * The representation of the engraving wires */ engravingWiresCompound?: T; } /** * Information needed to draw the part in an optimal way */ declare class DropletsPhoneHolderDrawingPart { /** * Shapes that exist in the drawing part, T can represent opancascade geometry, * babylonjs mesh, materials or other things that map to these drawing categories. */ shapes?: DropletsPhoneHolderDrawingPartShapes | { [x: string]: T; }; } /** * The parameter set for the Droplets Phone Holder, assembled from laser-cut flat parts. Generic in its * value types so the same list can be expressed for a plain script, where every value is a number, and for * a driven model, where a value can be an expression or a bound input. Concrete DTOs fill those type * parameters in; read this class for what the model is actually shaped by. */ declare class DropletsPhoneHolderDtoBase { title?: S; subtitle: S; includeLogo: B; thickness: T; kerf: T; phoneWidth: T; phoneHeight: T; phoneThickness: T; backLength: T; angle: T; offsetAroundPhone: T; penShelf: T; phoneLockHeight: T; filletRadius: T; includePattern: B; densityPattern: T; holesForWire: B; wireInputThickness: T; includeModel: B; includeDrawings: B; spacingDrawings: T; rotation?: T; direction?: V; scale?: V; origin?: V; } declare class DropletsPhoneHolderDto implements DropletsPhoneHolderDtoBase { constructor(title?: string, subtitle?: string, includeLogo?: boolean, thickness?: number, kerf?: number, phoneWidth?: number, phoneHeight?: number, phoneThickness?: number, backLength?: number, angle?: number, offsetAroundPhone?: number, penShelf?: number, phoneLockHeight?: number, filletRadius?: number, includePattern?: boolean, densityPattern?: number, holesForWire?: boolean, wireInputThickness?: number, includeModel?: boolean, includeDrawings?: boolean, spacingDrawings?: number, rotation?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Point3, scale?: Inputs.Base.Vector3); /** * Title of the phone holder * @default Your Name */ title: string; /** * Subtitle of the phone holder * @default And Message */ subtitle: string; /** * Include the logo * @default true */ includeLogo: boolean; /** * Thickness of the phone holder * @default 0.4 * @minimum 0 * @maximum Infinity * @step 0.1 */ thickness: number; /** * Kerf value for the laser cutting of joints * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.001 */ kerf: number; /** * Width of the phone * @default 8 * @minimum 4 * @maximum Infinity * @step 0.1 */ phoneWidth: number; /** * Height of the phone * @default 16 * @minimum 4 * @maximum Infinity * @step 0.1 */ phoneHeight: number; /** * Thickness of the phone * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ phoneThickness: number; /** * Length of the back * @default 10 * @minimum 5 * @maximum Infinity * @step 0.1 */ backLength: number; /** * Angle of the back * @default 20 * @minimum 0 * @maximum 60 * @step 1 */ angle: number; /** * Offset around the phone * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ offsetAroundPhone: number; /** * Pen shelf * @default 1 * @minimum 0.5 * @maximum Infinity * @step 0.1 */ penShelf: number; /** * Phone lock height * @default 2 * @minimum 0.5 * @maximum Infinity * @step 0.1 */ phoneLockHeight: number; /** * Fillet radius * @default 0.3 * @minimum 0.1 * @maximum 0.4 * @step 0.1 */ filletRadius: number; /** * Include pattern * @default false */ includePattern: boolean; /** * Density of the pattern * @default 0.4 * @minimum 0 * @maximum 2 * @step 0.1 */ densityPattern: number; /** * Include pattern * @default true */ holesForWire: boolean; /** * Wire input thickness * @default 1.5 * @minimum 0.7 * @maximum Infinity * @step 0.1 */ wireInputThickness: number; /** * Include 3D model * @default true */ includeModel: boolean; /** * Include drawings * @default true */ includeDrawings: boolean; /** * Spacing of the drawings * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ spacingDrawings: number; /** * Rotation of the model * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Origin of the model * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Point3; /** * Scale of the model * @default [1, 1, 1] */ scale: Inputs.Base.Vector3; } declare class DropletsPhoneHolderModelDto { /** * The model that represents result of the model * @default undefined */ model: DropletsPhoneHolderData; } declare class DropletsPhoneHolderModelDxfDto { /** * The model that represents result of the model * @default undefined */ model: DropletsPhoneHolderData; /** * The laser cut wires color * @default #000000 */ cutWiresColor: Inputs.Base.Color; /** * The laser engraving wires color * @default #0000ff */ engravingWiresColor: Inputs.Base.Color; /** * The file name * @default bitbybit-droplets-phone-holder */ fileName: string; /** * The angular deflection * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ angularDeflection: number; /** * The curvature deflection * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.001 */ curvatureDeflection: number; /** * Minimum of points * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ minimumOfPoints: number; /** * U tolerance * @default 1.0e-9 * @minimum 0 * @maximum Infinity * @step 1.0e-9 */ uTolerance: number; /** * Minimum length * @default 1.0e-7 * @minimum 0 * @maximum Infinity * @step 1.0e-7 */ minimumLength: number; } declare class DropletsPhoneHolderModelStepDto { /** * The model that represents result of the model * @default undefined */ model: DropletsPhoneHolderData; /** * The file name * @default bitbybit-droplets-phone-holder */ fileName: string; /** * Adjust Y to Z axis * @default true */ adjustYZ: boolean; } } } } /** * Furniture models - the largest of the finished-model families, and the closest to what a * real made-to-measure configurator needs. */ declare namespace Furniture { /** * Parametric chairs. */ declare namespace Chairs { /** * Snake Chair - a chair whose seat and back are one continuous swept surface. Seat height, * width and the sweep profile are parameters. */ declare namespace SnakeChair { declare class SnakeChairData { type: string; /** * The name of the model */ name: string; /** * Original inputs that were used to create the model */ originalInputs: SnakeChairDto; /** * Compound shape of the table geometry */ compound?: T; /** * Representation of table parts that are useful for drawing the object efficiently */ drawingPart?: SnakeChairDrawingPart; /** * Data that contains information and shapes of the top part of the table */ mainPart?: SnakeChairMainPart; /** * All the shapes of the vase */ shapes?: Models.OCCT.ShapeWithId[]; } declare class SnakeChairDrawDto { /** * Main material * @defaul undefined * @optional true */ mainMaterial?: T; /** * You can turn off drawing of faces via this property * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Hex colour string for the edges * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Edge width * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * This defines useful compounded objects for representing model in optimal and fast way. */ declare class SnakeChairDrawingPartShapes { /** * The representation of main part of the chair */ main?: T; } /** * Information needed to draw the part in an optimal way */ declare class SnakeChairDrawingPart extends Part { /** * Shapes that exist in the drawing part, T can represent opancascade geometry, * babylonjs mesh, materials or other things that map to these drawing categories. */ shapes?: SnakeChairDrawingPartShapes; } /** * The parameter set for the Snake Chair, whose seat and back are one swept surface. Generic in its value * types so the same list can be expressed for a plain script, where every value is a number, and for a * driven model, where a value can be an expression or a bound input. Concrete DTOs fill those type * parameters in; read this class for what the model is actually shaped by. */ declare class SnakeChairDtoBase { sittingHeight: T; backRestOffset: T; backRestHeight: T; width: T; length: T; thickness: T; ornamentDepth: T; nrOrnamentPlanks: T; filletRadius: T; precision: T; rotation?: T; scale?: T; origin?: U; direction?: U; } declare class SnakeChairDto implements SnakeChairDtoBase { constructor(sittingHeight?: number, backRestOffset?: number, backRestHeight?: number, width?: number, length?: number, thickness?: number, nrOrnamentPlanks?: number, ornamentDepth?: number, filletRadius?: number, precision?: number, drawEdges?: boolean, rotation?: number, scale?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3); /** * Height of the sitting area * @default 0.45 * @minimum 0.1 * @maximum Infinity * @step 0.01 */ sittingHeight: number; /** * Sitting top offset from perpendicular ending of the chair * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ backRestOffset: number; /** * Height of the back rest * @default 0.7 * @minimum 0.1 * @maximum Infinity * @step 0.01 */ backRestHeight: number; /** * Width of the table * @default 0.45 * @minimum 0 * @maximum Infinity * @step 0.01 */ width: number; /** * Length of the table * @default 0.45 * @minimum 0 * @maximum Infinity * @step 0.01 */ length: number; /** * The thickness of the chair * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ thickness: number; /** * The number of ornament planks * @default 7 * @minimum 1 * @maximum Infinity * @step 1 */ nrOrnamentPlanks: number; /** * The ornament depth of the chair * @default 0.01 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ ornamentDepth: number; /** * The radius of the fillet * @default 0.05 * @minimum 0.001 * @maximum Infinity * @step 0.01 */ filletRadius: number; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Rotation of the table in degrees * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Scale of the table * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Origin of the medal * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } declare class SnakeChairModelDto { /** * The model that represents result of the good coffee table create operation * @default undefined */ model: SnakeChairData; } /** * The single swept body of the Snake Chair - one named component of an assembled model, carrying its own * shapes and any sub-parts beneath it. Models return their parts rather than a single fused solid, so a * configurator can produce a cutting list, price components individually, or show and hide them one at a * time. */ declare class SnakeChairMainPart extends Part { sittingCenter?: Inputs.Base.Point3; shapes?: { sittingWire?: T; compound?: T; }; } } } /** * Parametric tables. */ declare namespace Tables { /** * Elegant Table - a table with a profiled top and turned legs, rebuilt from length, width, * height and leg profile rather than swapped between fixed sizes. */ declare namespace ElegantTable { declare class ElegantTableData { type: string; /** * The name of the model */ name: string; /** * Original inputs that were used to create the model */ originalInputs: ElegantTableDto; /** * Compound shape of the table geometry */ compound?: T; /** * Representation of table parts that are useful for drawing the object efficiently */ drawingPart?: ElegantTableDrawingPart; /** * Data that contains information and shapes of the top part of the table */ topPart?: ElegantTableTopPart; /** * Data that contains information and shapes repreesenting the legs of the table */ legParts?: ElegantTableLegPart[]; /** * All the shapes of the vase */ shapes?: Models.OCCT.ShapeWithId[]; } declare class ElegantTableDrawDto { /** * Material of the top of the table * @defaul undefined * @optional true */ topMaterial?: T; /** * Material of the top base of the table * @defaul undefined * @optional true */ topBaseMaterial?: T; /** * Material of the legs of the table * @defaul undefined * @optional true */ legsMaterial?: T; /** * You can turn off drawing of faces via this property * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Hex colour string for the edges * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Edge width * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * This defines useful compounded objects for representing elegant table in optimal and fast way. */ declare class ElegantTableDrawingPartShapes { /** * The representation of top of the table */ top?: T; /** * The representation of base of the table top */ topBase?: T; /** * The representation of all legs as compound of the table */ legs?: T; } /** * Information needed to draw the part in an optimal way */ declare class ElegantTableDrawingPart extends Part { /** * Shapes that exist in the drawing part, T can represent opancascade geometry, * babylonjs mesh, materials or other things that map to these drawing categories. */ shapes?: ElegantTableDrawingPartShapes; } /** * The parameter set for the Elegant Table, with a profiled top and turned legs. Generic in its value types * so the same list can be expressed for a plain script, where every value is a number, and for a driven * model, where a value can be an expression or a bound input. Concrete DTOs fill those type parameters in; * read this class for what the model is actually shaped by. */ declare class ElegantTableDtoBase { height: T; width: T; length: T; topThickness: T; topOffset: T; bottomThickness: T; minFillet: T; radiusLegTop: T; radiusLegBottom: T; nrLegPairs: T; precision: T; rotation?: T; scale?: T; origin?: U; direction?: U; } declare class ElegantTableDto implements ElegantTableDtoBase { constructor(height?: number, width?: number, length?: number, topThickness?: number, topOffset?: number, bottomThickness?: number, minFillet?: number, radiusLegTop?: number, radiusLegBottom?: number, nrLegPairs?: number, precision?: number, drawEdges?: boolean, rotation?: number, scale?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3); /** * Height of the table * @default 0.74 * @minimum 0.1 * @maximum Infinity * @step 0.01 */ height: number; /** * Width of the table * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * Length of the table * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * Top thickness of the table * @default 0.02 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ topThickness: number; /** * Top offset from the base of the table * @default 0.03 * @minimum 0 * @maximum Infinity * @step 0.01 */ topOffset: number; /** * Bottom thickness of the table * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ bottomThickness: number; /** * Fillet table corners * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ minFillet: number; /** * Radius leg top * @default 0.03 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ radiusLegTop: number; /** * Radius leg top * @default 0.01 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ radiusLegBottom: number; /** * The number of leg pairs of the table * @default 2 * @minimum 2 * @maximum Infinity * @step 1 */ nrLegPairs: number; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Rotation of the table in degrees * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Scale of the table * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Origin of the medal * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } declare class ElegantTableLegByIndexDto { /** * The model that represents result of the elegant table create operation * @default undefined */ model: ElegantTableData; /** * The index of the leg to be returned * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * One leg of the Elegant Table - one named component of an assembled model, carrying its own shapes and any * sub-parts beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class ElegantTableLegPart extends Part { topCenter?: Inputs.Base.Point3; bottomCenter?: Inputs.Base.Point3; topRadius?: number; bottomRadius?: number; shapes?: { topCircleWire?: T; bottomCircleWire?: T; leg?: T; }; } declare class ElegantTableModelDto { /** * The model that represents result of the elegant table create operation * @default undefined */ model: ElegantTableData; } /** * The top of the Elegant Table - one named component of an assembled model, carrying its own shapes and any * sub-parts beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class ElegantTableTopPart extends Part { topCenter?: Inputs.Base.Point3; bottomCenter?: Inputs.Base.Point3; shapes?: { topPanel?: T; topWire?: T; bottomWire?: T; bottomPanel?: T; compound?: T; }; } } /** * Good Coffee Table - a low table built from separately parameterised parts, so each part can * be queried individually for a cutting list. */ declare namespace GoodCoffeeTable { declare class GoodCoffeeTableData { type: string; /** * The name of the model */ name: string; /** * Original inputs that were used to create the model */ originalInputs: GoodCoffeeTableDto; /** * Compound shape of the table geometry */ compound?: T; /** * Representation of table parts that are useful for drawing the object efficiently */ drawingPart?: GoodCoffeeTableDrawingPart; /** * Data that contains information and shapes of the top part of the table */ topPart?: GoodCoffeeTableTopPart; /** * Data that contains information and shapes of the shelf part of the table */ shelfPart?: GoodCoffeeTableShelfPart; /** * Data that contains information and shapes repreesenting the legs of the table */ legParts?: GoodCoffeeTableLegPart[]; /** * All the shapes of the vase */ shapes?: Models.OCCT.ShapeWithId[]; } declare class GoodCoffeeTableDrawDto { /** * Material of the glass * @defaul undefined * @optional true */ topGlassMaterial?: T; /** * Material of the top frame of the table * @defaul undefined * @optional true */ topMaterial?: T; /** * Material of the shelf of the table * @defaul undefined * @optional true */ shelfMaterial?: T; /** * Material of the legs of the table * @defaul undefined * @optional true */ legsMaterial?: T; /** * You can turn off drawing of faces via this property * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Hex colour string for the edges * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Edge width * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * This defines useful compounded objects for representing elegant table in optimal and fast way. */ declare class GoodCoffeeTableDrawingPartShapes { /** * The representation of top of the table */ top?: T; /** * The representation of glass of the table top */ topGlass?: T; /** * The shelf of the table */ shelf?: T; /** * The representation of all legs as compound of the table */ legs?: T; } /** * Information needed to draw the part in an optimal way */ declare class GoodCoffeeTableDrawingPart extends Part { /** * Shapes that exist in the drawing part, T can represent opancascade geometry, * babylonjs mesh, materials or other things that map to these drawing categories. */ shapes?: GoodCoffeeTableDrawingPartShapes; } /** * The parameter set for the Good Coffee Table, a low table with a shelf. Generic in its value types so the * same list can be expressed for a plain script, where every value is a number, and for a driven model, * where a value can be an expression or a bound input. Concrete DTOs fill those type parameters in; read * this class for what the model is actually shaped by. */ declare class GoodCoffeeTableDtoBase { height: T; width: T; length: T; topThickness: T; topGlassOffset: T; glassThickness: T; glassHolderLength: T; chamfer: T; shelfTopOffset: T; shelfThickness: T; legWidth: T; legDepth: T; precision: T; rotation?: T; scale?: T; origin?: U; direction?: U; } declare class GoodCoffeeTableDto implements GoodCoffeeTableDtoBase { constructor(height?: number, width?: number, length?: number, chamfer?: number, topThickness?: number, topGlassOffset?: number, glassThickness?: number, glassHolderLength?: number, shelfTopOffset?: number, shelfThickness?: number, legWidth?: number, legDepth?: number, precision?: number, drawEdges?: boolean, rotation?: number, scale?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3); /** * Height of the table * @default 0.4 * @minimum 0.1 * @maximum Infinity * @step 0.01 */ height: number; /** * Width of the table * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * Length of the table * @default 1.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * Chamfer the corners * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.001 */ chamfer: number; /** * Top thickness of the table * @default 0.05 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ topThickness: number; /** * Top offset from the edge of the table till the glass * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ topGlassOffset: number; /** * Glass thickness of the table * @default 0.005 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassThickness: number; /** * Glass holder length of the table * @default 0.02 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassHolderLength: number; /** * The offset of the shelf from the bottom of the top - 0 means that no shelf is made as such shelf would be non-functional. * @default 0.15 * @minimum 0 * @maximum Infinity * @step 0.01 */ shelfTopOffset: number; /** * Shelf thickness * @default 0.03 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ shelfThickness: number; /** * Width of the leg * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ legWidth: number; /** * The depth of the leg * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ legDepth: number; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Rotation of the table in degrees * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Scale of the table * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Origin of the medal * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } declare class GoodCoffeeTableLegByIndexDto { /** * The model that represents result of the elegant table create operation * @default undefined */ model: GoodCoffeeTableData; /** * The index of the leg to be returned * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * One leg of the Good Coffee Table - one named component of an assembled model, carrying its own shapes and * any sub-parts beneath it. Models return their parts rather than a single fused solid, so a configurator * can produce a cutting list, price components individually, or show and hide them one at a time. */ declare class GoodCoffeeTableLegPart extends Part { topCenter?: Inputs.Base.Point3; bottomCenter?: Inputs.Base.Point3; width: number; depth: number; height: number; shapes?: { topWire?: T; bottomWire?: T; leg?: T; }; } declare class GoodCoffeeTableModelDto { /** * The model that represents result of the good coffee table create operation * @default undefined */ model: GoodCoffeeTableData; } /** * The lower shelf of the Good Coffee Table - one named component of an assembled model, carrying its own * shapes and any sub-parts beneath it. Models return their parts rather than a single fused solid, so a * configurator can produce a cutting list, price components individually, or show and hide them one at a * time. */ declare class GoodCoffeeTableShelfPart extends Part { topCenter?: Inputs.Base.Point3; bottomCenter?: Inputs.Base.Point3; shapes?: { topWire?: T; bottomWire?: T; compound?: T; }; } /** * The top of the Good Coffee Table - one named component of an assembled model, carrying its own shapes and * any sub-parts beneath it. Models return their parts rather than a single fused solid, so a configurator * can produce a cutting list, price components individually, or show and hide them one at a time. */ declare class GoodCoffeeTableTopPart extends Part { topCenter?: Inputs.Base.Point3; shapes?: { topFrame?: T; topWire?: T; glassWire?: T; glassPanel?: T; compound?: T; }; } } /** * Snake Table - a table matching the Snake Chair, with a swept base and a flat top. */ declare namespace SnakeTable { declare class SnakeTableData { type: string; /** * The name of the model */ name: string; /** * Original inputs that were used to create the model */ originalInputs: SnakeTableDto; /** * Compound shape of the table geometry */ compound?: T; /** * Representation of table parts that are useful for drawing the object efficiently */ drawingPart?: SnakeTableDrawingPart; /** * Data that contains information and shapes of the top part of the table */ mainPart?: SnakeTableMainPart; /** * All the shapes of the vase */ shapes?: Models.OCCT.ShapeWithId[]; } declare class SnakeTableDrawDto { /** * Main material * @defaul undefined * @optional true */ mainMaterial?: T; /** * Glass material * @defaul undefined * @optional true */ glassMaterial?: T; /** * You can turn off drawing of faces via this property * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Hex colour string for the edges * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Edge width * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * This defines useful compounded objects for representing model in optimal and fast way. */ declare class SnakeTableDrawingPartShapes { /** * The representation of main part of the table */ main?: T; /** * The representation of the glass of the table */ glass?: T; } /** * Information needed to draw the part in an optimal way */ declare class SnakeTableDrawingPart extends Part { /** * Shapes that exist in the drawing part, T can represent opancascade geometry, * babylonjs mesh, materials or other things that map to these drawing categories. */ shapes?: SnakeTableDrawingPartShapes; } /** * The parameter set for the Snake Table, matching the Snake Chair. Generic in its value types so the same * list can be expressed for a plain script, where every value is a number, and for a driven model, where a * value can be an expression or a bound input. Concrete DTOs fill those type parameters in; read this class * for what the model is actually shaped by. */ declare class SnakeTableDtoBase { height: T; width: T; length: T; supportLength: T; shelfHeight: T; glassThickness: T; glassOffset: T; thickness: T; ornamentDepth: T; nrOrnamentPlanks: T; filletRadius: T; precision: T; rotation?: T; scale?: T; origin?: U; direction?: U; } declare class SnakeTableDto implements SnakeTableDtoBase { constructor(height?: number, width?: number, length?: number, supportLength?: number, shelfHeight?: number, thickness?: number, glassThickness?: number, glassOffset?: number, nrOrnamentPlanks?: number, ornamentDepth?: number, filletRadius?: number, precision?: number, drawEdges?: boolean, rotation?: number, scale?: number, origin?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3); /** * Height of the table * @default 0.74 * @minimum 0 * @maximum Infinity * @step 0.01 */ height: number; /** * Width of the table * @default 1 * @minimum 0 * @maximum Infinity * @step 0.01 */ width: number; /** * Length of the table * @default 2 * @minimum 0 * @maximum Infinity * @step 0.01 */ length: number; /** * The length of the support * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.01 */ supportLength: number; /** * The height of the shelf * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ shelfHeight: number; /** * The thickness of the table * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ thickness: number; /** * The thickness of the glass * @default 0.005 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassThickness: number; /** * The glass offset - goes beyond width and length limitations * @default 0 * @minimum 0 * @maximum Infinity * @step 0.01 */ glassOffset: number; /** * The number of ornament planks * @default 7 * @minimum 1 * @maximum Infinity * @step 1 */ nrOrnamentPlanks: number; /** * The ornament depth of the table * @default 0.01 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ ornamentDepth: number; /** * The radius of the fillet * @default 0.05 * @minimum 0.001 * @maximum Infinity * @step 0.01 */ filletRadius: number; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Defines if the edges of the model should be drawn * @default true */ drawEdges: boolean; /** * Rotation of the table in degrees * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Scale of the table * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Origin of the medal * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction of the model * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } declare class SnakeTableModelDto { /** * The model that represents result of the good coffee table create operation * @default undefined */ model: SnakeTableData; } /** * The swept base of the Snake Table - one named component of an assembled model, carrying its own shapes * and any sub-parts beneath it. Models return their parts rather than a single fused solid, so a * configurator can produce a cutting list, price components individually, or show and hide them one at a * time. */ declare class SnakeTableMainPart extends Part { topCenter?: Inputs.Base.Point3; shapes?: { topWire?: T; glass?: T; main?: T; compound?: T; }; } } } } /** * Types and helpers shared across the finished models - the common parameter shapes and the * utilities each model builds on. */ declare namespace Shared { /** * One component of a finished model, carrying its shape along with the metadata a bill of materials * needs - what it is, what it is made of, and how many are required. Returning parts rather than a * single fused solid is what lets a configurator produce a cutting list alongside the picture. */ declare class Part { id?: string; rotation?: number; center?: Inputs.Base.Point3; scale?: Inputs.Base.Vector3; direction?: Inputs.Base.Vector3; } } } /** * Higher-level tools built on top of the kernels: dimension annotations, camera navigation, * surface patterning and 3D text with real font support. Each composes several lower-level * operations into one call, so look here before assembling the same behaviour by hand. */ declare namespace Advanced { /** * Enumerations used by the advanced tools - dimension styles, alignment and pattern modes. */ declare namespace Enums { /** * What an advanced operation should hand back: a wire, meaning the outline only; a face, meaning * the outline filled; or a solid, meaning the face given thickness. Choosing the lightest form you * actually need keeps the result cheap - ask for a wire if you are only going to offset or pattern * it, and only ask for a solid when the shape has to be manufactured or booleaned. */ declare enum outputShapeEnum { wire = "wire", face = "face", solid = "solid" } } /** * 3D text: real font loading, glyph outlines, and the extrusion of those outlines into solids. * This is what turns a customer's engraving text into geometry that can be manufactured. */ declare namespace Text3D { /** * One character of a 3D text run, holding the glyph's outlines and the shapes produced from * them. Text is built character by character so each can be positioned, kerned and extruded * independently before the run is assembled. */ declare class CharacterPart { id: string; shapes?: { compound?: T; }; } /** * One face of a 3D text glyph - a single filled region of a character, which for a letter with * enclosed counters such as o or A is one of several. */ declare class FacePart { id: string; type: faceTypeEnum; shapes?: { face?: T; }; } /** * How 3D text relates to the surface it sits on. separatedExtrusion extrudes the letters as their * own solids standing on the face; integratedExtrusion fuses them into it so the result is one * body; cutout subtracts them, engraving the text into the surface. Engraving and embossing on a * product are cutout and integratedExtrusion respectively. */ declare enum faceTextVarEnum { separatedExtrusion = "separatedExtrusion", integratedExtrusion = "integratedExtrusion", cutout = "cutout" } /** * How the faces of a character are produced. compound keeps each glyph's outer outline and its * counters - the enclosed holes in letters like o and A - as one compound shape; originalCutout * subtracts the counters from the outline so a filled face has real holes; cutoutInsideCharacter * cuts them only where they fall inside the character's own body. The difference matters for any * font whose glyphs have enclosed regions. */ declare enum faceTypeEnum { compound = "compound", cutout = "originalCutout", cutoutInsideCharacter = "cutoutInsideCharacter" } /** * A font as the 3D text API sees it: its family, the variants available, and the glyph data * read from the underlying TTF. This is what turns a font name into outlines that can be extruded. */ declare class FontDefinition { name: string; type?: fontsEnum; variant?: fontVariantsEnum; font: Font; } /** * The catalogue of fonts shipped with the platform, pairing each family with the variants it * provides. The 3D text API reads it to resolve a requested font and variant to real glyph data, * and it is what the fontsEnum and fontVariantsEnum values are generated from. */ declare const fontsModel: { key: string; variants: string[]; }[]; /** * The weights and styles available across the shipped fonts - regular, bold, italic and their * combinations. Not every family has every variant; asking for one a family does not ship falls * back to its regular face. */ declare enum fontVariantsEnum { Regular = "Regular", Black = "Black", Bold = "Bold", ExtraBold = "ExtraBold", Medium = "Medium", SemiBold = "SemiBold", BlackItalic = "BlackItalic", BoldItalic = "BoldItalic", Italic = "Italic", Light = "Light", LightItalic = "LightItalic", MediumItalic = "MediumItalic", Thin = "Thin", ThinItalic = "ThinItalic", ExtraLight = "ExtraLight" } /** * Every font available to the 3D text API, one entry per TTF shipped with the platform. The value * is the family name to pass alongside a variant from fontVariantsEnum. Glyph outlines are read * from the font file at build time, so what you get is the real typeface rather than an * approximation - which matters when an engraved name has to match a brand. */ declare enum fontsEnum { Aboreto = "Aboreto", Bungee = "Bungee", IndieFlower = "IndieFlower", Lugrasimo = "Lugrasimo", Orbitron = "Orbitron", Roboto = "Roboto", RobotoSlab = "RobotoSlab", Silkscreen = "Silkscreen", Tektur = "Tektur", Workbench = "Workbench" } /** * Where a text block is anchored inside its bounding rectangle, as one of nine positions from * leftTop to rightBottom. This decides which point stays fixed as the text grows or shrinks - * centerMiddle keeps it centred, leftTop keeps the first character in place. */ declare enum recAlignmentEnum { leftTop = "leftTop", leftMiddle = "leftMiddle", leftBottom = "leftBottom", centerTop = "centerTop", centerMiddle = "centerMiddle", centerBottom = "centerBottom", rightTop = "rightTop", rightMiddle = "rightMiddle", rightBottom = "rightBottom" } declare class Text3DData { /** * Type of the object being configured */ type: string; /** * Default name of the object */ name: string; /** * The advance width of the text */ advanceWidth: number; /** * The bounding box of the text */ boundingBox: { x1: number; y1: number; x2: number; y2: number; }; /** * Original inputs */ originalInputs?: Text3DDto | Texts3DFaceDto; /** * Compounded shape of the 3d text */ compound?: T; /** * The parts of letters */ characterParts?: CharacterPart[]; /** * This only applies if we use 3d text on face algorithms */ faceParts?: FacePart[]; /** * All the shapes of the 3d text */ shapes?: Models.OCCT.ShapeWithId[]; /** * All the letter coordinates of the 3d text */ characterCenterCoordinates: Inputs.Base.Point3[]; } declare class Text3DDto { constructor(text?: string, fontType?: fontsEnum, fontVariant?: fontVariantsEnum, fontSize?: number, height?: number, rotation?: number, origin?: Inputs.Base.Vector3, direction?: Inputs.Base.Vector3, originAlignment?: recAlignmentEnum); /** * The type of font to use * @default bitbybit.dev */ text: string; /** * The type of font to use * @default Roboto */ fontType: fontsEnum; /** * The type of font to use * @default Regular */ fontVariant: fontVariantsEnum; /** * The size of the font * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * The height of the font extrusion, if 0 then face will be returned and not a solid * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The rotation of the generated text * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin of the text * @default [0, 0, 0] */ origin: Inputs.Base.Vector3; /** * Direction of the text * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; /** * Origin alignment * @default centerMiddle */ originAlignment: recAlignmentEnum; } declare class Text3DFaceDefinitionDto { constructor(faceTextVar?: faceTextVarEnum, text?: string, fontType?: fontsEnum, fontVariant?: fontVariantsEnum, fontSize?: number, height?: number, rotation?: number, originParamU?: number, originParamV?: number, originAlignment?: recAlignmentEnum); /** * You can choose how your face text will be constructed. * Separated extrusion will only return text letters * Integrated extrusion will create a shell from the extruded text and original face * Integrated pull in will create a shell from the negative extrusion and original face * Cutout will return compound with faces that are left after cutting the original face with text * @default separatedExtrusion */ faceTextVar: faceTextVarEnum; /** * The type of font to use * @default bitbybit.dev */ text: string; /** * The type of font to use * @default Roboto */ fontType: fontsEnum; /** * The type of font to use * @default Regular */ fontVariant: fontVariantsEnum; /** * The size of the font * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * The height of the font extrusion, if 0 then face will be returned and not a solid * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The rotation of the generated text * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin u param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Origin v param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Origin alignment * @default centerMiddle */ originAlignment: recAlignmentEnum; } declare class Text3DFaceDefinitionUrlDto { constructor(faceTextVar?: faceTextVarEnum, text?: string, fontUrl?: string, fontSize?: number, height?: number, rotation?: number, originParamU?: number, originParamV?: number, originAlignment?: recAlignmentEnum); /** * You can choose how your face text will be constructed. * Separated extrusion will only return text letters * Integrated extrusion will create a shell from the extruded text and original face * Integrated pull in will create a shell from the negative extrusion and original face * Cutout will return compound with faces that are left after cutting the original face with text * @default separatedExtrusion */ faceTextVar: faceTextVarEnum; /** * The type of font to use * @default bitbybit.dev */ text: string; /** * The font URL to load and use. If Url is provided then font will be loaded using opentype.js. * Supported formats are: ttf, otf, woff. * Please note that Woff2 is not supported by opentype.js as it is a compressed format. * @default https://git-cdn.bitbybit.dev/latest/fonts/Tektur/Tektur-Bold.ttf */ fontUrl: string; /** * The size of the font * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * The height of the font extrusion, if 0 then face will be returned and not a solid * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The rotation of the generated text * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin u param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Origin v param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Origin alignment * @default centerMiddle */ originAlignment: recAlignmentEnum; } declare class Text3DFaceDefinitionUrlParsedDto { constructor(faceTextVar?: faceTextVarEnum, text?: string, letterPaths?: any, fontSize?: number, height?: number, rotation?: number, originParamU?: number, originParamV?: number, originAlignment?: recAlignmentEnum); /** * You can choose how your face text will be constructed. * Separated extrusion will only return text letters * Integrated extrusion will create a shell from the extruded text and original face * Integrated pull in will create a shell from the negative extrusion and original face * Cutout will return compound with faces that are left after cutting the original face with text * @default separatedExtrusion */ faceTextVar: faceTextVarEnum; /** * The type of font to use * @default bitbybit.dev */ text: string; /** * The parsed letter paths that were generated by opentype.js * @default undefined */ letterPaths: any; /** * The size of the font * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * The height of the font extrusion, if 0 then face will be returned and not a solid * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The rotation of the generated text * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin u param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Origin v param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Origin alignment * @default centerMiddle */ originAlignment: recAlignmentEnum; } declare class Text3DFaceDto { constructor(face?: T, facePlanar?: boolean, faceTextVar?: faceTextVarEnum, text?: string, fontType?: fontsEnum, fontVariant?: fontVariantsEnum, fontSize?: number, height?: number, rotation?: number, originParamU?: number, originParamV?: number, originAlignment?: recAlignmentEnum); /** * The face of the text * @default undefined */ face: T; /** * If the face is planar it should be true * @default false */ facePlanar: boolean; /** * You can choose how your face text will be constructed. * Separated extrusion will only return text letters * Integrated extrusion will create a shell from the extruded text and original face * Integrated pull in will create a shell from the negative extrusion and original face * Cutout will return compound with faces that are left after cutting the original face with text */ faceTextVar: faceTextVarEnum; /** * The type of font to use * @default bitbybit.dev */ text: string; /** * The type of font to use * @default Roboto */ fontType: fontsEnum; /** * The type of font to use * @default Regular */ fontVariant: fontVariantsEnum; /** * The size of the font * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * The height of the font extrusion, if 0 then face will be returned and not a solid * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The rotation of the generated text * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin u param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Origin v param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Origin alignment * @default centerMiddle */ originAlignment: recAlignmentEnum; } declare class Text3DFaceUrlDto { constructor(face?: T, facePlanar?: boolean, faceTextVar?: faceTextVarEnum, text?: string, fontUrl?: string, fontSize?: number, height?: number, rotation?: number, originParamU?: number, originParamV?: number, originAlignment?: recAlignmentEnum); /** * The face of the text * @default undefined */ face: T; /** * If the face is planar it should be true * @default false */ facePlanar: boolean; /** * You can choose how your face text will be constructed. * Separated extrusion will only return text letters * Integrated extrusion will create a shell from the extruded text and original face * Integrated pull in will create a shell from the negative extrusion and original face * Cutout will return compound with faces that are left after cutting the original face with text */ faceTextVar: faceTextVarEnum; /** * The type of font to use * @default bitbybit.dev */ text: string; /** * The font URL to load and use. If Url is provided then font will be loaded using opentype.js. * Supported formats are: ttf, otf, woff. * Please note that Woff2 is not supported by opentype.js as it is a compressed format. * @default https://git-cdn.bitbybit.dev/latest/fonts/Tektur/Tektur-Bold.ttf */ fontUrl: string; /** * The size of the font * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * The height of the font extrusion, if 0 then face will be returned and not a solid * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The rotation of the generated text * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin u param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Origin v param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Origin alignment * @default centerMiddle */ originAlignment: recAlignmentEnum; } declare class Text3DFaceUrlParsedDto { constructor(face?: T, facePlanar?: boolean, faceTextVar?: faceTextVarEnum, text?: string, letterPaths?: any, fontSize?: number, height?: number, rotation?: number, originParamU?: number, originParamV?: number, originAlignment?: recAlignmentEnum); /** * The face of the text * @default undefined */ face: T; /** * If the face is planar it should be true * @default false */ facePlanar: boolean; /** * You can choose how your face text will be constructed. * Separated extrusion will only return text letters * Integrated extrusion will create a shell from the extruded text and original face * Integrated pull in will create a shell from the negative extrusion and original face * Cutout will return compound with faces that are left after cutting the original face with text */ faceTextVar: faceTextVarEnum; /** * The type of font to use * @default bitbybit.dev */ text: string; /** * The parsed letter paths that were generated by opentype.js * @default undefined */ letterPaths: any; /** * The size of the font * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * The height of the font extrusion, if 0 then face will be returned and not a solid * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The rotation of the generated text * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin u param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Origin v param for the text 0 - 1 * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Origin alignment * @default centerMiddle */ originAlignment: recAlignmentEnum; } declare class Text3DLetterByIndexDto { /** * The model that represents result of the text3d create operation * @default undefined */ model: Text3DData; /** * The index of the letter to be returned * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } declare class Text3DModelDto { /** * The model that represents result of the text3d create operation * @default undefined */ model: Text3DData; } declare class Text3DUrlDto { constructor(text?: string, fontUrl?: string, fontSize?: number, height?: number, rotation?: number, origin?: Inputs.Base.Vector3, direction?: Inputs.Base.Vector3, originAlignment?: recAlignmentEnum); /** * The type of font to use * @default bitbybit.dev */ text: string; /** * The font URL to load and use. If Url is provided then font will be loaded using opentype.js. * Supported formats are: ttf, otf, woff. * Please note that Woff2 is not supported by opentype.js as it is a compressed format. * @default https://git-cdn.bitbybit.dev/latest/fonts/Tektur/Tektur-Bold.ttf */ fontUrl: string; /** * The size of the font * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * The height of the font extrusion, if 0 then face will be returned and not a solid * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The rotation of the generated text * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin of the text * @default [0, 0, 0] */ origin: Inputs.Base.Vector3; /** * Direction of the text * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; /** * Origin alignment * @default centerMiddle */ originAlignment: recAlignmentEnum; } declare class Text3DUrlParsedDto { constructor(text?: string, letterPaths?: any, fontSize?: number, height?: number, rotation?: number, origin?: Inputs.Base.Vector3, direction?: Inputs.Base.Vector3, originAlignment?: recAlignmentEnum); /** * The type of font to use * @default bitbybit.dev */ text: string; /** * The parsed letter paths that were generated by opentype.js * @default undefined */ letterPaths: any; /** * The size of the font * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * The height of the font extrusion, if 0 then face will be returned and not a solid * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * The rotation of the generated text * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Origin of the text * @default [0, 0, 0] */ origin: Inputs.Base.Vector3; /** * Direction of the text * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; /** * Origin alignment * @default centerMiddle */ originAlignment: recAlignmentEnum; } declare class Texts3DFaceDto { constructor(face: T, facePlanar?: boolean, definitions?: Text3DFaceDefinitionDto[]); /** * The face of the text * @default undefined */ face: T; /** * If the face is planar it should be true * @default false */ facePlanar: boolean; /** * The definitions of texts to create on the face * @default undefined */ definitions: Text3DFaceDefinitionDto[]; } declare class Texts3DFaceUrlDto { constructor(face: T, facePlanar?: boolean, definitions?: Text3DFaceDefinitionUrlDto[]); /** * The face of the text * @default undefined */ face: T; /** * If the face is planar it should be true * @default false */ facePlanar: boolean; /** * The definitions of texts to create on the face * @default undefined */ definitions: Text3DFaceDefinitionUrlDto[]; } declare class Texts3DFaceUrlParsedDto { constructor(face: T, facePlanar?: boolean, definitions?: Text3DFaceDefinitionUrlParsedDto[]); /** * The face of the text * @default undefined */ face: T; /** * If the face is planar it should be true * @default false */ facePlanar: boolean; /** * The definitions of texts to create on the face * @default undefined */ definitions: Text3DFaceDefinitionUrlParsedDto[]; } } /** * Surface patterning - projecting a repeating motif onto a face and turning it into real * geometry, which is how textured and perforated surfaces are produced without modelling * each cell by hand. */ declare namespace Patterns { /** * Patterns applied across the surface of a face. */ declare namespace FacePatterns { /** * A simple pyramidal cell pattern - each pattern cell becomes a pyramid raised from the face, * with height and base size driven by parameters. */ declare namespace PyramidSimple { declare class PyramidSimpleAffectorsDto { constructor(faces?: T[], affectorPoints?: Inputs.Base.Point3[], uNumber?: number, vNumber?: number, minHeight?: number, maxHeight?: number, precision?: number); /** * The faces on which to apply the pattern * @default undefined */ faces: T[]; /** * The affector points affect the height of the pyramid elements. The distance is measured between a center point of the corner points and the attractor point. Then it is remapped to certain values. * @default undefined */ affectorPoints: Inputs.Base.Point3[]; /** * The affector radius indicates the limit of affection. Cells heights that are further away from the affector than this radius will not be adjusted. If value is not provided, all affector points will use the radius of 10. * @default undefined * @optional true */ affectorRadiusList?: number[]; /** * The affector factors determine if a given affector attracts (value 0 to 1) or repulses (values -1 to 0) the default height of the pyramid elements. * If value is not provided, all affector points will use the factor of 1 and will thus attract the heights. * @default undefined * @optional true */ affectorFactors?: number[]; /** * The nr of pyramids along u direction of the face * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ uNumber: number; /** * The nr of pyramids along v direction of the face * @default 5 * @minimum 1 * @maximum Infinity * @step 1 */ vNumber: number; /** * The default height for the pyramid if it is not affected by any of the affectors. * @default 0.2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ defaultHeight: number; /** * Min value to add to the height if affector factor is 1 or subtract from the height if affector factor is -1. * This adds to the height if the affector factor > 0 and subtracts from the height if the affector factor is < 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ affectMinHeight: number; /** * Max value to add to the height if affector factor is 1 or subtract from the height if affector factor is -1. * This adds to the height if the affector factor > 0 and subtracts from the height if the affector factor is < 0. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ affectMaxHeight: number; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; } declare class PyramidSimpeByIndexDto { /** * The model that represents result of the pyramid * @default undefined */ model: PyramidSimpleData; /** * The index of pyramid element to be returned * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * One cell of a simple pyramid face pattern - the pyramid raised from a single * pattern cell - one named component of an assembled model, carrying its own shapes and any sub-parts * beneath it. Models return their parts rather than a single fused solid, so a configurator can * produce a cutting list, price components individually, or show and hide them one at a time. */ declare class PyramidSimpleCellPart { id: string; uIndex: number; vIndex: number; cornerPoint1: Inputs.Base.Point3; cornerPoint2: Inputs.Base.Point3; cornerPoint3: Inputs.Base.Point3; cornerPoint4: Inputs.Base.Point3; cornerNormal1?: Inputs.Base.Vector3; cornerNormal2?: Inputs.Base.Vector3; cornerNormal3?: Inputs.Base.Vector3; cornerNormal4?: Inputs.Base.Vector3; centerPoint?: Inputs.Base.Point3; centerNormal?: Inputs.Base.Point3; topPoint?: Inputs.Base.Point3; shapes?: { wire1?: T; wire2?: T; wire3?: T; wire4?: T; face1?: T; face2?: T; face3?: T; face4?: T; compound?: T; }; } declare class PyramidSimpleData { /** * Type of the object being configured */ type: string; /** * Default name of the object */ name: string; /** * Original inputs */ originalInputs?: PyramidSimpleDto | PyramidSimpleAffectorsDto; /** * Compounded shape of the pyramids */ compound?: T; /** * All the shapes of the pyramid */ shapes?: Models.OCCT.ShapeWithId[]; /** * Data that contains information and shapes about each face on which pyramids were computed */ faceParts?: PyramidSimpleFacePart[]; /** * All the pyramid top coordinates */ topCoordinates: Inputs.Base.Point3[]; } declare class PyramidSimpleDto { constructor(faces?: T[], uNumber?: number, vNumber?: number, height?: number); /** * The faces on which to apply the pattern * @default undefined */ faces: T[]; /** * The nr of pyramids along u direction of the face * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ uNumber: number; /** * The nr of pyramids along v direction of the face * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ vNumber: number; /** * The height of the pyramid * @default 0.2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ height: number; /** * Meshing precision of the drawn model. The lower the number the more precise the drawn model is. Keep in mind that output of this algorithm also contains pure occt shape that can be meshed separately in draw any async commands * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; } declare class PyramidSimpleFacePart { id: string; /** * Data that contains information and shapes of the top part of the table */ cells?: PyramidSimpleCellPart[]; shapes?: { compound?: T; startPolylineWireU?: T; startPolylineWireV?: T; endPolylineWireU?: T; endPolylineWireV?: T; compoundPolylineWiresU?: T; compoundPolylineWiresV?: T; compoundPolylineWiresUV?: T; }; } declare class PyramidSimpleModelCellDto { /** * The part that represents the cell of the pyramid * @default undefined */ cells: PyramidSimpleCellPart; } declare class PyramidSimpleModelCellsDto { /** * The part that represents the cells of the pyramid * @default undefined */ cells: PyramidSimpleCellPart[]; } declare class PyramidSimpleModelCellsIndexDto { /** * The part that represents the cells of the pyramid * @default undefined */ cells: PyramidSimpleCellPart[]; /** * The index that can represent a corner, face or a wire in the pyramid * @default 0 * @minimum 0 * @maximum 3 * @step 1 */ index: number; } declare class PyramidSimpleModelDto { /** * The model that represents result of the pyramid create operation * @default undefined */ model: PyramidSimpleData; } declare class PyramidSimpleModelFaceCellIndexDto { /** * The model that represents result of the pyramid create operation * @default undefined */ model: PyramidSimpleData; /** * Face index for the pyramid queries * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ faceIndex: number; /** * Cell u index for the pyramid * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ uIndex: number; /** * Cell v index for the pyramid * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ vIndex: number; } declare class PyramidSimpleModelFaceCellsUIndexDto { /** * The model that represents result of the pyramid create operation * @default undefined */ model: PyramidSimpleData; /** * Face index for the pyramid queries * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ faceIndex: number; /** * U index of the pyramid cells * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ uIndex: number; } declare class PyramidSimpleModelFaceCellsVIndexDto { /** * The model that represents result of the pyramid create operation * @default undefined */ model: PyramidSimpleData; /** * Face index for the pyramid queries * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ faceIndex: number; /** * V index of the pyramid cells * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ vIndex: number; } declare class PyramidSimpleModelFaceIndexDto { /** * The model that represents result of the pyramid create operation * @default undefined */ model: PyramidSimpleData; /** * Face index for the pyramid queries * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ faceIndex: number; } } } } /** * Camera navigation helpers: framing a shape, orbiting, and moving the view to a named * position without hand-writing camera math. */ declare namespace Navigation { declare class FlyToDto { constructor(cameraPosition?: Inputs.Base.Point3, cameraTarget?: Inputs.Base.Point3, animationSpeed?: number, ease?: Inputs.Math.easeEnum); /** * Camera position to fly to * @default [10, 10, 10] */ cameraPosition: Inputs.Base.Point3; /** * Camera look at point to fly to * @default [0, 0, 0] */ cameraTarget: Inputs.Base.Point3; /** * Flight time in seconds. 0 or less jumps to the view with no animation. * @default 2 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ animationSpeed: number; /** * Easing curve of the flight: easeIn starts gently, easeOut ends gently, easeInOut does both; elastic, back and bounce overshoot. * @default easeInOutCubic */ ease: Inputs.Math.easeEnum; } declare class FocusFromAngleDto { constructor(meshes?: BABYLON.Mesh[], includeChildren?: boolean, orientation?: number[], distance?: number, padding?: number, animationSpeed?: number, ease?: Inputs.Math.easeEnum); /** * List of meshes to focus on * @default [] */ meshes: BABYLON.Mesh[]; /** * Whether to include children when computing bounding boxes * @default true */ includeChildren: boolean; /** * Orientation vector indicating the direction from which to view the object * The camera will be positioned in this direction from the center of the bounding box * @default [1, 1, 1] */ orientation: number[]; /** * Distance from the center of the bounding box to position the camera * If not specified, distance will be automatically calculated based on object size * @default undefined * @minimum 0.01 * @maximum Infinity * @step 0.1 * @optional true */ distance?: number; /** * Padding multiplier to control spacing around objects when distance is auto-calculated * Higher values = more space around object (camera further away) * Lower values = tighter framing (camera closer) * Only applies when distance is not manually specified * @default 1.5 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ padding: number; /** * Speed of camera animation in seconds * @default 1.0 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ animationSpeed: number; /** * Easing curve of the focus animation: easeIn starts gently, easeOut ends gently, easeInOut does both; elastic, back and bounce overshoot. * @default easeInOutCubic */ ease: Inputs.Math.easeEnum; } declare class PointOfInterestDto { constructor(name?: string, position?: Inputs.Base.Point3, cameraTarget?: Inputs.Base.Point3, cameraPosition?: Inputs.Base.Point3, style?: PointOfInterestStyleDto, animationSpeed?: number, ease?: Inputs.Math.easeEnum); /** Point of Interest name * @default Point of Interest */ name: string; /** * Camera look at point * @default [0, 1, 0] */ position: Inputs.Base.Point3; /** * Camera look at point * @default [0, 0, 0] */ cameraTarget: Inputs.Base.Point3; /** * Camera position * @default [10, 10, 10] */ cameraPosition: Inputs.Base.Point3; /** * Point of Interest style * @default undefined * @optional true */ style?: PointOfInterestStyleDto; /** * Flight time in seconds when the point is clicked. 0 or less jumps to the view with no animation. * @default 2 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ animationSpeed: number; /** * Easing curve of the flight when the point is clicked: easeIn starts gently, easeOut ends gently, easeInOut does both. * @default easeInOutCubic */ ease: Inputs.Math.easeEnum; } declare class PointOfInterestEntity extends PointOfInterestDto { type: string; entityName: string; } declare class PointOfInterestStyleDto { constructor(pointSize?: number, pointColor?: string, hoverPointColor?: string, pulseColor?: string, pulseMinSize?: number, pulseMaxSize?: number, pulseThickness?: number, pulseSpeed?: number, textColor?: string, hoverTextColor?: string, textSize?: number, textFontWeight?: number, textBackgroundColor?: string, textBackgroundOpacity?: number, textBackgroundStroke?: boolean, textBackgroundStrokeThickness?: number, textBackgroundRadius?: number, textPosition?: Inputs.Base.topBottomEnum, stableSize?: boolean, alwaysOnTop?: boolean); /** * Diameter of the central point in pixels * @default 20 */ pointSize?: number | undefined; /** Color of the central point * @default #ffffff */ pointColor?: Inputs.Base.Color; /** Color of the central point on hover * @default #0000ff */ hoverPointColor?: Inputs.Base.Color; /** Color of the animated pulse * @default #ffffff */ pulseColor?: Inputs.Base.Color; /** Hover color of the animated pulse * @default #0000ff */ hoverPulseColor?: Inputs.Base.Color; /** Smallest diameter of the pulse in pixels * @default 20 */ pulseMinSize?: number | undefined; /** Largest diameter of the pulse in pixels * @default 50 */ pulseMaxSize?: number | undefined; /** Thickness of the pulse ring in pixels * @default 2 */ pulseThickness?: number | undefined; /** Speed multiplier for the pulse animation * @default 3 */ pulseSpeed?: number | undefined; /** Color of the text label * @default #ffffff */ textColor?: Inputs.Base.Color; /** Color of the text label on hover * @default #0000ff */ hoverTextColor?: Inputs.Base.Color; /** Font size of the text label in pixels * @default 14 */ textSize?: number | undefined; /** Font weight of the text label * @default 400 * @minimum 100 * @maximum 900 * @step 100 */ textFontWeight?: number | undefined; /** Background color of text label * @default #000000 */ textBackgroundColor?: Inputs.Base.Color; /** Opacity of text background * @default 0.0 * @minimum 0 * @maximum 1 * @step 0.1 */ textBackgroundOpacity: number; /** Whether to show stroke around text background * @default false */ textBackgroundStroke: boolean; /** Thickness of the stroke around text background * @default 8 * @minimum 1 * @maximum 20 * @step 1 */ textBackgroundStrokeThickness: number; /** Corner radius for text background rounding * @default 40 * @minimum 0 * @maximum 100 * @step 5 */ textBackgroundRadius: number; /** Position of the text label relative to the point in screen space (top or bottom) * @default bottom */ textPosition: Inputs.Base.topBottomEnum; /** Whether the entire point of interest should maintain stable size regardless of camera distance * @default true */ stableSize: boolean; /** Whether the point of interest should always render on top of other objects * @default false */ alwaysOnTop: boolean; } declare class ZoomOnDto { constructor(meshes?: BABYLON.Mesh[], includeChildren?: boolean, animationSpeed?: number, offset?: number, doNotUpdateMaxZ?: boolean, ease?: Inputs.Math.easeEnum); /** * List of meshes to zoom on * @default [] */ meshes: BABYLON.Mesh[]; /** * Whether to include children when analyzing bounding boxes * @default true */ includeChildren: boolean; /** * Speed of camera animation in seconds * @default 0.8 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ animationSpeed: number; /** * Offset multiplier to control spacing around objects * Negative values = tighter framing (closer to object) * 0 = default BabylonJS framing (has built-in padding) * Positive values = more space around object * @default 0 * @minimum -0.9 * @maximum Infinity * @step 0.1 */ offset: number; /** * Whether to prevent updating camera's maxZ (far clipping plane) during zoom * @default true */ doNotUpdateMaxZ: boolean; /** * Easing curve of the zoom animation: easeIn starts gently, easeOut ends gently, easeInOut does both; elastic, back and bounce overshoot. * @default easeInOutCubic */ ease: Inputs.Math.easeEnum; } } /** * Dimension annotations - linear, angular and radial - drawn into the scene with leader lines, * arrowheads, units and configurable styling. Use them to show a configurator's measurements * to a customer, or to check a model against its intended sizes. */ declare namespace Dimensions { declare class AngularDimensionDto { constructor(centerPoint?: Inputs.Base.Point3, direction1?: Inputs.Base.Vector3, direction2?: Inputs.Base.Vector3, radius?: number, labelOffset?: number, decimalPlaces?: number, labelSuffix?: string, labelOverwrite?: string, radians?: boolean, removeTrailingZeros?: boolean, style?: DimensionStyleDto); /** * Center point of the angle * @default [0, 0, 0] */ centerPoint: Inputs.Base.Point3; /** * First direction vector * @default [1, 0, 0] */ direction1: Inputs.Base.Vector3; /** * Second direction vector * @default [0, 1, 0] */ direction2: Inputs.Base.Vector3; /** * Radius of the dimension arc * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ radius: number; /** * Label offset from arc * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Decimal places for angle display * @default 1 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Suffix to add to the angle label * @default ° */ labelSuffix: string; /** * Override label text with custom expression (supports 'val' for computed value, e.g., '100*val', 'Angle: val°') * @default 1*val */ labelOverwrite: string; /** * Whether to display angle in radians * @default false */ radians: boolean; /** * Remove trailing zeros from decimal places * @default false */ removeTrailingZeros: boolean; /** * Dimension style * @default undefined * @optional true */ style?: DimensionStyleDto; } declare class AngularDimensionEntity extends AngularDimensionDto { type: string; entityName: string; /** Identifier for this dimension entity * @ignore true */ id?: string; } declare class DiametralDimensionDto { constructor(centerPoint?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3, diameter?: number, labelOffset?: number, decimalPlaces?: number, labelSuffix?: string, labelOverwrite?: string, showCenterMark?: boolean, removeTrailingZeros?: boolean, style?: DimensionStyleDto); /** * Center point of the circle/arc * @default [0, 0, 0] */ centerPoint: Inputs.Base.Point3; /** * Direction vector for diameter line * @default [1, 0, 0] */ direction: Inputs.Base.Vector3; /** * Diameter value * @default 2 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ diameter: number; /** * Label offset from diameter line * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Decimal places for measurement display * @default 2 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Label suffix text * @default mm */ labelSuffix: string; /** * Override label text with custom expression (supports 'val' for computed value, e.g., '100*val', '⌀ val mm') * @default 1*val */ labelOverwrite: string; /** * Whether to show center mark at center point * @default true */ showCenterMark: boolean; /** * Remove trailing zeros from decimal places * @default false */ removeTrailingZeros: boolean; /** * Dimension style * @default undefined * @optional true */ style?: DimensionStyleDto; } declare class DiametralDimensionEntity extends DiametralDimensionDto { type: string; entityName: string; /** Identifier for this dimension entity * @ignore true */ id?: string; } declare class DimensionStyleDto { constructor(lineColor?: string, lineThickness?: number, extensionLineLength?: number, arrowTailLength?: number, textColor?: string, textSize?: number, textFontWeight?: number, textBackgroundColor?: string, textBackgroundOpacity?: number, textBackgroundStroke?: boolean, textBackgroundStrokeThickness?: number, textBackgroundRadius?: number, textStableSize?: boolean, arrowSize?: number, arrowColor?: string, showArrows?: boolean, textBillboard?: boolean, occlusionCheckInterval?: number, alwaysOnTop?: boolean); /** * Color of dimension lines * @default #ffffff */ lineColor: Inputs.Base.Color; /** * Thickness of dimension lines * @default 0.01 * @minimum 0.01 * @maximum 0.5 * @step 0.01 */ lineThickness: number; /** * Length of extension lines beyond dimension line * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ extensionLineLength: number; /** * Length of arrow tail extensions beyond arrow tips * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ arrowTailLength: number; /** * Color of dimension text * @default #ffffff */ textColor: Inputs.Base.Color; /** * Size of dimension text * @default 16 * @minimum 0 * @maximum Infinity * @step 2 */ textSize: number; /** * Font weight of dimension text * @default 400 * @minimum 100 * @maximum 900 * @step 100 */ textFontWeight: number; /** * Background color of text (if needed) * @default #000000 */ textBackgroundColor: Inputs.Base.Color; /** * Opacity of text background * @default 0.0 * @minimum 0 * @maximum 1 * @step 0.1 */ textBackgroundOpacity: number; /** * Whether to show stroke around text background * @default false */ textBackgroundStroke: boolean; /** * Thickness of the stroke around text background * @default 8 * @minimum 1 * @maximum 20 * @step 1 */ textBackgroundStrokeThickness: number; /** * Corner radius for text background rounding * @default 40 * @minimum 0 * @maximum 100 * @step 5 */ textBackgroundRadius: number; /** * Whether text should maintain stable size regardless of camera distance * @default false */ textStableSize: boolean; /** * Size of arrow heads * @default 0.05 * @minimum 0 * @maximum Infinity * @step 0.01 */ arrowSize: number; /** * Color of arrow heads * @default #ffffff */ arrowColor: Inputs.Base.Color; /** * Whether to show arrow heads/cones * @default true */ showArrows: boolean; /** * Whether text should billboard (always face camera) * @default true */ textBillboard: boolean; /** * How often to check for occlusion in milliseconds (only for GUI modes) * @default 100 * @minimum 50 * @maximum 1000 * @step 50 */ occlusionCheckInterval: number; /** * Whether dimensions should always render on top of other objects * @default false */ alwaysOnTop: boolean; } declare class LinearDimensionDto { constructor(startPoint?: Inputs.Base.Point3, endPoint?: Inputs.Base.Point3, direction?: Inputs.Base.Vector3, labelOffset?: number, decimalPlaces?: number, labelSuffix?: string, labelOverwrite?: string, removeTrailingZeros?: boolean, style?: DimensionStyleDto); /** * Start point of the dimension * @default [0, 0, 0] */ startPoint: Inputs.Base.Point3; /** * End point of the dimension * @default [1, 0, 0] */ endPoint: Inputs.Base.Point3; /** * Direction vector for dimension line offset * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; /** * Label offset from dimension line * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Decimal places for measurement display * @default 2 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Label suffix text * @default mm */ labelSuffix: string; /** * Override label text with custom expression (supports 'val' for computed value, e.g., '100*val', 'Length: val mm') * @default 1*val */ labelOverwrite: string; /** * Remove trailing zeros from decimal places * @default false */ removeTrailingZeros: boolean; /** * Dimension style * @default undefined * @optional true */ style?: DimensionStyleDto; } declare class LinearDimensionEntity extends LinearDimensionDto { type: string; entityName: string; /** Identifier for this dimension entity * @ignore true */ id?: string; } /** * Which axis an ordinate dimension measures along: x, y or z. Ordinate dimensions report the * distance from a single reference point along one axis, which is how machining drawings avoid * accumulating tolerance across a chain of dimensions. */ declare enum ordinateAxisEnum { x = "x", y = "y", z = "z" } declare class OrdinateDimensionDto { constructor(measurementPoint?: Inputs.Base.Point3, referencePoint?: Inputs.Base.Point3, axis?: ordinateAxisEnum, labelOffset?: number, decimalPlaces?: number, labelSuffix?: string, labelOverwrite?: string, showLeaderLine?: boolean, removeTrailingZeros?: boolean, style?: DimensionStyleDto); /** * Point to measure coordinate from * @default [1, 1, 1] */ measurementPoint: Inputs.Base.Point3; /** * Reference origin point for coordinate system * @default [0, 0, 0] */ referencePoint: Inputs.Base.Point3; /** * Which axis coordinate to display (X, Y, or Z) * @default x */ axis: ordinateAxisEnum; /** * Label offset from measurement point * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Decimal places for measurement display * @default 2 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Label suffix text * @default mm */ labelSuffix: string; /** * Override label text with custom expression (supports 'val' for computed value, e.g., '100*val', 'X: val mm') * @default 1*val */ labelOverwrite: string; /** * Whether to show leader line from measurement point to label * @default true */ showLeaderLine: boolean; /** * Remove trailing zeros from decimal places * @default false */ removeTrailingZeros: boolean; /** * Dimension style * @default undefined * @optional true */ style?: DimensionStyleDto; } declare class OrdinateDimensionEntity extends OrdinateDimensionDto { type: string; entityName: string; /** Identifier for this dimension entity * @ignore true */ id?: string; } declare class RadialDimensionDto { constructor(centerPoint?: Inputs.Base.Point3, radiusPoint?: Inputs.Base.Point3, labelOffset?: number, decimalPlaces?: number, labelSuffix?: string, labelOverwrite?: string, showDiameter?: boolean, showCenterMark?: boolean, removeTrailingZeros?: boolean, style?: DimensionStyleDto); /** * Center point of the circle/arc * @default [0, 0, 0] */ centerPoint: Inputs.Base.Point3; /** * Point on the radius/perimeter of the circle/arc * @default [1, 0, 0] */ radiusPoint: Inputs.Base.Point3; /** * Label offset from radius line * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Decimal places for measurement display * @default 2 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Label suffix text * @default mm */ labelSuffix: string; /** * Override label text with custom expression (supports 'val' for computed value, e.g., '100*val', 'R val mm') * @default 1*val */ labelOverwrite: string; /** * Whether to show diameter instead of radius * @default false */ showDiameter: boolean; /** * Whether to show center mark at center point * @default true */ showCenterMark: boolean; /** * Remove trailing zeros from decimal places * @default false */ removeTrailingZeros: boolean; /** * Dimension style * @default undefined * @optional true */ style?: DimensionStyleDto; } declare class RadialDimensionEntity extends RadialDimensionDto { type: string; entityName: string; /** Identifier for this dimension entity * @ignore true */ id?: string; } } } /** * This should be used only if you want to use only JSCAD worker without other of the bitbybit packages */ declare class BitByBitJSCAD { jscadWorkerManager: JSCADWorkerManager; jscad: JSCAD; constructor(); /** * Connects this facade to the web worker that runs the JSCAD kernel. * * Create the worker yourself from the package's worker entry, hand it over here, and wait for the * kernel to report that it is loaded before making calls; without a worker every call would hang. * @param jscad - The worker running the JSCAD kernel */ init(jscad: Worker): void; } /** * Combining JSCAD geometry: union fuses, subtract cuts and intersect keeps the overlap, in a * two-input form and a many-input form. All inputs of one call must be of the same kind, either * solids or flat 2D shapes, or the kernel throws an error; a path cannot be combined. Every method * gives new geometry and leaves the inputs as they are. */ declare class JSCADBooleans { private readonly jscadWorkerManager; /** * Keeps only the volume or area that all the inputs share, dropping everything else. * * The inputs must all be solids or all be 2D shapes; an empty result is possible when they do * not overlap. * @param inputs - The solids or 2D shapes to intersect * @returns The shared part as one solid or 2D shape * @group boolean * @shortname intersect * @drawable true * @example * ```typescript * const common = await bitbybit.jscad.booleans.intersect({ meshes: [cube, sphere] }); * ``` */ intersect(inputs: Inputs.JSCAD.BooleanObjectsDto): Promise; /** * Cuts every later input out of the first one, leaving what remains of the first. * * The inputs must all be solids or all be 2D shapes; the order matters, the first is the one * being cut. * @param inputs - The geometry to cut from, first, followed by the geometry to cut with * @returns The first input minus the others * @group boolean * @shortname subtract * @drawable true * @example * ```typescript * const holed = await bitbybit.jscad.booleans.subtract({ meshes: [cube, cylinder1, cylinder2] }); * ``` */ subtract(inputs: Inputs.JSCAD.BooleanObjectsDto): Promise; /** * Fuses all the inputs into one solid or one 2D shape, merging where they overlap and keeping * separate parts as one entity. * * The inputs must all be solids or all be 2D shapes. * @param inputs - The solids or 2D shapes to fuse * @returns The fused solid or 2D shape * @group boolean * @shortname union * @drawable true * @example * ```typescript * const fused = await bitbybit.jscad.booleans.union({ meshes: [cube, sphere] }); * ``` */ union(inputs: Inputs.JSCAD.BooleanObjectsDto): Promise; /** * Keeps only the volume or area that `first` and `second` share, the two-input form of * `intersect`. * @param inputs - The two solids or two 2D shapes * @returns The shared part * @group boolean * @shortname intersect two * @drawable true * @example * ```typescript * const common = await bitbybit.jscad.booleans.intersectTwo({ first: cube, second: sphere }); * ``` */ intersectTwo(inputs: Inputs.JSCAD.BooleanTwoObjectsDto): Promise; /** * Cuts `second` out of `first`, the two-input form of `subtract`. * @param inputs - The geometry to cut from and the geometry to cut with * @returns The first input minus the second * @group boolean * @shortname subtract two * @drawable true * @example * ```typescript * const holed = await bitbybit.jscad.booleans.subtractTwo({ first: cube, second: sphere }); * ``` */ subtractTwo(inputs: Inputs.JSCAD.BooleanTwoObjectsDto): Promise; /** * Fuses `first` and `second` into one, the two-input form of `union`. * @param inputs - The two solids or two 2D shapes * @returns The fused solid or 2D shape * @group boolean * @shortname union two * @drawable true * @example * ```typescript * const fused = await bitbybit.jscad.booleans.unionTwo({ first: cube, second: sphere }); * ``` */ unionTwo(inputs: Inputs.JSCAD.BooleanTwoObjectsDto): Promise; /** * Cuts every entry of `meshes` out of `from`, leaving what remains of `from`; the same as * `subtract` with the base geometry named separately. * @param inputs - The geometry to cut from and the list of geometry to cut with * @returns The base geometry minus the others * @group boolean * @shortname subtract from * @drawable true * @example * ```typescript * const holed = await bitbybit.jscad.booleans.subtractFrom({ from: cube, meshes: [cylinder1, cylinder2] }); * ``` */ subtractFrom(inputs: Inputs.JSCAD.BooleanObjectsFromDto): Promise; /** * Sweeps each later solid over the whole surface of the running result and fuses everything it * passes through, so the first solid grows by the shape of the others - the Minkowski sum, * which is how a solid is rounded or padded by a sphere. * * Solids only; a 2D shape or a path throws an error. * @param inputs - The solids to sum, at least two * @returns The grown solid * @group minkowski * @shortname minkowski sum * @drawable true * @example * ```typescript * const padded = await bitbybit.jscad.booleans.minkowskiSum({ meshes: [cube, sphere] }); * ``` */ minkowskiSum(inputs: Inputs.JSCAD.MinkowskiSumDto): Promise; } /** * Giving JSCAD geometry a color of its own. A colored entity is always drawn in that color, ahead * of whatever color the drawing options ask for; the color survives transforms but a boolean result * starts uncolored again. */ declare class JSCADColors { private readonly jscadWorkerManager; /** * Gives a solid, a 2D shape or a path a fixed color from a hex string, returning a colored * copy; a list gives a list of colored copies in the same order. * * The color wins over the color of the drawing options, so leave the entity uncolored to * control it there. * @param inputs - The geometry, or a list of it, and the hex color * @returns The colored geometry, one or a list to match the input * @group colorize * @shortname colorize geometry * @drawable true * @example * ```typescript * const red = await bitbybit.jscad.colors.colorize({ geometry: cube, color: "#ff0000" }); * ``` */ colorize(inputs: Inputs.JSCAD.ColorizeDto): Promise; } /** * Growing and shrinking JSCAD geometry by a distance: `expand` moves every boundary outward, or * inward for a negative distance, and `offset` builds the outline at that distance. Both work on * flat 2D shapes and paths and shape their corners as `corners` says; `expand` also grows solids, * with round corners only. */ declare class JSCADExpansions { private readonly jscadWorkerManager; /** * Grows geometry by moving its whole boundary outward by `delta`, or shrinks it when `delta` is * negative. * * A 2D shape stays a 2D shape, a path becomes a 2D band of that width around it, and a solid * grows into a bigger solid, with round corners and a positive `delta` only. Corners are * rounded when `corners` is left out. * @param inputs - The geometry, the distance, the corner style and the segments for round corners * @returns The grown or shrunk geometry * @group expansion * @shortname expand * @drawable true * @example * ```typescript * const square = await bitbybit.jscad.polygon.square({ center: [0, 0], size: 10 }); * const grown = await bitbybit.jscad.expansions.expand({ geometry: square, delta: 1, corners: Bit.Inputs.JSCAD.solidCornerTypeEnum.round, segments: 16 }); * ``` */ expand(inputs: Inputs.JSCAD.ExpansionDto): Promise; /** * Builds the outline of a 2D shape or path at distance `delta` from the original, outward for * positive and inward for negative. * * A 2D shape gives a bigger or smaller 2D shape and a path gives a parallel path. When * `corners` is left out, corners are kept sharp. * @param inputs - The 2D shape or path, the distance, the corner style and the segments for round corners * @returns The offset 2D shape or path * @group expansion * @shortname offset * @drawable true * @example * ```typescript * const path = await bitbybit.jscad.path.createFromPoints({ points: [[0, 0], [10, 0], [10, 10]], closed: false }); * const parallel = await bitbybit.jscad.expansions.offset({ geometry: path, delta: 1, corners: Bit.Inputs.JSCAD.solidCornerTypeEnum.edge, segments: 16 }); * ``` */ offset(inputs: Inputs.JSCAD.ExpansionDto): Promise; } /** * Turning flat JSCAD shapes into solids: straight extrusion along Z with an optional twist, a wall * built along an outline, and revolution around the Z axis. Every flat shape lies in the XY plane, * so the result grows out of that plane along Z. */ declare class JSCADExtrusions { private readonly jscadWorkerManager; /** * Extrudes a flat 2D shape straight along Z by `height` into a solid, twisting it on the way * when `twistAngle` is not zero. * * `twistAngle` in degrees turns the top relative to the bottom around Z and `twistSteps` is the * number of slices used for it, at least 1. A negative `height` extrudes downward. * @param inputs - The 2D shape, the height, the twist angle and the twist steps * @returns The extruded solid * @group extrude * @shortname linear * @drawable true * @example * ```typescript * const square = await bitbybit.jscad.polygon.square({ center: [0, 0], size: 10 }); * const twisted = await bitbybit.jscad.extrusions.extrudeLinear({ geometry: square, height: 20, twistAngle: 90, twistSteps: 15 }); * ``` */ extrudeLinear(inputs: Inputs.JSCAD.ExtrudeLinearDto): Promise; /** * Builds a wall along the outline of a 2D shape or path: the outline is thickened by `size` on * each side and raised by `height` along Z. * * The wall stands on the XY plane and is twice `size` thick, centered on the outline; the * inside of a 2D shape stays empty. A list of inputs gives a list of walls. * @param inputs - The 2D shape or path, the height and the half thickness * @returns The wall as a solid * @group extrude * @shortname rectangular * @drawable true * @example * ```typescript * const circle = await bitbybit.jscad.polygon.circle({ center: [0, 0], radius: 10, segments: 32 }); * const ring = await bitbybit.jscad.extrusions.extrudeRectangular({ geometry: circle, height: 5, size: 0.5 }); * ``` */ extrudeRectangular(inputs: Inputs.JSCAD.ExtrudeRectangularDto): Promise; /** * Builds a wall along a polyline of points, as `extrudeRectangular` does for a path: the line * is thickened by `size` on each side and raised by `height` along Z. * * Only the X and Y coordinates of the points are used and repeated consecutive points are * dropped. * @param inputs - The points, the height and the half thickness * @returns The wall as a solid * @group extrude * @shortname rectangular points * @drawable true * @example * ```typescript * const wall = await bitbybit.jscad.extrusions.extrudeRectangularPoints({ points: [[0, 0, 0], [10, 0, 0], [10, 10, 0]], height: 5, size: 0.5 }); * ``` */ extrudeRectangularPoints(inputs: Inputs.JSCAD.ExtrudeRectangularPointsDto): Promise; /** * Revolves a flat 2D shape around the Z axis into a solid. * * The shape lies in the XY plane, so its X coordinate is its distance from the axis, and a * shape crossing the axis is clipped there. `angle` and `startAngle` are in degrees, 360 makes * a full ring, and `segments` counts the steps of a full turn. * @param inputs - The 2D shape, the sweep angle, the start angle and the segment count * @returns The revolved solid * @group extrude * @shortname rotational * @drawable true * @example * ```typescript * const profile = await bitbybit.jscad.polygon.circle({ center: [10, 0], radius: 3, segments: 24 }); * const ring = await bitbybit.jscad.extrusions.extrudeRotate({ polygon: profile, angle: 360, startAngle: 0, segments: 48 }); * ``` */ extrudeRotate(inputs: Inputs.JSCAD.ExtrudeRotateDto): Promise; } /** * Wrapping JSCAD geometry in its convex hull, the shape a tight sheet would take around it: `hull` * wraps everything at once and `hullChain` wraps each consecutive pair, so a row of shapes becomes * a bent tube rather than one lump. All inputs of a call must be of the same kind, solids, 2D * shapes or paths. */ declare class JSCADHulls { private readonly jscadWorkerManager; /** * Wraps each consecutive pair of inputs in a convex hull and fuses the hulls, so a row of * shapes becomes a continuous strand that follows their order. * * A bend in the row is kept, where `hull` would fill it in. All inputs must be of the same * kind. * @param inputs - The solids, 2D shapes or paths, in the order they connect * @returns The chained hull * @group hulls * @shortname hull chain * @drawable true * @example * ```typescript * const spheres = await bitbybit.jscad.shapes.spheresOnCenterPoints({ centers: [[0, 0, 0], [10, 0, 0], [10, 10, 0]], radius: 1, segments: 16 }); * const strand = await bitbybit.jscad.hulls.hullChain({ meshes: spheres }); * ``` */ hullChain(inputs: Inputs.JSCAD.HullDto): Promise; /** * Wraps all the inputs in one convex hull, the smallest shape without dents that contains them * all, regardless of their order. * * All inputs must be of the same kind, solids, 2D shapes or paths. * @param inputs - The solids, 2D shapes or paths * @returns The convex hull * @group hulls * @shortname hull * @drawable true * @example * ```typescript * const wrapped = await bitbybit.jscad.hulls.hull({ meshes: [cube, sphere] }); * ``` */ hull(inputs: Inputs.JSCAD.HullDto): Promise; /** * Tells whether a solid is convex, meaning it already equals its own hull: every straight line * between two of its points stays inside it. * * Solids only; a 2D shape or a path throws an error. * @param inputs - The solid to examine * @returns True when the solid is convex * @group hulls * @shortname is convex * @drawable false * @example * ```typescript * const convex = await bitbybit.jscad.hulls.isConvex({ mesh: shape }); * ``` */ isConvex(inputs: Inputs.JSCAD.SolidDto): Promise; } /** * The entry point to the JSCAD kernel, a mesh-based solid modeler with three kinds of geometry: a * solid, held as a closed set of polygons; a flat 2D shape, held as a region in the XY plane; and a * 2D path, an open or closed polyline in that plane. `shapes` and `polygon` build them, `booleans`, * `extrusions`, `expansions` and `hulls` combine and grow them, `text` writes with them and * `colors` tints them. Flat shapes live in the XY plane and extrude along Z. The methods on the * service itself convert solids to mesh data, move them with matrices and write STL, DXF and 3MF * files. Credit to the JSCAD community for the kernel. */ declare class JSCAD { private readonly jscadWorkerManager; readonly booleans: JSCADBooleans; readonly expansions: JSCADExpansions; readonly extrusions: JSCADExtrusions; readonly hulls: JSCADHulls; readonly path: JSCADPath; readonly polygon: JSCADPolygon; readonly shapes: JSCADShapes; readonly text: JSCADText; readonly colors: JSCADColors; /** * Turns a solid into a list of triangles, each given as three points, with the solid's own * transform already applied. * * A flat 2D shape is given a tiny thickness first so it has faces at all. An entity with no * polygons gives an empty list. * @param inputs - The solid or 2D shape * @returns The triangles as lists of three points * @group conversions * @shortname to polygon points * @drawable false * @example * ```typescript * const cube = await bitbybit.jscad.shapes.cube({ center: [0, 0, 0], size: 10 }); * const triangles = await bitbybit.jscad.toPolygonPoints({ mesh: cube }); * ``` */ toPolygonPoints(inputs: Inputs.JSCAD.MeshDto): Promise; /** * Moves, rotates or scales several solids with the same transformation, giving new solids in * the same order. * * `transformation` is one 4x4 matrix, a list of matrices applied in order, or a list of such * lists; a flat 2D shape or a path throws an error. * @param inputs - The solids and the transformation * @returns The transformed solids, in the same order * @group transforms * @shortname transform solids * @drawable true * @example * ```typescript * const translation = bitbybit.transforms.translationXYZ({ translation: [10, 0, 0] }); * const moved = await bitbybit.jscad.transformSolids({ meshes: [cube, sphere], transformation: translation }); * ``` */ transformSolids(inputs: Inputs.JSCAD.TransformSolidsDto): Promise; /** * Moves, rotates or scales a solid with a transformation, giving a new solid. * * `transformation` is one 4x4 matrix, a list of matrices applied in order, or a list of such * lists; a flat 2D shape or a path throws an error. * @param inputs - The solid and the transformation * @returns The transformed solid * @group transforms * @shortname transform solid * @drawable true * @example * ```typescript * const rotation = bitbybit.transforms.rotationCenterAxis({ angle: 45, axis: [0, 1, 0], center: [0, 0, 0] }); * const turned = await bitbybit.jscad.transformSolid({ mesh: cube, transformation: rotation }); * ``` */ transformSolid(inputs: Inputs.JSCAD.TransformSolidDto): Promise; /** * Writes a solid as a binary STL file, the common format for 3D printing, and downloads it in * the browser as `fileName` plus `.stl`. * @param inputs - The solid and the file name * @returns The STL file as a blob; the asynchronous API starts the download instead and returns nothing * @group io * @shortname solid to stl * @example * ```typescript * await bitbybit.jscad.downloadSolidSTL({ mesh: cube, fileName: "cube" }); * ``` */ downloadSolidSTL(inputs: Inputs.JSCAD.DownloadSolidDto): Promise; /** * Writes several solids into one binary STL file and downloads it in the browser as `fileName` * plus `.stl`. * @param inputs - The solids and the file name * @returns The STL file as a blob; the asynchronous API starts the download instead and returns nothing * @group io * @shortname solids to stl * @example * ```typescript * await bitbybit.jscad.downloadSolidsSTL({ meshes: [cube, sphere], fileName: "parts" }); * ``` */ downloadSolidsSTL(inputs: Inputs.JSCAD.DownloadSolidsDto): Promise; /** * Writes a solid, a 2D shape, a path or a list of them as a DXF drawing file and downloads it * in the browser as `fileName` plus `.dxf`. * * `options` is passed to the DXF writer as it is and can stay out. * @param inputs - The geometry, the file name and the optional writer options * @returns The DXF file as a blob; the asynchronous API starts the download instead and returns nothing * @group io * @shortname geometry to dxf * @example * ```typescript * const circle = await bitbybit.jscad.polygon.circle({ center: [0, 0], radius: 5, segments: 32 }); * await bitbybit.jscad.downloadGeometryDxf({ geometry: circle, fileName: "circle", options: {} }); * ``` */ downloadGeometryDxf(inputs: Inputs.JSCAD.DownloadGeometryDto): Promise; /** * Writes a solid, a 2D shape, a path or a list of them as a 3MF file, a modern 3D printing * format, and downloads it in the browser as `fileName` plus `.3mf`. * * `options` is passed to the 3MF writer as it is and can stay out. * @param inputs - The geometry, the file name and the optional writer options * @returns The 3MF file as a blob; the asynchronous API starts the download instead and returns nothing * @group io * @shortname geometry to 3mf * @example * ```typescript * await bitbybit.jscad.downloadGeometry3MF({ geometry: [cube, sphere], fileName: "parts", options: {} }); * ``` */ downloadGeometry3MF(inputs: Inputs.JSCAD.DownloadGeometryDto): Promise; private downloadFile; } /** * Building JSCAD paths, the 2D polylines that walls are extruded along, offsets follow and filled * shapes are closed from. A path lies in the XY plane and is open or closed; it grows by appending * points, polylines and arcs to its end, and a closed path accepts nothing more. Points given in 3D * keep only X and Y. */ declare class JSCADPath { private readonly jscadWorkerManager; /** * Builds a 2D path through the points in order, open or closed back to the first point as * `closed` says. * * Only X and Y of each point are used and repeated consecutive points are removed. * @param inputs - The points and whether to close the path * @returns The 2D path * @group from * @shortname points * @drawable true * @example * ```typescript * const path = await bitbybit.jscad.path.createFromPoints({ points: [[0, 0], [10, 0], [10, 10]], closed: false }); * ``` */ createFromPoints(inputs: Inputs.JSCAD.PathFromPointsDto): Promise; /** * Builds one 2D path per list of points, in the same order; a list whose last point coincides * with its first becomes a closed path, any other stays open. * * Only X and Y of each point are used and repeated consecutive points are removed. * @param inputs - The lists of points * @returns One 2D path per list * @group from * @shortname paths from points * @drawable true * @example * ```typescript * const paths = await bitbybit.jscad.path.createPathsFromPoints({ pointsLists: [[[0, 0], [10, 0], [10, 10], [0, 0]], [[20, 0], [30, 0]]] }); * ``` */ createPathsFromPoints(inputs: Inputs.JSCAD.PathsFromPointsDto): Promise; /** * Builds a 2D path through the points of a polyline, open or closed back to the first point as * `closed` says, whatever the polyline's own flag holds. * * Only X and Y of each point are used and repeated consecutive points are removed. * @param inputs - The polyline and whether to close the path * @returns The 2D path * @group from * @shortname polyline * @drawable true * @example * ```typescript * const path = await bitbybit.jscad.path.createFromPolyline({ polyline: { points: [[0, 0, 0], [10, 0, 0], [10, 10, 0]] }, closed: true }); * ``` */ createFromPolyline(inputs: Inputs.JSCAD.PathFromPolylineDto): Promise; /** * Makes an empty open 2D path with no points, a starting point for `appendPoints`, * `appendPolyline` and `appendArc`. * @returns The empty 2D path * @group create * @shortname empty * @drawable false * @example * ```typescript * const empty = await bitbybit.jscad.path.createEmpty(); * const path = await bitbybit.jscad.path.appendPoints({ path: empty, points: [[0, 0], [10, 0], [10, 10]] }); * ``` */ createEmpty(): Promise; /** * Closes an open 2D path by joining its last point back to its first, giving a closed copy; a * path that is already closed comes back closed. * * A 2D shape or a solid throws an error. * @param inputs - The 2D path * @returns The closed 2D path * @group edit * @shortname close * @drawable true * @example * ```typescript * const closed = await bitbybit.jscad.path.close({ path }); * ``` */ close(inputs: Inputs.JSCAD.PathDto): Promise; /** * Adds points to the end of an open 2D path, giving a longer copy. * * Only X and Y of each point are used and repeated consecutive points are removed; a closed * path throws an error. * @param inputs - The 2D path and the points to add * @returns The extended 2D path * @group append * @shortname points * @drawable true * @example * ```typescript * const longer = await bitbybit.jscad.path.appendPoints({ path, points: [[20, 10], [20, 0]] }); * ``` */ appendPoints(inputs: Inputs.JSCAD.PathAppendPointsDto): Promise; /** * Adds the points of a polyline to the end of an open 2D path, giving a longer copy. * * Only X and Y of each point are used and repeated consecutive points are removed; a closed * path throws an error. * @param inputs - The 2D path and the polyline to add * @returns The extended 2D path * @group append * @shortname polyline * @drawable true * @example * ```typescript * const longer = await bitbybit.jscad.path.appendPolyline({ path, polyline: { points: [[20, 10, 0], [20, 0, 0]] } }); * ``` */ appendPolyline(inputs: Inputs.JSCAD.PathAppendPolylineDto): Promise; /** * Adds an elliptical arc from the last point of an open 2D path to `endPoint`, giving a longer * copy. * * `radiusX` and `radiusY` size the ellipse and `xAxisRotation` tilts it in degrees; `clockwise` * and `large` pick one of the four arcs that fit, and radii too small to reach the end point * are scaled up. * @param inputs - The 2D path, the end point, the two radii, the tilt, the arc choice and the segment count * @returns The extended 2D path * @group append * @shortname arc * @drawable true * @example * ```typescript * const start = await bitbybit.jscad.path.createFromPoints({ points: [[0, 0]], closed: false }); * const arc = await bitbybit.jscad.path.appendArc({ path: start, endPoint: [10, 10], radiusX: 10, radiusY: 10, xAxisRotation: 0, clockwise: false, large: false, segments: 32 }); * ``` */ appendArc(inputs: Inputs.JSCAD.PathAppendArcDto): Promise; } /** * Building flat JSCAD shapes, the filled 2D regions that booleans combine and extrusions turn into * solids. They lie in the XY plane: a shape made from points or a curve keeps only the X and Y * coordinates, and the circle, ellipse, rectangle, square and star primitives take a 2D center. * List outline points counter-clockwise. */ declare class JSCADPolygon { private readonly jscadWorkerManager; /** * Builds a filled 2D shape from the outline points, taken in order and closed back to the * first. * * Only X and Y are used, Z is dropped; repeated consecutive points are removed and at least * three distinct points are needed. Counter-clockwise order gives a normal shape, clockwise * gives a negative one. * @param inputs - The outline points * @returns The 2D shape * @group from * @shortname polygon from points * @drawable true * @example * ```typescript * const triangle = await bitbybit.jscad.polygon.createFromPoints({ points: [[0, 0, 0], [10, 0, 0], [5, 8, 0]] }); * ``` */ createFromPoints(inputs: Inputs.JSCAD.PointsDto): Promise; /** * Builds a filled 2D shape from the points of a polyline, closed back to the first point * whatever the polyline says. * * Only X and Y are used, Z is dropped; repeated consecutive points are removed and at least * three distinct points are needed. * @param inputs - The polyline * @returns The 2D shape * @group from * @shortname polyline * @drawable true * @example * ```typescript * const shape = await bitbybit.jscad.polygon.createFromPolyline({ polyline: { points: [[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]], isClosed: true } }); * ``` */ createFromPolyline(inputs: Inputs.JSCAD.PolylineDto): Promise; /** * Builds a filled 2D shape from a NURBS curve by sampling it into points and closing the * outline. * * Only X and Y of the sampled points are used, Z is dropped. * @param inputs - The NURBS curve * @returns The 2D shape * @group from * @shortname curve * @drawable true * @deprecated This takes a verb-nurbs curve, and verb is deprecated for removal in the next major, so this goes with it. It is also the one method here that converts between two different CAD kernels, which belongs above a kernel-specific package rather than inside one. Build the polygon from points or from a polyline instead. * @example * ```typescript * const shape = await bitbybit.jscad.polygon.createFromCurve({ curve }); * ``` */ createFromCurve(inputs: Inputs.JSCAD.CurveDto): Promise; /** * Builds a filled 2D shape from the points of a 2D path, closed back to the first point. * * Repeated consecutive points are removed and at least three distinct points are needed; a 2D * shape or a solid throws an error. * @param inputs - The 2D path * @returns The 2D shape * @group from * @shortname path * @drawable true * @example * ```typescript * const path = await bitbybit.jscad.path.createFromPoints({ points: [[0, 0], [10, 0], [10, 10]], closed: true }); * const shape = await bitbybit.jscad.polygon.createFromPath({ path }); * ``` */ createFromPath(inputs: Inputs.JSCAD.PathDto): Promise; /** * Builds a filled circle of the given `radius` around a 2D `center`; `segments` is the number * of straight sides that approximate it. * @param inputs - The center, the radius and the segment count * @returns The circle as a 2D shape * @group primitives * @shortname circle * @drawable true * @example * ```typescript * const disc = await bitbybit.jscad.polygon.circle({ center: [0, 0], radius: 5, segments: 32 }); * ``` */ circle(inputs: Inputs.JSCAD.CircleDto): Promise; /** * Builds a filled ellipse around a 2D `center`, with `radius` holding the X and Y half-sizes; * `segments` is the number of straight sides that approximate it. * @param inputs - The center, the two radii and the segment count * @returns The ellipse as a 2D shape * @group primitives * @shortname ellipse * @drawable true * @example * ```typescript * const oval = await bitbybit.jscad.polygon.ellipse({ center: [0, 0], radius: [10, 5], segments: 48 }); * ``` */ ellipse(inputs: Inputs.JSCAD.EllipseDto): Promise; /** * Builds a filled rectangle around a 2D `center`, with `width` along X and `length` along Y. * @param inputs - The center, the width and the length * @returns The rectangle as a 2D shape * @group primitives * @shortname rectangle * @drawable true * @example * ```typescript * const plate = await bitbybit.jscad.polygon.rectangle({ center: [0, 0], width: 20, length: 10 }); * ``` */ rectangle(inputs: Inputs.JSCAD.RectangleDto): Promise; /** * Builds a filled rectangle with its four corners rounded by `roundRadius`, around a 2D * `center` with `width` along X and `length` along Y. * * `roundRadius` must be less than half of the smaller side or an error is thrown; `segments` * sets how smoothly each corner is faceted. * @param inputs - The center, the rounding radius, the segment count, the width and the length * @returns The rounded rectangle as a 2D shape * @group primitives * @shortname rounded rectangle * @drawable true * @example * ```typescript * const plate = await bitbybit.jscad.polygon.roundedRectangle({ center: [0, 0], roundRadius: 2, segments: 16, width: 20, length: 10 }); * ``` */ roundedRectangle(inputs: Inputs.JSCAD.RoundedRectangleDto): Promise; /** * Builds a filled square of side `size` around a 2D `center`, with its sides parallel to the * axes. * @param inputs - The center and the side length * @returns The square as a 2D shape * @group primitives * @shortname square * @drawable true * @example * ```typescript * const tile = await bitbybit.jscad.polygon.square({ center: [0, 0], size: 10 }); * ``` */ square(inputs: Inputs.JSCAD.SquareDto): Promise; /** * Builds a filled star with `vertices` tips around a 2D `center`, the tips at `outerRadius` and * the notches between them at `innerRadius`. * * `startAngle` in degrees turns the first tip away from the X axis. `density` matters only when * `innerRadius` is 0: the notch radius is then derived from it, as in a pentagram with density * 2. * @param inputs - The center, the number of tips, the density, the two radii and the start angle * @returns The star as a 2D shape * @group primitives * @shortname star * @drawable true * @example * ```typescript * const star = await bitbybit.jscad.polygon.star({ center: [0, 0], vertices: 5, density: 2, outerRadius: 10, innerRadius: 4, startAngle: 90 }); * ``` */ star(inputs: Inputs.JSCAD.StarDto): Promise; } /** * Building JSCAD solids: cubes, cuboids, spheres, ellipsoids, cylinders, a torus and a solid from * raw polygon points, each with a variant that places one copy on every point of a list. The kernel * keeps Z as its own axis, so a cylinder stands along Z and a torus lies flat in the XY plane; * every solid is a closed mesh of polygons and `segments` says how many flat facets approximate a * round surface. */ declare class JSCADShapes { private readonly jscadWorkerManager; /** * Builds a cube of edge length `size` centered on `center`, with its faces parallel to the * axes. * @param inputs - The center and the edge length * @returns The cube solid * @group primitives * @shortname cube * @drawable true * @example * ```typescript * const cube = await bitbybit.jscad.shapes.cube({ center: [0, 0, 0], size: 10 }); * ``` */ cube(inputs: Inputs.JSCAD.CubeDto): Promise; /** * Builds one cube of edge length `size` on every point of `centers`, in the same order. * @param inputs - The center points and the edge length * @returns One cube per center point * @group primitives on centers * @shortname cubes * @drawable true * @example * ```typescript * const cubes = await bitbybit.jscad.shapes.cubesOnCenterPoints({ centers: [[0, 0, 0], [20, 0, 0], [40, 0, 0]], size: 10 }); * ``` */ cubesOnCenterPoints(inputs: Inputs.JSCAD.CubeCentersDto): Promise; /** * Builds a box centered on `center` with `width` along X, `height` along Y and `length` along * Z, its faces parallel to the axes. * @param inputs - The center and the three side lengths * @returns The box solid * @group primitives * @shortname cuboid * @drawable true * @example * ```typescript * const box = await bitbybit.jscad.shapes.cuboid({ center: [0, 0, 0], width: 10, height: 5, length: 20 }); * ``` */ cuboid(inputs: Inputs.JSCAD.CuboidDto): Promise; /** * Builds one box of the given `width`, `height` and `length` on every point of `centers`, in * the same order. * @param inputs - The center points and the three side lengths * @returns One box per center point * @group primitives on centers * @shortname cuboids * @drawable true * @example * ```typescript * const boxes = await bitbybit.jscad.shapes.cuboidsOnCenterPoints({ centers: [[0, 0, 0], [20, 0, 0]], width: 10, height: 5, length: 20 }); * ``` */ cuboidsOnCenterPoints(inputs: Inputs.JSCAD.CuboidCentersDto): Promise; /** * Builds a cylinder with an elliptical cross-section whose radii can differ at the two ends, * standing along Z and centered on `center`. * * `startRadius` is the X and Y radius at the bottom end and `endRadius` at the top, so unequal * pairs make a tapered or cone-like solid; `height` is split evenly above and below `center`. * @param inputs - The center, the height, the two radius pairs and the segment count * @returns The elliptic cylinder solid * @group primitives * @shortname cylinder elliptic * @drawable true * @example * ```typescript * const cone = await bitbybit.jscad.shapes.cylinderElliptic({ center: [0, 0, 0], height: 10, startRadius: [4, 2], endRadius: [1, 0.5], segments: 32 }); * ``` */ cylinderElliptic(inputs: Inputs.JSCAD.CylidnerEllipticDto): Promise; /** * Builds one elliptic cylinder with the given radii and height on every point of `centers`, in * the same order, as `cylinderElliptic` does for one. * @param inputs - The center points, the height, the two radius pairs and the segment count * @returns One elliptic cylinder per center point * @group primitives on centers * @shortname cylinder elliptic * @drawable true * @example * ```typescript * const cones = await bitbybit.jscad.shapes.cylinderEllipticOnCenterPoints({ centers: [[0, 0, 0], [20, 0, 0]], height: 10, startRadius: [4, 2], endRadius: [1, 0.5], segments: 32 }); * ``` */ cylinderEllipticOnCenterPoints(inputs: Inputs.JSCAD.CylidnerCentersEllipticDto): Promise; /** * Builds a round cylinder of the given `radius` standing along Z, with `height` split evenly * above and below `center`. * * `segments` is the number of flat sides around it; more makes it rounder. * @param inputs - The center, the height, the radius and the segment count * @returns The cylinder solid * @group primitives * @shortname cylinder * @drawable true * @example * ```typescript * const cylinder = await bitbybit.jscad.shapes.cylinder({ center: [0, 0, 0], height: 10, radius: 3, segments: 32 }); * ``` */ cylinder(inputs: Inputs.JSCAD.CylidnerDto): Promise; /** * Builds one cylinder of the given `radius` and `height` on every point of `centers`, in the * same order, as `cylinder` does for one. * @param inputs - The center points, the height, the radius and the segment count * @returns One cylinder per center point * @group primitives on centers * @shortname cylinder * @drawable true * @example * ```typescript * const posts = await bitbybit.jscad.shapes.cylindersOnCenterPoints({ centers: [[0, 0, 0], [20, 0, 0], [40, 0, 0]], height: 10, radius: 1, segments: 16 }); * ``` */ cylindersOnCenterPoints(inputs: Inputs.JSCAD.CylidnerCentersDto): Promise; /** * Builds an ellipsoid, a sphere stretched separately along X, Y and Z, centered on `center`. * * `radius` holds the three half-sizes in `[x, y, z]` order; equal values make a sphere. * @param inputs - The center, the three radii and the segment count * @returns The ellipsoid solid * @group primitives * @shortname ellipsoid * @drawable true * @example * ```typescript * const egg = await bitbybit.jscad.shapes.ellipsoid({ center: [0, 0, 0], radius: [5, 3, 8], segments: 32 }); * ``` */ ellipsoid(inputs: Inputs.JSCAD.EllipsoidDto): Promise; /** * Builds one ellipsoid with the given radii on every point of `centers`, in the same order, as * `ellipsoid` does for one. * @param inputs - The center points, the three radii and the segment count * @returns One ellipsoid per center point * @group primitives on centers * @shortname ellipsoid * @drawable true * @example * ```typescript * const eggs = await bitbybit.jscad.shapes.ellipsoidsOnCenterPoints({ centers: [[0, 0, 0], [20, 0, 0]], radius: [5, 3, 8], segments: 32 }); * ``` */ ellipsoidsOnCenterPoints(inputs: Inputs.JSCAD.EllipsoidCentersDto): Promise; /** * Builds a sphere from evenly sized triangles, the way a geodesic dome is built, centered on * `center`. * * `frequency` is how finely the twenty starting faces are subdivided; it is used in whole * multiples of 6 and must be at least 6, and higher values give a rounder sphere. * @param inputs - The center, the radius and the subdivision frequency * @returns The geodesic sphere solid * @group primitives * @shortname geodesic sphere * @drawable true * @example * ```typescript * const dome = await bitbybit.jscad.shapes.geodesicSphere({ center: [0, 0, 0], radius: 5, frequency: 12 }); * ``` */ geodesicSphere(inputs: Inputs.JSCAD.GeodesicSphereDto): Promise; /** * Builds one geodesic sphere of the given `radius` on every point of `centers`, in the same * order, as `geodesicSphere` does for one. * @param inputs - The center points, the radius and the subdivision frequency * @returns One geodesic sphere per center point * @group primitives on centers * @shortname geodesic sphere * @drawable true * @example * ```typescript * const domes = await bitbybit.jscad.shapes.geodesicSpheresOnCenterPoints({ centers: [[0, 0, 0], [20, 0, 0]], radius: 5, frequency: 12 }); * ``` */ geodesicSpheresOnCenterPoints(inputs: Inputs.JSCAD.GeodesicSphereCentersDto): Promise; /** * Builds a box with all its edges and corners rounded by `roundRadius`, centered on `center` * with `width` along X, `height` along Y and `length` along Z. * * `roundRadius` must be less than half of the smallest side or an error is thrown; `segments` * sets how smoothly the rounding is faceted. * @param inputs - The center, the three side lengths, the rounding radius and the segment count * @returns The rounded box solid * @group primitives * @shortname rounded cuboid * @drawable true * @example * ```typescript * const soft = await bitbybit.jscad.shapes.roundedCuboid({ center: [0, 0, 0], width: 10, height: 5, length: 20, roundRadius: 1, segments: 16 }); * ``` */ roundedCuboid(inputs: Inputs.JSCAD.RoundedCuboidDto): Promise; /** * Builds one rounded box with the given sides and rounding on every point of `centers`, in the * same order, as `roundedCuboid` does for one. * @param inputs - The center points, the three side lengths, the rounding radius and the segment count * @returns One rounded box per center point * @group primitives on centers * @shortname rounded cuboid * @drawable true * @example * ```typescript * const softBoxes = await bitbybit.jscad.shapes.roundedCuboidsOnCenterPoints({ centers: [[0, 0, 0], [20, 0, 0]], width: 10, height: 5, length: 20, roundRadius: 1, segments: 16 }); * ``` */ roundedCuboidsOnCenterPoints(inputs: Inputs.JSCAD.RoundedCuboidCentersDto): Promise; /** * Builds a cylinder standing along Z whose two rims are rounded by `roundRadius`, with `height` * split evenly above and below `center`. * * `height` must be more than twice `roundRadius` or an error is thrown. * @param inputs - The center, the rounding radius, the height, the radius and the segment count * @returns The rounded cylinder solid * @group primitives * @shortname rounded cylinder * @drawable true * @example * ```typescript * const pill = await bitbybit.jscad.shapes.roundedCylinder({ center: [0, 0, 0], roundRadius: 1, height: 10, radius: 3, segments: 32 }); * ``` */ roundedCylinder(inputs: Inputs.JSCAD.RoundedCylidnerDto): Promise; /** * Builds one rounded cylinder with the given size and rounding on every point of `centers`, in * the same order, as `roundedCylinder` does for one. * @param inputs - The center points, the rounding radius, the height, the radius and the segment count * @returns One rounded cylinder per center point * @group primitives on centers * @shortname rounded cylinder * @drawable true * @example * ```typescript * const pills = await bitbybit.jscad.shapes.roundedCylindersOnCenterPoints({ centers: [[0, 0, 0], [20, 0, 0]], roundRadius: 1, height: 10, radius: 3, segments: 32 }); * ``` */ roundedCylindersOnCenterPoints(inputs: Inputs.JSCAD.RoundedCylidnerCentersDto): Promise; /** * Builds a sphere of the given `radius` centered on `center`; `segments` is the number of * facets around it, so more makes it rounder. * @param inputs - The center, the radius and the segment count * @returns The sphere solid * @group primitives * @shortname sphere * @drawable true * @example * ```typescript * const ball = await bitbybit.jscad.shapes.sphere({ center: [0, 0, 0], radius: 5, segments: 32 }); * ``` */ sphere(inputs: Inputs.JSCAD.SphereDto): Promise; /** * Builds one sphere of the given `radius` on every point of `centers`, in the same order, as * `sphere` does for one. * @param inputs - The center points, the radius and the segment count * @returns One sphere per center point * @group primitives on centers * @shortname sphere * @drawable true * @example * ```typescript * const balls = await bitbybit.jscad.shapes.spheresOnCenterPoints({ centers: [[0, 0, 0], [20, 0, 0], [40, 0, 0]], radius: 5, segments: 32 }); * ``` */ spheresOnCenterPoints(inputs: Inputs.JSCAD.SphereCentersDto): Promise; /** * Builds a torus, a ring with a round cross-section, lying flat in the XY plane around `center` * with Z through its hole. * * `outerRadius` is the distance from the center to the middle of the tube and `innerRadius` the * tube's own radius, which must be smaller. Rotations and `startAngle` are in degrees; an * `outerRotation` below 360 leaves the ring open. * @param inputs - The center, the two radii, the two segment counts, the two rotations and the start angle * @returns The torus solid * @group primitives * @shortname torus * @drawable true * @example * ```typescript * const ring = await bitbybit.jscad.shapes.torus({ center: [0, 0, 0], innerRadius: 1, outerRadius: 5, innerSegments: 16, outerSegments: 48, innerRotation: 0, outerRotation: 360, startAngle: 0 }); * ``` */ torus(inputs: Inputs.JSCAD.TorusDto): Promise; /** * Builds a solid from its faces, each given as a list of points that go around the face. * * List the points of every face clockwise as seen from outside the solid; the faces must close * the solid for booleans to work on it. Each list is read in reverse order and the input is not * changed. * @param inputs - The faces as lists of points * @returns The solid * @group shapes * @shortname from polygon points * @drawable true * @example * ```typescript * const tetrahedron = await bitbybit.jscad.shapes.fromPolygonPoints({ polygonPoints: [ * [[0, 0, 0], [10, 0, 0], [0, 10, 0]], * [[0, 0, 0], [0, 10, 0], [0, 0, 10]], * [[0, 0, 0], [0, 0, 10], [10, 0, 0]], * [[10, 0, 0], [0, 0, 10], [0, 10, 0]], * ] }); * ``` */ fromPolygonPoints(inputs: Inputs.JSCAD.FromPolygonPoints): Promise; } /** * Writing text with JSCAD's built-in stroke font. `createVectorText` gives the pen strokes of the * text as lists of 2D points in the XY plane; `cylindricalText` and `sphericalText` turn every * stroke into a solid by chaining hulled cylinders or spheres along it, centered on the origin. The * text `height` is the height of a capital letter in model units. */ declare class JSCADText { private readonly jscadWorkerManager; /** * Writes text as solids: every pen stroke becomes a chain of cylinders standing along Z, hulled * together into one smooth solid, so a letter like A gives several solids. * * The strokes lie in the XY plane, centered on the origin, and the cylinders are * `extrusionHeight` long with half above and half below the plane. * @param inputs - The text, the cylinder height and radius, the segment count and the font options * @returns One solid per pen stroke * @group text * @shortname cylindrical * @drawable true * @example * ```typescript * const letters = await bitbybit.jscad.text.cylindricalText({ text: "Hello", extrusionHeight: 2, extrusionSize: 0.5, segments: 16, xOffset: 0, yOffset: 0, height: 10, lineSpacing: 1.4, letterSpacing: 1, align: Bit.Inputs.JSCAD.jscadTextAlignEnum.center, extrudeOffset: 0 }); * ``` */ cylindricalText(inputs: Inputs.JSCAD.CylinderTextDto): Promise; /** * Writes text as solids: every pen stroke becomes a chain of spheres hulled together into one * rounded solid, so a letter like A gives several solids. * * The strokes lie in the XY plane, centered on the origin, and the spheres of `radius` sit on * that plane. * @param inputs - The text, the sphere radius, the segment count and the font options * @returns One solid per pen stroke * @group text * @shortname spherical * @drawable true * @example * ```typescript * const letters = await bitbybit.jscad.text.sphericalText({ text: "Hello", radius: 0.5, segments: 16, xOffset: 0, yOffset: 0, height: 10, lineSpacing: 1.4, letterSpacing: 1, align: Bit.Inputs.JSCAD.jscadTextAlignEnum.center, extrudeOffset: 0 }); * ``` */ sphericalText(inputs: Inputs.JSCAD.SphereTextDto): Promise; /** * Writes text as pen strokes: each stroke is a list of 2D points in the XY plane, and a letter * may take several. * * The text starts at `xOffset`, `yOffset` and is not centered; `height` is the height of a * capital letter, `lineSpacing` and `letterSpacing` scale the gaps and `align` places the lines * of a multi-line text. * @param inputs - The text and the font options * @returns The strokes as lists of 2D points * @group text * @shortname vector * @drawable false * @example * ```typescript * const strokes = await bitbybit.jscad.text.createVectorText({ text: "Hi", segments: 16, xOffset: 0, yOffset: 0, height: 10, lineSpacing: 1.4, letterSpacing: 1, align: Bit.Inputs.JSCAD.jscadTextAlignEnum.center, extrudeOffset: 0 }); * ``` */ createVectorText(inputs: Inputs.JSCAD.TextDto): Promise; } /** * This should be used only if you want to use only Manifold worker without other of the bitbybit packages */ declare class BitByBitManifold { manifoldWorkerManager: ManifoldWorkerManager; manifold: ManifoldBitByBit; constructor(); /** * Connects this facade to the web worker that runs the Manifold kernel. * * Create the worker yourself from the package's worker entry, hand it over here, and wait for the * kernel to report that it is loaded before making calls; without a worker every call would hang. * @param manifold - The worker running the Manifold kernel */ init(manifold: Worker): void; } /** * Combining Manifold cross-sections: fusing, cutting and intersecting two or many flat outlines at * once. The two-shape and many-shape forms give the same results and exist for convenience; every * method returns a new cross-section and leaves the inputs as they are. */ declare class CrossSectionBooleans { private readonly manifoldWorkerManager; /** * Cuts the second cross-section out of the first, leaving what remains of the first. * @param inputs - The cross-section to cut from and the one to cut with * @returns The first minus the second * @group a to b * @shortname subtract * @drawable true * @example * ```typescript * const ring = await bitbybit.manifold.crossSection.booleans.subtract({ crossSection1: outerDisc, crossSection2: innerDisc }); * ``` */ subtract(inputs: Inputs.Manifold.TwoCrossSectionsDto): Promise; /** * Fuses two cross-sections into one outline, holes and all. * @param inputs - The two cross-sections * @returns The fused cross-section * @group a to b * @shortname add * @drawable true * @example * ```typescript * const fused = await bitbybit.manifold.crossSection.booleans.add({ crossSection1: square, crossSection2: disc }); * ``` */ add(inputs: Inputs.Manifold.TwoCrossSectionsDto): Promise; /** * Keeps only the area two cross-sections share, dropping everything else. * @param inputs - The two cross-sections * @returns The shared area * @group a to b * @shortname intersect * @drawable true * @example * ```typescript * const common = await bitbybit.manifold.crossSection.booleans.intersect({ crossSection1: square, crossSection2: disc }); * ``` */ intersect(inputs: Inputs.Manifold.TwoCrossSectionsDto): Promise; /** * Cuts the second cross-section out of the first, the same as `subtract`. * @param inputs - The cross-section to cut from and the one to cut with * @returns The first minus the second * @group 2 cross sections * @shortname difference 2 cs * @drawable true * @example * ```typescript * const ring = await bitbybit.manifold.crossSection.booleans.differenceTwo({ crossSection1: outerDisc, crossSection2: innerDisc }); * ``` */ differenceTwo(inputs: Inputs.Manifold.TwoCrossSectionsDto): Promise; /** * Fuses two cross-sections into one, the same as `add`. * @param inputs - The two cross-sections * @returns The fused cross-section * @group 2 cross sections * @shortname union 2 cs * @drawable true * @example * ```typescript * const fused = await bitbybit.manifold.crossSection.booleans.unionTwo({ crossSection1: square, crossSection2: disc }); * ``` */ unionTwo(inputs: Inputs.Manifold.TwoCrossSectionsDto): Promise; /** * Keeps only the area two cross-sections share, the same as `intersect`. * @param inputs - The two cross-sections * @returns The shared area * @group 2 cross sections * @shortname intersect 2 cs * @drawable true * @example * ```typescript * const common = await bitbybit.manifold.crossSection.booleans.intersectionTwo({ crossSection1: square, crossSection2: disc }); * ``` */ intersectionTwo(inputs: Inputs.Manifold.TwoCrossSectionsDto): Promise; /** * Cuts every further cross-section in the list out of the first one. * @param inputs - The cross-sections, the first being the one cut from * @returns The first minus all the others * @group multiple * @shortname diff cross sections * @drawable true * @example * ```typescript * const plate = await bitbybit.manifold.crossSection.booleans.difference({ crossSections: [square, hole1, hole2] }); * ``` */ difference(inputs: Inputs.Manifold.CrossSectionsDto): Promise; /** * Fuses all the cross-sections in a list into one. * @param inputs - The cross-sections * @returns The fused cross-section * @group multiple * @shortname union cross sections * @drawable true * @example * ```typescript * const fused = await bitbybit.manifold.crossSection.booleans.union({ crossSections: [square, disc, rectangle] }); * ``` */ union(inputs: Inputs.Manifold.CrossSectionsDto): Promise; /** * Keeps only the area all the cross-sections in a list share. * @param inputs - The cross-sections * @returns The area common to all of them * @group multiple * @shortname intersection cross sections * @drawable true * @example * ```typescript * const common = await bitbybit.manifold.crossSection.booleans.intersection({ crossSections: [square, disc] }); * ``` */ intersection(inputs: Inputs.Manifold.CrossSectionsDto): Promise; } /** * Flat outlines in the Manifold kernel, the 2D shapes that `operations.extrude` and * `operations.revolve` turn into solids and that `slice` and `project` cut out of them. A * cross-section is one or more closed polygons in the XY plane, holes included; `shapes` builds * them, `booleans` combines them, `operations` offsets, hulls and extrudes them, `transforms` moves * them and `evaluate` measures them. The methods here convert between cross-sections and plain * point lists, and free the memory a cross-section holds. */ declare class ManifoldCrossSection { private readonly manifoldWorkerManager; readonly shapes: CrossSectionShapes; readonly operations: CrossSectionOperations; readonly booleans: CrossSectionBooleans; readonly transforms: CrossSectionTransforms; readonly evaluate: CrossSectionEvaluate; /** * Builds a cross-section from one polygon given as points; only the X and Y of each point are * used. * * `fillRule` decides which regions of a self-crossing polygon count as inside; * `removeDuplicates` drops consecutive repeated points within `tolerance` first. * @param inputs - The polygon points, the fill rule and the duplicate handling * @returns The cross-section * @group create * @shortname cross section from points * @drawable true * @example * ```typescript * const outline = await bitbybit.manifold.crossSection.crossSectionFromPoints({ * points: [[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]], * fillRule: Bit.Inputs.Manifold.fillRuleEnum.positive, * removeDuplicates: false, * tolerance: 1e-7, * }); * ``` */ crossSectionFromPoints(inputs: Inputs.Manifold.CrossSectionFromPolygonPointsDto): Promise; /** * Builds a cross-section from several polygons given as points, for instance an outline and its * holes; only the X and Y of each point are used. * * `fillRule` decides which regions count as inside where polygons overlap; `removeDuplicates` * drops consecutive repeated points within `tolerance` first. * @param inputs - The polygons as point lists, the fill rule and the duplicate handling * @returns The cross-section * @group create * @shortname cross section from polygons * @drawable true * @example * ```typescript * const plate = await bitbybit.manifold.crossSection.crossSectionFromPolygons({ * polygonPoints: [outerPoints, holePoints], * fillRule: Bit.Inputs.Manifold.fillRuleEnum.evenOdd, * removeDuplicates: false, * tolerance: 1e-7, * }); * ``` */ crossSectionFromPolygons(inputs: Inputs.Manifold.CrossSectionFromPolygonsPointsDto): Promise; /** * Reads a cross-section back as its polygons, each a list of 2D points. * @param inputs - The cross-section * @returns One list of 2D points per polygon * @group decompose * @shortname cross section to polygons * @drawable false * @example * ```typescript * const polygons = await bitbybit.manifold.crossSection.crossSectionToPolygons({ crossSection: outline }); * ``` */ crossSectionToPolygons(inputs: Inputs.Manifold.CrossSectionDto): Promise; /** * Reads a cross-section back as its polygons with 3D points, Z set to 0, ready for drawing as * polylines. * @param inputs - The cross-section * @returns One list of points per polygon * @group decompose * @shortname cross section to points * @drawable false * @example * ```typescript * const polylines = await bitbybit.manifold.crossSection.crossSectionToPoints({ crossSection: outline }); * ``` */ crossSectionToPoints(inputs: Inputs.Manifold.CrossSectionDto): Promise; /** * Reads several cross-sections back as their polygons, as `crossSectionToPolygons` does for * one. * @param inputs - The cross-sections * @returns One polygon list per cross-section, in the same order * @group decompose * @shortname cross sections to polygons * @drawable false * @example * ```typescript * const polygons = await bitbybit.manifold.crossSection.crossSectionsToPolygons({ crossSections: [outline, hole] }); * ``` */ crossSectionsToPolygons(inputs: Inputs.Manifold.CrossSectionsDto): Promise; /** * Reads several cross-sections back as polygons with 3D points, as `crossSectionToPoints` does * for one. * @param inputs - The cross-sections * @returns One list of point polygons per cross-section, in the same order * @group decompose * @shortname cross sections to points * @drawable false * @example * ```typescript * const polylines = await bitbybit.manifold.crossSection.crossSectionsToPoints({ crossSections: [outline, hole] }); * ``` */ crossSectionsToPoints(inputs: Inputs.Manifold.CrossSectionsDto): Promise; } /** * Measuring Manifold cross-sections: area, emptiness, vertex and contour counts and the bounding * rectangle. Nothing here changes the cross-section. */ declare class CrossSectionEvaluate { private readonly manifoldWorkerManager; /** * Measures the area of a cross-section, in square model units, holes excluded. * @param inputs - The cross-section * @returns The area * @group basic * @shortname area * @drawable false * @example * ```typescript * const area = await bitbybit.manifold.crossSection.evaluate.area({ crossSection: outline }); * ``` */ area(inputs: Inputs.Manifold.CrossSectionDto): Promise; /** * Tells whether a cross-section has no contours at all. * @param inputs - The cross-section * @returns True when the cross-section is empty * @group basic * @shortname is empty * @drawable false * @example * ```typescript * const empty = await bitbybit.manifold.crossSection.evaluate.isEmpty({ crossSection: outline }); * ``` */ isEmpty(inputs: Inputs.Manifold.CrossSectionDto): Promise; /** * Counts the vertices of a cross-section over all its contours. * @param inputs - The cross-section * @returns The number of vertices * @group basic * @shortname num vert * @drawable false * @example * ```typescript * const vertices = await bitbybit.manifold.crossSection.evaluate.numVert({ crossSection: outline }); * ``` */ numVert(inputs: Inputs.Manifold.CrossSectionDto): Promise; /** * Counts the contours of a cross-section: its outer outlines and its holes. * @param inputs - The cross-section * @returns The number of contours * @group basic * @shortname num contour * @drawable false * @example * ```typescript * const contours = await bitbybit.manifold.crossSection.evaluate.numContour({ crossSection: plate }); * ``` */ numContour(inputs: Inputs.Manifold.CrossSectionDto): Promise; /** * Finds the rectangle around a cross-section as two 2D points: the minimum corner, then the * maximum corner. * @param inputs - The cross-section * @returns The minimum corner and the maximum corner * @group basic * @shortname bounds * @drawable false * @example * ```typescript * const [min, max] = await bitbybit.manifold.crossSection.evaluate.bounds({ crossSection: outline }); * ``` */ bounds(inputs: Inputs.Manifold.CrossSectionDto): Promise; } /** * Working with Manifold cross-sections beyond booleans: turning them into solids by extruding along * Z or revolving, offsetting their outlines, wrapping them in a convex hull, simplifying them, and * composing and decomposing them. Every method returns a new shape. */ declare class CrossSectionOperations { private readonly manifoldWorkerManager; /** * Wraps a cross-section in its convex hull, the smallest outline without dents that contains * it, like a rubber band stretched around it. * @param inputs - The cross-section * @returns The convex hull * @group basic * @shortname hull * @drawable true * @example * ```typescript * const wrapped = await bitbybit.manifold.crossSection.operations.hull({ crossSection: outline }); * ``` */ hull(inputs: Inputs.Manifold.CrossSectionDto): Promise; /** * Sweeps a cross-section along Z into a solid of the given height. * * `twistDegrees` turns the top against the bottom, `scaleTopX` and `scaleTopY` shrink or grow * it, and `nDivisions` adds sections in between so twists and tapers stay smooth; 0 for both * top scales makes a cone. `center` centers the solid on the XY plane instead of standing it on * it. * @param inputs - The cross-section, the height, the divisions, the twist in degrees, the top scale and whether to center it * @returns The extruded solid * @group basic * @shortname extrude * @drawable true * @example * ```typescript * const twisted = await bitbybit.manifold.crossSection.operations.extrude({ crossSection: square, height: 20, nDivisions: 20, twistDegrees: 90, scaleTopX: 0.5, scaleTopY: 0.5, center: false }); * ``` */ extrude(inputs: Inputs.Manifold.ExtrudeDto): Promise; /** * Spins a cross-section around the Y axis into a solid, like a lathe; only the part of the * outline on the positive X side is used. * * `revolveDegrees` below 360 gives a partial turn and `circularSegments` sets how round the * result is. The kernel stands the result along Z; `matchProfile`, true by default, turns it * back to match the profile. * @param inputs - The cross-section, the angle in degrees, the number of segments and whether to match the profile * @returns The revolved solid * @group basic * @shortname revolve * @drawable true * @example * ```typescript * const vase = await bitbybit.manifold.crossSection.operations.revolve({ crossSection: profile, revolveDegrees: 360, circularSegments: 64, matchProfile: true }); * ``` */ revolve(inputs: Inputs.Manifold.RevolveDto): Promise; /** * Moves the outline of a cross-section outward by `delta`, or inward for a negative delta, so * an outer contour grows and a hole shrinks. * * `joinType` says how corners are treated: rounded, squared off, mitered or beveled; * `miterLimit` caps how far a miter may reach and `circularSegments` how round a rounded corner * is. `simplify` afterwards cleans up tiny segments. * @param inputs - The cross-section, the distance, the corner treatment and its settings * @returns The offset cross-section * @group basic * @shortname offset * @drawable true * @example * ```typescript * const bigger = await bitbybit.manifold.crossSection.operations.offset({ crossSection: outline, delta: 1, joinType: Bit.Inputs.Manifold.manifoldJoinTypeEnum.round, miterLimit: 2, circularSegments: 32 }); * ``` */ offset(inputs: Inputs.Manifold.OffsetDto): Promise; /** * Removes points of a cross-section that lie within `epsilon` of the line between their * neighbors, dropping near-duplicates and collinear points. * * A larger epsilon removes more; run it after `offset` to clean up the tiny segments offsetting * leaves behind. * @param inputs - The cross-section and the distance below which a point is dropped * @returns The simplified cross-section * @group basic * @shortname simplify * @drawable true * @example * ```typescript * const cleaner = await bitbybit.manifold.crossSection.operations.simplify({ crossSection: offsetOutline, epsilon: 1e-4 }); * ``` */ simplify(inputs: Inputs.Manifold.SimplifyDto): Promise; /** * Packs several cross-sections or polygons into one cross-section without fusing them, the * inverse of `decompose`. * @param inputs - The cross-sections or polygons to pack together * @returns One cross-section holding all of them * @group composition * @shortname compose * @drawable true * @example * ```typescript * const packed = await bitbybit.manifold.crossSection.operations.compose({ polygons: [square, disc] }); * ``` */ compose(inputs: Inputs.Manifold.ComposeDto<(Inputs.Manifold.CrossSectionPointer | Inputs.Base.Vector2[])[]>): Promise; /** * Splits a cross-section into its separate, unconnected outlines, each with its own holes, the * inverse of `compose`. * @param inputs - The cross-section * @returns The separate outlines * @group composition * @shortname decompose * @drawable true * @example * ```typescript * const pieces = await bitbybit.manifold.crossSection.operations.decompose({ crossSection: packed }); * ``` */ decompose(inputs: Inputs.Manifold.CrossSectionDto): Promise; } /** * Building Manifold cross-sections, the flat outlines that become solids: squares, rectangles, * circles and outlines from raw polygons. They lie in the XY plane; `center` places a shape on the * origin, otherwise its corner sits there. */ declare class CrossSectionShapes { private readonly manifoldWorkerManager; /** * Builds a cross-section from polygons given as 2D points, fusing overlapping ones so the * result has no crossings. * * `fillRule` decides which regions count as inside where polygons overlap or a polygon crosses * itself. * @param inputs - The polygons as 2D point lists and the fill rule * @returns The cross-section * @group base * @shortname create * @drawable true * @example * ```typescript * const outline = await bitbybit.manifold.crossSection.shapes.create({ polygons: [[[0, 0], [10, 0], [10, 10], [0, 10]]], fillRule: Bit.Inputs.Manifold.fillRuleEnum.evenOdd }); * ``` */ create(inputs: Inputs.Manifold.CreateContourSectionDto): Promise; /** * Creates a square cross-section of the given side; with `center` true it is centered on the * origin, otherwise its corner sits there. * @param inputs - The side length and whether to center it * @returns The square cross-section * @group primitives * @shortname square * @drawable true * @example * ```typescript * const square = await bitbybit.manifold.crossSection.shapes.square({ size: 10, center: true }); * ``` */ square(inputs: Inputs.Manifold.SquareDto): Promise; /** * Creates a circular cross-section of the given radius, centered on the origin and drawn with * `circularSegments` straight sides. * @param inputs - The radius and the number of sides * @returns The circle cross-section * @group primitives * @shortname circle * @drawable true * @example * ```typescript * const disc = await bitbybit.manifold.crossSection.shapes.circle({ radius: 5, circularSegments: 64 }); * ``` */ circle(inputs: Inputs.Manifold.CircleDto): Promise; /** * Creates a rectangular cross-section with `length` along X and `height` along Y; with `center` * true it is centered on the origin, otherwise its corner sits there. * @param inputs - The length, the height and whether to center it * @returns The rectangle cross-section * @group primitives * @shortname rectangle * @drawable true * @example * ```typescript * const rectangle = await bitbybit.manifold.crossSection.shapes.rectangle({ length: 20, height: 10, center: true }); * ``` */ rectangle(inputs: Inputs.Manifold.RectangleDto): Promise; } /** * Moving, turning, scaling, mirroring and warping Manifold cross-sections in the XY plane. Angles * are in degrees and rotations turn about the origin; every method returns a new cross-section. */ declare class CrossSectionTransforms { private readonly manifoldWorkerManager; /** * Scales a cross-section by a separate factor along X and Y, about the origin. * @param inputs - The cross-section and the two factors * @returns The scaled cross-section * @group transforms * @shortname scale 2d * @drawable true * @example * ```typescript * const stretched = await bitbybit.manifold.crossSection.transforms.scale2D({ crossSection: square, vector: [2, 1] }); * ``` */ scale2D(inputs: Inputs.Manifold.Scale2DCrossSectionDto): Promise; /** * Scales a cross-section uniformly about the origin by a factor. * @param inputs - The cross-section and the factor * @returns The scaled cross-section * @group transforms * @shortname scale uniform * @drawable true * @example * ```typescript * const bigger = await bitbybit.manifold.crossSection.transforms.scale({ crossSection: square, factor: 2 }); * ``` */ scale(inputs: Inputs.Manifold.ScaleCrossSectionDto): Promise; /** * Mirrors a cross-section across the line through the origin that is perpendicular to the given * normal. * @param inputs - The cross-section and the normal of the mirror line * @returns The mirrored cross-section * @group transforms * @shortname mirror * @drawable true * @example * ```typescript * const other = await bitbybit.manifold.crossSection.transforms.mirror({ crossSection: outline, normal: [1, 0] }); * ``` */ mirror(inputs: Inputs.Manifold.MirrorCrossSectionDto): Promise; /** * Moves a cross-section by a 2D vector, in model units. * @param inputs - The cross-section and the vector to move it by * @returns The moved cross-section * @group transforms * @shortname translate * @drawable true * @example * ```typescript * const moved = await bitbybit.manifold.crossSection.transforms.translate({ crossSection: square, vector: [10, 0] }); * ``` */ translate(inputs: Inputs.Manifold.TranslateCrossSectionDto): Promise; /** * Moves a cross-section by separate distances along X and Y, in model units. * @param inputs - The cross-section and the two distances * @returns The moved cross-section * @group transforms * @shortname translate xy * @drawable true * @example * ```typescript * const moved = await bitbybit.manifold.crossSection.transforms.translateXY({ crossSection: square, x: 10, y: 5 }); * ``` */ translateXY(inputs: Inputs.Manifold.TranslateXYCrossSectionDto): Promise; /** * Rotates a cross-section about the origin by an angle in degrees, counterclockwise. * @param inputs - The cross-section and the angle in degrees * @returns The rotated cross-section * @group transforms * @shortname rotate * @drawable true * @example * ```typescript * const turned = await bitbybit.manifold.crossSection.transforms.rotate({ crossSection: square, degrees: 45 }); * ``` */ rotate(inputs: Inputs.Manifold.RotateCrossSectionDto): Promise; /** * Applies a 3x3 matrix to a cross-section, for any combination of move, turn, scale and shear * in the plane. * @param inputs - The cross-section and the 3x3 matrix * @returns The transformed cross-section * @group matrix * @shortname transform * @drawable true * @example * ```typescript * const moved = await bitbybit.manifold.crossSection.transforms.transform({ crossSection: square, transform: matrix }); * ``` */ transform(inputs: Inputs.Manifold.TransformCrossSectionDto): Promise; /** * Moves every point of a cross-section with a function of your own that changes the point in * place, then fuses the result so any crossings the move introduced are cleaned up. * @param inputs - The cross-section and the function that moves each point * @returns The warped cross-section * @group transforms * @shortname warp * @drawable true * @example * ```typescript * const wavy = await bitbybit.manifold.crossSection.transforms.warp({ * crossSection: square, * warpFunc: (vert) => { vert[1] += Math.sin(vert[0]) * 0.5; }, * }); * ``` */ warp(inputs: Inputs.Manifold.CrossSectionWarpDto): Promise; } /** * Combining Manifold solids: fusing, cutting and intersecting two or many at once, and splitting a * solid with another solid or a plane. Because the kernel works on closed triangle meshes, these * are fast and always give a watertight result; the two-shape and many-shape forms give the same * results and exist for convenience. Every method returns new solids and leaves the inputs as they * are. */ declare class ManifoldBooleans { private readonly manifoldWorkerManager; /** * Sweeps the second solid over the whole surface of the first and fuses everything it passes * through, growing the first solid by the shape of the second - the Minkowski sum, which is * how a solid is rounded or padded by a sphere. * @param inputs - The solid to grow and the solid to sweep * @returns The grown solid * @group minkowski * @shortname minkowski sum * @drawable true * @example * ```typescript * const padded = await bitbybit.manifold.manifold.booleans.minkowskiSum({ manifold1: cube, manifold2: sphere }); * ``` */ minkowskiSum(inputs: Inputs.Manifold.TwoManifoldsDto): Promise; /** * Sweeps the second solid over the whole surface of the first and cuts away everything it * passes through, shrinking the first solid by the shape of the second - the Minkowski * difference, the erosion that undoes a Minkowski sum. * @param inputs - The solid to shrink and the solid to sweep * @returns The shrunken solid * @group minkowski * @shortname minkowski difference * @drawable true * @example * ```typescript * const eroded = await bitbybit.manifold.manifold.booleans.minkowskiDifference({ manifold1: cube, manifold2: sphere }); * ``` */ minkowskiDifference(inputs: Inputs.Manifold.TwoManifoldsDto): Promise; /** * Cuts the second solid out of the first, leaving what remains of the first. * @param inputs - The solid to cut from and the solid to cut with * @returns The first solid minus the second * @group a to b * @shortname subtract * @drawable true * @example * ```typescript * const holed = await bitbybit.manifold.manifold.booleans.subtract({ manifold1: cube, manifold2: sphere }); * ``` */ subtract(inputs: Inputs.Manifold.TwoManifoldsDto): Promise; /** * Fuses two solids into one closed, watertight solid. * @param inputs - The two solids * @returns The fused solid * @group a to b * @shortname add * @drawable true * @example * ```typescript * const fused = await bitbybit.manifold.manifold.booleans.add({ manifold1: cube, manifold2: sphere }); * ``` */ add(inputs: Inputs.Manifold.TwoManifoldsDto): Promise; /** * Keeps only the volume two solids share, dropping everything else. * @param inputs - The two solids * @returns The shared volume * @group a to b * @shortname intersect * @drawable true * @example * ```typescript * const common = await bitbybit.manifold.manifold.booleans.intersect({ manifold1: cube, manifold2: sphere }); * ``` */ intersect(inputs: Inputs.Manifold.TwoManifoldsDto): Promise; /** * Cuts the second solid out of the first, the same as `subtract`. * @param inputs - The solid to cut from and the solid to cut with * @returns The first solid minus the second * @group 2 manifolds * @shortname difference 2 manifolds * @drawable true * @example * ```typescript * const holed = await bitbybit.manifold.manifold.booleans.differenceTwo({ manifold1: cube, manifold2: sphere }); * ``` */ differenceTwo(inputs: Inputs.Manifold.TwoManifoldsDto): Promise; /** * Fuses two solids into one, the same as `add`. * @param inputs - The two solids * @returns The fused solid * @group 2 manifolds * @shortname union 2 manifolds * @drawable true * @example * ```typescript * const fused = await bitbybit.manifold.manifold.booleans.unionTwo({ manifold1: cube, manifold2: sphere }); * ``` */ unionTwo(inputs: Inputs.Manifold.TwoManifoldsDto): Promise; /** * Keeps only the volume two solids share, the same as `intersect`. * @param inputs - The two solids * @returns The shared volume * @group 2 manifolds * @shortname intersection 2 manifolds * @drawable true * @example * ```typescript * const common = await bitbybit.manifold.manifold.booleans.intersectionTwo({ manifold1: cube, manifold2: sphere }); * ``` */ intersectionTwo(inputs: Inputs.Manifold.TwoManifoldsDto): Promise; /** * Cuts every further solid in the list out of the first one. * @param inputs - The solids, the first being the one cut from * @returns The first solid minus all the others * @group multiple * @shortname difference manifolds * @drawable true * @example * ```typescript * const holed = await bitbybit.manifold.manifold.booleans.difference({ manifolds: [cube, sphere, cylinder] }); * ``` */ difference(inputs: Inputs.Manifold.ManifoldsDto): Promise; /** * Fuses all the solids in a list into one. * @param inputs - The solids * @returns The fused solid * @group multiple * @shortname union manifolds * @drawable true * @example * ```typescript * const fused = await bitbybit.manifold.manifold.booleans.union({ manifolds: [cube, sphere, cylinder] }); * ``` */ union(inputs: Inputs.Manifold.ManifoldsDto): Promise; /** * Keeps only the volume all the solids in a list share. * @param inputs - The solids * @returns The volume common to all of them * @group multiple * @shortname intersection manifolds * @drawable true * @example * ```typescript * const common = await bitbybit.manifold.manifold.booleans.intersection({ manifolds: [cube, sphere] }); * ``` */ intersection(inputs: Inputs.Manifold.ManifoldsDto): Promise; /** * Cuts a solid with another solid and keeps both pieces: the part inside the cutter and the * part outside it. * * Cheaper than an intersection followed by a subtraction when both are needed. * @param inputs - The solid to split and the solid to cut with * @returns Two solids: the part inside the cutter, then the part outside it * @group split * @shortname split * @drawable true * @example * ```typescript * const [inside, outside] = await bitbybit.manifold.manifold.booleans.split({ manifoldToSplit: cube, manifoldCutter: sphere }); * ``` */ split(inputs: Inputs.Manifold.SplitManifoldsDto): Promise; /** * Cuts a solid with a plane and keeps both pieces. * * The plane is given by its normal and its distance from the origin along that normal; the * first piece lies on the side the normal points to, the second on the other side. * @param inputs - The solid, the plane normal and the plane's distance from the origin * @returns Two solids: the part on the normal's side, then the rest * @group split * @shortname split by plane * @drawable true * @example * ```typescript * const [top, bottom] = await bitbybit.manifold.manifold.booleans.splitByPlane({ manifold: cube, normal: [0, 0, 1], originOffset: 0.5 }); * ``` */ splitByPlane(inputs: Inputs.Manifold.SplitByPlaneDto): Promise; /** * Cuts a solid into slabs with several parallel planes, all with the same normal, at the given * distances from the origin. * * Each cut keeps the part on the far side of the normal as a finished piece and carries the * rest to the next distance, so the offsets should increase; n offsets give n + 1 pieces, empty * ones dropped. * @param inputs - The solid, the plane normal and the distances of the planes from the origin * @returns The slabs, one more than the offsets given * @group split * @shortname split by plane on offsets * @drawable true * @example * ```typescript * const slabs = await bitbybit.manifold.manifold.booleans.splitByPlaneOnOffsets({ manifold: cube, normal: [0, 0, 1], originOffsets: [0.25, 0.5, 0.75] }); * ``` */ splitByPlaneOnOffsets(inputs: Inputs.Manifold.SplitByPlaneOnOffsetsDto): Promise; /** * Cuts a solid with a plane and keeps only the part on the side the normal points to. * * The plane is given by its normal and its distance from the origin along that normal. * @param inputs - The solid, the plane normal and the plane's distance from the origin * @returns The part of the solid on the normal's side * @group trim * @shortname trim by plane * @drawable true * @example * ```typescript * const half = await bitbybit.manifold.manifold.booleans.trimByPlane({ manifold: sphere, normal: [0, 0, 1], originOffset: 0 }); * ``` */ trimByPlane(inputs: Inputs.Manifold.TrimByPlaneDto): Promise; } /** * Measuring Manifold solids and reading their bookkeeping: surface area and volume, vertex, * triangle and edge counts, the bounding box, the tolerance, the genus, the gap to another solid, * and the id and status the kernel tracks for every solid. Nothing here changes the solid. */ declare class ManifoldEvaluate { private readonly manifoldWorkerManager; /** * Measures the total surface area of a solid, in square model units. * @param inputs - The solid * @returns The surface area * @group basic * @shortname surface area * @drawable false * @example * ```typescript * const area = await bitbybit.manifold.manifold.evaluate.surfaceArea({ manifold: cube }); * ``` */ surfaceArea(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Measures the volume of a solid, in cubic model units. * @param inputs - The solid * @returns The volume * @group basic * @shortname volume * @drawable false * @example * ```typescript * const volume = await bitbybit.manifold.manifold.evaluate.volume({ manifold: cube }); * ``` */ volume(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Tells whether a solid has no triangles at all, as the result of an intersection of shapes * that do not overlap would. * @param inputs - The solid * @returns True when the solid is empty * @group basic * @shortname is empty * @drawable false * @example * ```typescript * const empty = await bitbybit.manifold.manifold.evaluate.isEmpty({ manifold: shape }); * ``` */ isEmpty(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Counts the vertices of a solid's mesh, the corners its triangles share. * @param inputs - The solid * @returns The number of vertices * @group basic * @shortname num vert * @drawable false * @example * ```typescript * const vertices = await bitbybit.manifold.manifold.evaluate.numVert({ manifold: shape }); * ``` */ numVert(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Counts the triangles of a solid's mesh, which is its whole surface. * @param inputs - The solid * @returns The number of triangles * @group basic * @shortname num triangles * @drawable false * @example * ```typescript * const triangles = await bitbybit.manifold.manifold.evaluate.numTri({ manifold: shape }); * ``` */ numTri(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Counts the edges of a solid's mesh, each shared by two triangles. * @param inputs - The solid * @returns The number of edges * @group basic * @shortname num edges * @drawable false * @example * ```typescript * const edges = await bitbybit.manifold.manifold.evaluate.numEdge({ manifold: shape }); * ``` */ numEdge(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Counts the property channels each vertex of a solid carries; the position alone takes three. * @param inputs - The solid * @returns The number of properties per vertex * @group basic * @shortname num prop * @drawable false * @example * ```typescript * const channels = await bitbybit.manifold.manifold.evaluate.numProp({ manifold: shape }); * ``` */ numProp(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Counts the property vertices of a solid, which is at least `numVert`: a vertex whose * neighboring triangles carry different properties, such as a sharp edge with two normals, is * stored more than once. * @param inputs - The solid * @returns The number of property vertices * @group basic * @shortname num prop vert * @drawable false * @example * ```typescript * const propVertices = await bitbybit.manifold.manifold.evaluate.numPropVert({ manifold: shape }); * ``` */ numPropVert(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Finds the axis-aligned box around every vertex of a solid. * @param inputs - The solid * @returns The minimum corner and the maximum corner * @group basic * @shortname bounding box * @drawable false * @example * ```typescript * const [min, max] = await bitbybit.manifold.manifold.evaluate.boundingBox({ manifold: shape }); * ``` */ boundingBox(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Reads the tolerance of a solid, the rounding error that has built up over the transforms and * operations that made it. * * Triangles thinner than this are treated as degenerate and removed. * @param inputs - The solid * @returns The tolerance in model units * @group basic * @shortname tolerance * @drawable false * @example * ```typescript * const tolerance = await bitbybit.manifold.manifold.evaluate.tolerance({ manifold: shape }); * ``` */ tolerance(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Counts the holes through a solid, the way a ring has one and a sphere none. * * It only makes sense for a single connected piece, so run `operations.decompose` first on a * solid made of several. * @param inputs - The solid * @returns The number of holes through the solid * @group basic * @shortname genus * @drawable false * @example * ```typescript * const holes = await bitbybit.manifold.manifold.evaluate.genus({ manifold: shape }); * ``` */ genus(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Measures the smallest distance between two solids, searching no farther than `searchLength`. * * The result is between 0 and the search length. * @param inputs - The two solids and how far to search, in model units * @returns The smallest gap between them * @group basic * @shortname min gap * @drawable false * @example * ```typescript * const gap = await bitbybit.manifold.manifold.evaluate.minGap({ manifold1: cube, manifold2: sphere, searchLength: 100 }); * ``` */ minGap(inputs: Inputs.Manifold.ManifoldsMinGapDto): Promise; /** * Shoots a ray segment from one point to another and lists every place it crosses the surface * of a solid, nearest first; an empty list when it misses. * * A hit carries the point, the normal there, the original face id and its distance along the * segment as a fraction of the segment's length. * @param inputs - The solid, the start and the end of the ray segment * @returns The hits sorted by distance * @group spatial * @shortname ray cast * @drawable false * @example * ```typescript * const hits = await bitbybit.manifold.manifold.evaluate.rayCast({ manifold: shape, origin: [0, 10, 0], endpoint: [0, -10, 0] }); * ``` */ rayCast(inputs: Inputs.Manifold.RayCastDto): Promise; /** * Reads the id of a solid that is an original, as `operations.asOriginal` or a freshly built * solid makes it; a solid produced from others by an operation reports -1. * @param inputs - The solid * @returns The original id, or -1 * @group basic * @shortname original id * @drawable false * @example * ```typescript * const id = await bitbybit.manifold.manifold.evaluate.originalID({ manifold: shape }); * ``` */ originalID(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Tells why a solid came out empty: `NoError`, or a reason such as `NotManifold` or * `InvalidConstruction` when the mesh it was built from was not a closed surface. * * The status is carried through later operations, so a broken input does not get lost; an empty * solid can still report `NoError`, as intersecting shapes that do not overlap does. * @param inputs - The solid * @returns The status name * @group basic * @shortname status * @drawable false * @example * ```typescript * const status = await bitbybit.manifold.manifold.evaluate.status({ manifold: shape }); * ``` */ status(inputs: Inputs.Manifold.ManifoldDto): Promise; } /** * Solids in the Manifold kernel: `shapes` builds cubes, spheres, cylinders and solids from meshes, * `booleans` fuses, cuts and splits them, `operations` hulls, slices, refines and smooths them, * `transforms` moves them and `evaluate` measures them. A solid here is a closed triangle mesh; * every operation returns a new solid and the inputs stay as they are. The methods on this class * turn solids into plain mesh data. */ declare class Manifold { private readonly manifoldWorkerManager; readonly shapes: ManifoldShapes; readonly booleans: ManifoldBooleans; readonly operations: ManifoldOperations; readonly transforms: ManifoldTransforms; readonly evaluate: ManifoldEvaluate; /** * Turns a solid into plain mesh data: vertex properties, triangle indexes and the runs that * group triangles by their original shape. * * `normalIdx` names the vertex property channel that holds normals, when the solid carries * them. * @param inputs - The solid and the optional normal channel * @returns The mesh data * @group meshing * @shortname manifold to mesh * @drawable false * @example * ```typescript * const mesh = await bitbybit.manifold.manifold.manifoldToMesh({ manifold: cube }); * ``` */ manifoldToMesh(inputs: Inputs.Manifold.ManifoldToMeshDto): Promise; /** * Turns several solids into plain mesh data, as `manifoldToMesh` does for one. * * `normalIdx` gives one normal channel per solid. * @param inputs - The solids and the optional normal channels * @returns One mesh per solid, in the same order * @group meshing * @shortname manifolds to meshes * @drawable false * @example * ```typescript * const meshes = await bitbybit.manifold.manifold.manifoldsToMeshes({ manifolds: [cube, sphere] }); * ``` */ manifoldsToMeshes(inputs: Inputs.Manifold.ManifoldsToMeshesDto): Promise; } /** * Changing Manifold solids beyond booleans: wrapping them in a convex hull, slicing and projecting * them into cross-sections, refining and smoothing their meshes, simplifying them, composing and * decomposing them, and computing normals and curvature into vertex property channels. A property * channel is one number per vertex stored on the mesh, such as the three channels of a normal. * Every method returns a new solid. */ declare class ManifoldOperations { private readonly manifoldWorkerManager; /** * Wraps a solid in its convex hull, the smallest shape without dents that contains it, like * shrink-wrap pulled tight over it. * @param inputs - The solid * @returns The convex hull * @group hulls * @shortname convex hull * @drawable true * @example * ```typescript * const wrapped = await bitbybit.manifold.manifold.operations.hull({ manifold: shape }); * ``` */ hull(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Wraps points, solids or a mix of both in one convex hull, the smallest shape without dents * that contains them all. * @param inputs - The points and solids to wrap * @returns The convex hull * @group hulls * @shortname hull points * @drawable true * @example * ```typescript * const wrapped = await bitbybit.manifold.manifold.operations.hullPoints({ points: [[0, 0, 0], [10, 0, 0], [0, 10, 0], [0, 0, 10]] }); * ``` */ hullPoints(inputs: Inputs.Manifold.HullPointsDto<(Inputs.Base.Point3 | Inputs.Manifold.ManifoldPointer)[]>): Promise; /** * Cuts a solid with a plane parallel to the XY plane at the given Z height and returns the flat * section as a cross-section. * * A height at the bottom of the solid's bounding box gives its bottom faces; a height at the * top gives an empty cross-section. * @param inputs - The solid and the Z height of the cut * @returns The section as a cross-section * @group cross sections * @shortname slice * @drawable true * @example * ```typescript * const section = await bitbybit.manifold.manifold.operations.slice({ manifold: sphere, height: 2 }); * ``` */ slice(inputs: Inputs.Manifold.SliceDto): Promise; /** * Flattens a solid onto the XY plane and returns its outline as a cross-section, like its * shadow under a light straight above. * @param inputs - The solid * @returns The outline as a cross-section * @group cross sections * @shortname project * @drawable true * @example * ```typescript * const shadow = await bitbybit.manifold.manifold.operations.project({ manifold: shape }); * ``` */ project(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Gives a solid a new tolerance, the rounding error it is allowed to carry, and simplifies its * mesh when the tolerance grows. * * Triangles thinner than the tolerance are treated as degenerate and removed. * @param inputs - The solid and the tolerance in model units * @returns The solid with the new tolerance * @group basic * @shortname set tolerance * @drawable false * @example * ```typescript * const coarser = await bitbybit.manifold.manifold.operations.setTolerance({ manifold: shape, tolerance: 0.01 }); * ``` */ setTolerance(inputs: Inputs.Manifold.ManifoldRefineToleranceDto): Promise; /** * Reserves a run of `count` unique mesh ids and returns the first, for marking sets of * triangles that can be found again after later operations. * * Assign them to a mesh's `runOriginalID` before building a solid from it, for instance to keep * several materials apart. * @param inputs - How many ids to reserve * @returns The first of the reserved ids; the rest follow in sequence * @group basic * @shortname reserve id * @drawable false * @example * ```typescript * const firstId = await bitbybit.manifold.manifold.operations.reserveIds({ count: 2 }); * ``` */ reserveIds(inputs: Inputs.Manifold.CountDto): Promise; /** * Makes a copy of a solid that counts as a new original, so the copy can carry its own vertex * properties, such as a different UV mapping, and be told apart from what it was built from. * * Coplanar faces are merged and the edges between them collapsed on the way; keep the mesh * route instead when those edges must stay. * @param inputs - The solid * @returns The copy marked as an original * @group basic * @shortname as original * @drawable true * @example * ```typescript * const original = await bitbybit.manifold.manifold.operations.asOriginal({ manifold: shape }); * ``` */ asOriginal(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Packs several solids into one, the inverse of `decompose`. * * Solids that overlap are fused, as a boolean union would; solids kept apart stay separate * pieces of the one result. * @param inputs - The solids to pack together * @returns One solid holding all of them * @group composition * @shortname compose * @drawable true * @example * ```typescript * const packed = await bitbybit.manifold.manifold.operations.compose({ manifolds: [cube, sphere] }); * ``` */ compose(inputs: Inputs.Manifold.ManifoldsDto): Promise; /** * Splits a solid into its separate, unconnected pieces, the inverse of `compose`. * * A solid that is all one piece comes back as a list of one copy. * @param inputs - The solid * @returns The separate pieces * @group composition * @shortname decompose * @drawable true * @example * ```typescript * const pieces = await bitbybit.manifold.manifold.operations.decompose({ manifold: packed }); * ``` */ decompose(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Computes a normal for every vertex from the mesh and stores it in three property channels * starting at `normalIdx`. * * Edges sharper than `minSharpAngle`, in degrees, keep separate normals on each side and stay * crisp; at 0 every triangle keeps its own normal. Flat faces of several triangles stay flat. * @param inputs - The solid, the first normal channel and the sharp angle in degrees * @returns The solid with normals stored * @group adjustments * @shortname calculate normals * @drawable true * @example * ```typescript * const withNormals = await bitbybit.manifold.manifold.operations.calculateNormals({ manifold: shape, normalIdx: 0, minSharpAngle: 60 }); * ``` */ calculateNormals(inputs: Inputs.Manifold.CalculateNormalsDto): Promise; /** * Computes how strongly the surface bends at every vertex and stores it in property channels: * Gaussian curvature at `gaussianIdx`, mean curvature at `meanIdx`. * * Curvature is the inverse of the bending radius, positive where the surface is convex and * negative where it is concave; an index below 0 skips that channel. * @param inputs - The solid and the two channels to store into * @returns The solid with curvature stored * @group adjustments * @shortname calculate curvature * @drawable true * @example * ```typescript * const withCurvature = await bitbybit.manifold.manifold.operations.calculateCurvature({ manifold: shape, gaussianIdx: 0, meanIdx: 1 }); * ``` */ calculateCurvature(inputs: Inputs.Manifold.CalculateCurvatureDto): Promise; /** * Adds triangles to a smoothed solid until every point of its mesh lies within `tolerance` of * the smooth surface, so tightly curved regions get more triangles than flat ones. * * Only a solid that was smoothed with `smoothOut` or `smoothByNormals` changes; any other comes * back as a copy. * @param inputs - The solid and the tolerance in model units * @returns The refined solid * @group adjustments * @shortname refine to tolerance * @drawable true * @example * ```typescript * const finer = await bitbybit.manifold.manifold.operations.refineToTolerance({ manifold: smoothed, tolerance: 0.01 }); * ``` */ refineToTolerance(inputs: Inputs.Manifold.ManifoldRefineToleranceDto): Promise; /** * Adds triangles to a solid by splitting every edge into pieces of roughly the given length, * adding inner vertices to keep the triangles even. * * On a solid smoothed with `smoothOut` or `smoothByNormals` the new vertices move onto the * smooth surface; otherwise the surface stays as it is. * @param inputs - The solid and the target edge length in model units * @returns The refined solid * @group adjustments * @shortname refine to length * @drawable true * @example * ```typescript * const finer = await bitbybit.manifold.manifold.operations.refineToLength({ manifold: smoothed, length: 0.5 }); * ``` */ refineToLength(inputs: Inputs.Manifold.ManifoldRefineLengthDto): Promise; /** * Adds triangles to a solid by splitting every edge into `number` pieces; with 2, each triangle * becomes four. * * On a solid smoothed with `smoothOut` or `smoothByNormals` the new vertices move onto the * smooth surface; otherwise the new triangles stay flat. * @param inputs - The solid and how many pieces to split each edge into * @returns The refined solid * @group adjustments * @shortname refine * @drawable true * @example * ```typescript * const finer = await bitbybit.manifold.manifold.operations.refine({ manifold: smoothed, number: 2 }); * ``` */ refine(inputs: Inputs.Manifold.ManifoldRefineDto): Promise; /** * Marks a solid for smoothing by working out tangents from its triangles, so a later `refine` * or `refineToLength` bends the new triangles into a smooth surface. * * Edges sharper than `minSharpAngle`, in degrees, stay sharp; `minSmoothness` above 0 rounds * those a little, and 1 smooths everything. The geometry itself does not change until it is * refined. * @param inputs - The solid, the sharp angle in degrees and the smoothness of sharp edges * @returns The solid with smoothing tangents * @group adjustments * @shortname smooth out * @drawable true * @example * ```typescript * const smoothed = await bitbybit.manifold.manifold.operations.smoothOut({ manifold: cube, minSharpAngle: 60, minSmoothness: 0 }); * const rounded = await bitbybit.manifold.manifold.operations.refineToLength({ manifold: smoothed, length: 0.5 }); * ``` */ smoothOut(inputs: Inputs.Manifold.ManifoldSmoothOutDto): Promise; /** * Marks a solid for smoothing using the normals stored in its vertex properties, so a later * `refine` or `refineToLength` bends the new triangles into a smooth surface. * * `normalIdx` is the first of the three normal channels, as `calculateNormals` stores them; * where the normals on a vertex disagree the edge stays sharp. * @param inputs - The solid and the first normal channel * @returns The solid with smoothing tangents * @group adjustments * @shortname smooth by normals * @drawable true * @example * ```typescript * const smoothed = await bitbybit.manifold.manifold.operations.smoothByNormals({ manifold: withNormals, normalIdx: 0 }); * ``` */ smoothByNormals(inputs: Inputs.Manifold.ManifoldSmoothByNormalsDto): Promise; /** * Removes vertices from a solid's mesh while keeping every surface within `tolerance` of where * it was, to cut the triangle count. * * The result keeps a subset of the original vertices; the solid's own tolerance value stays * unchanged. * @param inputs - The solid and how far surfaces may move, in model units * @returns The simplified solid * @group adjustments * @shortname simplify * @drawable true * @example * ```typescript * const lighter = await bitbybit.manifold.manifold.operations.simplify({ manifold: shape, tolerance: 0.05 }); * ``` */ simplify(inputs: Inputs.Manifold.ManifoldSimplifyDto): Promise; /** * Rewrites the vertex properties of a solid with a function that receives each vertex's * position and old properties and fills in the new ones. * * `numProp` sets how many properties each vertex has afterwards, so channels can be added or * dropped; reading past the old count or writing past the new one is undefined. * @param inputs - The solid, the new property count and the function that fills the properties * @returns The solid with the new properties * @group adjustments * @shortname set properties * @drawable true * @example * ```typescript * const colored = await bitbybit.manifold.manifold.operations.setProperties({ * manifold: shape, * numProp: 3, * propFunc: (newProp, position) => { newProp[0] = position[0]; newProp[1] = position[1]; newProp[2] = position[2]; }, * }); * ``` */ setProperties(inputs: Inputs.Manifold.ManifoldSetPropertiesDto): Promise; } /** * Building Manifold solids: the cube, sphere, cylinder and tetrahedron primitives, and solids from * triangle meshes or lists of triangles. The kernel keeps Z as its up axis, so a cylinder stands * along Z and a cube's `size` runs along X, Y and Z; every solid comes back as a closed triangle * mesh. */ declare class ManifoldShapes { private readonly manifoldWorkerManager; /** * Builds a solid from plain mesh data, the form `manifoldToMesh` hands out, so a mesh can make * a round trip through other tools. * * The mesh must be closed and consistently oriented, or an error is thrown; degenerate * triangles and unneeded vertices are removed on the way in. * @param inputs - The mesh data * @returns The solid * @group create * @shortname manifold from mesh * @drawable true * @example * ```typescript * const solid = await bitbybit.manifold.manifold.shapes.manifoldFromMesh({ mesh }); * ``` */ manifoldFromMesh(inputs: Inputs.Manifold.CreateFromMeshDto): Promise; /** * Builds a solid from a list of triangles, each given as three points, merging points that * coincide. * * The triangles must form a closed, consistently oriented surface; entries that are not three * points are skipped, and points with missing coordinates throw an error. * @param inputs - The triangles as lists of three points * @returns The solid * @group create * @shortname from polygon points * @drawable true * @example * ```typescript * const solid = await bitbybit.manifold.manifold.shapes.fromPolygonPoints({ polygonPoints: triangles }); * ``` */ fromPolygonPoints(inputs: Inputs.Manifold.FromPolygonPointsDto): Promise; /** * Creates a cube solid with the given side length. * * With `center` true the cube is centered on the origin; otherwise its corner sits on the origin * and it extends along the positive axes. * @param inputs - The side length and whether to center it * @returns The box solid * @group primitives * @shortname cube * @drawable true * @example * ```typescript * const box = await bitbybit.manifold.manifold.shapes.cube({ size: 10, center: true }); * ``` */ cube(inputs: Inputs.Manifold.CubeDto): Promise; /** * Creates a sphere solid of the given radius, centered on the origin. * * `circularSegments` is the number of segments around the sphere; it is rounded up to a * multiple of four, since the sphere is built by refining an octahedron. * @param inputs - The radius and the number of segments around the sphere * @returns The sphere solid * @group primitives * @shortname sphere * @drawable true * @example * ```typescript * const ball = await bitbybit.manifold.manifold.shapes.sphere({ radius: 5, circularSegments: 32 }); * ``` */ sphere(inputs: Inputs.Manifold.SphereDto): Promise; /** * Creates a tetrahedron solid centered on the origin, with one corner at `[1, 1, 1]` and the * others placed symmetrically. * @returns The tetrahedron solid * @group primitives * @shortname tetrahedron * @drawable true * @example * ```typescript * const tetra = await bitbybit.manifold.manifold.shapes.tetrahedron(); * ``` */ tetrahedron(): Promise; /** * Creates a cylinder solid standing along Z, or a cone when the top radius differs from the * bottom one. * * `radiusLow` is the bottom radius and must be above 0, `radiusHigh` the top radius, which may * be 0 for a point; `circularSegments` sets how round the sides are. `center` centers the * cylinder on the origin instead of standing it on it. * @param inputs - The height, the bottom and top radii, the number of segments and whether to center it * @returns The cylinder or cone solid * @group primitives * @shortname cylinder * @drawable true * @example * ```typescript * const cone = await bitbybit.manifold.manifold.shapes.cylinder({ height: 10, radiusLow: 4, radiusHigh: 1, circularSegments: 32, center: false }); * ``` */ cylinder(inputs: Inputs.Manifold.CylinderDto): Promise; } /** * Moving, turning, scaling, mirroring and warping Manifold solids. The kernel combines transforms * lazily, so chaining them is cheap; angles are in degrees, and rotations turn about the origin, X * first, then Y, then Z. Every method returns a new solid. */ declare class ManifoldTransforms { private readonly manifoldWorkerManager; /** * Scales a solid by a separate factor along X, Y and Z, about the origin. * @param inputs - The solid and the three factors * @returns The scaled solid * @group transforms * @shortname scale 3d * @drawable true * @example * ```typescript * const stretched = await bitbybit.manifold.manifold.transforms.scale3D({ manifold: cube, vector: [1, 2, 1] }); * ``` */ scale3D(inputs: Inputs.Manifold.Scale3DDto): Promise; /** * Scales a solid by a factor per axis, about the origin; it takes the same inputs as `scale3D`, * so use equal factors for a uniform scale. * @param inputs - The solid and the three factors * @returns The scaled solid * @group transforms * @shortname scale uniform * @drawable true * @example * ```typescript * const bigger = await bitbybit.manifold.manifold.transforms.scale({ manifold: cube, vector: [2, 2, 2] }); * ``` */ scale(inputs: Inputs.Manifold.Scale3DDto): Promise; /** * Mirrors a solid across the plane through the origin with the given normal. * * A zero-length normal gives an empty solid. * @param inputs - The solid and the normal of the mirror plane * @returns The mirrored solid * @group transforms * @shortname mirror * @drawable true * @example * ```typescript * const other = await bitbybit.manifold.manifold.transforms.mirror({ manifold: shape, normal: [1, 0, 0] }); * ``` */ mirror(inputs: Inputs.Manifold.MirrorDto): Promise; /** * Moves a solid by a vector, in model units. * @param inputs - The solid and the vector to move it by * @returns The moved solid * @group transforms * @shortname translate * @drawable true * @example * ```typescript * const moved = await bitbybit.manifold.manifold.transforms.translate({ manifold: cube, vector: [10, 0, 0] }); * ``` */ translate(inputs: Inputs.Manifold.TranslateDto): Promise; /** * Makes one moved copy of a solid per vector, for laying out repeats. * @param inputs - The solid and the vectors to move copies by * @returns One moved copy per vector, in the same order * @group multiple * @shortname translate by vectors * @drawable true * @example * ```typescript * const row = await bitbybit.manifold.manifold.transforms.translateByVectors({ manifold: cube, vectors: [[0, 0, 0], [10, 0, 0], [20, 0, 0]] }); * ``` */ translateByVectors(inputs: Inputs.Manifold.TranslateByVectorsDto): Promise; /** * Moves a solid by separate distances along X, Y and Z, in model units. * @param inputs - The solid and the three distances * @returns The moved solid * @group transforms * @shortname translate xyz * @drawable true * @example * ```typescript * const moved = await bitbybit.manifold.manifold.transforms.translateXYZ({ manifold: cube, x: 10, y: 0, z: 5 }); * ``` */ translateXYZ(inputs: Inputs.Manifold.TranslateXYZDto): Promise; /** * Rotates a solid about the origin by Euler angles in degrees: first about X, then Y, then Z. * * Multiples of 90 degrees are exact, with no rounding error. * @param inputs - The solid and the three angles in degrees * @returns The rotated solid * @group transforms * @shortname rotate * @drawable true * @example * ```typescript * const turned = await bitbybit.manifold.manifold.transforms.rotate({ manifold: cube, vector: [0, 0, 45] }); * ``` */ rotate(inputs: Inputs.Manifold.RotateDto): Promise; /** * Rotates a solid about the origin by separate angles in degrees about X, then Y, then Z. * * Multiples of 90 degrees are exact, with no rounding error. * @param inputs - The solid and the three angles in degrees * @returns The rotated solid * @group transforms * @shortname rotate xyz * @drawable true * @example * ```typescript * const turned = await bitbybit.manifold.manifold.transforms.rotateXYZ({ manifold: cube, x: 0, y: 0, z: 45 }); * ``` */ rotateXYZ(inputs: Inputs.Manifold.RotateXYZDto): Promise; /** * Applies a 4x4 matrix to a solid. * * The matrix is column-major, 16 numbers with the translation at indexes 12 to 14; the kernel * reads it as a 3x4 affine transform and ignores the last row. * @param inputs - The solid and the matrix * @returns The transformed solid * @group matrix * @shortname transform * @drawable true * @example * ```typescript * const moved = await bitbybit.manifold.manifold.transforms.transform({ manifold: cube, transform: matrix }); * ``` */ transform(inputs: Inputs.Manifold.TransformDto): Promise; /** * Applies a list of 4x4 matrices to a solid one after another, first to last, and returns the * final result. * * An empty list throws an error. * @param inputs - The solid and the matrices * @returns The solid after all the matrices * @group matrix * @shortname transforms * @drawable true * @example * ```typescript * const placed = await bitbybit.manifold.manifold.transforms.transforms({ manifold: cube, transforms: [turn, move] }); * ``` */ transforms(inputs: Inputs.Manifold.TransformsDto): Promise; /** * Moves every vertex of a solid with a function of your own that changes the vertex position in * place, for bends, tapers and other free deformations. * * The mesh connectivity stays the same and nothing checks that the result still makes sense, so * a function that folds the surface through itself gives a broken solid. * @param inputs - The solid and the function that moves each vertex * @returns The warped solid * @group transforms * @shortname warp * @drawable true * @example * ```typescript * const bent = await bitbybit.manifold.manifold.transforms.warp({ * manifold: cube, * warpFunc: (vert) => { vert[0] += vert[2] * 0.2; }, * }); * ``` */ warp(inputs: Inputs.Manifold.ManifoldWarpDto): Promise; } /** * The entry point to the Manifold kernel, a fast mesh-based solid modeler: `manifold` builds and * changes solids, `crossSection` handles the flat outlines they are extruded and revolved from, and * `mesh` reads the triangle data. Manifold works on triangle meshes rather than exact curves, so * booleans are quick and always watertight, and it keeps its own Z axis as up: extrusions grow * along Z and slices are parallel to the XY plane. The methods on the service itself turn solids * and cross-sections into plain mesh data for drawing. */ declare class ManifoldBitByBit { private readonly manifoldWorkerManager; readonly manifold: Manifold; readonly crossSection: ManifoldCrossSection; readonly mesh: Mesh; /** * Turns manifold shape into a mesh pointer that lives in worker's memory. This pointer can be used with bitbybit.manifold.mesh functions * @param inputs Manifold shape * @returns Pointer to manifold mesh definition * @group meshing * @shortname manifold to mesh pointer * @drawable false */ manifoldToMeshPointer(inputs: Inputs.Manifold.ManifoldToMeshDto): Promise; /** * Turns a solid into plain mesh data, or a cross-section into its polygons, ready for drawing * or export. * * `normalIdx` names the vertex property channel that holds normals, when the solid carries * them. * @param inputs - The solid or cross-section and the optional normal channel * @returns The mesh data of a solid, or the polygons of a cross-section * @group decompose * @shortname decompose m or cs * @drawable false * @example * ```typescript * const mesh = await bitbybit.manifold.decomposeManifoldOrCrossSection({ manifoldOrCrossSection: cube }); * ``` */ decomposeManifoldOrCrossSection(inputs: Inputs.Manifold.DecomposeManifoldOrCrossSectionDto): Promise; /** * Turns a solid into a list of triangles, each three points, the same form * `shapes.fromPolygonPoints` reads back. * * An empty solid gives an empty list. * @param inputs - The solid * @returns One list of three points per triangle * @group decompose * @shortname to polygon points * @drawable false * @example * ```typescript * const triangles = await bitbybit.manifold.toPolygonPoints({ manifold: cube }); * ``` */ toPolygonPoints(inputs: Inputs.Manifold.ManifoldDto): Promise; /** * Turns several solids into mesh data, or cross-sections into polygons, as * `decomposeManifoldOrCrossSection` does for one. * * `normalIdx` gives one normal channel per shape. * @param inputs - The solids or cross-sections and the optional normal channels * @returns One mesh or polygon list per shape, in the same order * @group decompose * @shortname decompose m's or cs's * @drawable false * @example * ```typescript * const meshes = await bitbybit.manifold.decomposeManifoldsOrCrossSections({ manifoldsOrCrossSections: [cube, sphere] }); * ``` */ decomposeManifoldsOrCrossSections(inputs: Inputs.Manifold.DecomposeManifoldsOrCrossSectionsDto): Promise<(Inputs.Manifold.DecomposedManifoldMeshDto | Inputs.Base.Vector2[][])[]>; /** * Frees the memory a solid or a cross-section holds inside the kernel; the object cannot be * used afterwards. Call it for results a script no longer needs, so long sessions do not run * out of memory. * @param inputs - The solid or cross-section to free * @group cleanup * @shortname delete m or cs * @drawable false * @example * ```typescript * await bitbybit.manifold.deleteManifoldOrCrossSection({ manifoldOrCrossSection: cube }); * ``` */ deleteManifoldOrCrossSection(inputs: Inputs.Manifold.ManifoldOrCrossSectionDto): Promise; /** * Frees the memory several solids or cross-sections hold inside the kernel; they cannot be used * afterwards. Call it for results a script no longer needs, so long sessions do not run out of * memory. * @param inputs - The solids or cross-sections to free * @group cleanup * @shortname delete m's or cs's * @drawable false * @example * ```typescript * await bitbybit.manifold.deleteManifoldsOrCrossSections({ manifoldsOrCrossSections: [cube, sphere] }); * ``` */ deleteManifoldsOrCrossSections(inputs: Inputs.Manifold.ManifoldsOrCrossSectionsDto): Promise; } /** * Reading Manifold mesh data: the position and extra properties of a vertex, the vertices of a * triangle, the tangent of a half-edge, the transform of a triangle run, and the counts of * properties, vertices, triangles and runs. Indexes count from 0. */ declare class MeshEvaluate { private readonly manifoldWorkerManager; /** * Reads the position of one vertex of a mesh. * @param inputs - The mesh and the vertex index * @returns The vertex position * @group basic * @shortname position * @drawable true * @example * ```typescript * const point = await bitbybit.manifold.mesh.evaluate.position({ mesh, vertexIndex: 0 }); * ``` */ position(inputs: Inputs.Manifold.MeshVertexIndexDto): Promise; /** * Reads the three vertex indexes of one triangle of a mesh, in counterclockwise order. * @param inputs - The mesh and the triangle index * @returns The three vertex indexes * @group basic * @shortname verts * @drawable false * @example * ```typescript * const corners = await bitbybit.manifold.mesh.evaluate.verts({ mesh, triangleIndex: 0 }); * ``` */ verts(inputs: Inputs.Manifold.MeshTriangleIndexDto): Promise; /** * Reads the tangent of one half-edge of a smoothed mesh: the direction the surface leaves the * edge's start vertex in, as three numbers plus a weight. * * Half-edge three times the triangle index plus `j` is the edge of triangle `t` that starts at * its `j`-th vertex; a mesh without smoothing tangents has none. * @param inputs - The mesh and the half-edge index * @returns The tangent as `[x, y, z, weight]` * @group basic * @shortname tangent * @drawable true * @example * ```typescript * const tangent = await bitbybit.manifold.mesh.evaluate.tangent({ mesh: smoothedMesh, halfEdgeIndex: 0 }); * ``` */ tangent(inputs: Inputs.Manifold.MeshHalfEdgeIndexDto): Promise; /** * Reads the properties of one vertex beyond its position, such as normals or colors stored in * extra channels. * @param inputs - The mesh and the vertex index * @returns The extra property values, in channel order * @group basic * @shortname extras * @drawable false * @example * ```typescript * const props = await bitbybit.manifold.mesh.evaluate.extras({ mesh, vertexIndex: 0 }); * ``` */ extras(inputs: Inputs.Manifold.MeshVertexIndexDto): Promise; /** * Reads the column-major 4x4 matrix that carries the original mesh onto one run of triangles, * the placement of that instance. * @param inputs - The mesh and the run index * @returns The 16 numbers of the matrix * @group basic * @shortname transform 4x4 matrix * @drawable false * @example * ```typescript * const placement = await bitbybit.manifold.mesh.evaluate.transform({ mesh, triangleRunIndex: 0 }); * ``` */ transform(inputs: Inputs.Manifold.MeshTriangleRunIndexDto): Promise; /** * Tells whether one run of triangles faces the other way than the original mesh it came from, * as the inner surface left by a subtraction does. Informational: the normals a mesh hands out * are already oriented for the result. * @param inputs - The mesh and the run index * @returns True when the run is a backside * @group basic * @shortname is backside * @drawable false * @example * ```typescript * const flipped = await bitbybit.manifold.mesh.evaluate.backside({ mesh, triangleRunIndex: 0 }); * ``` */ backside(inputs: Inputs.Manifold.MeshTriangleRunIndexDto): Promise; /** * Tells whether the first three extra property channels of one run of triangles hold vertex * normals, which `manifold.operations.calculateNormals` writes there. * @param inputs - The mesh and the run index * @returns True when the run carries normals in its properties * @group basic * @shortname has normals * @drawable false * @example * ```typescript * const lit = await bitbybit.manifold.mesh.evaluate.hasNormals({ mesh, triangleRunIndex: 0 }); * ``` */ hasNormals(inputs: Inputs.Manifold.MeshTriangleRunIndexDto): Promise; /** * Counts the property channels each vertex of a mesh carries; the position alone takes three. * @param inputs - The mesh * @returns The number of properties per vertex * @group basic * @shortname number props * @drawable false * @example * ```typescript * const channels = await bitbybit.manifold.mesh.evaluate.numProp({ mesh }); * ``` */ numProp(inputs: Inputs.Manifold.MeshDto): Promise; /** * Counts the property vertices of a mesh, which can exceed the geometric vertices where * neighboring triangles carry different properties. * @param inputs - The mesh * @returns The number of vertices * @group basic * @shortname number vertices * @drawable false * @example * ```typescript * const vertices = await bitbybit.manifold.mesh.evaluate.numVert({ mesh }); * ``` */ numVert(inputs: Inputs.Manifold.MeshDto): Promise; /** * Counts the triangles of a mesh, which together make its whole surface. * @param inputs - The mesh * @returns The number of triangles * @group basic * @shortname number triangles * @drawable false * @example * ```typescript * const triangles = await bitbybit.manifold.mesh.evaluate.numTri({ mesh }); * ``` */ numTri(inputs: Inputs.Manifold.MeshDto): Promise; /** * Counts the triangle runs of a mesh: each run is a stretch of consecutive triangles that came * from the same instance of the same input shape. * @param inputs - The mesh * @returns The number of runs * @group basic * @shortname number runs * @drawable false * @example * ```typescript * const runs = await bitbybit.manifold.mesh.evaluate.numRun({ mesh }); * ``` */ numRun(inputs: Inputs.Manifold.MeshDto): Promise; } /** * The plain triangle data of a Manifold solid, as `manifold.manifoldToMesh` hands it out: * `evaluate` reads vertices, triangles, tangents and the runs that group triangles by their * original shape, and `operations` repairs merge information. A mesh is what crosses from the * kernel to a renderer or a file. */ declare class Mesh { readonly operations: MeshOperations; readonly evaluate: MeshEvaluate; } /** * Repairs on Manifold mesh data before it is turned back into a solid; today that is `merge`, which * restores the merge information a file round trip loses. */ declare class MeshOperations { private readonly manifoldWorkerManager; /** * Fills in the mesh's merge information so it can become a solid again: vertices on open edges * within the tolerance are merged, keeping existing entries. * * A mesh that is already closed is left alone and false comes back. Meant for a mesh whose * merge data was lost in a file; the rebuilt solid reports a status if still open. * @param inputs - The mesh to repair * @returns True when the mesh was changed, false when it was already closed * @group base * @shortname merge * @drawable true * @example * ```typescript * const changed = await bitbybit.manifold.mesh.operations.merge({ mesh }); * ``` */ merge(inputs: Inputs.Manifold.MeshDto): Promise; } /** * The entry point to the OpenCascade kernel, gathering the shape, geometry, boolean, fillet, * operation, transform, assembly, dimension and IO groups. Every call is asynchronous because the * kernel runs as WebAssembly, usually in a worker, so the main thread stays responsive while a * heavy boolean runs. */ declare class BitByBitOCCT { occtWorkerManager: OCCTWorkerManager; occt: OCCT; constructor(); /** * Connects this facade to the web worker that runs the OpenCascade kernel. * * Create the worker yourself from the package's worker entry, hand it over here, and wait for the * kernel to report that it is loaded before making calls; without a worker every call would hang. * @param occt - The worker running the OpenCascade kernel */ init(occt: Worker): void; } /** * Assemblies as OpenCascade documents: a document holds parts, the sub-assemblies that group them * and the instances that place them, with names, colors and placements, the way a STEP assembly * does. `manager` builds documents step by step from parts and nodes, loads STEP files into them, * changes labels and exports to STEP and glTF; `query` reads parts, shapes, colors, placements and * the hierarchy back out. Every label in a document is addressed by its label id string. A document * stays in memory until it is deleted. * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 0, 0] }); * const part = await bitbybit.occt.assembly.manager.createPart({ id: "box", shape: box, name: "Box" }); * const root = await bitbybit.occt.assembly.manager.createAssemblyNode({ id: "root", name: "Root" }); * const instance = await bitbybit.occt.assembly.manager.createInstanceNode({ id: "box1", partId: "box", name: "Box 1", parentId: "root" }); * const structure = await bitbybit.occt.assembly.manager.combineStructure({ parts: [part], nodes: [root, instance], clearDocument: false }); * const doc = await bitbybit.occt.assembly.manager.buildAssemblyDocument({ structure }); * const parts = await bitbybit.occt.assembly.query.getDocumentParts({ document: doc }); * const glb = await bitbybit.occt.assembly.manager.exportDocumentToGltf({ document: doc, meshDeflection: 0.1, meshAngle: 0.5, internalVerticesMode: false, controlSurfaceDeflection: false, mergeFaces: false, forceUVExport: false, fileName: "assembly.glb", tryDownload: false }); * await bitbybit.occt.assembly.manager.deleteDocument({ document: doc }); * ``` */ declare class OCCTAssembly { readonly manager: OCCTAssemblyManager; readonly query: OCCTAssemblyQuery; } /** * Building and changing assembly documents: describe parts, assembly nodes and instance nodes one * object at a time, combine them into a structure, and build a document from it; or load a STEP * file into a document. Then recolor and rename labels, update or remove parts, and export to STEP * or glTF. A document is an in-memory handle that stays alive until it is deleted, so build once * and query or export as often as needed. */ declare class OCCTAssemblyManager { private readonly occWorkerManager; /** * Describes a part for an assembly structure: an id to reference it by, its shape, a name and * an optional color. * * Nothing is built yet; the part only becomes real when a structure holding it goes through * `buildAssemblyDocument`. Instance nodes place the part by its id, as many times as needed. * @param inputs - The part id, its shape, its name and an optional color * @returns The part definition, ready for `combineStructure` * @group assembly * @shortname create part * @drawable false * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 0, 0] }); * const part = await bitbybit.occt.assembly.manager.createPart({ id: "box", shape: box, name: "Box", colorRgba: { r: 1, g: 0, b: 0, a: 1 } }); * ``` */ createPart(inputs: Inputs.OCCT.CreateAssemblyPartDto): Promise>; /** * Describes an assembly node, a container that groups instances and other assemblies in the * hierarchy. * * `parentId` names the assembly it sits in; leave it out for a root. An optional matrix places * the whole group. * @param inputs - The node id, its name, an optional parent id, an optional color and an optional placement matrix * @returns The node definition, ready for `combineStructure` * @group assembly * @shortname create assembly node * @drawable false * @example * ```typescript * const root = await bitbybit.occt.assembly.manager.createAssemblyNode({ id: "root", name: "Root Assembly" }); * const sub = await bitbybit.occt.assembly.manager.createAssemblyNode({ id: "sub", name: "Sub Assembly", parentId: "root" }); * ``` */ createAssemblyNode(inputs: Inputs.OCCT.CreateAssemblyNodeDto): Promise; /** * Describes a part taken from another document, typically one loaded from STEP, so its whole * label tree with sub-assemblies, names and colors is copied into the new assembly. * * `sourceDocumentIndex` points into the `sourceDocuments` list given to * `buildAssemblyDocument`, and `sourceLabel` picks a sub-tree instead of the whole document. * Instance nodes place it by `partId` like any part. * @param inputs - The part id, the index of the source document, an optional source label, name and color * @returns The imported part definition, ready for `combineStructure` * @example * ```typescript * const chairDoc = await bitbybit.occt.assembly.manager.loadStepToDoc({ stepData }); * const chair = await bitbybit.occt.assembly.manager.createImportedPart({ id: "chair", sourceDocumentIndex: 0, name: "Chair" }); * const c1 = await bitbybit.occt.assembly.manager.createInstanceNode({ id: "c1", partId: "chair", name: "Chair 1", translation: [0, 0, 0] }); * const c2 = await bitbybit.occt.assembly.manager.createInstanceNode({ id: "c2", partId: "chair", name: "Chair 2", translation: [500, 0, 0] }); * const structure = await bitbybit.occt.assembly.manager.combineStructure({ parts: [], nodes: [c1, c2], loadedParts: [chair], clearDocument: false }); * const doc = await bitbybit.occt.assembly.manager.buildAssemblyDocument({ structure, sourceDocuments: [chairDoc] }); * ``` */ createImportedPart(inputs: Inputs.OCCT.CreateImportedPartDto): Promise; /** * Describes an instance node, one placement of a part: which part by `partId`, where it goes * and under which assembly. * * `translation` moves it, `rotation` turns it by Euler angles in degrees about X, Y and Z, * `scale` sizes it uniformly; a `matrix` can replace all three. The same part may be placed by * many instances. * @param inputs - The node id, the part id, the name, an optional parent id and the placement * @returns The node definition, ready for `combineStructure` * @group assembly * @shortname create instance node * @drawable false * @example * ```typescript * const first = await bitbybit.occt.assembly.manager.createInstanceNode({ id: "box1", partId: "box", name: "Box 1" }); * const second = await bitbybit.occt.assembly.manager.createInstanceNode({ id: "box2", partId: "box", name: "Box 2", translation: [20, 0, 0], rotation: [0, 0, 45] }); * ``` */ createInstanceNode(inputs: Inputs.OCCT.CreateInstanceNodeDto): Promise; /** * Describes a change to a part that already exists in a document: a new shape, a new name or a * new color, or any mix of them, addressed by the part's label. * * Collect the updates in `combineStructure` under `partUpdates` and pass the structure to * `buildAssemblyDocument` with the existing document. * @param inputs - The label of the part and the optional new shape, name and color * @returns The update definition, ready for `combineStructure` * @group assembly * @shortname create part update * @drawable false * @example * ```typescript * const parts = await bitbybit.occt.assembly.query.getDocumentParts({ document: doc }); * const bigger = await bitbybit.occt.shapes.solid.createBox({ width: 20, length: 20, height: 20, center: [0, 0, 0] }); * const update = await bitbybit.occt.assembly.manager.createPartUpdate({ label: parts[0].label, shape: bigger, name: "Bigger Box" }); * const structure = await bitbybit.occt.assembly.manager.combineStructure({ parts: [], nodes: [], partUpdates: [update], clearDocument: false }); * await bitbybit.occt.assembly.manager.buildAssemblyDocument({ structure, existingDocument: doc }); * ``` */ createPartUpdate(inputs: Inputs.OCCT.CreatePartUpdateDto): Promise>; /** * Gathers parts, nodes and, for updates, removals, part updates and imported parts into one * structure definition, the last step before `buildAssemblyDocument`. * * `clearDocument` false keeps what an existing document already holds when the structure is * applied to it. * @param inputs - The parts, the nodes, and the optional removals, part updates, imported parts and clear flag * @returns The structure, ready to build * @group assembly * @shortname combine structure * @drawable false * @example * ```typescript * const structure = await bitbybit.occt.assembly.manager.combineStructure({ parts: [part], nodes: [root, first, second], clearDocument: false }); * const doc = await bitbybit.occt.assembly.manager.buildAssemblyDocument({ structure }); * ``` */ combineStructure(inputs: Inputs.OCCT.CombineAssemblyStructureDto): Promise>; /** * Builds an assembly document from a structure, or applies the structure to an existing * document. * * With `existingDocument` the labels in `removals` are dropped first, the `partUpdates` * applied, then the new parts and nodes added; a structure with neither clears the document * unless `clearDocument` is false. `sourceDocuments` supplies the documents imported parts copy * from. The document stays in memory until deleted. * @param inputs - The structure, an optional document to update and the optional source documents * @returns The document handle, new or updated * @throws Error if assembly building fails * @group assembly * @shortname build document * @drawable false * @example * ```typescript * const structure = await bitbybit.occt.assembly.manager.combineStructure({ parts: [part], nodes: [root, first], clearDocument: false }); * const doc = await bitbybit.occt.assembly.manager.buildAssemblyDocument({ structure }); * const glb = await bitbybit.occt.assembly.manager.exportDocumentToGltf({ document: doc, meshDeflection: 0.1, meshAngle: 0.5, internalVerticesMode: false, controlSurfaceDeflection: false, mergeFaces: false, forceUVExport: false, fileName: "assembly.glb", tryDownload: false }); * ``` */ buildAssemblyDocument(inputs: Inputs.OCCT.BuildAssemblyDocumentDto): Promise; /** * Loads a STEP file into a new assembly document, with its parts, sub-assemblies, names, colors * and placements. * * `stepData` is the file as text or binary; gzip-compressed STEP-Z is accepted too. A file that * cannot be loaded throws. An instance the file leaves unnamed, as SolidWorks does, is named * after the part it places, numbered when that part repeats beside it. * @param inputs - The STEP file content * @returns The document handle * @throws Error if STEP loading fails * @group assembly * @shortname load STEP to document * @drawable false * @example * ```typescript * const doc = await bitbybit.occt.assembly.manager.loadStepToDoc({ stepData: stepText }); * const parts = await bitbybit.occt.assembly.query.getDocumentParts({ document: doc }); * ``` */ loadStepToDoc(inputs: Inputs.OCCT.LoadStepToDocDto): Promise; /** * Colors a label of a document, a part, instance or assembly, with red, green, blue and alpha * from 0 to 1. * * The color is kept when the document is exported to STEP or glTF. * @param inputs - The document, the label and the four color channels * @returns True when the color was set * @group modify * @shortname set label color * @drawable false * @example * ```typescript * const done = await bitbybit.occt.assembly.manager.setDocLabelColor({ document: doc, label: "0:1:1:1", r: 1, g: 0, b: 0, a: 1 }); * ``` */ setDocLabelColor(inputs: Inputs.OCCT.SetDocLabelColorDto): Promise; /** * Renames a label of a document, a part, instance or assembly. * @param inputs - The document, the label and the new name * @returns True when the name was set * @group modify * @shortname set label name * @drawable false * @example * ```typescript * const done = await bitbybit.occt.assembly.manager.setDocLabelName({ document: doc, label: "0:1:1:1", name: "Left bracket" }); * ``` */ setDocLabelName(inputs: Inputs.OCCT.SetDocLabelNameDto): Promise; /** * Writes an assembly document as a STEP file with its hierarchy, names and colors, and returns * the file's bytes. * * `author` and `organization` go into the file header; `compress` writes gzip-compressed STEP-Z * instead. Failure throws an error. * @param inputs - The document, the file name, the header details, the compression flag and the download option * @returns The STEP file as bytes * @group export * @shortname export document STEP * @drawable false * @example * ```typescript * const step = await bitbybit.occt.assembly.manager.exportDocumentToStep({ document: doc, fileName: "assembly.step", author: "Bitbybit user", organization: "Bitbybit", compress: false, tryDownload: false }); * ``` */ exportDocumentToStep(inputs: Inputs.OCCT.ExportDocumentToStepDto): Promise; /** * Triangulates an assembly document and writes it as a binary glTF (GLB) with the hierarchy, * names and colors kept as glTF nodes and materials. * * `meshDeflection` and `meshAngle` set how finely curved surfaces are triangulated; * `mergeFaces` joins the faces of a part into one mesh. Failure throws an error. * @param inputs - The document, the meshing settings, the export flags, the file name and the download option * @returns The GLB file as bytes * @group export * @shortname export document glTF * @drawable false * @example * ```typescript * const glb = await bitbybit.occt.assembly.manager.exportDocumentToGltf({ document: doc, meshDeflection: 0.1, meshAngle: 0.5, internalVerticesMode: false, controlSurfaceDeflection: false, mergeFaces: false, forceUVExport: false, fileName: "assembly.glb", tryDownload: false }); * ``` */ exportDocumentToGltf(inputs: Inputs.OCCT.ExportDocumentToGltfDto): Promise; /** * Writes an assembly document as a binary glTF (GLB) like `exportDocumentToGltf` and compresses * the geometry with Draco, which makes the file much smaller at the cost of a Draco-capable * loader. * * The Draco settings set the compression level and how many bits positions, normals, texture * coordinates and colors keep. * @param inputs - The document, the meshing settings, the export flags and the Draco settings * @returns The GLB file as bytes * @group export * @shortname export document glTF with draco * @drawable false * @example * ```typescript * const options = new Bit.Inputs.OCCT.ExportDocumentToGltfWithDracoDto(); * options.document = doc; * options.meshDeflection = 0.1; * options.dracoCompressionLevel = 7; * const glb = await bitbybit.occt.assembly.manager.exportDocumentToGltfWithDraco(options); * ``` */ exportDocumentToGltfWithDraco(inputs: Inputs.OCCT.ExportDocumentToGltfWithDracoDto): Promise; /** * Deletes an assembly document and frees the memory it holds. * * A document built with `buildAssemblyDocument` or loaded with `loadStepToDoc` stays in memory * until this is called, so delete it once its shapes and exports have been read. * @param inputs - The document to delete * @returns Nothing; the document handle is no longer valid afterwards * @group lifecycle * @shortname delete document * @drawable false * @example * ```typescript * const doc = await bitbybit.occt.assembly.manager.buildAssemblyDocument({ structure }); * const glb = await bitbybit.occt.assembly.manager.exportDocumentToGltf({ document: doc, meshDeflection: 0.1, meshAngle: 0.5, internalVerticesMode: false, controlSurfaceDeflection: false, mergeFaces: false, forceUVExport: false, fileName: "assembly.glb", tryDownload: false }); * await bitbybit.occt.assembly.manager.deleteDocument({ document: doc }); * ``` */ deleteDocument(inputs: Inputs.OCCT.DocumentQueryDto): Promise; } /** * Reading an assembly document: the parts and sub-assemblies it holds, the shape behind a label, a * label's color, placement and details, and the whole hierarchy as a tree. Labels are the ids the * document gives every part, instance and assembly, such as `0:1:1:1`; `getDocumentParts` and * `getAssemblyHierarchy` list them, the other methods take one. The document itself is not changed * by any query. */ declare class OCCTAssemblyQuery { private readonly occWorkerManager; /** * Lists every part and sub-assembly in a document with its label, name, type, color and how * many times it is placed. * * The labels are what the other query methods and the label setters take. * @param inputs - The document * @returns One entry per part or assembly * @group query * @shortname get parts * @drawable false * @example * ```typescript * const parts = await bitbybit.occt.assembly.query.getDocumentParts({ document: doc }); * parts.forEach(part => console.log(part.name, part.type, part.label)); * ``` */ getDocumentParts(inputs: Inputs.OCCT.DocumentQueryDto): Promise; /** * Reads the shape stored under a label of a document, for instance to draw one part or run an * operation on it. * @param inputs - The document and the label * @returns The shape at that label * @group query * @shortname get shape from label * @drawable true * @example * ```typescript * const shape = await bitbybit.occt.assembly.query.getShapeFromLabel({ document: doc, label: "0:1:1:1" }); * ``` */ getShapeFromLabel(inputs: Inputs.OCCT.DocumentLabelQueryDto): Promise; /** * Reads the color assigned to a label of a document, as red, green, blue and alpha from 0 to 1, * together with a flag saying whether the label has a color at all. * @param inputs - The document and the label * @returns The color with its `hasColor` flag * @group query * @shortname get label color * @drawable false * @example * ```typescript * const color = await bitbybit.occt.assembly.query.getLabelColor({ document: doc, label: "0:1:1:1" }); * if (color.hasColor) console.log(color.r, color.g, color.b); * ``` */ getLabelColor(inputs: Inputs.OCCT.DocumentLabelQueryDto): Promise; /** * Reads the placement of an instance label in a document as a column-major matrix plus its * translation, rotation quaternion and uniform scale. * * A part label, as opposed to an instance, carries no placement of its own. * @param inputs - The document and the label * @returns The matrix, the translation, the quaternion and the scale * @group query * @shortname get label transform * @drawable false * @example * ```typescript * const placement = await bitbybit.occt.assembly.query.getLabelTransform({ document: doc, label: "0:1:1:1" }); * console.log(placement.translation); * ``` */ getLabelTransform(inputs: Inputs.OCCT.DocumentLabelQueryDto): Promise; /** * Describes one label of a document: its name, its type and whether it is a simple shape, an * assembly, a reference to another label or a component of one. * @param inputs - The document and the label * @returns The label's name, type and flags * @group query * @shortname get label info * @drawable false * @example * ```typescript * const info = await bitbybit.occt.assembly.query.getLabelInfo({ document: doc, label: "0:1:1:1" }); * console.log(info.name, info.isAssembly); * ``` */ getLabelInfo(inputs: Inputs.OCCT.DocumentLabelQueryDto): Promise; /** * Reads the whole assembly tree of a document as a flat list of nodes with their parents, so it * can be walked or shown as a tree. * * Each node carries its label, name, type and placement, in depth-first order, so children * follow their parent. An unnamed instance is named after what it places, numbered when * repeated; `definitionName` holds that name. * @param inputs - The document * @returns The nodes of the tree with their count and the format version * @group query * @shortname get hierarchy * @drawable false * @example * ```typescript * const tree = await bitbybit.occt.assembly.query.getAssemblyHierarchy({ document: doc }); * console.log(tree.totalNodes, tree.nodes.map(n => n.name)); * ``` */ getAssemblyHierarchy(inputs: Inputs.OCCT.DocumentQueryDto): Promise; } /** * Combining OpenCascade shapes with each other: union fuses them into one, difference cuts one away * from another, intersection keeps only what they share. These work on the exact geometry and give * exact results. The mesh intersection methods instead triangulate the shapes and intersect the * triangles, which is faster and more robust on awkward geometry but gives polylines rather than * curves. Every method returns a new shape; unless `keepEdges` is set, faces that end up lying on * one surface are merged and the seams between them removed. */ declare class OCCTBooleans { private readonly occWorkerManager; /** * Fuses several shapes into one, the way two overlapping blobs of clay become one lump. * * The shapes are fused one after another in list order. With `keepEdges` false, the default, * faces that end up on one surface are merged and the seams removed; true keeps every edge of * the inputs. * @param inputs - The shapes to fuse and whether to keep the seam edges * @returns The fused shape * @group booleans * @shortname union * @drawable true * @example * ```typescript * const fused = await bitbybit.occt.booleans.union({ shapes: [box, cylinder], keepEdges: false }); * ``` */ union(inputs: Inputs.OCCT.UnionDto): Promise; /** * Cuts shapes away from a main shape, the way a drill removes material: what remains is the * main shape minus every shape in the list. * * The shapes are subtracted one after another. With `keepEdges` false, the default, faces left * on one surface are merged; when exactly one solid remains it is returned on its own rather * than inside a compound. * @param inputs - The main shape, the shapes to subtract and whether to keep the seam edges * @returns What is left of the main shape * @group booleans * @shortname difference * @drawable true * @example * ```typescript * const holed = await bitbybit.occt.booleans.difference({ shape: box, shapes: [cylinder], keepEdges: false }); * ``` */ difference(inputs: Inputs.OCCT.DifferenceDto): Promise; /** * Keeps only the volume the first shape shares with each of the others. * * The first shape is intersected with every other shape one at a time and the pieces come back * in one compound: with three shapes you get the overlap of the first with the second and with * the third, not of all three. Fewer than two shapes throw. * @param inputs - The shapes, the first being the one intersected with the rest, and whether to keep the seam edges * @returns A compound of the shared parts * @group booleans * @shortname intersection * @drawable true * @example * ```typescript * const common = await bitbybit.occt.booleans.intersection({ shapes: [box, sphere], keepEdges: false }); * ``` */ intersection(inputs: Inputs.OCCT.IntersectionDto): Promise; /** * Finds where the surfaces of two shapes cross by triangulating both and intersecting the * triangles, and returns the crossing lines as wires. * * Each shape has its own meshing precision: a smaller value follows curved surfaces more * closely and takes longer. The wires are polylines, so they trace the crossing approximately; * the exact curves come from `intersection` with faces. * @param inputs - The two shapes and their meshing precisions * @returns The crossing lines as polyline wires * @group mesh based * @shortname mesh mesh intersection as wires * @drawable true * @example * ```typescript * const seams = await bitbybit.occt.booleans.meshMeshIntersectionWires({ shape1: sphere, shape2: box, precision1: 0.01, precision2: 0.01 }); * ``` */ meshMeshIntersectionWires(inputs: Inputs.OCCT.MeshMeshIntersectionTwoShapesDto): Promise; /** * Finds where the surfaces of two shapes cross by triangulating both and intersecting the * triangles, and returns the crossing lines as lists of points. * * Each shape has its own meshing precision: a smaller value follows curved surfaces more * closely and takes longer. Each list of points is one crossing line, in order along it. * @param inputs - The two shapes and their meshing precisions * @returns One list of points per crossing line * @group mesh based * @shortname mesh mesh intersection as points * @drawable true * @example * ```typescript * const lines = await bitbybit.occt.booleans.meshMeshIntersectionPoints({ shape1: sphere, shape2: box, precision1: 0.01, precision2: 0.01 }); * ``` */ meshMeshIntersectionPoints(inputs: Inputs.OCCT.MeshMeshIntersectionTwoShapesDto): Promise; /** * Finds where the surface of one shape crosses the surfaces of several others by triangulating * them all and intersecting the triangles, and returns the crossing lines as wires. * * `precision` meshes the main shape and `precisionShapes` gives one precision per other shape; * smaller values follow curves more closely and take longer. * @param inputs - The main shape, the other shapes and the meshing precisions * @returns The crossing lines as polyline wires, for all the shapes together * @group mesh based * @shortname mesh mesh intersection of shapes as wires * @drawable true * @example * ```typescript * const seams = await bitbybit.occt.booleans.meshMeshIntersectionOfShapesWires({ shape: sphere, shapes: [box, cylinder], precision: 0.01, precisionShapes: [0.01, 0.01] }); * ``` */ meshMeshIntersectionOfShapesWires(inputs: Inputs.OCCT.MeshMeshesIntersectionOfShapesDto): Promise; /** * Finds where the surface of one shape crosses the surfaces of several others by triangulating * them all and intersecting the triangles, and returns the crossing lines as lists of points. * * `precision` meshes the main shape and `precisionShapes` gives one precision per other shape; * each list of points is one crossing line, in order along it. * @param inputs - The main shape, the other shapes and the meshing precisions * @returns One list of points per crossing line, for all the shapes together * @group mesh based * @shortname mesh mesh intersection of shapes as points * @drawable true * @example * ```typescript * const lines = await bitbybit.occt.booleans.meshMeshIntersectionOfShapesPoints({ shape: sphere, shapes: [box, cylinder], precision: 0.01, precisionShapes: [0.01, 0.01] }); * ``` */ meshMeshIntersectionOfShapesPoints(inputs: Inputs.OCCT.MeshMeshesIntersectionOfShapesDto): Promise; } /** * Structural queries over an OpenCascade shape seen as a graph: which faces touch, which faces an * edge belongs to, which edges meet at a vertex, what surface or curve backs each face or edge, how * shells and solids contain each other, and the product and occurrence tree of an assembly. Every * query returns plain data with `ok` and an error message rather than throwing, so a batch of * queries can report per-item failures; `reconstruct` turns a node of that data back into a real * sub-shape. */ declare class OCCTBrepGraph { private readonly occWorkerManager; /** * Counts what a shape is made of: solids, shells, faces, wires, edges, coedges and vertices, * the distinct surfaces and curves behind them, and any assembly products and occurrences. * * The quickest way to see what an imported file holds, and to tell one solid from a compound * that only looks like one. * @param inputs - The shape to analyze * @returns The counts and graph metadata * @group topology * @shortname analyze * @drawable false * @example * ```typescript * const census = await bitbybit.occt.brepGraph.analyze({ shape: imported }); * console.log(census.solids, census.faces); * ``` */ analyze(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Lists, for every face, the faces that share an edge with it, along with its edges, wire count * and outer wire. * * Faces are numbered from 0 in the order the kernel walks the shape, the same order * `shapes.face.getFaces` uses. This is the building block for growing a selection outward from * a seed face or finding the faces of a pocket. * @param inputs - The shape to analyze * @returns One adjacency entry per face * @group topology * @shortname face adjacency * @drawable false * @example * ```typescript * const adjacency = await bitbybit.occt.brepGraph.faceAdjacency({ shape: box }); * console.log(adjacency.faces[0].adjacent); * ``` */ faceAdjacency(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Lists, for every edge, the faces it belongs to, its end vertices and its topology flags, such * as whether it is a seam or a border edge. * * Edges are numbered from 0 in the order `shapes.edge.getEdges` lists them. * @param inputs - The shape to analyze * @returns One entry per edge * @group topology * @shortname edge face map * @drawable false * @example * ```typescript * const edges = await bitbybit.occt.brepGraph.edgeFaceMap({ shape: box }); * ``` */ edgeFaceMap(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Lists every vertex with its 3D point, its tolerance and the edges that meet there. * * Vertices are numbered from 0 in the order the kernel walks the shape. * @param inputs - The shape to analyze * @returns One entry per vertex * @group topology * @shortname vertex edge map * @drawable false * @example * ```typescript * const vertices = await bitbybit.occt.brepGraph.vertexEdgeMap({ shape: box }); * ``` */ vertexEdgeMap(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Describes the geometry of every face: the kind of surface it lies on, its UV bounds, whether * it carries a triangulation, and a unique id. * * Faces are numbered from 0 in the order `shapes.face.getFaces` uses. * @param inputs - The shape to analyze * @returns One geometry entry per face * @group geometry * @shortname face info * @drawable false * @example * ```typescript * const faces = await bitbybit.occt.brepGraph.faceInfo({ shape: cylinder }); * console.log(faces.faces.map(f => f.surfaceType)); * ``` */ faceInfo(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Describes the geometry of every edge: the kind of curve it follows, its parameter range, its * continuity and a unique id. * * Edges are numbered from 0 in the order `shapes.edge.getEdges` lists them. * @param inputs - The shape to analyze * @returns One geometry entry per edge * @group geometry * @shortname edge info * @drawable false * @example * ```typescript * const edges = await bitbybit.occt.brepGraph.edgeInfo({ shape: cylinder }); * ``` */ edgeInfo(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Maps the shape's parts upward: which shells each face belongs to, which solids each shell * belongs to, and which solids each face ends up in. * * Each list holds the parent indexes of one child, so a face shared by two solids lists both. * @param inputs - The shape to analyze * @returns The parent indexes per face and per shell * @group topology * @shortname containment * @drawable false * @example * ```typescript * const containment = await bitbybit.occt.brepGraph.containment({ shape: compound }); * ``` */ containment(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Describes every wire: whether it is closed, whether it is the outer boundary of its face, how * many coedges and distinct edges it has and which face owns it. * @param inputs - The shape to analyze * @returns One entry per wire * @group topology * @shortname wire info * @drawable false * @example * ```typescript * const wires = await bitbybit.occt.brepGraph.wireInfo({ shape: plateWithHoles }); * ``` */ wireInfo(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the assembly structure of a shape as products and occurrences: a product is a part or * sub-assembly defined once, an occurrence is one placement of it with a matrix and a parent. * * This is what STEP assembly import produces and what a tree view walks; a plain shape reports * no products. * @param inputs - The shape to analyze * @returns The root products, all products and all occurrences * @group assembly * @shortname assembly * @drawable false * @example * ```typescript * const tree = await bitbybit.occt.brepGraph.assembly({ shape: imported }); * console.log(tree.products.length, tree.occurrences.length); * ``` */ assembly(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Checks the structure of a shape's graph for problems such as dangling references or * inconsistent links, and lists every issue found with its severity. * * This checks the bookkeeping, not the geometry; `shapes.shape.isValid` and * `shapeFix.basicShapeRepair` deal with geometric validity. * @param inputs - The shape to analyze * @returns Whether the graph is sound and the issues found * @group validation * @shortname validate * @drawable false * @example * ```typescript * const report = await bitbybit.occt.brepGraph.validate({ shape: imported }); * console.log(report.valid, report.issues); * ``` */ validate(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Dumps the whole structure of a shape: every solid, shell, face, edge and vertex with its * unique id and the parts directly below it. * * The heaviest query here, for reasoning about the whole topology at once rather than answering * one question. * @param inputs - The shape to analyze * @returns The solids, shells, faces, edges and vertices with their references * @group topology * @shortname dump * @drawable false * @example * ```typescript * const structure = await bitbybit.occt.brepGraph.dump({ shape: box }); * console.log(structure.faces.length, structure.edges.length); * ``` */ dump(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Turns a node of the graph, given by its kind and index, back into the real sub-shape it * stands for, so a face or edge found by a query can be used in an operation. * * The indexes are the ones the query results use, counted from 0 per kind. * @param inputs - The shape, the node kind and the node index * @returns The sub-shape * @group navigate * @shortname reconstruct * @drawable true * @example * ```typescript * const face = await bitbybit.occt.brepGraph.reconstruct({ shape: box, kind: Bit.Inputs.OCCT.brepGraphNodeKindEnum.face, index: 2 }); * ``` */ reconstruct(inputs: Inputs.OCCT.BRepGraphReconstructDto): Promise; /** * Finds the graph node that stands for a given sub-shape of a shape: its kind, its index and * its unique id. * * The reverse of `reconstruct`; a sub-shape that does not belong to the shape gives a result * marked invalid. * @param inputs - The shape and one of its sub-shapes * @returns The node's kind, index and id, or an invalid result * @group navigate * @shortname node of shape * @drawable false * @example * ```typescript * const faces = await bitbybit.occt.shapes.face.getFaces({ shape: box }); * const node = await bitbybit.occt.brepGraph.nodeOfShape({ shape: box, subShape: faces[0] }); * console.log(node.kind, node.index); * ``` */ nodeOfShape(inputs: Inputs.OCCT.BRepGraphNodeOfShapeDto): Promise; } /** * Rounding and beveling single corners of an OpenCascade shell or solid, picked by a point near * them rather than by edge index: the corner nearest each point is found, classified and treated on * its own, leaving the rest of the shape untouched. A corner is where several edges meet at one * vertex. `classifyCornerByPoint` reports what kind of corner a point would pick, and * `cornerByPointReport` explains what a fillet did or why it was skipped. */ declare class OCCTCorners { private readonly occWorkerManager; /** * Rounds the corner nearest each given point on a shell or solid, touching only that corner. * * `radius` is the rounding size; `taperFactor`, for 3D corners, sets how far the rounding * reaches along the meeting edges, 0 for the tightest, 1 for the full reach. `snapTolerance` * caps the point-to-vertex distance, 0 accepting the nearest; `mode` `planarOnly` skips 3D * corners. * @param inputs - The shape, the points near the corners, the radius, the taper factor, the snap tolerance and the mode * @returns The shape with rounded corners * @group by point * @shortname fillet corner by point * @drawable true * @example * ```typescript * const rounded = await bitbybit.occt.corners.filletCornerByPoint({ * shape: box, * points: [[5, 5, 5]], * radius: 1, * taperFactor: 1, * snapTolerance: 0, * mode: Bit.Inputs.OCCT.cornerModeEnum.auto, * }); * ``` */ filletCornerByPoint(inputs: Inputs.OCCT.FilletCornerByPointDto): Promise; /** * Bevels the corner nearest each given point on a shell or solid, touching only that corner. * * `distance` is how far the bevel reaches from the corner and `angle` its slope in degrees. * `snapTolerance` caps how far a point may be from a vertex, 0 accepting the nearest; `mode` * `planarOnly` skips 3D corners. A corner that cannot be beveled throws. * @param inputs - The shape, the points near the corners, the distance, the angle, the snap tolerance and the mode * @returns The shape with beveled corners * @group by point * @shortname chamfer corner by point * @drawable true * @example * ```typescript * const beveled = await bitbybit.occt.corners.chamferCornerByPoint({ * shape: box, * points: [[5, 5, 5]], * distance: 1, * angle: 45, * snapTolerance: 0, * mode: Bit.Inputs.OCCT.cornerModeEnum.auto, * }); * ``` */ chamferCornerByPoint(inputs: Inputs.OCCT.ChamferCornerByPointDto): Promise; /** * Looks up the corner nearest each given point and reports what kind it is, without changing * the shape. * * Each entry says where the corner is, how far it was from the point, how many edges and faces * meet there and whether it is planar, developable or a true 3D corner, or why none was found. * It shows what `filletCornerByPoint` picks. * @param inputs - The shape, the points near the corners and the snap tolerance * @returns The report with one entry per point * @group by point * @shortname classify corner by point * @drawable false * @example * ```typescript * const report = await bitbybit.occt.corners.classifyCornerByPoint({ shape: box, points: [[5, 5, 5]], snapTolerance: 0 }); * console.log(report.results[0].classification); * ``` */ classifyCornerByPoint(inputs: Inputs.OCCT.ClassifyCornerByPointDto): Promise; /** * Runs the same corner rounding as `filletCornerByPoint` and returns a report instead of the * shape: for each point, which corner was found, how it was classified, what was done and * whether it succeeded. * * Handy for finding out why a fillet was skipped before changing the radius or the points. * @param inputs - The shape, the points near the corners, the radius, the taper factor, the snap tolerance and the mode * @returns The report with one entry per point * @group by point * @shortname corner by point report * @drawable false * @example * ```typescript * const report = await bitbybit.occt.corners.cornerByPointReport({ * shape: box, * points: [[5, 5, 5]], * radius: 1, * taperFactor: 1, * snapTolerance: 0, * mode: Bit.Inputs.OCCT.cornerModeEnum.auto, * }); * console.log(report.results[0].applied, report.results[0].message); * ``` */ cornerByPointReport(inputs: Inputs.OCCT.FilletCornerByPointDto): Promise; } /** * Measurement annotations drawn as OpenCascade wires: a linear dimension between two points, an * angular dimension between two directions, and a pin with a text label. Each comes back as one * compound of wires (lines, arrows and letters) that can be drawn, extruded or exported like any * other shape. Labels are written in the single-line Hershey font; sizes are in model units and * angles in degrees. */ declare class OCCTDimensions { private readonly occWorkerManager; /** * Draws a linear dimension between two points: a measured line offset from them by the * `direction` vector, extension lines back to the points, optional arrows and a label with the * distance. * * The label shows the distance rounded to `decimalPlaces` with `labelSuffix` after it, or * `labelOverwrite` instead; the units are the model's. `direction` must not run along the * measured line. * @param inputs - The two points, the offset direction, the crossing and arrow settings and the label settings * @returns A compound of the dimension wires * @group simple * @shortname linear dimension * @drawable true * @example * ```typescript * const dimension = await bitbybit.occt.dimensions.simpleLinearLengthDimension({ * start: [0, 0, 0], * end: [10, 0, 0], * direction: [0, 0, 2], * labelSuffix: " mm", * labelSize: 0.5, * decimalPlaces: 1, * endType: Bit.Inputs.OCCT.dimensionEndTypeEnum.arrow, * }); * ``` */ simpleLinearLengthDimension(inputs: Inputs.OCCT.SimpleLinearLengthDimensionDto): Promise; /** * Draws an angular dimension between two directions from a center point: an arc of the given * radius, extension lines, optional arrows and a label with the angle. * * The angle is written in degrees unless `radians` is true, rounded to `decimalPlaces` with * `labelSuffix` after it, or replaced by `labelOverwrite`. * @param inputs - The center, the two directions, the arc radius, the offsets and the label settings * @returns A compound of the dimension wires * @group simple * @shortname angular dimension * @drawable true * @example * ```typescript * const dimension = await bitbybit.occt.dimensions.simpleAngularDimension({ * center: [0, 0, 0], * direction1: [1, 0, 0], * direction2: [0, 0, 1], * radius: 4, * offsetFromCenter: 0.5, * extraSize: 0, * decimalPlaces: 1, * labelSuffix: " deg", * labelSize: 0.3, * labelOffset: 0.3, * radians: false, * }); * ``` */ simpleAngularDimension(inputs: Inputs.OCCT.SimpleAngularDimensionDto): Promise; /** * Draws a pin, a line from a start point to an end point with a text label at the end, for * pointing at a spot on a model and naming it. * * `direction` is the normal of the plane the label is written in; `offsetFromStart` moves the * line's start along it, and the arrow and label settings shape the rest. * @param inputs - The start and end points, the label plane direction, the label text and the arrow and label settings * @returns A compound of the pin wires * @group simple * @shortname pin with label * @drawable true * @example * ```typescript * const pin = await bitbybit.occt.dimensions.pinWithLabel({ * startPoint: [0, 0, 0], * endPoint: [0, 5, 2], * direction: [0, 0, 1], * label: "inlet", * labelSize: 0.3, * labelOffset: 0.3, * }); * ``` */ pinWithLabel(inputs: Inputs.OCCT.PinWithLabelDto): Promise; } /** * Draft angles for OpenCascade shapes: the slight taper cast and molded parts need so they slide * out of the mold. `draftAngle` tilts chosen faces of a solid about a neutral plane, while * `makeDraft` and `makeDraftToShape` grow a tapered skirt from a wire or the edges of a shape along * a pull direction. Angles are in degrees. */ declare class OCCTDraft { private readonly occWorkerManager; /** * Tilts the selected faces of a shape by a draft angle so the part can be pulled out of a mold * along `direction`. * * The faces pivot about the neutral plane, given by a point and a normal, which stays put; * `angle` is in degrees. `flag` keeps the standard draft side, false tapers the other way. * Undraftable faces throw. * @param inputs - The shape, the faces to tilt, the pull direction, the angle, the neutral plane and the side flag * @returns The shape with drafted faces * @group draft * @shortname draft angle * @drawable true * @example * ```typescript * const drafted = await bitbybit.occt.draft.draftAngle({ * shape: box, * faces: sideFaces, * direction: [0, 1, 0], * angle: 5, * neutralPlaneOrigin: [0, 0, 0], * neutralPlaneDirection: [0, 1, 0], * flag: true, * }); * ``` */ draftAngle(inputs: Inputs.OCCT.DraftAngleDto): Promise; /** * Grows a tapered skirt from a wire, or the edges of a shape, along a direction: each edge is * swept along `direction`, leaning outward or inward by `angle` degrees, until the skirt is * `lengthMax` long. * * `internal` leans the skirt inward instead of outward. A draft the kernel cannot build throws * an error. * @param inputs - The wire or shape, the direction, the angle, the maximum length and whether to lean inward * @returns The drafted skirt * @group draft * @shortname make draft * @drawable true * @example * ```typescript * const skirt = await bitbybit.occt.draft.makeDraft({ shape: outlineWire, direction: [0, 1, 0], angle: 5, lengthMax: 10, internal: false }); * ``` */ makeDraft(inputs: Inputs.OCCT.MakeDraftDto): Promise; /** * Grows a tapered skirt from a wire, or the edges of a shape, along a direction like * `makeDraft`, but stops it where it meets `stopShape` instead of at a fixed length. * * `keepOut` keeps the part of the stop shape outside the draft; `internal` leans the skirt * inward. A draft the kernel cannot build throws an error. * @param inputs - The wire or shape, the direction, the angle, the shape to stop at, the keep-out flag and whether to lean inward * @returns The drafted skirt * @group draft * @shortname make draft to shape * @drawable true * @example * ```typescript * const skirt = await bitbybit.occt.draft.makeDraftToShape({ shape: outlineWire, direction: [0, 1, 0], angle: 5, stopShape: ceilingFace, keepOut: false, internal: false }); * ``` */ makeDraftToShape(inputs: Inputs.OCCT.MakeDraftToShapeDto): Promise; } /** * Rounding and beveling the edges of OpenCascade shapes: a fillet replaces a sharp edge with a * rounded surface of a given radius, a chamfer with a flat bevel of a given distance. Edges are * chosen by 0-based index in the order `shapes.edge.getEdges` lists them, or passed in directly; * flat outlines and faces are rounded at their corners with `fillet2d`, whose corner indexes * start at 1. A radius that does not fit, for instance larger than a neighbouring face, makes * the kernel fail, so start small. Every method returns a new shape. */ declare class OCCTFillets { private readonly occWorkerManager; /** * Rounds the edges of a shape with a fillet radius, in model units. * * Without `indexes` every edge is rounded with `radius`. With `indexes`, counted from 0 in the * order `shapes.edge.getEdges` lists them, only those edges are rounded, each with `radius` or * the matching entry of `radiusList`, paired with the selected edges in edge order. * @param inputs - The shape, the radius or the radius list, and the optional 0-based edge indexes * @returns The shape with rounded edges * @group 3d fillets * @shortname fillet edges * @drawable true * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 20, height: 5, center: [0, 0, 0] }); * const rounded = await bitbybit.occt.fillets.filletEdges({ shape: box, radius: 1 }); * const twoEdges = await bitbybit.occt.fillets.filletEdges({ shape: box, radiusList: [1, 2], indexes: [0, 3] }); * ``` */ filletEdges(inputs: Inputs.OCCT.FilletDto): Promise; /** * Rounds the given edges of a shape, each with its own radius. * * The edges must belong to the shape; `radiusList` pairs with them by position and must have * the same length, or an error is thrown. * @param inputs - The shape, its edges to round and one radius per edge * @returns The shape with rounded edges * @group 3d fillets * @shortname fillet edges list * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box }); * const rounded = await bitbybit.occt.fillets.filletEdgesList({ shape: box, edges: [edges[0], edges[1]], radiusList: [1, 2] }); * ``` */ filletEdgesList(inputs: Inputs.OCCT.FilletEdgesListDto): Promise; /** * Rounds the given edges of a shape, all with the same radius. * * The edges must belong to the shape; an empty list throws an error. * @param inputs - The shape, its edges to round and the radius * @returns The shape with rounded edges * @group 3d fillets * @shortname fillet edges list one r * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box }); * const rounded = await bitbybit.occt.fillets.filletEdgesListOneRadius({ shape: box, edges: [edges[0], edges[1]], radius: 1 }); * ``` */ filletEdgesListOneRadius(inputs: Inputs.OCCT.FilletEdgesListOneRadiusDto): Promise; /** * Rounds one edge of a shape with a radius that changes along it. * * `paramsU` are positions along the edge as fractions from 0 at its start to 1 at its end, and * `radiusList` gives the radius at each; the kernel blends smoothly between them. The two lists * must have the same length, or an error is thrown. * @param inputs - The shape, its edge, the radii and the positions along the edge they apply at * @returns The shape with the rounded edge * @group 3d fillets * @shortname fillet edge variable r * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box }); * const tapered = await bitbybit.occt.fillets.filletEdgeVariableRadius({ shape: box, edge: edges[0], radiusList: [0.5, 2, 0.5], paramsU: [0, 0.5, 1] }); * ``` */ filletEdgeVariableRadius(inputs: Inputs.OCCT.FilletEdgeVariableRadiusDto): Promise; /** * Rounds several edges of a shape, each with the same radius profile that changes along it. * * `paramsU` are positions along each edge as fractions from 0 to 1 and `radiusList` the radius * at each; the lists must have the same length, or an error is thrown. * @param inputs - The shape, its edges, the radii and the positions along each edge they apply at * @returns The shape with the rounded edges * @group 3d fillets * @shortname fillet edges same variable r * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box }); * const tapered = await bitbybit.occt.fillets.filletEdgesSameVariableRadius({ shape: box, edges: [edges[0], edges[2]], radiusList: [0.5, 2, 0.5], paramsU: [0, 0.5, 1] }); * ``` */ filletEdgesSameVariableRadius(inputs: Inputs.OCCT.FilletEdgesSameVariableRadiusDto): Promise; /** * Rounds several edges of a shape, each with its own radius profile that changes along it. * * `radiusLists` and `paramsULists` hold one list per edge, in edge order; within each pair the * positions are fractions from 0 to 1 along the edge and the radii apply there. All three lists * must have the same length, or an error is thrown. * @param inputs - The shape, its edges, one radius list per edge and one position list per edge * @returns The shape with the rounded edges * @group 3d fillets * @shortname fillet edges variable r * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box }); * const tapered = await bitbybit.occt.fillets.filletEdgesVariableRadius({ * shape: box, * edges: [edges[0], edges[2]], * radiusLists: [[0.5, 2], [2, 0.5]], * paramsULists: [[0, 1], [0, 1]], * }); * ``` */ filletEdgesVariableRadius(inputs: Inputs.OCCT.FilletEdgesVariableRadiusDto): Promise; /** * Rounds the corners of a wire that does not lie in one plane. * * The kernel has no direct 3D wire fillet, so the wire is extruded along `direction` into a * shell, the shell is filleted and the rounded wire is read back off it; `direction` must not * be parallel to the wire and must leave room for the fillets. * @param inputs - The wire, the radius or radius list, the optional 0-based corner indexes and the extrusion direction * @returns The rounded wire * @group 3d fillets * @shortname fillet 3d wire * @drawable true * @example * ```typescript * const rounded = await bitbybit.occt.fillets.fillet3DWire({ shape: zigzagWire, radius: 0.5, direction: [0, 5, 0] }); * ``` */ fillet3DWire(inputs: Inputs.OCCT.Fillet3DWireDto): Promise; /** * Rounds the corners of several wires that do not lie in one plane, as `fillet3DWire` does for * one, with the same radius, indexes and direction for all. * @param inputs - The wires, the radius or radius list, the optional corner indexes and the extrusion direction * @returns The rounded wires, in the same order * @group 3d fillets * @shortname fillet 3d wires * @drawable true * @example * ```typescript * const rounded = await bitbybit.occt.fillets.fillet3DWires({ shapes: [wireA, wireB], radius: 0.5, direction: [0, 5, 0] }); * ``` */ fillet3DWires(inputs: Inputs.OCCT.Fillet3DWiresDto): Promise; /** * Bevels the edges of a shape by a distance, in model units, cutting each sharp edge back to a * flat strip. * * Without `indexes` every edge is beveled with `distance`. With `indexes`, counted from 0 in * the order `shapes.edge.getEdges` lists them, only those edges are beveled, each with * `distance` or the matching entry of `distanceList`, in edge order. * @param inputs - The shape, the distance or the distance list, and the optional 0-based edge indexes * @returns The shape with beveled edges * @group 3d chamfers * @shortname chamfer edges * @drawable true * @example * ```typescript * const beveled = await bitbybit.occt.fillets.chamferEdges({ shape: box, distance: 1 }); * ``` */ chamferEdges(inputs: Inputs.OCCT.ChamferDto): Promise; /** * Bevels the given edges of a shape, each by its own distance. * * The edges must belong to the shape; `distanceList` pairs with them by position and must have * the same length, or an error is thrown. * @param inputs - The shape, its edges to bevel and one distance per edge * @returns The shape with beveled edges * @group 3d chamfers * @shortname chamfer edges list * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box }); * const beveled = await bitbybit.occt.fillets.chamferEdgesList({ shape: box, edges: [edges[0], edges[1]], distanceList: [1, 2] }); * ``` */ chamferEdgesList(inputs: Inputs.OCCT.ChamferEdgesListDto): Promise; /** * Bevels one edge of a shape with an uneven chamfer: `distance1` is measured on `face`, one of * the two faces meeting at the edge, and `distance2` on the other. * * The face decides which side gets which distance; swap them to flip the bevel. * @param inputs - The shape, the edge, the face the first distance applies to, and the two distances * @returns The shape with the beveled edge * @group 3d chamfers * @shortname chamfer edge 2 dist * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box }); * const faces = await bitbybit.occt.shapes.face.getFaces({ shape: box }); * const beveled = await bitbybit.occt.fillets.chamferEdgeTwoDistances({ shape: box, edge: edges[0], face: faces[0], distance1: 1, distance2: 2 }); * ``` */ chamferEdgeTwoDistances(inputs: Inputs.OCCT.ChamferEdgeTwoDistancesDto): Promise; /** * Bevels several edges of a shape with the same uneven chamfer: `distance1` is measured on each * edge's paired face and `distance2` on the other face. * * `faces` pairs with `edges` by position and must have the same length, or an error is thrown. * @param inputs - The shape, the edges, one paired face per edge, and the two distances * @returns The shape with beveled edges * @group 3d chamfers * @shortname chamfer edges 2 dist * @drawable true * @example * ```typescript * const beveled = await bitbybit.occt.fillets.chamferEdgesTwoDistances({ shape: box, edges: [edges[0], edges[1]], faces: [faces[0], faces[0]], distance1: 1, distance2: 2 }); * ``` */ chamferEdgesTwoDistances(inputs: Inputs.OCCT.ChamferEdgesTwoDistancesDto): Promise; /** * Bevels several edges of a shape, each with its own uneven chamfer: for each edge `distances1` * is measured on its paired face and `distances2` on the other face. * * `faces`, `distances1` and `distances2` pair with `edges` by position and must all have the * same length, or an error is thrown. * @param inputs - The shape, the edges, one paired face per edge, and the two distance lists * @returns The shape with beveled edges * @group 3d chamfers * @shortname chamfer edges 2 dist lists * @drawable true * @example * ```typescript * const beveled = await bitbybit.occt.fillets.chamferEdgesTwoDistancesLists({ * shape: box, * edges: [edges[0], edges[1]], * faces: [faces[0], faces[0]], * distances1: [1, 0.5], * distances2: [2, 1], * }); * ``` */ chamferEdgesTwoDistancesLists(inputs: Inputs.OCCT.ChamferEdgesTwoDistancesListsDto): Promise; /** * Bevels one edge of a shape by a distance measured on `face` and an angle in degrees from that * face. * * The bevel starts `distance` away from the edge on the given face and leaves it at `angle`; 45 * degrees gives an even chamfer. * @param inputs - The shape, the edge, the face the distance is measured on, the distance and the angle * @returns The shape with the beveled edge * @group 3d chamfers * @shortname chamfer edge angle * @drawable true * @example * ```typescript * const beveled = await bitbybit.occt.fillets.chamferEdgeDistAngle({ shape: box, edge: edges[0], face: faces[0], distance: 1, angle: 30 }); * ``` */ chamferEdgeDistAngle(inputs: Inputs.OCCT.ChamferEdgeDistAngleDto): Promise; /** * Bevels several edges of a shape by the same distance and angle, the distance measured on each * edge's paired face and the angle in degrees from it. * * `faces` pairs with `edges` by position and must have the same length, or an error is thrown. * @param inputs - The shape, the edges, one paired face per edge, the distance and the angle * @returns The shape with beveled edges * @group 3d chamfers * @shortname chamfer edges angle * @drawable true * @example * ```typescript * const beveled = await bitbybit.occt.fillets.chamferEdgesDistAngle({ shape: box, edges: [edges[0], edges[1]], faces: [faces[0], faces[0]], distance: 1, angle: 30 }); * ``` */ chamferEdgesDistAngle(inputs: Inputs.OCCT.ChamferEdgesDistAngleDto): Promise; /** * Bevels several edges of a shape, each by its own distance and angle, the distance measured on * the edge's paired face and the angle in degrees from it. * * `faces`, `distances` and `angles` pair with `edges` by position and must all have the same * length, or an error is thrown. * @param inputs - The shape, the edges, one paired face per edge, the distances and the angles * @returns The shape with beveled edges * @group 3d chamfers * @shortname chamfer edges angles * @drawable true * @example * ```typescript * const beveled = await bitbybit.occt.fillets.chamferEdgesDistsAngles({ * shape: box, * edges: [edges[0], edges[1]], * faces: [faces[0], faces[0]], * distances: [1, 0.5], * angles: [30, 60], * }); * ``` */ chamferEdgesDistsAngles(inputs: Inputs.OCCT.ChamferEdgesDistsAnglesDto): Promise; /** * Rounds the corners of a flat wire or face with arcs of a given radius. * * Without `indexes` every corner is rounded with `radius`. With `indexes`, counted from 1 along * the outline, only those corners are rounded, each with `radius` or the matching entry of * `radiusList`, as long as `indexes`. Wires with free-form edges use `fillet3DWire`. * @param inputs - The flat wire or face, the radius or radius list, and the optional 1-based corner indexes * @returns The rounded wire or face * @group 2d fillets * @shortname fillet 2d wire or face * @drawable true * @example * ```typescript * const rectangle = await bitbybit.occt.shapes.wire.createRectangleWire({ width: 10, length: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * const rounded = await bitbybit.occt.fillets.fillet2d({ shape: rectangle, radius: 1 }); * const twoCorners = await bitbybit.occt.fillets.fillet2d({ shape: rectangle, radiusList: [1, 2], indexes: [1, 3] }); * ``` */ fillet2d(inputs: Inputs.OCCT.FilletDto): Promise; /** * Rounds the corners of several flat wires or faces, as `fillet2d` does for one, with the same * radius and corner indexes for all. * @param inputs - The flat wires or faces, the radius or radius list, and the optional 1-based corner indexes * @returns The rounded wires or faces, in the same order * @group 2d fillets * @shortname fillet 2d wires or faces * @drawable true * @example * ```typescript * const rounded = await bitbybit.occt.fillets.fillet2dShapes({ shapes: [rectangleA, rectangleB], radius: 1 }); * ``` */ fillet2dShapes(inputs: Inputs.OCCT.FilletShapesDto): Promise; /** * Joins two edges that lie in one plane with a rounding arc of the given radius, trimming the * edges to meet it, and returns the three pieces as one wire. * * The plane is given by `planeOrigin` and `planeDirection`, its normal. When several arcs fit, * `solution` picks one by index; -1 takes the one nearest `planeOrigin`. * @param inputs - The two edges, the plane they lie in, the radius and the solution index * @returns The wire of first edge, arc and second edge * @group 2d fillets * @shortname fillet 2 edges * @drawable true * @example * ```typescript * const corner = await bitbybit.occt.fillets.filletTwoEdgesInPlaneIntoAWire({ * edge1: horizontal, * edge2: vertical, * planeOrigin: [0, 0, 0], * planeDirection: [0, 1, 0], * radius: 1, * solution: -1, * }); * ``` */ filletTwoEdgesInPlaneIntoAWire(inputs: Inputs.OCCT.FilletTwoEdgesInPlaneDto): Promise; /** * Bevels the corners of a flat wire or face: each corner is cut back by `distance` along one * edge, at `angle` degrees to it. * * Without `indexes` every corner is beveled; with them, counted from 1 along the outline, only * those corners are. * @param inputs - The flat wire or face, the distance, the angle and the optional 1-based corner indexes * @returns The beveled wire or face * @group 2d fillets * @shortname chamfer 2d corners * @drawable true * @example * ```typescript * const beveled = await bitbybit.occt.fillets.chamfer2dVertices({ shape: rectangle, distance: 1, angle: 45, indexes: [1, 3] }); * ``` */ chamfer2dVertices(inputs: Inputs.OCCT.Chamfer2dVertexDto): Promise; } /** * Construction curves of OpenCascade: 2D curves in a plane or in the UV space of a surface * (circles, ellipses, segments, trimmed pieces), which feed * `shapes.edge.makeEdgeFromGeom2dCurveAndSurface`, and circle and ellipse wires. The 2D curves have * no topology and cannot be drawn; a point on them is read with `get2dPointFrom2dCurveOnParam`. */ declare class OCCTCurves { private readonly occWorkerManager; /** * Creates a 2D ellipse curve in a plane, for constructions in the UV space of a surface. * * `direction` is the direction of the major axis; `radiusMajor` must be at least `radiusMinor`, * and `sense` flips the curve's direction. The curve cannot be drawn; wrap it with * `shapes.edge.makeEdgeFromGeom2dCurveAndSurface`. * @param inputs - The center, the major axis direction, the two radii and the direction sense * @returns The 2D ellipse curve * @group primitives * @shortname ellipse 2d * @example * ```typescript * const ellipse = await bitbybit.occt.geom.curves.geom2dEllipse({ center: [0, 0], direction: [1, 0], radiusMinor: 1, radiusMajor: 2, sense: false }); * ``` */ geom2dEllipse(inputs: Inputs.OCCT.Geom2dEllipseDto): Promise; /** * Cuts a piece out of a 2D curve between the parameters `u1` and `u2`. * * On a closed curve such as a circle the parameters run around it, so a trimmed circle is an * arc. The result cannot be drawn on its own. * @param inputs - The 2D curve, the two parameters and the trimming options * @returns The trimmed 2D curve * @group create * @shortname trimmed 2d * @example * ```typescript * const arc = await bitbybit.occt.geom.curves.geom2dTrimmedCurve({ shape: circle2d, u1: 0, u2: 1.57, sense: true, adjustPeriodic: true }); * ``` */ geom2dTrimmedCurve(inputs: Inputs.OCCT.Geom2dTrimmedCurveDto): Promise; /** * Creates a straight 2D curve segment between two 2D points, for constructions in the UV space * of a surface. * * The segment cannot be drawn on its own. * @param inputs - The start and end points * @returns The 2D segment curve * @group primitives * @shortname segment 2d * @example * ```typescript * const segment = await bitbybit.occt.geom.curves.geom2dSegment({ start: [0, 0], end: [1, 0] }); * ``` */ geom2dSegment(inputs: Inputs.OCCT.Geom2dSegmentDto): Promise; /** * Evaluates a 2D curve at a parameter and returns the 2D point there. * * The parameter is in the curve's own range, not a fraction: a circle runs from 0 to two pi, a * segment from 0 to its length. * @param inputs - The 2D curve and the parameter * @returns The point as two numbers * @group get * @shortname 2d point on curve * @example * ```typescript * const point = await bitbybit.occt.geom.curves.get2dPointFrom2dCurveOnParam({ shape: circle2d, param: 1.57 }); * ``` */ get2dPointFrom2dCurveOnParam(inputs: Inputs.OCCT.DataOnGeometryAtParamDto): Promise; /** * Creates a full circle as a closed single-edge wire, lying in the plane whose normal is * `direction`. * * The same as `shapes.wire.createCircleWire`, kept here beside the 2D curves. * @param inputs - The radius, the center and the plane normal * @returns The circle wire * @group primitives * @shortname circle * @drawable false * @example * ```typescript * const circle = await bitbybit.occt.geom.curves.geomCircleCurve({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ geomCircleCurve(inputs: Inputs.OCCT.CircleDto): Promise; /** * Creates a full ellipse as a closed single-edge wire, lying in the plane whose normal is * `direction`. * * The same as `shapes.wire.createEllipseWire`, kept here beside the 2D curves; `radiusMajor` * must not be smaller than `radiusMinor`. * @param inputs - The center, the plane normal and the two radii * @returns The ellipse wire * @group primitives * @shortname ellipse * @drawable false * @example * ```typescript * const ellipse = await bitbybit.occt.geom.curves.geomEllipseCurve({ center: [0, 0, 0], direction: [0, 1, 0], radiusMinor: 3, radiusMajor: 6 }); * ``` */ geomEllipseCurve(inputs: Inputs.OCCT.EllipseDto): Promise; } /** * The geometric layer beneath the topology: the mathematical curves and surfaces themselves, * separate from the edges and faces that carry them. `curves` builds 2D curves for constructions in * UV space and evaluates them; `surfaces` builds infinite surfaces and extracts the surface a face * lies on. These objects cannot be drawn directly: wrap them into edges and faces with * `shapes.edge` and `shapes.face` first. */ declare class OCCTGeom { readonly curves: OCCTCurves; readonly surfaces: OCCTSurfaces; } /** * Construction surfaces of OpenCascade: the infinite mathematical surfaces that faces are cut from. * `cylindricalSurface` builds one and `surfaceFromFace` reads the surface a face lies on; both feed * `shapes.face.faceFromSurface`, `shapes.face.faceFromSurfaceAndWire` and * `shapes.edge.makeEdgeFromGeom2dCurveAndSurface`. A surface has no boundary and cannot be drawn by * itself. */ declare class OCCTSurfaces { private readonly occWorkerManager; /** * Creates an infinite cylindrical surface of the given radius around an axis through `center` * along `direction`. * * It has no ends and cannot be drawn; cut a face from it with * `shapes.face.faceFromSurfaceAndWire` or place wires on it with `shapes.wire.placeWireOnFace` * after making a face. * @param inputs - The radius, a point on the axis and the axis direction * @returns The cylindrical surface * @group surfaces * @shortname cylindrical * @drawable false * @example * ```typescript * const cylinder = await bitbybit.occt.geom.surfaces.cylindricalSurface({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ cylindricalSurface(inputs: Inputs.OCCT.GeomCylindricalSurfaceDto): Promise; /** * Reads the underlying surface a face lies on, without its boundary. * * A face is a bounded piece of such a surface; the surface itself extends beyond the face, * which is what lets a new wire be placed on it and cut into a different face. * @param inputs - The face * @returns The surface the face lies on * @group surfaces * @shortname from face * @drawable false * @example * ```typescript * const surface = await bitbybit.occt.geom.surfaces.surfaceFromFace({ shape: face }); * ``` */ surfaceFromFace(inputs: Inputs.OCCT.ShapeDto): Promise; } /** * Reading and writing OpenCascade shapes in exchange formats: STEP and IGES in, STEP, STL and DXF * out, STEP to glTF conversion with the assembly tree, colors and names preserved, and a STEP * assembly structure as JSON. Files travel as text or binary data, never as paths. OpenCascade * treats Z as up while this library treats Y as up, so the `adjustYtoZ` and `adjustZtoY` flags swap * the axes on the way out and in. */ declare class OCCTIO { readonly occWorkerManager: OCCTWorkerManager; /** * Writes a shape as STEP, the standard exchange format for exact CAD geometry, and starts a * browser download of the file. * * With `adjustYtoZ` true the shape is turned so this library's Y-up becomes STEP's Z-up; * `fromRightHanded` skips the mirror that swap otherwise includes. `fileName` names the download * and `tryDownload` false skips it. `saveShapeSTEPAndReturn` gives the file's text instead. * @param inputs - The shape, the file name, the axis adjustment and the download options * @returns Nothing; the download starts when the file is ready * @group io * @shortname save step * @drawable false * @example * ```typescript * await bitbybit.occt.io.saveShapeSTEP({ shape: box, fileName: "box.step", adjustYtoZ: true, tryDownload: true }); * ``` */ saveShapeSTEP(inputs: Inputs.OCCT.SaveStepDto): Promise; /** * Writes a shape as STEP, the standard exchange format for exact CAD geometry, and returns the * file's text. * * With `adjustYtoZ` true the shape is turned so this library's Y-up becomes STEP's Z-up; * `fromRightHanded` skips the mirror that swap otherwise includes. `fileName` and `tryDownload` * matter only where a browser download can be started. * @param inputs - The shape, the file name, the axis adjustment and the download options * @returns The STEP file as text * @group io * @shortname save step and return * @drawable false * @example * ```typescript * const step = await bitbybit.occt.io.saveShapeSTEPAndReturn({ shape: box, fileName: "box.step", adjustYtoZ: true, tryDownload: false }); * ``` */ saveShapeSTEPAndReturn(inputs: Inputs.OCCT.SaveStepDto): Promise; /** * Triangulates a shape, writes it as STL, the mesh format 3D printers read, and starts a browser * download of the file. * * `precision` is the meshing tolerance in model units; smaller values follow curved surfaces more * closely and make a bigger file. `adjustYtoZ` turns Y-up into Z-up. `fileName` names the * download, `tryDownload` false skips it. `saveShapeStlAndReturn` gives the text instead. * @param inputs - The shape, the file name, the meshing precision, the axis adjustment and the download options * @returns Nothing; the download starts when the file is ready * @group io * @shortname save stl * @drawable false * @example * ```typescript * await bitbybit.occt.io.saveShapeStl({ shape: box, fileName: "box.stl", precision: 0.01, adjustYtoZ: true, tryDownload: true }); * ``` */ saveShapeStl(inputs: Inputs.OCCT.SaveStlDto): Promise; /** * Triangulates a shape and writes it as STL, the mesh format 3D printers and slicers read, * returning the file's text. * * `precision` is the meshing tolerance in model units; smaller values follow curved surfaces * more closely and make a bigger file. `adjustYtoZ` turns the shape so Y-up becomes Z-up. * `fileName` and `tryDownload` only matter where a download can start. * @param inputs - The shape, the file name, the meshing precision, the axis adjustment and the download options * @returns The STL file as text * @group io * @shortname save stl return * @drawable false * @example * ```typescript * const stl = await bitbybit.occt.io.saveShapeStlAndReturn({ shape: box, fileName: "box.stl", precision: 0.01, adjustYtoZ: true, tryDownload: false }); * ``` */ saveShapeStlAndReturn(inputs: Inputs.OCCT.SaveStlDto): Promise; private saveSTEP; private saveStl; /** * Turns the wires of a shape into DXF path records, the first step of a 2D DXF export. * * The shape must lie flat on the XZ ground plane, since DXF drawings are two-dimensional. The * deflection settings say how closely curved edges are followed. Give the paths a layer with * `dxfPathsWithLayer` and write the file with `dxfCreate`. * @param inputs - The shape and the deflection settings * @returns The DXF paths * @group dxf * @shortname shape to dxf paths * @drawable false * @example * ```typescript * const paths = await bitbybit.occt.io.shapeToDxfPaths({ * shape: flatOutline, * angularDeflection: 0.1, * curvatureDeflection: 0.1, * minimumOfPoints: 2, * uTolerance: 1e-9, * minimumLength: 1e-7, * }); * ``` */ shapeToDxfPaths(inputs: Inputs.OCCT.ShapeToDxfPathsDto): Promise; /** * Puts DXF paths on a named layer with a color, making one part of a DXF drawing. * * A drawing may hold several parts, each with its own layer and color; `dxfCreate` writes them * into one file. * @param inputs - The paths, the layer name and the color * @returns The paths as one layered part * @group dxf * @shortname dxf paths with layer * @drawable false * @example * ```typescript * const part = await bitbybit.occt.io.dxfPathsWithLayer({ paths, layer: "cut", color: "#ff0000" }); * ``` */ dxfPathsWithLayer(inputs: Inputs.OCCT.DxfPathsWithLayerDto): Promise; /** * Writes DXF parts into one DXF file and returns its text. * * `colorFormat` chooses AutoCAD's indexed colors or true color, `acadVersion` the DXF version: * AC1009 is R12, the most widely readable, AC1015 is 2000. `fileName` and `tryDownload` matter * only where a browser download can be started. * @param inputs - The layered parts, the color format, the DXF version and the download options * @returns The DXF file as text * @group dxf * @shortname dxf create * @drawable false * @example * ```typescript * const dxf = await bitbybit.occt.io.dxfCreate({ * pathsParts: [part], * colorFormat: Bit.Inputs.OCCT.dxfColorFormatEnum.aci, * acadVersion: Bit.Inputs.OCCT.dxfAcadVersionEnum.AC1009, * fileName: "drawing.dxf", * tryDownload: false, * }); * ``` */ dxfCreate(inputs: Inputs.OCCT.DxfPathsPartsListDto): Promise; /** * Converts a STEP file into a binary glTF (GLB), keeping the assembly tree as glTF nodes along * with part names, colors, materials and placements. * * `stepData` is the file as text, ArrayBuffer or Uint8Array. The mesh settings say how finely * curved surfaces are triangulated: `meshPrecision` is the deflection, `meshAngle` the angular * deflection. Z-up becomes glTF's Y-up. Failure throws. * @param inputs - The STEP file content and the meshing settings * @returns The GLB file as bytes * @group assembly * @shortname step to gltf * @drawable false * @example * ```typescript * const glb = await bitbybit.occt.io.convertStepToGltf({ stepData: stepText, meshPrecision: 0.005, meshAngle: 0.5, meshRelative: true, internalVerticesMode: false, controlSurfaceDeflection: false }); * ``` */ convertStepToGltf(inputs: Inputs.OCCT.ConvertStepToGltfDto): Promise; /** * Converts a STEP file into a binary glTF (GLB) like `convertStepToGltf`, with every option * exposed. * * The read flags choose what to take from the file (colors, names, materials, layers, * properties), the mesh settings how finely to triangulate, the export settings how the glTF is * written (merged faces, 16-bit indexes, naming, scale). Switch off what you do not need. * @param inputs - The STEP file content and the reading, meshing and export settings * @returns The GLB file as bytes * @group assembly * @shortname step to gltf advanced * @drawable false * @example * ```typescript * const options = new Bit.Inputs.OCCT.ConvertStepToGltfAdvancedDto(); * options.stepData = stepText; * options.readColors = true; * options.readNames = true; * options.meshDeflection = 0.005; * options.mergeFaces = true; * options.adjustZtoY = true; * const glb = await bitbybit.occt.io.convertStepToGltfAdvanced(options); * ``` */ convertStepToGltfAdvanced(inputs: Inputs.OCCT.ConvertStepToGltfAdvancedDto): Promise; /** * Converts a STEP file into a binary glTF (GLB) like `convertStepToGltf` and compresses the * geometry with Draco, which makes the file much smaller at the cost of a Draco-capable loader. * * The Draco settings set the compression level and how many bits positions, normals, texture * coordinates and colors keep; fewer bits mean a smaller file and less precision. * @param inputs - The STEP file content, the meshing settings and the Draco settings * @returns The GLB file as bytes * @group assembly * @shortname step to gltf with draco * @drawable false * @example * ```typescript * const options = new Bit.Inputs.OCCT.ConvertStepToGltfWithDracoDto(); * options.stepData = stepText; * options.meshPrecision = 0.005; * options.dracoCompressionLevel = 7; * options.dracoQuantizePositionBits = 14; * const glb = await bitbybit.occt.io.convertStepToGltfWithDraco(options); * ``` */ convertStepToGltfWithDraco(inputs: Inputs.OCCT.ConvertStepToGltfWithDracoDto): Promise; /** * Converts a STEP file into a binary glTF (GLB) with every reading, meshing and writing option * exposed, as `convertStepToGltfAdvanced` does, and compresses the geometry with Draco. * * The Draco settings set the compression level and how many bits positions, normals, texture * coordinates and colors keep; fewer bits mean a smaller file and less precision. * @param inputs - The STEP file content, the reading, meshing and export settings, and the Draco settings * @returns The GLB file as bytes * @group assembly * @shortname step to gltf advanced with draco * @drawable false * @example * ```typescript * const options = new Bit.Inputs.OCCT.ConvertStepToGltfAdvancedWithDracoDto(); * options.stepData = stepText; * options.readColors = true; * options.meshDeflection = 0.005; * options.dracoCompressionLevel = 7; * const glb = await bitbybit.occt.io.convertStepToGltfAdvancedWithDraco(options); * ``` */ convertStepToGltfAdvancedWithDraco(inputs: Inputs.OCCT.ConvertStepToGltfAdvancedWithDracoDto): Promise; /** * Reads the assembly structure of a STEP file without building geometry: every part and * sub-assembly as a node with its id, name, whether it is an assembly, its visibility, its * color and its placement matrix. * * The nodes come in depth-first order, so children follow their parent. A file that cannot be * parsed reports its error in the result. * @param inputs - The STEP file content * @returns The list of nodes, the format version and any error * @group assembly * @shortname parse step to json * @drawable false * @example * ```typescript * const tree = await bitbybit.occt.io.parseStepToJson({ stepData: stepText }); * console.log(tree.nodes.map(n => n.name)); * ``` */ parseStepToJson(inputs: Inputs.OCCT.ParseStepAssemblyToJsonDto): Promise; } /** * The entry point to the OpenCascade kernel: every OCCT feature is reached through one of its * properties. `shapes` builds and reads vertices, edges, wires, faces, shells, solids and * compounds; `operations`, `booleans`, `fillets`, `transforms`, `corners` and `draft` change * shapes; `geom` handles curves and surfaces; `io` reads and writes STEP, IGES, STL and other * files; `assembly`, `dimensions`, `brepGraph`, `path` and `svg` cover documents, annotations, * topology graphs, machining paths and SVG. The methods on the service itself turn shapes into * triangle meshes for drawing. */ declare class OCCT { readonly occWorkerManager: OCCTWorkerManager; readonly shapes: OCCTShapes; readonly geom: OCCTGeom; readonly fillets: OCCTFillets; readonly transforms: OCCTTransforms; readonly operations: OCCTOperations; readonly booleans: OCCTBooleans; readonly dimensions: OCCTDimensions; readonly shapeFix: OCCTShapeFix; readonly assembly: OCCTAssembly; readonly brepGraph: OCCTBrepGraph; readonly corners: OCCTCorners; readonly draft: OCCTDraft; readonly io: OCCTIO; readonly path: OCCTPath; readonly svg: OCCTSVG; /** * Triangulates a shape and returns every triangle as three points, in one flat list over all * faces. * * `precision` is the meshing tolerance in model units: smaller values follow curved surfaces * more closely and give more triangles. `adjustYtoZ` swaps the Y and Z axes for tools that * treat Z as up, and `reversedPoints` flips the winding of each triangle. * @param inputs - The shape, the meshing precision and the axis and winding options * @returns One list of three points per triangle * @group convert * @shortname faces to polygon points * @drawable false * @example * ```typescript * const triangles = await bitbybit.occt.shapeFacesToPolygonPoints({ shape: sphere, precision: 0.01, adjustYtoZ: false, reversedPoints: false }); * ``` */ shapeFacesToPolygonPoints(inputs: Inputs.OCCT.ShapeFacesToPolygonPointsDto): Promise; /** * Triangulates a shape into a mesh for drawing: one entry per face with its vertices, normals, * UVs and triangle indexes, one per edge with its points, and the vertex points. * * `precision` is the meshing tolerance in model units; smaller values follow curved surfaces * more closely and cost more triangles. `adjustYtoZ` swaps Y and Z. A null shape gives empty * lists. * @param inputs - The shape, the meshing precision and the options * @returns The mesh as face, edge and point lists * @group convert * @shortname shape to mesh * @drawable false * @example * ```typescript * const mesh = await bitbybit.occt.shapeToMesh({ shape: sphere, precision: 0.01, adjustYtoZ: false }); * console.log(mesh.faceList.length, mesh.edgeList.length); * ``` */ shapeToMesh(inputs: Inputs.OCCT.ShapeToMeshDto): Promise; /** * Triangulates several shapes with the same settings, as `shapeToMesh` does for one. * @param inputs - The shapes, the meshing precision and the options * @returns One mesh per shape, in the same order * @group convert * @shortname shape to mesh * @drawable false * @example * ```typescript * const meshes = await bitbybit.occt.shapesToMeshes({ shapes: [box, sphere], precision: 0.01, adjustYtoZ: false }); * ``` */ shapesToMeshes(inputs: Inputs.OCCT.ShapesToMeshesDto): Promise; /** * Triangulates the top-level shapes of an assembly document into one combined mesh, with the * face colors of the document collected into the mesh's color groups. * @param inputs - The document and the meshing options * @returns The combined mesh * @ignore true */ docToMesh(inputs: Inputs.OCCT.DocToMeshDto): Promise; /** * Triangulates the top-level shapes of an assembly document into one mesh per shape, with the * face colors of the document collected into each mesh's color groups. * @param inputs - The document and the meshing options * @returns One mesh per top-level shape * @ignore true */ docToMeshes(inputs: Inputs.OCCT.DocToMeshesDto): Promise; /** * Frees the memory a shape holds inside the kernel; the shape cannot be used afterwards. Call * it for intermediate results a script no longer needs, so long sessions do not run out of * memory. * @param inputs - The shape to free * @group memory * @shortname delete shape * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 0, 0] }); * const rounded = await bitbybit.occt.fillets.filletEdges({ shape: box, radius: 1 }); * await bitbybit.occt.deleteShape({ shape: box }); * ``` */ deleteShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Frees the memory several shapes hold inside the kernel; they cannot be used afterwards. Call * it for intermediate results a script no longer needs, so long sessions do not run out of * memory. * @param inputs - The shapes to free * @group memory * @shortname delete shapes * @example * ```typescript * await bitbybit.occt.deleteShapes({ shapes: [box, cylinder] }); * ``` */ deleteShapes(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Frees every shape the kernel holds at once, including the ones your variables still point to, * so nothing created before can be used afterwards. Call it when starting over rather than * between steps. * @group memory * @shortname clean all cache * @example * ```typescript * await bitbybit.occt.cleanAllCache(); * ``` */ cleanAllCache(): Promise; } /** * The modeling operations that turn OpenCascade wires and faces into surfaces and solids and * measure shapes: lofting through sections, extruding and revolving, sweeping profiles along paths, * offsetting, thickening shells into solids, slicing and splitting, plus bounding boxes, bounding * spheres and closest-point queries. Distances are in model units and angles in degrees; every * operation returns a new shape. Booleans live in `booleans`, rounding in `fillets`. */ declare class OCCTOperations { private readonly occWorkerManager; /** * Builds a surface through a series of wires, like skin stretched over ribs: each wire is one * section and the surface passes through them in list order. * * Edges are accepted as single-edge wires. With `makeSolid` true and closed sections the result * is capped into a solid; otherwise it is a shell. Sections match up best with equal edge * counts. * @param inputs - The section wires or edges, in order, and whether to make a solid * @returns The lofted shell or solid * @group lofts * @shortname loft * @drawable true * @example * ```typescript * const bottom = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * const upper = await bitbybit.occt.shapes.wire.createSquareWire({ size: 6, center: [0, 10, 0], direction: [0, 1, 0] }); * const vase = await bitbybit.occt.operations.loft({ shapes: [bottom, upper], makeSolid: true }); * ``` */ loft(inputs: Inputs.OCCT.LoftDto): Promise; /** * Builds a surface through a series of wires like `loft`, with control over how the skin is * fitted. * * `straight` makes ruled patches between sections instead of a smooth blend; `closed` loops the * surface from the last section back to the first, and `periodic` makes that loop smooth by * resampling the sections. `startVertex` and `endVertex` close the ends to points. * @param inputs - The section wires or edges, whether to make a solid, the closing and smoothing options and optional end points * @returns The lofted shell or solid * @group lofts * @shortname loft adv. * @drawable true * @example * ```typescript * const cone = await bitbybit.occt.operations.loftAdvanced({ * shapes: [circleBottom, circleMiddle], * makeSolid: true, * closed: false, * periodic: false, * straight: false, * nrPeriodicSections: 10, * useSmoothing: false, * maxUDegree: 3, * tolerance: 1e-7, * parType: Bit.Inputs.OCCT.approxParametrizationTypeEnum.approxCentripetal, * endVertex: [0, 20, 0], * }); * ``` */ loftAdvanced(inputs: Inputs.OCCT.LoftAdvancedDto): Promise; /** * Finds the pair of points, one on each shape, that are closest to each other. * * The distance between them is the gap between the shapes; it is 0 when they touch or overlap. * Throws an error when no pair can be found. * @param inputs - The two shapes * @returns The point on the first shape and the point on the second * @group closest pts * @shortname two shapes * @drawable true * @example * ```typescript * const [onBox, onSphere] = await bitbybit.occt.operations.closestPointsBetweenTwoShapes({ shape1: box, shape2: sphere }); * ``` */ closestPointsBetweenTwoShapes(inputs: Inputs.OCCT.ClosestPointsBetweenTwoShapesDto): Promise; /** * Finds, for each point in a list, the closest point on a shape. * * A point already on the shape maps to itself. Useful for snapping points onto a surface. * @param inputs - The shape and the points * @returns One point on the shape per input point, in the same order * @group closest pts * @shortname on shape * @drawable true * @example * ```typescript * const snapped = await bitbybit.occt.operations.closestPointsOnShapeFromPoints({ shape: sphere, points: [[0, 20, 0], [20, 0, 0]] }); * ``` */ closestPointsOnShapeFromPoints(inputs: Inputs.OCCT.ClosestPointsOnShapeFromPointsDto): Promise; /** * Finds the closest point on each of several shapes for each point in a list. * * The result is one flat list: all the points for the first shape, in point order, then all the * points for the second shape, and so on. * @param inputs - The shapes and the points * @returns The closest points, grouped shape by shape * @group closest pts * @shortname on shapes * @drawable true * @example * ```typescript * const snapped = await bitbybit.occt.operations.closestPointsOnShapesFromPoints({ shapes: [box, sphere], points: [[0, 20, 0], [20, 0, 0]] }); * ``` */ closestPointsOnShapesFromPoints(inputs: Inputs.OCCT.ClosestPointsOnShapesFromPointsDto): Promise; /** * Measures how far each point in a list is from a shape, as the straight distance to the * closest point on it, in model units. * * The distance is to the shape's surface, so a point inside a solid still reports its distance * to the skin. * @param inputs - The shape and the points * @returns One distance per point, in the same order * @group measure * @shortname distances points to shape * @drawable false * @example * ```typescript * const distances = await bitbybit.occt.operations.distancesToShapeFromPoints({ shape: sphere, points: [[0, 20, 0], [20, 0, 0]] }); * ``` */ distancesToShapeFromPoints(inputs: Inputs.OCCT.ClosestPointsOnShapeFromPointsDto): Promise; /** * Computes the axis-aligned box that encloses a shape: its minimum and maximum corners, its * center and its size along X, Y and Z. * * On curved shapes the box can be a little larger than the shape itself, because the kernel * bounds the control geometry rather than the exact surface. * @param inputs - The shape * @returns The box as `min`, `max`, `center` and `size` * @group measure * @shortname bbox of shape * @drawable false * @example * ```typescript * const box = await bitbybit.occt.operations.boundingBoxOfShape({ shape }); * console.log(box.size, box.center); * ``` */ boundingBoxOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the minimum corner of a shape's axis-aligned bounding box, the point with the smallest * X, Y and Z. * @param inputs - The shape * @returns The minimum corner * @group measure * @shortname bbox min of shape * @drawable true * @example * ```typescript * const min = await bitbybit.occt.operations.boundingBoxMinOfShape({ shape }); * ``` */ boundingBoxMinOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the maximum corner of a shape's axis-aligned bounding box, the point with the largest * X, Y and Z. * @param inputs - The shape * @returns The maximum corner * @group measure * @shortname bbox max of shape * @drawable true * @example * ```typescript * const max = await bitbybit.occt.operations.boundingBoxMaxOfShape({ shape }); * ``` */ boundingBoxMaxOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the center of a shape's axis-aligned bounding box, halfway between its two corners. * * This is not the center of mass; `shapes.solid.getSolidCenterOfMass` and its siblings give * that. * @param inputs - The shape * @returns The center of the box * @group measure * @shortname bbox center of shape * @drawable true * @example * ```typescript * const center = await bitbybit.occt.operations.boundingBoxCenterOfShape({ shape }); * ``` */ boundingBoxCenterOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the size of a shape's axis-aligned bounding box along X, Y and Z, in model units. * @param inputs - The shape * @returns The width, height and length of the box * @group measure * @shortname bbox size of shape * @drawable false * @example * ```typescript * const size = await bitbybit.occt.operations.boundingBoxSizeOfShape({ shape }); * ``` */ boundingBoxSizeOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Builds the axis-aligned bounding box of a shape as a box solid, handy for drawing it or using * it in a boolean. * @param inputs - The shape * @returns The box solid * @group measure * @shortname bbox shape of shape * @drawable true * @example * ```typescript * const boxSolid = await bitbybit.occt.operations.boundingBoxShapeOfShape({ shape }); * ``` */ boundingBoxShapeOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Computes a sphere that encloses a shape: it is centered on the bounding box and reaches its * corners, so it always contains the shape but is not the smallest possible sphere. * @param inputs - The shape * @returns The sphere as `center` and `radius` * @group measure * @shortname bsphere of shape * @drawable false * @example * ```typescript * const sphere = await bitbybit.occt.operations.boundingSphereOfShape({ shape }); * console.log(sphere.radius); * ``` */ boundingSphereOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the center of a shape's bounding sphere, which is the center of its bounding box. * @param inputs - The shape * @returns The center of the sphere * @group measure * @shortname bsphere center of shape * @drawable false * @example * ```typescript * const center = await bitbybit.occt.operations.boundingSphereCenterOfShape({ shape }); * ``` */ boundingSphereCenterOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the radius of a shape's bounding sphere, the distance from the bounding box center to * its corner, in model units. * @param inputs - The shape * @returns The radius * @group measure * @shortname bsphere radius of shape * @drawable false * @example * ```typescript * const radius = await bitbybit.occt.operations.boundingSphereRadiusOfShape({ shape }); * ``` */ boundingSphereRadiusOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Builds the bounding sphere of a shape as a sphere solid. * @param inputs - The shape * @returns The sphere solid * @group measure * @shortname bsphere shape of shape * @drawable true * @example * ```typescript * const sphereSolid = await bitbybit.occt.operations.boundingSphereShapeOfShape({ shape }); * ``` */ boundingSphereShapeOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Sweeps a shape in a straight line along a vector, whose length is the distance: a face * becomes a solid, a wire a shell, an edge a face. * * The shape itself stays at the start of the extrusion; the vector is in model units, so `[0, * 10, 0]` extrudes 10 units up. * @param inputs - The shape and the direction vector, whose length is the distance * @returns The extruded shape * @group extrusions * @shortname extrude * @drawable true * @example * ```typescript * const disc = await bitbybit.occt.shapes.face.createCircleFace({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * const cylinder = await bitbybit.occt.operations.extrude({ shape: disc, direction: [0, 10, 0] }); * ``` */ extrude(inputs: Inputs.OCCT.ExtrudeDto): Promise; /** * Sweeps several shapes along the same vector, as `extrude` does for one. * @param inputs - The shapes and the direction vector, whose length is the distance * @returns The extruded shapes, in the same order * @group extrusions * @shortname extrude shapes * @drawable true * @example * ```typescript * const walls = await bitbybit.occt.operations.extrudeShapes({ shapes: [faceA, faceB], direction: [0, 10, 0] }); * ``` */ extrudeShapes(inputs: Inputs.OCCT.ExtrudeShapesDto): Promise; /** * Cuts a shape into pieces with other shapes, the way a knife splits a loaf, without removing * any material. * * With `nonDestructive` true, the default, the inputs are left untouched and the result holds * the pieces of every shape involved, the cutters included; with false only the pieces of * `shape` come back. `localFuzzyTolerance` lets geometry that nearly touches count as touching. * @param inputs - The shape to split, the shapes to split it with and the options * @returns The pieces * @group divisions * @shortname split * @drawable true * @example * ```typescript * const pieces = await bitbybit.occt.operations.splitShapeWithShapes({ shape: box, shapes: [cuttingPlane], localFuzzyTolerance: 1e-4, nonDestructive: false }); * ``` */ splitShapeWithShapes(inputs: Inputs.OCCT.SplitDto): Promise; /** * Spins a shape around an axis through the origin to sweep out a surface or solid: a face gives * a solid, a wire a shell. * * `angle` is in degrees; 360 or more gives a full turn. The axis runs along `direction`: a * profile beside the Y axis revolved about it gives a vase. The profile must not cross it. * @param inputs - The profile shape, the angle in degrees, the axis direction and whether to copy the geometry * @returns The revolved shape * @group revolutions * @shortname revolve * @drawable true * @example * ```typescript * const profile = await bitbybit.occt.shapes.wire.createPolylineWire({ points: [[2, 0, 0], [4, 0, 0], [3, 10, 0], [2, 12, 0]] }); * const vase = await bitbybit.occt.operations.revolve({ shape: profile, angle: 360, direction: [0, 1, 0], copy: false }); * ``` */ revolve(inputs: Inputs.OCCT.RevolveDto): Promise; /** * Extrudes a flat shape up along Y by `height` while twisting it by `angle` degrees about the Y * axis, like a twisted column. * * The shape should lie flat, as the profiles this package creates do. With `makeSolid` true, * the default, a face profile gives a closed solid; a wire gives a twisted shell. * @param inputs - The profile shape, the height, the twist angle in degrees and whether to make a solid * @returns The twisted extrusion * @group extrusions * @shortname rotated extrude * @drawable true * @example * ```typescript * const square = await bitbybit.occt.shapes.face.createSquareFace({ size: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * const twisted = await bitbybit.occt.operations.rotatedExtrude({ shape: square, height: 20, angle: 90, makeSolid: true }); * ``` */ rotatedExtrude(inputs: Inputs.OCCT.RotationExtrudeDto): Promise; /** * Sweeps one or more profile shapes along a path wire and closes the result into a solid. * * The profiles should be placed on the path; with several profiles the sweep blends from one to * the next along the way. * @param inputs - The path wire and the profile shapes placed on it * @returns The swept solid * @group pipeing * @shortname pipe * @drawable true * @example * ```typescript * const tube = await bitbybit.occt.operations.pipe({ shape: pathWire, shapes: [profileAtStart] }); * ``` */ pipe(inputs: Inputs.OCCT.ShapeShapesDto): Promise; /** * Sweeps a regular polygon along a wire, giving a tube with `nrCorners` flat sides, for * instance a hexagonal bar along a path. * * The polygon of `radius` is placed at the start of the wire, perpendicular to it. `makeSolid` * gives a solid instead of a shell, `trihedronEnum` chooses how the profile turns along the * path, and `forceApproxC1` smooths the result. * @param inputs - The path wire, the polygon radius and corner count, and the sweep options * @returns The swept solid or shell * @group pipeing * @shortname pipe polyline ngon * @drawable true * @example * ```typescript * const bar = await bitbybit.occt.operations.pipePolylineWireNGon({ * shape: pathWire, * radius: 0.5, * nrCorners: 6, * makeSolid: true, * trihedronEnum: Bit.Inputs.OCCT.geomFillTrihedronEnum.isConstantNormal, * forceApproxC1: false, * }); * ``` */ pipePolylineWireNGon(inputs: Inputs.OCCT.PipePolygonWireNGonDto): Promise; /** * Sweeps a circle along each of several wires, as `pipeWireCylindrical` does for one, all with * the same radius and options. * @param inputs - The path wires, the radius and the sweep options * @returns One tube per wire, in the same order * @group pipeing * @shortname pipe wires cylindrical * @drawable true * @example * ```typescript * const tubes = await bitbybit.occt.operations.pipeWiresCylindrical({ * shapes: [pathA, pathB], * radius: 0.5, * makeSolid: true, * trihedronEnum: Bit.Inputs.OCCT.geomFillTrihedronEnum.isConstantNormal, * forceApproxC1: false, * }); * ``` */ pipeWiresCylindrical(inputs: Inputs.OCCT.PipeWiresCylindricalDto): Promise; /** * Sweeps a circle along a wire, giving a round tube of the given radius that follows the path. * * The circle is placed at the start of the wire, perpendicular to it. `makeSolid` gives a solid * instead of a shell, `trihedronEnum` chooses how the profile turns as it follows the path, and * `forceApproxC1` smooths the result. * @param inputs - The path wire, the radius and the sweep options * @returns The tube as a solid or shell * @group pipeing * @shortname pipe wire cylindrical * @drawable true * @example * ```typescript * const tube = await bitbybit.occt.operations.pipeWireCylindrical({ * shape: pathWire, * radius: 0.5, * makeSolid: true, * trihedronEnum: Bit.Inputs.OCCT.geomFillTrihedronEnum.isConstantNormal, * forceApproxC1: false, * }); * ``` */ pipeWireCylindrical(inputs: Inputs.OCCT.PipeWireCylindricalDto): Promise; /** * Moves the boundary of a shape outward, or inward for a negative distance, by a fixed * distance: a wire grows into a parallel outline, a face or solid into a bigger one. * * A wire or edge is offset in its own plane, or on `face` when given; corners are rounded. A * distance of 0 returns the shape as it is. * @param inputs - The shape, an optional face to offset a wire on, the distance and the tolerance * @returns The offset shape * @group offsets * @shortname offset * @drawable true * @example * ```typescript * const bigger = await bitbybit.occt.operations.offset({ shape: box, distance: 1, tolerance: 0.1 }); * ``` */ offset(inputs: Inputs.OCCT.OffsetDto): Promise; /** * Offsets a shape like `offset`, with a choice of how corners are joined: `arc` rounds them, * `intersection` extends the sides to a sharp corner, `tangent` keeps them tangent. * * `removeIntEdges` drops the internal edges the offset can leave behind on a solid. * @param inputs - The shape, an optional face to offset a wire on, the distance, the tolerance, the corner join type and whether to remove internal edges * @returns The offset shape * @group offsets * @shortname offset adv. * @drawable true * @example * ```typescript * const sharper = await bitbybit.occt.operations.offsetAdv({ * shape: rectangleWire, * distance: 1, * tolerance: 0.1, * joinType: Bit.Inputs.OCCT.joinTypeEnum.intersection, * removeIntEdges: false, * }); * ``` */ offsetAdv(inputs: Inputs.OCCT.OffsetAdvancedDto): Promise; /** * Gives a face or shell a thickness, turning it into a solid slab or wall of the given * `offset`. * * A positive offset thickens toward the surface normal, a negative one the other way. Use it to * turn a lofted or swept skin into something printable. * @param inputs - The face or shell and the thickness * @returns The thick solid * @group offsets * @shortname thicken * @drawable true * @example * ```typescript * const wall = await bitbybit.occt.operations.makeThickSolidSimple({ shape: loftedShell, offset: 0.5 }); * ``` */ makeThickSolidSimple(inputs: Inputs.OCCT.ThisckSolidSimpleDto): Promise; /** * Hollows a solid into a shell of the given wall thickness by removing the listed faces and * offsetting the rest. * * Removing the top face of a box, for instance, gives an open cup. `offset` is the wall * thickness, negative to grow inward; `joinType` says how the offset walls meet at corners, the * other flags go to the kernel's thick-solid builder. * @param inputs - The solid, the faces to remove, the wall thickness, the tolerance and the join options * @returns The hollowed solid * @group offsets * @shortname joined thicken * @drawable true * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 0, 0] }); * const faces = await bitbybit.occt.shapes.face.getFaces({ shape: box }); * const cup = await bitbybit.occt.operations.makeThickSolidByJoin({ * shape: box, * shapes: [faces[0]], * offset: -1, * tolerance: 1e-3, * intersection: false, * selfIntersection: false, * joinType: Bit.Inputs.OCCT.joinTypeEnum.arc, * removeIntEdges: false, * }); * ``` */ makeThickSolidByJoin(inputs: Inputs.OCCT.ThickSolidByJoinDto): Promise; /** * Cuts a solid into parallel slices along a direction, like a loaf of bread, every `step` model * units from the bottom of the shape up. * * Each slice is the flat section where a cutting plane meets the solid; they come back together * in one compound. The shape must be or contain solids, or an error is thrown. * @param inputs - The shape, the distance between slices and the slicing direction * @returns A compound of the section faces * @group divisions * @shortname slice * @drawable true * @example * ```typescript * const layers = await bitbybit.occt.operations.slice({ shape: sphere, step: 0.5, direction: [0, 1, 0] }); * ``` */ slice(inputs: Inputs.OCCT.SliceDto): Promise; /** * Cuts a solid into parallel slices like `slice`, but with a repeating pattern of gaps between * them, such as 0.1, 0.5, 0.1, 0.5. * * The pattern is applied from the bottom of the shape up and repeats until the top is reached. * @param inputs - The shape, the pattern of gaps and the slicing direction * @returns A compound of the section faces * @group divisions * @shortname slice in step pattern * @drawable true * @example * ```typescript * const layers = await bitbybit.occt.operations.sliceInStepPattern({ shape: sphere, steps: [0.1, 0.5], direction: [0, 1, 0] }); * ``` */ sliceInStepPattern(inputs: Inputs.OCCT.SliceInStepPatternDto): Promise; /** * Offsets a wire that does not lie in one plane, by extruding it along `direction`, thickening * the result and reading the offset edge back off it. * * It works best on smooth wires; fillet sharp corners first with `fillets.fillet3DWire`. When * the offset edges cannot be joined into one wire they come back as a list of edges. * @param inputs - The wire, the offset distance and the direction to extrude along * @returns The offset wire, or the loose edges when they could not be joined * @group offsets * @shortname offset 3d wire * @drawable true * @example * ```typescript * const outer = await bitbybit.occt.operations.offset3DWire({ shape: smoothWire, offset: 1, direction: [0, 1, 0] }); * ``` */ offset3DWire(inputs: Inputs.OCCT.Offset3DWireDto): Promise; } /** * A generic 2D path builder: describe an outline as subpaths of line, quadratic, cubic and arc * segments, the vocabulary of SVG paths, and get an OpenCascade wire or face in one call. It knows * nothing about SVG itself; the SVG importer in `svg` translates documents into this vocabulary and * calls it. */ declare class OCCTPath { private readonly occWorkerManager; /** * Builds a shape from path subpaths: one wire per subpath, packed into a compound when there * are several, or a face when `makeFaces` is true and the outlines close. * * `joinSegments` merges consecutive segments into single edges within `tolerance`; `scale` and * `flipY` map the path's units and downward Y axis onto the ground plane. An empty path gives * undefined. * @param inputs - The subpaths, whether to make faces, the joining tolerance and the placement options * @returns The wire, compound of wires or face, or undefined for an empty path * @group create * @shortname shape from path * @drawable true * @example * ```typescript * const shape = await bitbybit.occt.path.shapeFromPath({ * subpaths: [{ start: [0, 0], segments: [{ type: "line", to: [10, 0] }, { type: "line", to: [10, 10] }, { type: "line", to: [0, 10] }], closed: true }], * makeFaces: true, * joinSegments: true, * tolerance: 1e-7, * scale: 1, * flipY: true, * origin: [0, 0, 0], * }); * ``` */ shapeFromPath(inputs: Inputs.OCCT.ShapeFromPathDto): Promise; } /** * Repairs for OpenCascade shapes that came out of a file or an operation with small defects: gaps * between edges, edges too short to matter, wires whose edges point different ways, tolerances that * drifted. Run `basicShapeRepair` on a shape that fails `shapes.shape.isValid` or refuses a * boolean; the wire fixes clean up outlines before they become faces. Every method returns a new * shape. */ declare class OCCTShapeFix { private readonly occWorkerManager; /** * Runs the kernel's general repair over a shape: closes small gaps, fixes wire and face defects * and brings tolerances into the given range. * * `precision` is the size of defect to look for, `minTolerance` and `maxTolerance` bound the * tolerances the repaired shape may carry, all in model units. Try it first on any shape that * fails `shapes.shape.isValid`. * @param inputs - The shape and the precision and tolerance bounds * @returns The repaired shape * @group shape * @shortname basic shape repair * @drawable true * @example * ```typescript * const fixed = await bitbybit.occt.shapeFix.basicShapeRepair({ shape: imported, precision: 0.001, maxTolerance: 0.01, minTolerance: 0.0001 }); * ``` */ basicShapeRepair(inputs: Inputs.OCCT.BasicShapeRepairDto): Promise; /** * Removes edges shorter than `precsmall` from a wire and closes the gaps they leave, so a tiny * sliver no longer breaks a fillet or a face. * * With `lockvtx` true the existing vertices are kept in place; otherwise they may move to close * the gap. A `precsmall` of 0 uses the wire's own tolerance. * @param inputs - The wire, whether to keep vertices fixed and the length below which an edge counts as small * @returns The cleaned wire * @group wire * @shortname fix small edge * @drawable true * @example * ```typescript * const clean = await bitbybit.occt.shapeFix.fixSmallEdgeOnWire({ shape: wire, lockvtx: false, precsmall: 0.001 }); * ``` */ fixSmallEdgeOnWire(inputs: Inputs.OCCT.FixSmallEdgesInWireDto): Promise; /** * Rebuilds a wire so its edges run head to tail in one direction along it. * * A wire assembled from loose edges can hold edges pointing against the flow; this walks the * wire in order and joins the edges again the right way round, which some operations need. * @param inputs - The wire * @returns The wire with consistently oriented edges * @group wire * @shortname fix edge orientations * @drawable true * @example * ```typescript * const ordered = await bitbybit.occt.shapeFix.fixEdgeOrientationsAlongWire({ shape: wire }); * ``` */ fixEdgeOrientationsAlongWire(inputs: Inputs.OCCT.ShapeDto): Promise; } /** * Compounds in OpenCascade: a loose collection of shapes of any kind kept together as one shape, so * a set of parts can be moved, drawn or exported in one go. The shapes stay separate inside; a * compound does not fuse them. `shapes.shape` and the getters on the other shape classes take a * compound apart again. */ declare class OCCTCompound { private readonly occWorkerManager; /** * Bundles any shapes into one compound so they can be handled as a single shape. * * The shapes are not joined or fused; they simply travel together. * @param inputs - The shapes to bundle * @returns The compound holding them * @group create * @shortname make * @drawable true * @example * ```typescript * const group = await bitbybit.occt.shapes.compound.makeCompound({ shapes: [box, sphere] }); * ``` */ makeCompound(inputs: Inputs.OCCT.CompoundShapesDto): Promise; /** * Takes a compound apart into the shapes it was made of, in the order they were added. * @param inputs - The compound * @returns The shapes inside it * @group get * @shortname get shapes of compound * @drawable true * @example * ```typescript * const parts = await bitbybit.occt.shapes.compound.getShapesOfCompound({ shape: group }); * ``` */ getShapesOfCompound(inputs: Inputs.OCCT.ShapeDto): Promise; } /** * Edges in OpenCascade: single curves between two vertices, straight, circular, elliptical or * free-form. Build them from points and lines, as arcs, circles and ellipses, or as tangent * constructions against circles; read them back as points, lengths, tangents and centers; and pick * edges out of any shape. Edges join end to end into wires, which `shapes.wire` handles. Parameters * along an edge run from 0 at its start to 1 at its end; angles are in degrees. */ declare class OCCTEdge { private readonly occWorkerManager; /** * Rebuilds the curve of an edge as a B-spline of a given degree, within a tolerance. * * Lowering the degree simplifies the curve, raising it gives later operations more freedom; * either way the new curve stays within `tolerance` of the old. * @param inputs - The edge, the degree to rebuild to and the tolerance * @returns A new edge with the rebuilt curve * @group rebuild * @shortname rebuild edge degree * @drawable true * @example * ```typescript * const simpler = await bitbybit.occt.shapes.edge.rebuildEdgeDegree({ shape: edge, degree: 3, tolerance: 1e-3 }); * ``` */ rebuildEdgeDegree(inputs: Inputs.OCCT.RebuildCurveDegreeDto): Promise; /** * Moves the seam of a closed periodic edge, the point where it starts and ends, to a given * parameter along the curve. * * The geometry does not change; only where the edge is considered to begin. * @param inputs - The periodic edge and the parameter of the new seam * @returns A new edge starting at the seam * @group seam * @shortname move edge seam by param * @drawable true * @example * ```typescript * const rotated = await bitbybit.occt.shapes.edge.moveEdgeSeamByParameter({ shape: circle, parameter: 1.57 }); * ``` */ moveEdgeSeamByParameter(inputs: Inputs.OCCT.CurveSeamByParameterDto): Promise; /** * Moves the seam of a closed periodic edge, the point where it starts and ends, by a distance * along the curve from its current start. * * The geometry does not change; only where the edge is considered to begin. * @param inputs - The periodic edge and the distance to move the seam * @returns A new edge starting at the seam * @group seam * @shortname move edge seam by length * @drawable true * @example * ```typescript * const rotated = await bitbybit.occt.shapes.edge.moveEdgeSeamByLength({ shape: circle, length: 2.5 }); * ``` */ moveEdgeSeamByLength(inputs: Inputs.OCCT.CurveSeamByLengthDto): Promise; /** * Collects diagnostic facts about the curve of an edge: its type and degree, control point and * knot counts, whether it is rational, periodic or closed, its parameter range and period, its * length and its end points. * @param inputs - The edge to inspect * @returns The report about the edge's curve * @group debug * @shortname edge debug info * @drawable false * @example * ```typescript * const info = await bitbybit.occt.shapes.edge.debugInfo({ shape: edge }); * ``` */ debugInfo(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Makes a straight edge from a line object of the form `{ start, end }`. * @param inputs - The line * @returns The straight edge * @group from base * @shortname edge from base line * @drawable true * @example * ```typescript * const edge = await bitbybit.occt.shapes.edge.fromBaseLine({ line: { start: [0, 0, 0], end: [10, 0, 0] } }); * ``` */ fromBaseLine(inputs: Inputs.OCCT.LineBaseDto): Promise; /** * Makes one straight edge per line object of the form `{ start, end }`. * @param inputs - The lines * @returns One edge per line, in the same order * @group from base * @shortname edges from base lines * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.fromBaseLines({ lines: [{ start: [0, 0, 0], end: [10, 0, 0] }, { start: [10, 0, 0], end: [10, 10, 0] }] }); * ``` */ fromBaseLines(inputs: Inputs.OCCT.LinesBaseDto): Promise; /** * Makes a straight edge from a segment, a pair of points `[start, end]`. * @param inputs - The segment * @returns The straight edge * @group from base * @shortname edge from base segment * @drawable true * @example * ```typescript * const edge = await bitbybit.occt.shapes.edge.fromBaseSegment({ segment: [[0, 0, 0], [10, 0, 0]] }); * ``` */ fromBaseSegment(inputs: Inputs.OCCT.SegmentBaseDto): Promise; /** * Makes one straight edge per segment, each a pair of points `[start, end]`. * @param inputs - The segments * @returns One edge per segment, in the same order * @group from base * @shortname edges from base segments * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.fromBaseSegments({ segments: [[[0, 0, 0], [10, 0, 0]], [[10, 0, 0], [10, 10, 0]]] }); * ``` */ fromBaseSegments(inputs: Inputs.OCCT.SegmentsBaseDto): Promise; /** * Joins each point to the next with a straight edge, so a list of points becomes a chain of * edges. * * The edges are returned loose; `shapes.wire.createPolylineWire` makes the joined wire * directly. * @param inputs - The points, in order * @returns One edge per pair of neighboring points * @group from base * @shortname edges from points * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.fromPoints({ points: [[0, 0, 0], [10, 0, 0], [10, 10, 0]] }); * ``` */ fromPoints(inputs: Inputs.OCCT.PointsDto): Promise; /** * Makes one straight edge per segment of a polyline object; a closed polyline also gets the * edge from its last point back to its first. * @param inputs - The polyline * @returns One edge per segment, in order * @group from base * @shortname edges from polyline * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.fromBasePolyline({ polyline: { points: [[0, 0, 0], [10, 0, 0], [10, 10, 0]], isClosed: true } }); * ``` */ fromBasePolyline(inputs: Inputs.OCCT.PolylineBaseDto): Promise; /** * Makes the three straight edges of a triangle given as three points. * @param inputs - The triangle * @returns Its three edges * @group from base * @shortname edges from triangle * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.fromBaseTriangle({ triangle: [[0, 0, 0], [10, 0, 0], [0, 10, 0]] }); * ``` */ fromBaseTriangle(inputs: Inputs.OCCT.TriangleBaseDto): Promise; /** * Makes the three straight edges of every triangle of a mesh, all in one flat list. * * A triangle whose edges cannot be built is skipped with a warning rather than stopping the * rest. * @param inputs - The mesh as a list of triangles * @returns The edges of all the triangles * @group from base * @shortname edges from mesh * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.fromBaseMesh({ mesh: triangles }); * ``` */ fromBaseMesh(inputs: Inputs.OCCT.MeshBaseDto): Promise; /** * Makes a straight edge between two points, the simplest edge there is. * @param inputs - The start and end points * @returns The straight edge * @group primitives * @shortname line * @drawable true * @example * ```typescript * const edge = await bitbybit.occt.shapes.edge.line({ start: [0, 0, 0], end: [10, 0, 0] }); * ``` */ line(inputs: Inputs.OCCT.LineDto): Promise; /** * Makes a circular arc that starts at the first point, passes through the middle one and ends * at the last. * @param inputs - The three points * @returns The arc edge * @group primitives * @shortname arc 3 points * @drawable true * @example * ```typescript * const arc = await bitbybit.occt.shapes.edge.arcThroughThreePoints({ start: [0, 0, 0], middle: [5, 5, 0], end: [10, 0, 0] }); * ``` */ arcThroughThreePoints(inputs: Inputs.OCCT.ArcEdgeThreePointsDto): Promise; /** * Makes a circular arc from one point to another that leaves the first point in a given * direction. * * The tangent fixes the plane and the radius of the arc. * @param inputs - The start point, the tangent direction there and the end point * @returns The arc edge * @group primitives * @shortname arc 2 points tangent * @drawable true * @example * ```typescript * const arc = await bitbybit.occt.shapes.edge.arcThroughTwoPointsAndTangent({ start: [0, 0, 0], tangentVec: [0, 1, 0], end: [10, 0, 0] }); * ``` */ arcThroughTwoPointsAndTangent(inputs: Inputs.OCCT.ArcEdgeTwoPointsTangentDto): Promise; /** * Cuts an arc out of a circle edge between two points on it. * * `sense` picks which way round the circle the arc runs from the first point to the second. * @param inputs - The circle edge, the two points and the direction of travel * @returns The arc edge * @group primitives * @shortname arc from circle and points * @drawable true * @example * ```typescript * const arc = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoPoints({ circle, start: [10, 0, 0], end: [0, 0, 10], sense: true }); * ``` */ arcFromCircleAndTwoPoints(inputs: Inputs.OCCT.ArcEdgeCircleTwoPointsDto): Promise; /** * Cuts an arc out of a circle edge between two angles, in degrees, measured around the circle * from its own start. * * `sense` picks which way round the circle the arc runs from the first angle to the second. * @param inputs - The circle edge, the two angles in degrees and the direction of travel * @returns The arc edge * @group primitives * @shortname arc from circle and angles * @drawable true * @example * ```typescript * const quarter = await bitbybit.occt.shapes.edge.arcFromCircleAndTwoAngles({ circle, alphaAngle1: 0, alphaAngle2: 90, sense: true }); * ``` */ arcFromCircleAndTwoAngles(inputs: Inputs.OCCT.ArcEdgeCircleTwoAnglesDto): Promise; /** * Cuts an arc out of a circle edge that starts at a point on the circle and spans a given * angle, in degrees. * * `sense` picks which way round the circle the arc runs. * @param inputs - The circle edge, the start point, the angle in degrees and the direction of travel * @returns The arc edge * @group primitives * @shortname arc from circle point and angle * @drawable true * @example * ```typescript * const arc = await bitbybit.occt.shapes.edge.arcFromCirclePointAndAngle({ circle, point: [10, 0, 0], alphaAngle: 45, sense: true }); * ``` */ arcFromCirclePointAndAngle(inputs: Inputs.OCCT.ArcEdgeCirclePointAngleDto): Promise; /** * Makes a full circle as one closed edge, lying in the plane whose normal is `direction`. * @param inputs - The radius, the center and the plane normal * @returns The circle edge * @group primitives * @shortname circle * @drawable true * @example * ```typescript * const circle = await bitbybit.occt.shapes.edge.createCircleEdge({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createCircleEdge(inputs: Inputs.OCCT.CircleDto): Promise; /** * Makes a full ellipse as one closed edge, lying in the plane whose normal is `direction`. * * `radiusMajor` must not be smaller than `radiusMinor`, or the kernel refuses the ellipse. * @param inputs - The center, the plane normal and the two radii * @returns The ellipse edge * @group primitives * @shortname ellipse * @drawable true * @example * ```typescript * const ellipse = await bitbybit.occt.shapes.edge.createEllipseEdge({ center: [0, 0, 0], direction: [0, 1, 0], radiusMinor: 3, radiusMajor: 6 }); * ``` */ createEllipseEdge(inputs: Inputs.OCCT.EllipseDto): Promise; /** * Merges faces that lie on the same surface and edges on the same curve, which removes the * internal seams a boolean or a fuse leaves behind. * * It is `shapes.shape.unifySameDomain` with edges and faces both unified and B-splines left as * they are. * @param inputs - The shape * @returns The shape without internal seams * @group shapes * @shortname remove internal * @drawable true * @example * ```typescript * const clean = await bitbybit.occt.shapes.edge.removeInternalEdges({ shape: fused }); * ``` */ removeInternalEdges(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Makes an edge from a 2D curve laid onto a surface: the curve lives in the surface's UV space * and the edge follows it across the surface. * @param inputs - The 2D curve and the surface to lay it on * @returns The edge on the surface * @group from * @shortname 2d curve and surface * @drawable true * @example * ```typescript * const edge = await bitbybit.occt.shapes.edge.makeEdgeFromGeom2dCurveAndSurface({ curve: curve2d, surface }); * ``` */ makeEdgeFromGeom2dCurveAndSurface(inputs: Inputs.OCCT.CurveAndSurfaceDto): Promise; /** * Picks one edge out of a shape by its position, counting from 0, in the order the kernel walks * the shape. * * The shape must be an edge, a wire or something built from them; an index beyond the last edge * throws an error. * @param inputs - The shape and the 0-based index * @returns The edge at that index * @group get * @shortname get edge * @drawable true * @example * ```typescript * const first = await bitbybit.occt.shapes.edge.getEdge({ shape: wire, index: 0 }); * ``` */ getEdge(inputs: Inputs.OCCT.EdgeIndexDto): Promise; /** * Lists every edge of a shape in the order the kernel walks it, which is not the order along a * wire; use `getEdgesAlongWire` for that. * @param inputs - The shape * @returns The edges found in the shape * @group get * @shortname get edges * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.getEdges({ shape: box }); * ``` */ getEdges(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Lists the edges of a wire in the order they follow each other along it, each oriented to run * in the wire's direction. * * A single edge is returned as a one-element list. * @param inputs - The wire * @returns Its edges in order along the wire * @group get * @shortname get edges along wire * @drawable true * @example * ```typescript * const ordered = await bitbybit.occt.shapes.edge.getEdgesAlongWire({ shape: wire }); * ``` */ getEdgesAlongWire(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Lists only the circular edges of a wire, in the order they follow each other along it. * @param inputs - The wire * @returns Its circular edges in order * @group get * @shortname get circular edges along wire * @drawable true * @example * ```typescript * const arcs = await bitbybit.occt.shapes.edge.getCircularEdgesAlongWire({ shape: roundedRectangle }); * ``` */ getCircularEdgesAlongWire(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Lists only the straight edges of a wire, in the order they follow each other along it. * @param inputs - The wire * @returns Its straight edges in order * @group get * @shortname get linear edges along wire * @drawable true * @example * ```typescript * const straights = await bitbybit.occt.shapes.edge.getLinearEdgesAlongWire({ shape: roundedRectangle }); * ``` */ getLinearEdgesAlongWire(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Lists the end points of every edge of a shape, with repeats removed, so a corner where * several edges meet appears once. * * The points come in no particular order. * @param inputs - The shape whose edges to read: a wire, face, shell or solid * @returns The unique end points of the edges * @group get * @shortname corners * @drawable true * @example * ```typescript * const corners = await bitbybit.occt.shapes.edge.getCornerPointsOfEdgesForShape({ shape: box }); * ``` */ getCornerPointsOfEdgesForShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Measures the length of an edge along its curve, in model units. * @param inputs - The edge * @returns The length * @group get * @shortname edge length * @drawable false * @example * ```typescript * const len = await bitbybit.occt.shapes.edge.getEdgeLength({ shape: edge }); * ``` */ getEdgeLength(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Measures every edge of a shape along its curve, in model units. * @param inputs - The shape * @returns One length per edge, in the order `getEdges` lists them * @group get * @shortname edge lengths of shape * @drawable false * @example * ```typescript * const lengths = await bitbybit.occt.shapes.edge.getEdgeLengthsOfShape({ shape: box }); * ``` */ getEdgeLengthsOfShape(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Measures each edge in a list along its curve, in model units. * @param inputs - The edges * @returns One length per edge, in the same order * @group get * @shortname lengths * @drawable false * @example * ```typescript * const lengths = await bitbybit.occt.shapes.edge.getEdgesLengths({ shapes: edges }); * ``` */ getEdgesLengths(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Finds the center of mass of an edge, the balance point of its curve; for a straight edge that * is its midpoint, for an arc a point inside the curve. * @param inputs - The edge * @returns The center of mass point * @group get * @shortname center of mass * @drawable true * @example * ```typescript * const center = await bitbybit.occt.shapes.edge.getEdgeCenterOfMass({ shape: edge }); * ``` */ getEdgeCenterOfMass(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the center of mass of each edge in a list. * @param inputs - The edges * @returns One point per edge, in the same order * @group get * @shortname centers of mass * @drawable true * @example * ```typescript * const centers = await bitbybit.occt.shapes.edge.getEdgesCentersOfMass({ shapes: edges }); * ``` */ getEdgesCentersOfMass(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Finds the center of the circle a circular edge lies on. * * An edge that is not circular throws an error. * @param inputs - The circular edge * @returns The center point * @group get circular edge * @shortname get center of circular edge * @drawable true * @example * ```typescript * const center = await bitbybit.occt.shapes.edge.getCircularEdgeCenterPoint({ shape: arc }); * ``` */ getCircularEdgeCenterPoint(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the radius of the circle a circular edge lies on. * * An edge that is not circular throws an error. * @param inputs - The circular edge * @returns The radius in model units * @group get circular edge * @shortname get radius of circular edge * @drawable false * @example * ```typescript * const radius = await bitbybit.occt.shapes.edge.getCircularEdgeRadius({ shape: arc }); * ``` */ getCircularEdgeRadius(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the normal of the plane a circular edge lies in. * * An edge that is not circular throws an error. * @param inputs - The circular edge * @returns The unit normal of the circle's plane * @group get circular edge * @shortname get plane direction of circular edge * @drawable true * @example * ```typescript * const normal = await bitbybit.occt.shapes.edge.getCircularEdgePlaneDirection({ shape: arc }); * ``` */ getCircularEdgePlaneDirection(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the point a fraction of the way along an edge: 0 is the start, 1 the end, 0.5 the * middle of the parameter range. * * The fraction follows the curve's own parameter, which for a free-form curve is not evenly * spread by length; use `pointOnEdgeAtLength` for a distance. * @param inputs - The edge and the fraction from 0 to 1 * @returns The point on the edge * @group extract * @shortname point at param * @drawable true * @example * ```typescript * const middle = await bitbybit.occt.shapes.edge.pointOnEdgeAtParam({ shape: edge, param: 0.5 }); * ``` */ pointOnEdgeAtParam(inputs: Inputs.OCCT.DataOnGeometryAtParamDto): Promise; /** * Finds the point at the same fraction along each edge in a list. * @param inputs - The edges and the fraction from 0 to 1 * @returns One point per edge, in the same order * @group extract * @shortname points on edges at param * @drawable true * @example * ```typescript * const middles = await bitbybit.occt.shapes.edge.pointsOnEdgesAtParam({ shapes: edges, param: 0.5 }); * ``` */ pointsOnEdgesAtParam(inputs: Inputs.OCCT.DataOnGeometryesAtParamDto): Promise; /** * Turns every edge of a shape into a run of points that follows its curve closely enough to * draw it, one list per edge. * * The deflection settings say how tightly the points hug curved edges; a wire's edges come in * their order along the wire. * @param inputs - The shape and the deflection settings * @returns One list of points per edge * @group extract * @shortname edges to points * @drawable false * @example * ```typescript * const polylines = await bitbybit.occt.shapes.edge.edgesToPoints({ * shape: wire, * angularDeflection: 0.1, * curvatureDeflection: 0.1, * minimumOfPoints: 2, * uTolerance: 1e-9, * minimumLength: 1e-7, * }); * ``` */ edgesToPoints(inputs: Inputs.OCCT.EdgesToPointsDto): Promise; /** * Flips the direction of an edge, so its start becomes its end. * @param inputs - The edge * @returns A new edge running the other way * @group get * @shortname reversed edge * @drawable true * @example * ```typescript * const back = await bitbybit.occt.shapes.edge.reversedEdge({ shape: edge }); * ``` */ reversedEdge(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the direction the edge is heading at a fraction of the way along it, from 0 at the * start to 1 at the end. * @param inputs - The edge and the fraction from 0 to 1 * @returns The tangent direction * @group extract * @shortname tangent at param * @drawable true * @example * ```typescript * const tangent = await bitbybit.occt.shapes.edge.tangentOnEdgeAtParam({ shape: arc, param: 0.5 }); * ``` */ tangentOnEdgeAtParam(inputs: Inputs.OCCT.DataOnGeometryAtParamDto): Promise; /** * Finds the direction each edge in a list is heading at the same fraction along it. * @param inputs - The edges and the fraction from 0 to 1 * @returns One tangent per edge, in the same order * @group extract * @shortname tangents on edges at param * @drawable true * @example * ```typescript * const tangents = await bitbybit.occt.shapes.edge.tangentsOnEdgesAtParam({ shapes: edges, param: 0.5 }); * ``` */ tangentsOnEdgesAtParam(inputs: Inputs.OCCT.DataOnGeometryesAtParamDto): Promise; /** * Finds the point a given distance along an edge from its start, measured along the curve in * model units. * @param inputs - The edge and the distance from its start * @returns The point on the edge * @group extract * @shortname point at length * @drawable true * @example * ```typescript * const point = await bitbybit.occt.shapes.edge.pointOnEdgeAtLength({ shape: edge, length: 2.5 }); * ``` */ pointOnEdgeAtLength(inputs: Inputs.OCCT.DataOnGeometryAtLengthDto): Promise; /** * Finds the point at the same distance from the start along each edge in a list. * @param inputs - The edges and the distance from the start * @returns One point per edge, in the same order * @group extract * @shortname points at length * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.edge.pointsOnEdgesAtLength({ shapes: edges, length: 2.5 }); * ``` */ pointsOnEdgesAtLength(inputs: Inputs.OCCT.DataOnGeometryesAtLengthDto): Promise; /** * Finds the direction the edge is heading at a given distance along it from its start, measured * along the curve. * @param inputs - The edge and the distance from its start * @returns The tangent direction * @group extract * @shortname tangent at length * @drawable true * @example * ```typescript * const tangent = await bitbybit.occt.shapes.edge.tangentOnEdgeAtLength({ shape: arc, length: 2.5 }); * ``` */ tangentOnEdgeAtLength(inputs: Inputs.OCCT.DataOnGeometryAtLengthDto): Promise; /** * Finds the direction each edge in a list is heading at the same distance from its start. * @param inputs - The edges and the distance from the start * @returns One tangent per edge, in the same order * @group extract * @shortname tangents at length * @drawable true * @example * ```typescript * const tangents = await bitbybit.occt.shapes.edge.tangentsOnEdgesAtLength({ shapes: edges, length: 2.5 }); * ``` */ tangentsOnEdgesAtLength(inputs: Inputs.OCCT.DataOnGeometryesAtLengthDto): Promise; /** * Reads the point where an edge starts, in the edge's own direction. * @param inputs - The edge * @returns The start point * @group extract * @shortname start point * @drawable true * @example * ```typescript * const start = await bitbybit.occt.shapes.edge.startPointOnEdge({ shape: edge }); * ``` */ startPointOnEdge(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the start point of each edge in a list. * @param inputs - The edges * @returns One start point per edge, in the same order * @group extract * @shortname start points * @drawable true * @example * ```typescript * const starts = await bitbybit.occt.shapes.edge.startPointsOnEdges({ shapes: edges }); * ``` */ startPointsOnEdges(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Reads the point where an edge ends, in the edge's own direction. * @param inputs - The edge * @returns The end point * @group extract * @shortname end point * @drawable true * @example * ```typescript * const end = await bitbybit.occt.shapes.edge.endPointOnEdge({ shape: edge }); * ``` */ endPointOnEdge(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the end point of each edge in a list. * @param inputs - The edges * @returns One end point per edge, in the same order * @group extract * @shortname end points * @drawable true * @example * ```typescript * const ends = await bitbybit.occt.shapes.edge.endPointsOnEdges({ shapes: edges }); * ``` */ endPointsOnEdges(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Places points along an edge at equal steps of its parameter, from start to end. * * `nrOfDivisions` steps give one more point than that; `removeStartPoint` and `removeEndPoint` * drop the ends. On a free-form curve equal parameter steps are not equal distances; use * `divideEdgeByEqualDistanceToPoints` for those. * @param inputs - The edge, the number of divisions and whether to drop the end points * @returns The points along the edge, in order * @group extract * @shortname points by params * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.edge.divideEdgeByParamsToPoints({ shape: edge, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false }); * ``` */ divideEdgeByParamsToPoints(inputs: Inputs.OCCT.DivideDto): Promise; /** * Places points along each edge in a list at equal steps of its parameter, one list per edge. * @param inputs - The edges, the number of divisions and whether to drop the end points * @returns One list of points per edge, in the same order * @group extract * @shortname points by params on edges * @drawable false * @example * ```typescript * const points = await bitbybit.occt.shapes.edge.divideEdgesByParamsToPoints({ shapes: edges, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false }); * ``` */ divideEdgesByParamsToPoints(inputs: Inputs.OCCT.DivideShapesDto): Promise; /** * Places points along an edge at equal distances measured along its curve, from start to end. * * `nrOfDivisions` steps give one more point than that; `removeStartPoint` and `removeEndPoint` * drop the ends. * @param inputs - The edge, the number of divisions and whether to drop the end points * @returns The points along the edge, in order * @group extract * @shortname points by distance * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.edge.divideEdgeByEqualDistanceToPoints({ shape: edge, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false }); * ``` */ divideEdgeByEqualDistanceToPoints(inputs: Inputs.OCCT.DivideDto): Promise; /** * Places points along each edge in a list at equal distances along its curve, one list per * edge. * @param inputs - The edges, the number of divisions and whether to drop the end points * @returns One list of points per edge, in the same order * @group extract * @shortname points by distance on edges * @drawable false * @example * ```typescript * const points = await bitbybit.occt.shapes.edge.divideEdgesByEqualDistanceToPoints({ shapes: edges, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false }); * ``` */ divideEdgesByEqualDistanceToPoints(inputs: Inputs.OCCT.DivideShapesDto): Promise; /** * Draws the straight lines from two points that just touch a circle, one tangent line from each * point. * * `positionResult` keeps the solutions on one side of the circle or all of them, and * `circleRemainder` adds the piece of the circle between the touching points. * @param inputs - The circle edge, the two points, the tolerance and which solutions to keep * @returns The tangent lines, and the circle piece when asked for * @group constraint * @shortname tan lines from 2 pts to circle * @drawable true * @example * ```typescript * const tangents = await bitbybit.occt.shapes.edge.constraintTanLinesFromTwoPtsToCircle({ * circle, * point1: [20, 0, 0], * point2: [-20, 0, 0], * tolerance: 1e-7, * positionResult: Bit.Inputs.OCCT.positionResultEnum.all, * circleRemainder: Bit.Inputs.OCCT.circleInclusionEnum.none, * }); * ``` */ constraintTanLinesFromTwoPtsToCircle(inputs: Inputs.OCCT.ConstraintTanLinesFromTwoPtsToCircleDto): Promise; /** * Draws the two straight lines from a point that just touch a circle. * * `positionResult` keeps the solution on one side of the circle or both, and `circleRemainder` * adds the piece of the circle between the touching points. * @param inputs - The circle edge, the point, the tolerance and which solutions to keep * @returns The tangent lines, and the circle piece when asked for * @group constraint * @shortname tan lines from pt to circle * @drawable true * @example * ```typescript * const tangents = await bitbybit.occt.shapes.edge.constraintTanLinesFromPtToCircle({ * circle, * point: [20, 0, 0], * tolerance: 1e-7, * positionResult: Bit.Inputs.OCCT.positionResultEnum.all, * circleRemainder: Bit.Inputs.OCCT.circleInclusionEnum.none, * }); * ``` */ constraintTanLinesFromPtToCircle(inputs: Inputs.OCCT.ConstraintTanLinesFromPtToCircleDto): Promise; /** * Draws the straight lines that just touch two circles at once, like a belt around two pulleys. * * `positionResult` keeps the lines on one side or all of them, and `circleRemainders` adds the * outside or inside pieces of the circles between the touching points, which completes the belt * shape. * @param inputs - The two circle edges, the tolerance and which solutions and circle pieces to keep * @returns The tangent lines, and the circle pieces when asked for * @group constraint * @shortname tan lines on two circles * @drawable true * @example * ```typescript * const belt = await bitbybit.occt.shapes.edge.constraintTanLinesOnTwoCircles({ * circle1, * circle2, * tolerance: 1e-7, * positionResult: Bit.Inputs.OCCT.positionResultEnum.all, * circleRemainders: Bit.Inputs.OCCT.twoCircleInclusionEnum.outside, * }); * ``` */ constraintTanLinesOnTwoCircles(inputs: Inputs.OCCT.ConstraintTanLinesOnTwoCirclesDto): Promise; /** * Draws the circles of a given radius that just touch two circles at once. * @param inputs - The two circle edges, the tolerance and the radius of the new circles * @returns The tangent circles * @group constraint * @shortname tan circles on two circles * @drawable true * @example * ```typescript * const circles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnTwoCircles({ circle1, circle2, tolerance: 1e-7, radius: 3 }); * ``` */ constraintTanCirclesOnTwoCircles(inputs: Inputs.OCCT.ConstraintTanCirclesOnTwoCirclesDto): Promise; /** * Draws the circles of a given radius that pass through a point and just touch a circle. * @param inputs - The circle edge, the point, the tolerance and the radius of the new circles * @returns The tangent circles * @group constraint * @shortname tan circles on circle and pnt * @drawable true * @example * ```typescript * const circles = await bitbybit.occt.shapes.edge.constraintTanCirclesOnCircleAndPnt({ circle, point: [15, 0, 0], tolerance: 1e-7, radius: 3 }); * ``` */ constraintTanCirclesOnCircleAndPnt(inputs: Inputs.OCCT.ConstraintTanCirclesOnCircleAndPntDto): Promise; /** * Tells whether an edge is a straight line. * @param inputs - The edge * @returns True when the edge is straight * @group is * @shortname is edge linear * @drawable false * @example * ```typescript * const straight = await bitbybit.occt.shapes.edge.isEdgeLinear({ shape: edge }); * ``` */ isEdgeLinear(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether an edge lies on a circle, whether a full circle or an arc. * @param inputs - The edge * @returns True when the edge is circular * @group is * @shortname is edge circular * @drawable false * @example * ```typescript * const round = await bitbybit.occt.shapes.edge.isEdgeCircular({ shape: edge }); * ``` */ isEdgeCircular(inputs: Inputs.OCCT.ShapeDto): Promise; } /** * Faces in OpenCascade: bounded pieces of a surface, flat or curved, with an outer boundary wire * and optional inner wires that make holes. Build them from wires or surfaces, or as ready-made * flat shapes (circles, rectangles, stars, beam profiles) that lie on the ground plane unless * `direction` says otherwise; walk their surface through UV parameters to get points, normals and * grids of wires; cut hole patterns into them; and measure area and center of mass. U and V are the * two directions of a surface, given here as fractions from 0 to 1 of the face's own range. Faces * join edge to edge into shells, which `shapes.shell` handles. */ declare class OCCTFace { private readonly occWorkerManager; /** * Rebuilds the surface of a face as a B-spline of the given U and V degrees. * * Lowering a degree smooths the surface into a simpler approximation within `tolerance`; * raising it is exact. `keepTrim` keeps the original boundary wires, which is reliable when * raising; otherwise the face covers the whole new surface. A rebuild that fails gives a null * face. * @param inputs - The face, the target U and V degrees, the tolerance and whether to keep the boundary * @returns The rebuilt face * @group rebuild * @shortname rebuild face degree * @drawable true * @example * ```typescript * const smoother = await bitbybit.occt.shapes.face.rebuildFaceDegree({ shape: face, uDegree: 2, vDegree: 2, tolerance: 0.01, keepTrim: true }); * ``` */ rebuildFaceDegree(inputs: Inputs.OCCT.RebuildFaceDegreeDto): Promise; /** * Changes how the UV parameters run over a face: swap U and V, reverse U, reverse V, or any * combination. * * The geometry stays the same; only the parameter directions change, which matters for every * method here that works in UV, such as `subdivideToPoints` or `wireAlongParam`. The face is * rebuilt over the surface's natural bounds. * @param inputs - The face and which flips to apply * @returns The face with the changed parametrization * @group rebuild * @shortname flip face uv * @drawable true * @example * ```typescript * const flipped = await bitbybit.occt.shapes.face.flipFaceUV({ shape: face, swapUV: true, reverseU: false, reverseV: false }); * ``` */ flipFaceUV(inputs: Inputs.OCCT.FlipFaceUVDto): Promise; /** * Reparametrizes a face so equal steps in U or V give roughly equal distances on the surface. * * Many surfaces bunch their parameters up in places, so a UV grid over them looks uneven; this * resamples the surface at `samples` points per direction and refits it, which evens out * `subdivideToPoints` and its siblings. The face is rebuilt over the new bounds. * @param inputs - The face, which directions to normalize, the sample count and the fit tolerance * @returns The reparametrized face * @group rebuild * @shortname normalize face uv * @drawable true * @example * ```typescript * const even = await bitbybit.occt.shapes.face.normalizeFaceParametrization({ shape: face, normalizeU: true, normalizeV: true, samples: 50, tolerance: 0.001 }); * ``` */ normalizeFaceParametrization(inputs: Inputs.OCCT.NormalizeFaceParametrizationDto): Promise; /** * Collects diagnostic facts about a face: its surface type, U and V degrees, control point and * knot counts, whether U or V are closed, periodic or rational, the UV bounds, area, planarity, * orientation and the number of wires and edges. * * An empty or null face gives a report marked invalid. * @param inputs - The face to inspect * @returns The report * @group debug * @shortname face debug info * @drawable false * @example * ```typescript * const info = await bitbybit.occt.shapes.face.debugInfo({ shape: face }); * console.log(info.type, info.isPlanar, info.area); * ``` */ debugInfo(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Creates a flat triangular face from three points. * @param inputs - The triangle as three points * @returns The face * @group from base * @shortname face from triangle * @drawable true * @example * ```typescript * const face = await bitbybit.occt.shapes.face.fromBaseTriangle({ triangle: [[0, 0, 0], [10, 0, 0], [0, 0, 10]] }); * ``` */ fromBaseTriangle(inputs: Inputs.OCCT.TriangleBaseDto): Promise; /** * Creates one flat triangular face per triangle of a mesh. * * A triangle that cannot form a face, for instance one with repeated points, is skipped with a * warning in the console. * @param inputs - The mesh as a list of triangles * @returns One face per triangle that could be built * @group from base * @shortname faces from mesh * @drawable true * @example * ```typescript * const faces = await bitbybit.occt.shapes.face.fromBaseMesh({ * mesh: [[[0, 0, 0], [10, 0, 0], [0, 0, 10]], [[10, 0, 0], [10, 0, 10], [0, 0, 10]]], * }); * ``` */ fromBaseMesh(inputs: Inputs.OCCT.MeshBaseDto): Promise; /** * Creates one face per wire, each cut from the surface of a guiding face so it takes that * surface's curvature. * * The wires must lie on the surface. With `inside` true each wire is turned so its face is the * region it encloses; with false the wire's own direction decides, and a wire running the other * way gives the outside region. * @param inputs - The wires, the guiding face and which side to keep * @returns One face per wire, in the same order * @group from * @shortname faces from wires on face * @drawable true * @example * ```typescript * const patches = await bitbybit.occt.shapes.face.createFacesFromWiresOnFace({ wires: circlesOnSphere, face: sphereFace, inside: true }); * ``` */ createFacesFromWiresOnFace(inputs: Inputs.OCCT.FacesFromWiresOnFaceDto): Promise; /** * Creates a face from a wire that lies on the surface of a guiding face, so the new face takes * the curvature of that surface. * * With `inside` true the wire is turned so the face is the region it encloses; with false the * wire's own direction decides, and a wire running the other way gives the region outside it. * @param inputs - The wire, the guiding face and which side to keep * @returns The new face * @group from * @shortname face from wire on face * @drawable true * @example * ```typescript * const patch = await bitbybit.occt.shapes.face.createFaceFromWireOnFace({ wire: circleOnCylinder, face: cylinderFace, inside: true }); * ``` */ createFaceFromWireOnFace(inputs: Inputs.OCCT.FaceFromWireOnFaceDto): Promise; /** * Creates a face bounded by a closed wire. * * With `planar` true the wire must lie in one plane and the face is flat; with false a smooth * surface is fitted through the wire's edges, which fills a wire that is not flat. A shape that * is not a wire throws an error. * @param inputs - The wire and whether the face must be flat * @returns The new face * @group from * @shortname face from wire * @drawable true * @example * ```typescript * const wire = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * const disc = await bitbybit.occt.shapes.face.createFaceFromWire({ shape: wire, planar: true }); * ``` */ createFaceFromWire(inputs: Inputs.OCCT.FaceFromWireDto): Promise; /** * Creates one face from several wires: the first wire is the outer boundary and every further * wire cuts a hole in it. * * With `planar` true the wires must lie in one plane. The hole wires must sit inside the outer * one without crossing it or each other. * @param inputs - The wires, outer boundary first, and whether the face must be flat * @returns The face with holes * @group from * @shortname face from wires * @drawable true * @example * ```typescript * const outer = await bitbybit.occt.shapes.wire.createRectangleWire({ width: 20, length: 10, center: [0, 0, 0], direction: [0, 1, 0] }); * const hole = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 2, center: [0, 0, 0], direction: [0, 1, 0] }); * const plate = await bitbybit.occt.shapes.face.createFaceFromWires({ shapes: [outer, hole], planar: true }); * ``` */ createFaceFromWires(inputs: Inputs.OCCT.FaceFromWiresDto): Promise; /** * Creates one face from several wires on the surface of a guiding face: the first wire is the * outer boundary and every further wire cuts a hole. * * The face takes the curvature of the guiding surface. `inside` applies to the first wire: true * turns it so the face is the region it encloses; false lets its own direction decide. * @param inputs - The wires, outer boundary first, the guiding face and which side to keep * @returns The face with holes * @group from * @shortname face from wires on face * @drawable true * @example * ```typescript * const perforated = await bitbybit.occt.shapes.face.createFaceFromWiresOnFace({ wires: [outerOnCylinder, holeOnCylinder], face: cylinderFace, inside: true }); * ``` */ createFaceFromWiresOnFace(inputs: Inputs.OCCT.FaceFromWiresOnFaceDto): Promise; /** * Creates one face per closed wire, each as `createFaceFromWire` would. * * With `planar` true every wire must lie in a plane; with false a smooth surface is fitted * through each. * @param inputs - The wires and whether the faces must be flat * @returns One face per wire, in the same order * @group from * @shortname faces from wires * @drawable true * @example * ```typescript * const faces = await bitbybit.occt.shapes.face.createFacesFromWires({ shapes: wires, planar: true }); * ``` */ createFacesFromWires(inputs: Inputs.OCCT.FacesFromWiresDto): Promise; /** * Joins circles with tangent belts: for each pair it draws the two outer tangent lines and the * outer arcs between them and fills that outline with a flat face. * * `combination` picks the pairs: `allWithAll` every circle with every other, `inOrder` * neighbors in the list, `inOrderClosed` also the last with the first. `unify` fuses the faces; * otherwise they form a compound. * @param inputs - The circle wires, how to pair them, whether to fuse the result and the tolerance * @returns The fused shape, or the compound of belt faces * @group from * @shortname face from circles tan * @drawable true * @example * ```typescript * const a = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 3, center: [0, 0, 0], direction: [0, 1, 0] }); * const b = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 1, center: [10, 0, 0], direction: [0, 1, 0] }); * const c = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 2, center: [5, 0, 8], direction: [0, 1, 0] }); * const belt = await bitbybit.occt.shapes.face.createFaceFromMultipleCircleTanWires({ * circles: [a, b, c], * combination: Bit.Inputs.OCCT.combinationCirclesForFaceEnum.inOrderClosed, * unify: true, * tolerance: 1e-7, * }); * ``` */ createFaceFromMultipleCircleTanWires(inputs: Inputs.OCCT.FaceFromMultipleCircleTanWiresDto): Promise; /** * Joins circles from consecutive lists with tangent belts, the way * `createFaceFromMultipleCircleTanWires` joins single circles. * * `allWithAll` joins every circle of a list with every circle of the next; `inOrder` joins * circles at the same position in neighboring lists, which need equal lengths; `inOrderClosed` * also closes each list into a ring. `unify` fuses the faces; otherwise they form a compound. * @param inputs - The lists of circle wires, how to pair them, whether to fuse the result and the tolerance * @returns The fused shape, or the compound of belt faces * @group from * @shortname face from multiple circle tan collections * @drawable true * @example * ```typescript * const mesh = await bitbybit.occt.shapes.face.createFaceFromMultipleCircleTanWireCollections({ * listsOfCircles: [bottomRow, middleRow, topRow], * combination: Bit.Inputs.OCCT.combinationCirclesForFaceEnum.inOrderClosed, * unify: true, * tolerance: 1e-7, * }); * ``` */ createFaceFromMultipleCircleTanWireCollections(inputs: Inputs.OCCT.FaceFromMultipleCircleTanWireCollectionsDto): Promise; /** * Creates a face that covers a whole surface, out to the surface's natural bounds. * * `tolerance` is used to detect degenerate edges, such as the pole of a sphere. Surfaces come * from `geom.surfaces`. * @param inputs - The surface and the tolerance for degenerate edges * @returns The face * @group from * @shortname surface * @drawable true * @example * ```typescript * const face = await bitbybit.occt.shapes.face.faceFromSurface({ shape: surface, tolerance: 1e-7 }); * ``` */ faceFromSurface(inputs: Inputs.OCCT.ShapeWithToleranceDto): Promise; /** * Creates a face by cutting a surface with a wire that lies on it. * * With `inside` true the wire is turned so the face is the region it encloses; with false the * wire's own direction decides, and a wire running the other way gives the region outside it. * Surfaces come from `geom.surfaces`. * @param inputs - The surface, the wire on it and which side to keep * @returns The face * @group from * @shortname surface and wire * @drawable true * @example * ```typescript * const patch = await bitbybit.occt.shapes.face.faceFromSurfaceAndWire({ surface, wire: wireOnSurface, inside: true }); * ``` */ faceFromSurfaceAndWire(inputs: Inputs.OCCT.FaceFromSurfaceAndWireDto): Promise; /** * Creates a flat face from a list of corner points, closing the outline from the last point * back to the first. * * The points must lie in one plane. * @param inputs - The corner points in order * @returns The face * @group primitives * @shortname polygon * @drawable true * @example * ```typescript * const face = await bitbybit.occt.shapes.face.createPolygonFace({ points: [[0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]] }); * ``` */ createPolygonFace(inputs: Inputs.OCCT.PolygonDto): Promise; /** * Creates a flat circular face, a disc. * * `direction` is the normal of its plane: the default `[0, 1, 0]` lays it flat on the ground. * @param inputs - The radius, the center and the plane normal * @returns The disc face * @group primitives * @shortname circle * @drawable true * @example * ```typescript * const disc = await bitbybit.occt.shapes.face.createCircleFace({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createCircleFace(inputs: Inputs.OCCT.CircleDto): Promise; /** * Fills a rectangle on the ground plane with a grid of flat hexagonal faces, centered on the * origin. * * The hexagons are scaled so `nrHexagonsInWidth` fit across `width` and `nrHexagonsInHeight` * across `height`. The scale, fillet and inclusion patterns are read hexagon by hexagon and * repeat; the extend flags stretch the outer rows past the edges to cover the rectangle. * @param inputs - The rectangle size, the hexagon counts, the extend flags and the optional patterns * @returns One face per hexagon, row by row * @group primitives * @shortname hexagons in grid * @drawable true * @example * ```typescript * const cells = await bitbybit.occt.shapes.face.hexagonsInGrid({ * width: 20, * height: 10, * nrHexagonsInWidth: 8, * nrHexagonsInHeight: 4, * flatTop: false, * scalePatternWidth: [0.9], * scalePatternHeight: [0.9], * }); * ``` */ hexagonsInGrid(inputs: Inputs.OCCT.HexagonsInGridDto): Promise; /** * Creates a flat elliptical face. * * `direction` is the normal of its plane: the default `[0, 1, 0]` lays it flat on the ground. * `radiusMajor` must be at least `radiusMinor`. * @param inputs - The two radii, the center and the plane normal * @returns The ellipse face * @group primitives * @shortname ellipse * @drawable true * @example * ```typescript * const face = await bitbybit.occt.shapes.face.createEllipseFace({ radiusMinor: 3, radiusMajor: 6, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createEllipseFace(inputs: Inputs.OCCT.EllipseDto): Promise; /** * Creates a flat square face centered on `center`. * * `direction` is the normal of its plane: the default `[0, 1, 0]` lays it flat on the ground. * @param inputs - The side length, the center and the plane normal * @returns The square face * @group primitives * @shortname square * @drawable true * @example * ```typescript * const face = await bitbybit.occt.shapes.face.createSquareFace({ size: 10, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createSquareFace(inputs: Inputs.OCCT.SquareDto): Promise; /** * Creates a flat rectangular face centered on `center`. * * On the ground plane `width` runs along X and `length` along Z; `direction` is the normal of * the plane, and the default `[0, 1, 0]` keeps the face flat on the ground. * @param inputs - The width, the length, the center and the plane normal * @returns The rectangle face * @group primitives * @shortname rectangle * @drawable true * @example * ```typescript * const face = await bitbybit.occt.shapes.face.createRectangleFace({ width: 20, length: 10, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createRectangleFace(inputs: Inputs.OCCT.RectangleDto): Promise; /** * Creates a flat L-shaped face: two rectangular legs joined at a corner. * * The first leg has `widthFirst` and `lengthFirst`, the second `widthSecond` and * `lengthSecond`; `align` puts the corner on the outside, inside or middle of the legs, and * `rotation` turns the shape in its plane, in degrees. It lies flat on the ground unless * `direction` says otherwise. * @param inputs - The two leg sizes, the alignment, the rotation, the center and the plane normal * @returns The L-shaped face * @group primitives * @shortname L-polygon * @drawable true * @example * ```typescript * const face = await bitbybit.occt.shapes.face.createLPolygonFace({ * widthFirst: 2, * lengthFirst: 10, * widthSecond: 2, * lengthSecond: 6, * align: Bit.Inputs.OCCT.directionEnum.outside, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createLPolygonFace(inputs: Inputs.OCCT.LPolygonDto): Promise; /** * Creates a flat star-shaped face with `numRays` points. * * The points reach `outerRadius` and the notches between them `innerRadius`; `half` keeps only * the first half of the rays. `offsetOuterEdges` lifts the ray tips out of the plane and is * meant for the wire; a flat face needs it at 0. It lies flat on the ground unless `direction` * says otherwise. * @param inputs - The two radii, the number of rays, the center, the plane normal and the options * @returns The star face * @group primitives * @shortname star * @drawable true * @example * ```typescript * const star = await bitbybit.occt.shapes.face.createStarFace({ outerRadius: 5, innerRadius: 2, numRays: 5, center: [0, 0, 0], direction: [0, 1, 0], offsetOuterEdges: 0, half: false }); * ``` */ createStarFace(inputs: Inputs.OCCT.StarDto): Promise; /** * Creates a flat face shaped like a stylized Christmas tree: `nrSkirts` layers of branches, * narrowing from `outerDist` to `innerDist` off the trunk line, on a trunk of `trunkHeight` and * `trunkWidth`. * * Unlike the other flat shapes here it stands upright in the XY plane, tip along Y; `direction` * is the trunk-to-tip direction, `rotation` spins it about that axis, in degrees. * @param inputs - The tree proportions, the trunk size, the options, the origin and the trunk-to-tip direction * @returns The tree face * @group primitives * @shortname christmas tree * @drawable true * @example * ```typescript * const tree = await bitbybit.occt.shapes.face.createChristmasTreeFace({ * height: 10, * innerDist: 1.5, * outerDist: 4, * nrSkirts: 4, * trunkHeight: 1.5, * trunkWidth: 1, * half: false, * rotation: 0, * origin: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createChristmasTreeFace(inputs: Inputs.OCCT.ChristmasTreeDto): Promise; /** * Creates a flat parallelogram face: a rectangle of `width` and `height` whose sides lean over * by `angle` degrees. * * With `aroundCenter` true the shape is centered on `center`; otherwise it starts there and * extends in the positive directions. `direction` is the normal of the plane; the default `[0, * 1, 0]` lays it flat on the ground. * @param inputs - The width, the height, the lean angle, whether to center it, the center and the plane normal * @returns The parallelogram face * @group primitives * @shortname parallelogram * @drawable true * @example * ```typescript * const face = await bitbybit.occt.shapes.face.createParallelogramFace({ width: 10, height: 5, angle: 30, aroundCenter: true, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createParallelogramFace(inputs: Inputs.OCCT.ParallelogramDto): Promise; /** * Creates a flat heart-shaped face that fits roughly into a square of `sizeApprox`. * * `rotation` turns it in its plane, in degrees. `direction` is the normal of the plane; the * default `[0, 1, 0]` lays it flat on the ground. * @param inputs - The approximate size, the rotation, the center and the plane normal * @returns The heart face * @group primitives * @shortname heart * @drawable true * @example * ```typescript * const heart = await bitbybit.occt.shapes.face.createHeartFace({ sizeApprox: 10, rotation: 0, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createHeartFace(inputs: Inputs.OCCT.Heart2DDto): Promise; /** * Creates a flat regular polygon face with `nrCorners` corners, all on a circle of `radius`. * * `direction` is the normal of the plane; the default `[0, 1, 0]` lays it flat on the ground. * @param inputs - The number of corners, the radius, the center and the plane normal * @returns The polygon face * @group primitives * @shortname n-gon * @drawable true * @example * ```typescript * const hexagon = await bitbybit.occt.shapes.face.createNGonFace({ nrCorners: 6, radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createNGonFace(inputs: Inputs.OCCT.NGonWireDto): Promise; /** * Creates the flat cross-section of an I-beam: two horizontal flanges joined by a vertical web. * * `width` is the flange width, `height` the total height, `webThickness` and `flangeThickness` * the wall thicknesses; `alignment` says which point of the profile's box sits on `center`, * `rotation` turns it in its plane, in degrees. It lies on the ground, ready to extrude along * Y. * @param inputs - The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal * @returns The I-beam profile face * @group beam profiles * @shortname I-beam profile * @drawable true * @example * ```typescript * const profile = await bitbybit.occt.shapes.face.createIBeamProfileFace({ * width: 10, * height: 20, * webThickness: 2, * flangeThickness: 3, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * const beam = await bitbybit.occt.operations.extrude({ shape: profile, direction: [0, 100, 0] }); * ``` */ createIBeamProfileFace(inputs: Inputs.OCCT.IBeamProfileDto): Promise; /** * Creates the flat cross-section of an H-beam: two vertical flanges joined by a horizontal web, * an I-beam on its side. * * `width` is the total width, `height` the flange height, `webThickness` and `flangeThickness` * the wall thicknesses; `alignment` says which point of the profile's box sits on `center`, * `rotation` turns it in its plane, in degrees. It lies on the ground. * @param inputs - The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal * @returns The H-beam profile face * @group beam profiles * @shortname H-beam profile * @drawable true * @example * ```typescript * const profile = await bitbybit.occt.shapes.face.createHBeamProfileFace({ * width: 20, * height: 10, * webThickness: 2, * flangeThickness: 3, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createHBeamProfileFace(inputs: Inputs.OCCT.HBeamProfileDto): Promise; /** * Creates the flat cross-section of a T-beam: a horizontal flange with a vertical web hanging * from its middle. * * `width` is the flange width, `height` the total height, `webThickness` and `flangeThickness` * the wall thicknesses; `alignment` says which point of the profile's box sits on `center`, and * `rotation` turns it in its plane, in degrees. It lies flat on the ground. * @param inputs - The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal * @returns The T-beam profile face * @group beam profiles * @shortname T-beam profile * @drawable true * @example * ```typescript * const profile = await bitbybit.occt.shapes.face.createTBeamProfileFace({ * width: 10, * height: 12, * webThickness: 2, * flangeThickness: 2, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createTBeamProfileFace(inputs: Inputs.OCCT.TBeamProfileDto): Promise; /** * Creates the flat cross-section of a U-beam, a channel: a web with two flanges of * `flangeWidth` standing up from its ends. * * `width` and `height` are the total size, `webThickness` and `flangeThickness` the wall * thicknesses; `alignment` says which point of the profile's box sits on `center`, `rotation` * turns it in its plane, in degrees. It lies flat on the ground. * @param inputs - The profile size, the thicknesses, the flange width, the alignment, the rotation, the center and the plane normal * @returns The U-beam profile face * @group beam profiles * @shortname U-beam profile * @drawable true * @example * ```typescript * const profile = await bitbybit.occt.shapes.face.createUBeamProfileFace({ * width: 10, * height: 6, * webThickness: 1, * flangeThickness: 1, * flangeWidth: 3, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createUBeamProfileFace(inputs: Inputs.OCCT.UBeamProfileDto): Promise; /** * Picks one face out of a shape by its position, counting from 0, in the order the kernel walks * the shape. * * The shape must be a face or something built from faces; an index beyond the last face throws * an error. * @param inputs - The shape and the 0-based index * @returns The face at that index * @group get * @shortname face * @drawable true * @example * ```typescript * const first = await bitbybit.occt.shapes.face.getFace({ shape: box, index: 0 }); * ``` */ getFace(inputs: Inputs.OCCT.ShapeIndexDto): Promise; /** * Lists every face of a shape in the order the kernel walks it. * @param inputs - The shape * @returns The faces found in the shape * @group get * @shortname faces * @drawable true * @example * ```typescript * const faces = await bitbybit.occt.shapes.face.getFaces({ shape: box }); * ``` */ getFaces(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Flips a face so its normal points the other way. * * The geometry stays the same; only the orientation changes, which decides the outside of a * shell and the direction `normalOnUV` reports. * @param inputs - The face * @returns The flipped face * @group get * @shortname reversed * @drawable true * @example * ```typescript * const flipped = await bitbybit.occt.shapes.face.reversedFace({ shape: face }); * ``` */ reversedFace(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Lays a grid of points over a face by stepping evenly through its U and V ranges. * * `nrDivisionsU` by `nrDivisionsV` points cover the face edge to edge, listed row by row: all V * values for the first U, then the next U. The removal flags drop the first or last row; the * shift flags push every point half a step. * @param inputs - The face, the number of points in U and V, and the shift and removal options * @returns The points, row by row * @group extract * @shortname points * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.face.subdivideToPoints({ * shape: face, * nrDivisionsU: 10, * nrDivisionsV: 5, * shiftHalfStepU: false, * removeStartEdgeU: false, * removeEndEdgeU: false, * shiftHalfStepV: false, * removeStartEdgeV: false, * removeEndEdgeV: false, * }); * ``` */ subdivideToPoints(inputs: Inputs.OCCT.FaceSubdivisionDto): Promise; /** * Draws evenly spaced wires across a face along one parameter direction, like the lines of a * ruled sheet. * * `nrDivisions` steps give one more wire than that, the boundary lines included; `removeStart` * and `removeEnd` drop those, `shiftHalfStep` moves every wire half a step. With `isU` true * each wire sits at a fixed U and runs across V; false swaps the roles. * @param inputs - The face, the number of divisions, the direction and the options * @returns The wires, in order along the chosen direction * @group extract * @shortname wires * @drawable true * @example * ```typescript * const lines = await bitbybit.occt.shapes.face.subdivideToWires({ shape: face, nrDivisions: 10, isU: true, shiftHalfStep: false, removeStart: false, removeEnd: false }); * ``` */ subdivideToWires(inputs: Inputs.OCCT.FaceSubdivisionToWiresDto): Promise; /** * Lays rectangular wires over a face, one per cell of an `nrRectanglesU` by `nrRectanglesV` * division of its UV range, following the surface. * * The border offsets trim the range at each end. Each rectangle sits centered in its cell, * sized by the scale patterns as a fraction of it; the fillet pattern rounds corners, the * inclusion pattern skips cells. * @param inputs - The face, the cell counts, the border offsets and the optional patterns * @returns The rectangle wires, cell by cell * @group patterns * @shortname rectangle wires on face * @drawable true * @example * ```typescript * const cells = await bitbybit.occt.shapes.face.subdivideToRectangleWires({ * shape: face, * nrRectanglesU: 6, * nrRectanglesV: 4, * scalePatternU: [0.8, 0.5], * scalePatternV: [0.8], * filletPattern: [0.3], * inclusionPattern: [true, true, false], * offsetFromBorderU: 0.05, * offsetFromBorderV: 0.05, * }); * ``` */ subdivideToRectangleWires(inputs: Inputs.OCCT.FaceSubdivideToRectangleWiresDto): Promise; /** * Cuts a grid of rectangular holes into a face and returns the perforated face. * * The holes follow the same cells and patterns as `subdivideToRectangleWires`; when no scale * pattern is given each hole covers half its cell. With `holesToFaces` true the result also * carries one face per hole, after the perforated face, which is handy for lids or fillers. * @param inputs - The face, the cell counts, the border offsets, the optional patterns and whether to return the hole faces * @returns The perforated face, followed by the hole faces when asked for * @group patterns * @shortname rectangle holes on face * @drawable true * @example * ```typescript * const [perforated] = await bitbybit.occt.shapes.face.subdivideToRectangleHoles({ * shape: face, * nrRectanglesU: 6, * nrRectanglesV: 4, * scalePatternU: [0.6], * scalePatternV: [0.6], * filletPattern: [0.5], * inclusionPattern: [true], * holesToFaces: false, * offsetFromBorderU: 0.05, * offsetFromBorderV: 0.05, * }); * ``` */ subdivideToRectangleHoles(inputs: Inputs.OCCT.FaceSubdivideToRectangleHolesDto): Promise; /** * Lays a honeycomb of hexagonal wires over a face, `nrHexagonsU` by `nrHexagonsV` of them * fitted into its UV range, each following the surface. * * The border offsets trim a fraction of the range at each end; `flatU` turns a flat side toward * U, the extend flags stretch the outer rows past the edges. Scale, fillet and inclusion * patterns repeat per hexagon. * @param inputs - The face, the hexagon counts, the orientation, the border offsets, the extend flags and the optional patterns * @returns The hexagon wires, row by row * @group patterns * @shortname hexagon wires on face * @drawable true * @example * ```typescript * const cells = await bitbybit.occt.shapes.face.subdivideToHexagonWires({ * shape: face, * nrHexagonsU: 8, * nrHexagonsV: 6, * flatU: false, * scalePatternU: [0.9], * scalePatternV: [0.9], * filletPattern: [0.2], * inclusionPattern: [true], * offsetFromBorderU: 0, * offsetFromBorderV: 0, * }); * ``` */ subdivideToHexagonWires(inputs: Inputs.OCCT.FaceSubdivideToHexagonWiresDto): Promise; /** * Cuts a honeycomb of hexagonal holes into a face and returns the perforated face. * * The holes follow the same layout and patterns as `subdivideToHexagonWires`; when no scale * pattern is given each hole is half the size of its hexagon. With `holesToFaces` true the * result also carries one face per hole, after the perforated face. * @param inputs - The face, the hexagon counts, the orientation, the border offsets, the optional patterns and whether to return the hole faces * @returns The perforated face, followed by the hole faces when asked for * @group patterns * @shortname hexagon holes on face * @drawable true * @example * ```typescript * const [perforated] = await bitbybit.occt.shapes.face.subdivideToHexagonHoles({ * shape: face, * nrHexagonsU: 8, * nrHexagonsV: 6, * flatU: false, * holesToFaces: false, * scalePatternU: [0.7], * scalePatternV: [0.7], * filletPattern: [0], * inclusionPattern: [true], * offsetFromBorderU: 0.05, * offsetFromBorderV: 0.05, * }); * ``` */ subdivideToHexagonHoles(inputs: Inputs.OCCT.FaceSubdivideToHexagonHolesDto): Promise; /** * Lays a grid of points over a face like `subdivideToPoints`, but shifts and removes points on * every nth row or column, for brick-like and staggered patterns. * * Each rule is a pair: `shiftHalfStepNthU` says every how-manyth V row moves half a step in U, * `shiftHalfStepUOffsetN` where counting starts; the removal rules drop every nth point of an * edge row. * @param inputs - The face, the number of points in U and V, and the nth-row shift and removal rules * @returns The points, row by row * @group extract * @shortname points nth * @drawable true * @example * ```typescript * const staggered = await bitbybit.occt.shapes.face.subdivideToPointsControlled({ * shape: face, * nrDivisionsU: 10, * nrDivisionsV: 10, * shiftHalfStepNthU: 2, * shiftHalfStepUOffsetN: 0, * removeStartEdgeNthU: 0, * removeStartEdgeUOffsetN: 0, * removeEndEdgeNthU: 0, * removeEndEdgeUOffsetN: 0, * shiftHalfStepNthV: 0, * shiftHalfStepVOffsetN: 0, * removeStartEdgeNthV: 0, * removeStartEdgeVOffsetN: 0, * removeEndEdgeNthV: 0, * removeEndEdgeVOffsetN: 0, * }); * ``` */ subdivideToPointsControlled(inputs: Inputs.OCCT.FaceSubdivisionControlledDto): Promise; /** * Computes the surface normal at every point of the grid `subdivideToPoints` would lay over a * face, with the same options and the same order. * * The normals are unit vectors and follow the face's orientation, so a reversed face gives them * flipped. Pair the list with `subdivideToPoints` to place things standing on the surface. * @param inputs - The face, the number of points in U and V, and the shift and removal options * @returns The unit normals, row by row * @group extract * @shortname normals * @drawable true * @example * ```typescript * const normals = await bitbybit.occt.shapes.face.subdivideToNormals({ * shape: face, * nrDivisionsU: 10, * nrDivisionsV: 5, * shiftHalfStepU: false, * removeStartEdgeU: false, * removeEndEdgeU: false, * shiftHalfStepV: false, * removeStartEdgeV: false, * removeEndEdgeV: false, * }); * ``` */ subdivideToNormals(inputs: Inputs.OCCT.FaceSubdivisionDto): Promise; /** * Lists the UV parameter pairs of the grid `subdivideToPoints` would lay over a face, with the * same options and the same order. * * The pairs are in the face's real UV values, not fractions. * @param inputs - The face, the number of points in U and V, and the shift and removal options * @returns The UV pairs, row by row * @group extract * @shortname uvs * @drawable true * @example * ```typescript * const uvs = await bitbybit.occt.shapes.face.subdivideToUV({ * shape: face, * nrDivisionsU: 10, * nrDivisionsV: 5, * shiftHalfStepU: false, * removeStartEdgeU: false, * removeEndEdgeU: false, * shiftHalfStepV: false, * removeStartEdgeV: false, * removeEndEdgeV: false, * }); * ``` */ subdivideToUV(inputs: Inputs.OCCT.FaceSubdivisionDto): Promise; /** * Finds the point on a face at the given UV fractions. * * `paramU` and `paramV` run from 0 to 1 over the face's U and V range, so `0.5, 0.5` is the * middle of the range, which on a trimmed face is not always inside the face. * @param inputs - The face and the U and V fractions * @returns The point on the surface * @group extract * @shortname point on uv * @drawable true * @example * ```typescript * const middle = await bitbybit.occt.shapes.face.pointOnUV({ shape: face, paramU: 0.5, paramV: 0.5 }); * ``` */ pointOnUV(inputs: Inputs.OCCT.DataOnUVDto): Promise; /** * Finds the surface normal of a face at the given UV fractions. * * `paramU` and `paramV` run from 0 to 1 over the face's U and V range. The normal is a unit * vector and follows the face's orientation, so a reversed face gives it flipped. * @param inputs - The face and the U and V fractions * @returns The unit normal * @group extract * @shortname normal on uv * @drawable true * @example * ```typescript * const normal = await bitbybit.occt.shapes.face.normalOnUV({ shape: face, paramU: 0.5, paramV: 0.5 }); * ``` */ normalOnUV(inputs: Inputs.OCCT.DataOnUVDto): Promise; /** * Finds the points on a face at several UV fraction pairs at once. * * Each pair holds U then V, both from 0 to 1 over the face's range. * @param inputs - The face and the list of U and V fraction pairs * @returns One point per pair, in the same order * @group extract * @shortname points on uvs * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.face.pointsOnUVs({ shape: face, paramsUV: [[0, 0], [0.5, 0.5], [1, 1]] }); * ``` */ pointsOnUVs(inputs: Inputs.OCCT.DataOnUVsDto): Promise; /** * Finds the surface normals of a face at several UV fraction pairs at once. * * Each pair holds U then V, both from 0 to 1 over the face's range. The normals are unit * vectors of the underlying surface; unlike `normalOnUV`, they are not flipped for a reversed * face. * @param inputs - The face and the list of U and V fraction pairs * @returns One unit normal per pair, in the same order * @group extract * @shortname normals on uvs * @drawable true * @example * ```typescript * const normals = await bitbybit.occt.shapes.face.normalsOnUVs({ shape: face, paramsUV: [[0, 0], [0.5, 0.5], [1, 1]] }); * ``` */ normalsOnUVs(inputs: Inputs.OCCT.DataOnUVsDto): Promise; /** * Places evenly spaced points along one straight line across a face's UV range. * * With `isU` true the line sits at `param` (a fraction from 0 to 1 of the U range) and * `nrPoints` points spread over the whole V range; with false the roles swap. * `removeStartPoint` and `removeEndPoint` drop the ends, and `shiftHalfStep` moves every point * half a step. * @param inputs - The face, the direction, the fraction along it, the number of points and the options * @returns The points along the line, in order * @group extract * @shortname points on param * @drawable true * @example * ```typescript * const midline = await bitbybit.occt.shapes.face.subdivideToPointsOnParam({ shape: face, isU: true, param: 0.5, nrPoints: 10, shiftHalfStep: false, removeStartPoint: false, removeEndPoint: false }); * ``` */ subdivideToPointsOnParam(inputs: Inputs.OCCT.FaceLinearSubdivisionDto): Promise; /** * Draws one wire across a face along a parameter line, following the surface. * * With `isU` true the wire sits at `param` (a fraction from 0 to 1 of the U range) and runs * over the whole V range; with false the roles swap. * @param inputs - The face, the direction and the fraction along it * @returns The wire on the surface * @group extract * @shortname wire along param * @drawable true * @example * ```typescript * const middle = await bitbybit.occt.shapes.face.wireAlongParam({ shape: face, isU: true, param: 0.5 }); * ``` */ wireAlongParam(inputs: Inputs.OCCT.WireAlongParamDto): Promise; /** * Draws several wires across a face, one per parameter value, following the surface. * * With `isU` true each wire sits at its fraction of the U range and runs over the whole V * range; with false the roles swap. * @param inputs - The face, the direction and the fractions along it * @returns One wire per fraction, in the same order * @group extract * @shortname wires along params * @drawable true * @example * ```typescript * const wires = await bitbybit.occt.shapes.face.wiresAlongParams({ shape: face, isU: false, params: [0.25, 0.5, 0.75] }); * ``` */ wiresAlongParams(inputs: Inputs.OCCT.WiresAlongParamsDto): Promise; /** * Reads the smallest U parameter value of a face, in the surface's own units. * * Together with `getUMaxBound`, `getVMinBound` and `getVMaxBound` it gives the range that the * UV fractions used elsewhere in this class map onto. * @param inputs - The face * @returns The lower U bound * @group get * @shortname u min * @drawable false * @example * ```typescript * const uMin = await bitbybit.occt.shapes.face.getUMinBound({ shape: face }); * ``` */ getUMinBound(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the largest U parameter value of a face, in the surface's own units. * @param inputs - The face * @returns The upper U bound * @group get * @shortname u max * @drawable false * @example * ```typescript * const uMax = await bitbybit.occt.shapes.face.getUMaxBound({ shape: face }); * ``` */ getUMaxBound(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the smallest V parameter value of a face, in the surface's own units. * @param inputs - The face * @returns The lower V bound * @group get * @shortname v min * @drawable false * @example * ```typescript * const vMin = await bitbybit.occt.shapes.face.getVMinBound({ shape: face }); * ``` */ getVMinBound(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the largest V parameter value of a face, in the surface's own units. * @param inputs - The face * @returns The upper V bound * @group get * @shortname v max * @drawable false * @example * ```typescript * const vMax = await bitbybit.occt.shapes.face.getVMaxBound({ shape: face }); * ``` */ getVMaxBound(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Measures the surface area of a face, in square model units. * @param inputs - The face * @returns The area * @group get * @shortname face area * @drawable false * @example * ```typescript * const area = await bitbybit.occt.shapes.face.getFaceArea({ shape: face }); * ``` */ getFaceArea(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Measures the surface area of each face in a list, in square model units. * @param inputs - The faces * @returns One area per face, in the same order * @group get * @shortname areas of faces * @drawable false * @example * ```typescript * const areas = await bitbybit.occt.shapes.face.getFacesAreas({ shapes: faces }); * ``` */ getFacesAreas(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Finds the center of mass of a face, the point its area balances on. * * On a curved or ring-shaped face this point can lie off the surface. * @param inputs - The face * @returns The center of mass * @group get * @shortname center of mass * @drawable true * @example * ```typescript * const center = await bitbybit.occt.shapes.face.getFaceCenterOfMass({ shape: face }); * ``` */ getFaceCenterOfMass(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the center of mass of each face in a list. * @param inputs - The faces * @returns One point per face, in the same order * @group get * @shortname centers of mass * @drawable true * @example * ```typescript * const centers = await bitbybit.occt.shapes.face.getFacesCentersOfMass({ shapes: faces }); * ``` */ getFacesCentersOfMass(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Sorts points as inside a face, on its boundary or outside it, and keeps the chosen groups. * * `keepIn`, `keepOn`, `keepOut` and `keepUnknown` choose the groups; `tolerance` decides how * close to the boundary counts as on it. With `useBndBox`, a point outside the bounding box * grown by `gapTolerance` is outside. * @param inputs - The face, the points, the tolerance, the bounding-box shortcut and which groups to keep * @returns The points that passed, in their original order * @group filter * @shortname filter face points * @drawable true * @example * ```typescript * const onFace = await bitbybit.occt.shapes.face.filterFacePoints({ * shape: face, * points: grid, * tolerance: 1e-4, * useBndBox: false, * gapTolerance: 0.1, * keepIn: true, * keepOn: true, * keepOut: false, * keepUnknown: false, * }); * ``` */ filterFacePoints(inputs: Inputs.OCCT.FilterFacePointsDto): Promise; /** * Runs `filterFacePoints` against several faces with the same points and options. * * By default the result holds one list per face; with `flatPointsArray` true the lists are * joined into one, so a point on two faces appears twice. * @param inputs - The faces, the points, the tolerance, which groups to keep and whether to flatten the result * @returns One list of points per face, or a single joined list * @group filter * @shortname filter points on faces * @drawable true * @example * ```typescript * const perFace = await bitbybit.occt.shapes.face.filterFacesPoints({ * shapes: faces, * points: grid, * tolerance: 1e-4, * useBndBox: false, * gapTolerance: 0.1, * keepIn: true, * keepOn: true, * keepOut: false, * keepUnknown: false, * flatPointsArray: false, * }); * ``` */ filterFacesPoints(inputs: Inputs.OCCT.FilterFacesPointsDto): Promise; } /** * Questions and repairs that apply to any OpenCascade shape whatever its kind: what type it is, * which way it is oriented, whether it is closed, valid or the same object as another, and * `unifySameDomain`, which merges faces and edges that lie on one surface after a boolean. For work * specific to one kind, use the vertex, edge, wire, face, shell, solid and compound classes beside * this one. */ declare class OCCTShape { private readonly occWorkerManager; /** * Returns the shape as it is; the internal-edge purge is not applied in this version, so the * result is the input. * @param inputs - The shape * @returns The same shape * @group edit * @shortname purge internal edges * @drawable true */ purgeInternalEdges(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Merges faces that lie on the same surface and edges that lie on the same curve into single * faces and edges, which cleans up the seams a boolean or a fuse leaves behind. * * `unifyEdges` and `unifyFaces` choose what to merge, and `concatBSplines` joins runs of * B-spline edges into one curve. * @param inputs - The shape and which kinds of merge to apply * @returns The simplified shape * @group edit * @shortname unify same domain * @drawable true * @example * ```typescript * const clean = await bitbybit.occt.shapes.shape.unifySameDomain({ shape: fused, unifyEdges: true, unifyFaces: true, concatBSplines: true }); * ``` */ unifySameDomain(inputs: Inputs.OCCT.UnifySameDomainDto): Promise; /** * Tells whether the kernel has the shape flagged as closed, such as a wire that loops back to * its start or a shell with no gaps. * @param inputs - The shape * @returns True when the shape is flagged closed * @group analysis * @shortname is closed * @drawable false * @example * ```typescript * const wireIsClosed = await bitbybit.occt.shapes.shape.isClosed({ shape: wire }); * ``` */ isClosed(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether the kernel has the shape flagged as convex. * @param inputs - The shape * @returns True when the shape is flagged convex * @group analysis * @shortname is convex * @drawable false */ isConvex(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether the kernel has already run its validity check on the shape. * @param inputs - The shape * @returns True when the shape carries the checked flag * @group analysis * @shortname is checked * @drawable false */ isChecked(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether the kernel has the shape flagged as free, that is, not held inside another * shape. * @param inputs - The shape * @returns True when the shape carries the free flag * @group analysis * @shortname is free * @drawable false */ isFree(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether the kernel has the shape flagged as infinite, such as an unbounded plane or * line. * @param inputs - The shape * @returns True when the shape carries the infinite flag * @group analysis * @shortname is infinite * @drawable false */ isInfinite(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether the kernel has the shape flagged as modified since it was last checked. * @param inputs - The shape * @returns True when the shape carries the modified flag * @group analysis * @shortname is modified * @drawable false */ isModified(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether the kernel has the shape flagged as locked against changes. * @param inputs - The shape * @returns True when the shape carries the locked flag * @group analysis * @shortname is locked * @drawable false */ isLocked(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether the shape is empty: a handle that holds no geometry, which an operation that * failed can return. * @param inputs - The shape * @returns True when the shape holds nothing * @group analysis * @shortname is null * @drawable false * @example * ```typescript * const empty = await bitbybit.occt.shapes.shape.isNull({ shape: result }); * ``` */ isNull(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether two handles point at the same geometry with the same placement and orientation. * @param inputs - The two shapes * @returns True when they are equal * @group analysis * @shortname is equal * @drawable false * @example * ```typescript * const equal = await bitbybit.occt.shapes.shape.isEqual({ shape: a, otherShape: b }); * ``` */ isEqual(inputs: Inputs.OCCT.CompareShapesDto): Promise; /** * Tells whether two handles differ in geometry, placement or orientation. * @param inputs - The two shapes * @returns True when they are not equal * @group analysis * @shortname is not equal * @drawable false */ isNotEqual(inputs: Inputs.OCCT.CompareShapesDto): Promise; /** * Tells whether two handles share the same underlying geometry, even if placed or oriented * differently. * @param inputs - The two shapes * @returns True when they share geometry * @group analysis * @shortname is partner * @drawable false */ isPartner(inputs: Inputs.OCCT.CompareShapesDto): Promise; /** * Tells whether two handles share the same geometry and placement, ignoring orientation. * @param inputs - The two shapes * @returns True when they are the same up to orientation * @group analysis * @shortname is same * @drawable false */ isSame(inputs: Inputs.OCCT.CompareShapesDto): Promise; /** * Reads which way the shape is oriented: forward, reversed, internal or external, which for a * face decides which side its normal points to. * @param inputs - The shape * @returns The orientation * @group analysis * @shortname get orientation * @drawable false * @example * ```typescript * const orientation = await bitbybit.occt.shapes.shape.getOrientation({ shape: face }); * ``` */ getOrientation(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads what kind of shape this is: vertex, edge, wire, face, shell, solid, compound or another * kernel type. * @param inputs - The shape * @returns The shape type * @group analysis * @shortname get shape type * @drawable false * @example * ```typescript * const type = await bitbybit.occt.shapes.shape.getShapeType({ shape: unknownShape }); * ``` */ getShapeType(inputs: Inputs.OCCT.ShapeDto): Promise; } /** * Shape construction in OpenCascade, grouped by what you are building: vertices, edges, wires, * faces, shells, solids and compounds. The groups mirror the topological hierarchy, and a normal * modelling session climbs it - points become a wire, the wire becomes a face, the face is extruded * into a solid. Reach into the group for the kind you want rather than looking for one flat list. */ declare class OCCTShapes { readonly vertex: OCCTVertex; readonly edge: OCCTEdge; readonly wire: OCCTWire; readonly face: OCCTFace; readonly shell: OCCTShell; readonly solid: OCCTSolid; readonly compound: OCCTCompound; readonly shape: OCCTShape; } /** * Shells in OpenCascade: sets of faces joined along their edges. A shell that closes on itself with * no gaps bounds a volume and can become a solid with `shapes.solid.fromClosedShell`; an open shell * is a surface with a rim. Build one by sewing faces together, check whether it is closed and * measure its area. */ declare class OCCTShell { private readonly occWorkerManager; /** * Collects diagnostic facts about a shell: whether it is valid, how many faces and edges it * has, its total area and, for every face, the surface type, degrees, control point counts, * bounds and area. * * An empty or null shape gives a report marked invalid with zero counts. * @param inputs - The shell to inspect * @returns The report with counts, area and one entry per face * @group debug * @shortname shell debug info * @drawable false * @example * ```typescript * const info = await bitbybit.occt.shapes.shell.debugInfo({ shape: shell }); * ``` */ debugInfo(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Joins faces into a shell by sewing their edges together where they meet within the tolerance. * * Faces whose edges are further apart than the tolerance stay unjoined, so a shell meant to be * closed may come out open; a larger tolerance sews more, a smaller one is more precise. * @param inputs - The faces and the sewing tolerance * @returns The shell made from the faces * @group create * @shortname sew * @drawable true * @example * ```typescript * const shell = await bitbybit.occt.shapes.shell.sewFaces({ shapes: [top, bottom, side], tolerance: 1e-7 }); * ``` */ sewFaces(inputs: Inputs.OCCT.SewDto): Promise; /** * Measures the total area of all the faces of a shell, in square model units. * @param inputs - The shell * @returns The surface area * @group get * @shortname area * @drawable false * @example * ```typescript * const area = await bitbybit.occt.shapes.shell.getShellSurfaceArea({ shape: shell }); * ``` */ getShellSurfaceArea(inputs: Inputs.OCCT.ShapeDto): Promise; } /** * Solids in OpenCascade: closed shapes that enclose a volume. Build one from a primitive * (`createBox`, `createSphere`, `createCylinder`, `createCone`, `createTorus`), from a flat profile * extruded front and back (the star, n-gon, heart, beam and other profile solids), or from a closed * shell with `fromClosedShell`; then measure it with the volume, surface area and center of mass * getters, and filter points by whether they lie inside it. Vertices, edges, wires, faces, shells * and compounds have their own classes beside this one under `shapes`. */ declare class OCCTSolid { private readonly occWorkerManager; /** * Collects diagnostic facts about a solid: whether it is valid, how many faces and edges it * has, its surface area and volume, and for every face the surface type, degrees, control point * counts, bounds and area. * * An empty or null shape gives a report marked invalid with zero counts. * @param inputs - The solid to inspect * @returns The report with counts, area, volume and one entry per face * @group debug * @shortname solid debug info * @drawable false * @example * ```typescript * const info = await bitbybit.occt.shapes.solid.debugInfo({ shape: box }); * console.log(info.nbFaces, info.volume); * ``` */ debugInfo(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Turns a closed shell into a solid, so the volume it encloses becomes a body that can be * measured, booleaned and meshed. * * The shell must be watertight; a shell with gaps produces a solid the kernel cannot use. * @param inputs - The closed shell * @returns The solid bounded by the shell * @group from * @shortname solid from closed shell * @drawable true * @example * ```typescript * const solid = await bitbybit.occt.shapes.solid.fromClosedShell({ shape: closedShell }); * ``` */ fromClosedShell(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Creates a box solid with its sides parallel to the axes. * * `width` runs along X, `height` along Y (up) and `length` along Z, all in model units. By * default the box is centered on `center`; with `originOnCenter` set to false it stands on that * point instead, so `center` becomes the middle of the bottom face. * @param inputs - Box size, the point it is placed on, and whether it is centered on or stands on it * @returns A new solid * @group primitives * @shortname box * @drawable true * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 20, height: 5, center: [0, 0, 0], originOnCenter: true }); * ``` */ createBox(inputs: Inputs.OCCT.BoxDto): Promise; /** * Creates a cube solid, a box with all three sides the same size, parallel to the axes. * * By default the cube is centered on `center`; with `originOnCenter` set to false it stands on * that point instead, so `center` becomes the middle of the bottom face. * @param inputs - Cube size, the point it is placed on, and whether it is centered on or stands on it * @returns A new solid * @group primitives * @shortname cube * @drawable true * @example * ```typescript * const cube = await bitbybit.occt.shapes.solid.createCube({ size: 10, center: [0, 0, 0], originOnCenter: true }); * ``` */ createCube(inputs: Inputs.OCCT.CubeDto): Promise; /** * Creates a box solid that starts at a corner point and extends along the positive axes. * * The corner with the smallest x, y and z sits at `corner`; the box reaches `width` along X, * `height` along Y and `length` along Z from there, all in model units. * @param inputs - Box size and the corner it grows from * @returns A new solid * @group primitives * @shortname box corner * @drawable true * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBoxFromCorner({ width: 10, length: 20, height: 5, corner: [0, 0, 0] }); * ``` */ createBoxFromCorner(inputs: Inputs.OCCT.BoxFromCornerDto): Promise; /** * Creates a cylinder solid with a round base at `center`, growing `height` along `direction`. * * With `originOnCenter` on, the cylinder is shifted back by half its height so `center` sits in * its middle. `angle`, in degrees, cuts a wedge out of the full 360 degree round, like a slice * of cake. * @param inputs - Radius, height, base center, direction, an optional partial angle and whether to center on the point * @returns A new solid * @group primitives * @shortname cylinder * @drawable true * @example * ```typescript * const cylinder = await bitbybit.occt.shapes.solid.createCylinder({ radius: 5, height: 20, center: [0, 0, 0], direction: [0, 1, 0], angle: 360, originOnCenter: false }); * ``` */ createCylinder(inputs: Inputs.OCCT.CylinderDto): Promise; /** * Creates one cylinder solid along each line, from its start to its end, all with the same * radius. * * The height of each cylinder is the length of its line. * @param inputs - The lines and the radius * @returns One solid per line, in the same order * @group primitives * @shortname cylinders on lines * @drawable true * @example * ```typescript * const rods = await bitbybit.occt.shapes.solid.createCylindersOnLines({ * lines: [{ start: [0, 0, 0], end: [0, 10, 0] }, { start: [5, 0, 0], end: [5, 10, 0] }], * radius: 0.5, * }); * ``` */ createCylindersOnLines(inputs: Inputs.OCCT.CylindersOnLinesDto): Promise; /** * Creates a sphere solid of the given radius around a center point. * @param inputs - Radius and center * @returns A new solid * @group primitives * @shortname sphere * @drawable true * @example * ```typescript * const sphere = await bitbybit.occt.shapes.solid.createSphere({ radius: 5, center: [0, 0, 0] }); * ``` */ createSphere(inputs: Inputs.OCCT.SphereDto): Promise; /** * Creates a cone solid, or a truncated cone when both radii are above 0, standing on a round * base at `center` and growing `height` along `direction`. * * `radius1` is the base and `radius2` the top; a top radius of 0 makes a pointed cone. `angle`, * in degrees, cuts a wedge out of the full 360 degree round. * @param inputs - Base and top radius, height, base center, direction and an optional partial angle * @returns A new solid * @group primitives * @shortname cone * @drawable true * @example * ```typescript * const cone = await bitbybit.occt.shapes.solid.createCone({ radius1: 5, radius2: 0, height: 10, center: [0, 0, 0], direction: [0, 1, 0], angle: 360 }); * ``` */ createCone(inputs: Inputs.OCCT.ConeDto): Promise; /** * Creates a torus solid, a ring with a round cross-section, centered on `center` with its axis * along `direction`. * * `majorRadius` is the distance from the center to the middle of the tube and `minorRadius` the * tube's own radius. `angle`, in degrees, makes a partial ring instead of the full 360 degrees. * @param inputs - Major and minor radius, center, direction and an optional partial angle * @returns A new solid * @group primitives * @shortname torus * @drawable true * @example * ```typescript * const ring = await bitbybit.occt.shapes.solid.createTorus({ majorRadius: 10, minorRadius: 2, center: [0, 0, 0], direction: [0, 1, 0], angle: 360 }); * ``` */ createTorus(inputs: Inputs.OCCT.TorusDto): Promise; /** * Creates a star-shaped solid by extruding a flat star profile forward and backward along its * own normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. The star itself is built as * `shapes.wire.createStarWire` builds it. * @param inputs - The star profile and the two extrusion lengths * @returns A new solid * @group primitives * @shortname star * @drawable true * @example * ```typescript * const star = await bitbybit.occt.shapes.solid.createStarSolid({ * numRays: 5, * outerRadius: 10, * innerRadius: 5, * half: false, * center: [0, 0, 0], * direction: [0, 1, 0], * extrusionLengthFront: 2, * extrusionLengthBack: 0, * }); * ``` */ createStarSolid(inputs: Inputs.OCCT.StarSolidDto): Promise; /** * Creates a solid with a regular polygon cross-section by extruding a flat n-gon profile * forward and backward along its own normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. * @param inputs - The polygon profile and the two extrusion lengths * @returns A new solid * @group primitives * @shortname n-gon * @drawable true * @example * ```typescript * const hexPrism = await bitbybit.occt.shapes.solid.createNGonSolid({ * nrCorners: 6, * radius: 5, * center: [0, 0, 0], * direction: [0, 1, 0], * extrusionLengthFront: 10, * extrusionLengthBack: 0, * }); * ``` */ createNGonSolid(inputs: Inputs.OCCT.NGonSolidDto): Promise; /** * Creates a solid with a parallelogram cross-section by extruding a flat parallelogram profile * forward and backward along its own normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. * @param inputs - The parallelogram profile and the two extrusion lengths * @returns A new solid * @group primitives * @shortname parallelogram * @drawable true * @example * ```typescript * const slab = await bitbybit.occt.shapes.solid.createParallelogramSolid({ * width: 10, * height: 5, * angle: 15, * center: [0, 0, 0], * direction: [0, 1, 0], * aroundCenter: true, * extrusionLengthFront: 2, * extrusionLengthBack: 0, * }); * ``` */ createParallelogramSolid(inputs: Inputs.OCCT.ParallelogramSolidDto): Promise; /** * Creates a heart-shaped solid by extruding a flat heart profile forward and backward along its * own normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. * @param inputs - The heart profile and the two extrusion lengths * @returns A new solid * @group primitives * @shortname heart * @drawable true * @example * ```typescript * const heart = await bitbybit.occt.shapes.solid.createHeartSolid({ * sizeApprox: 10, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * extrusionLengthFront: 2, * extrusionLengthBack: 0, * }); * ``` */ createHeartSolid(inputs: Inputs.OCCT.HeartSolidDto): Promise; /** * Creates a Christmas tree-shaped solid by extruding a flat tree profile forward and backward * along its own normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. * @param inputs - The tree profile and the two extrusion lengths * @returns A new solid * @group primitives * @shortname christmas tree * @drawable true * @example * ```typescript * const tree = await bitbybit.occt.shapes.solid.createChristmasTreeSolid({ * height: 10, * innerDist: 1.5, * outerDist: 3, * nrSkirts: 5, * trunkHeight: 1, * trunkWidth: 1, * half: false, * rotation: 0, * origin: [0, 0, 0], * direction: [0, 1, 0], * extrusionLengthFront: 2, * extrusionLengthBack: 0, * }); * ``` */ createChristmasTreeSolid(inputs: Inputs.OCCT.ChristmasTreeSolidDto): Promise; /** * Creates an L-shaped solid by extruding a flat L profile forward and backward along its own * normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. * @param inputs - The L profile and the two extrusion lengths * @returns A new solid * @group primitives * @shortname L-polygon * @drawable true * @example * ```typescript * const bracket = await bitbybit.occt.shapes.solid.createLPolygonSolid({ * widthFirst: 10, * lengthFirst: 20, * widthSecond: 10, * lengthSecond: 15, * align: Bit.Inputs.OCCT.directionEnum.outside, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * extrusionLengthFront: 2, * extrusionLengthBack: 0, * }); * ``` */ createLPolygonSolid(inputs: Inputs.OCCT.LPolygonSolidDto): Promise; /** * Creates an I-beam by extruding its flat profile forward and backward along its own normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. * @param inputs - The I-beam profile and the two extrusion lengths * @returns A new solid * @group beam * @shortname I-beam profile * @drawable true * @example * ```typescript * const beam = await bitbybit.occt.shapes.solid.createIBeamProfileSolid({ * width: 10, * height: 20, * flangeThickness: 1, * webThickness: 1, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 0, 1], * extrusionLengthFront: 100, * extrusionLengthBack: 0, * }); * ``` */ createIBeamProfileSolid(inputs: Inputs.OCCT.IBeamProfileSolidDto): Promise; /** * Creates an H-beam by extruding its flat profile forward and backward along its own normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. * @param inputs - The H-beam profile and the two extrusion lengths * @returns A new solid * @group beam * @shortname H-beam profile * @drawable true * @example * ```typescript * const beam = await bitbybit.occt.shapes.solid.createHBeamProfileSolid({ * width: 20, * height: 20, * flangeThickness: 1, * webThickness: 1, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 0, 1], * extrusionLengthFront: 100, * extrusionLengthBack: 0, * }); * ``` */ createHBeamProfileSolid(inputs: Inputs.OCCT.HBeamProfileSolidDto): Promise; /** * Creates a T-beam by extruding its flat profile forward and backward along its own normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. * @param inputs - The T-beam profile and the two extrusion lengths * @returns A new solid * @group beam * @shortname T-beam profile * @drawable true * @example * ```typescript * const beam = await bitbybit.occt.shapes.solid.createTBeamProfileSolid({ * width: 10, * height: 20, * flangeThickness: 1, * webThickness: 1, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 0, 1], * extrusionLengthFront: 100, * extrusionLengthBack: 0, * }); * ``` */ createTBeamProfileSolid(inputs: Inputs.OCCT.TBeamProfileSolidDto): Promise; /** * Creates a U-beam by extruding its flat profile forward and backward along its own normal. * * `extrusionLengthFront` and `extrusionLengthBack` say how far it grows each way, in model * units; at least one must be above 0 or an error is thrown. * @param inputs - The U-beam profile and the two extrusion lengths * @returns A new solid * @group beam * @shortname U-beam profile * @drawable true * @example * ```typescript * const beam = await bitbybit.occt.shapes.solid.createUBeamProfileSolid({ * width: 10, * height: 20, * flangeThickness: 1, * webThickness: 1, * flangeWidth: 3, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 0, 1], * extrusionLengthFront: 100, * extrusionLengthBack: 0, * }); * ``` */ createUBeamProfileSolid(inputs: Inputs.OCCT.UBeamProfileSolidDto): Promise; /** * Measures the total area of all the faces of a solid. * @param inputs - The solid * @returns The surface area in square model units * @group get * @shortname area * @drawable false * @example * ```typescript * const area = await bitbybit.occt.shapes.solid.getSolidSurfaceArea({ shape: box }); * ``` */ getSolidSurfaceArea(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Measures the volume a solid encloses, in cubic model units. * @param inputs - The solid * @returns The volume in cubic model units * @group get * @shortname volume * @drawable false * @example * ```typescript * const volume = await bitbybit.occt.shapes.solid.getSolidVolume({ shape: box }); * ``` */ getSolidVolume(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Measures the volume of each solid in a list. * @param inputs - The solids * @returns One volume per solid, in the same order * @group get * @shortname volumes * @drawable false * @example * ```typescript * const volumes = await bitbybit.occt.shapes.solid.getSolidsVolumes({ shapes: [box, sphere] }); * ``` */ getSolidsVolumes(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Finds the center of mass of a solid, treating it as filled with material of uniform density. * @param inputs - The solid * @returns The center of mass point * @group get * @shortname center of mass * @drawable true * @example * ```typescript * const center = await bitbybit.occt.shapes.solid.getSolidCenterOfMass({ shape: box }); * ``` */ getSolidCenterOfMass(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the center of mass of each solid in a list, treating each as filled with material of * uniform density. * @param inputs - The solids * @returns One point per solid, in the same order * @group get * @shortname centers of mass * @drawable true * @example * ```typescript * const centers = await bitbybit.occt.shapes.solid.getSolidsCentersOfMass({ shapes: [box, sphere] }); * ``` */ getSolidsCentersOfMass(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Lists the solids inside any shape, such as the bodies of a compound or the result of a * boolean. * * A shape that is itself a solid gives a list with that one solid. * @param inputs - The shape to take the solids from * @returns The solids found in the shape * @group get * @shortname solids * @drawable true * @example * ```typescript * const solids = await bitbybit.occt.shapes.solid.getSolids({ shape: compound }); * ``` */ getSolids(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Keeps the points that lie inside, on the surface of, or outside a solid, as chosen by the * `keepIn`, `keepOn` and `keepOut` flags. * * A point counts as on the surface when it is within `tolerance` of it. Points the kernel * cannot classify are kept only with `keepUnknown`. * @param inputs - The solid, the points, the tolerance and which classes of point to keep * @returns The points that passed the filter, in their original order * @group filter * @shortname filter solid points * @drawable true * @example * ```typescript * const inside = await bitbybit.occt.shapes.solid.filterSolidPoints({ * shape: box, * points: [[0, 0, 0], [100, 0, 0]], * tolerance: 1e-7, * keepIn: true, * keepOn: false, * keepOut: false, * keepUnknown: false, * }); * ``` */ filterSolidPoints(inputs: Inputs.OCCT.FilterSolidPointsDto): Promise; } /** * Vertices in OpenCascade: the kernel's own form of a point, the corner where edges meet. Plain * `[x, y, z]` points are what the rest of the library works with, so the methods here mostly * convert between the two: make vertices from points, read points back out of vertices, list the * vertices of any shape, and project points onto a shape. */ declare class OCCTVertex { private readonly occWorkerManager; /** * Makes a vertex from x, y and z values. * @param inputs - The three coordinates * @returns The vertex * @group from * @shortname vertex from xyz * @drawable true * @example * ```typescript * const vertex = await bitbybit.occt.shapes.vertex.vertexFromXYZ({ x: 1, y: 2, z: 3 }); * ``` */ vertexFromXYZ(inputs: Inputs.OCCT.XYZDto): Promise; /** * Makes a vertex, the kernel's own point, from a plain `[x, y, z]` point. * @param inputs - The point as `[x, y, z]` * @returns The vertex * @group from * @shortname vertex from point * @drawable true * @example * ```typescript * const vertex = await bitbybit.occt.shapes.vertex.vertexFromPoint({ point: [1, 2, 3] }); * ``` */ vertexFromPoint(inputs: Inputs.OCCT.PointDto): Promise; /** * Makes one vertex, the kernel's own point, for each plain `[x, y, z]` point. * @param inputs - The points * @returns One vertex per point, in the same order * @group from * @shortname vertices from points * @drawable true * @example * ```typescript * const vertices = await bitbybit.occt.shapes.vertex.verticesFromPoints({ points: [[0, 0, 0], [1, 0, 0]] }); * ``` */ verticesFromPoints(inputs: Inputs.OCCT.PointsDto): Promise; /** * Makes one vertex per point and bundles them into a single compound, so a whole point cloud * can be drawn or transformed as one shape. * @param inputs - The points * @returns A compound holding one vertex per point * @group from * @shortname compound vertices from points * @drawable true * @example * ```typescript * const cloud = await bitbybit.occt.shapes.vertex.verticesCompoundFromPoints({ points: [[0, 0, 0], [1, 0, 0], [0, 1, 0]] }); * ``` */ verticesCompoundFromPoints(inputs: Inputs.OCCT.PointsDto): Promise; /** * Lists every vertex of a shape as the kernel walks it. * * A vertex is repeated for every face and edge that use it, so a box lists 48 vertices rather * than its 8 corners; use `getVerticesAsPoints` with `point.removeAllDuplicateVectors` for * unique corners. * @param inputs - The shape * @returns The vertices found in the shape * @group get * @shortname get vertices from shape * @drawable true * @example * ```typescript * const corners = await bitbybit.occt.shapes.vertex.getVertices({ shape: box }); * ``` */ getVertices(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Lists every vertex of a shape as a plain `[x, y, z]` point, as the kernel walks it. * * A vertex is repeated for every face and edge that use it, so a box lists 48 points rather * than its 8 corners; `point.removeAllDuplicateVectors` reduces them to the unique ones. * @param inputs - The shape * @returns The points of the vertices * @group get * @shortname get vertices as points * @drawable true * @example * ```typescript * const corners = await bitbybit.occt.shapes.vertex.getVerticesAsPoints({ shape: box }); * ``` */ getVerticesAsPoints(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the coordinates of each vertex as a plain `[x, y, z]` point. * @param inputs - The vertices * @returns One point per vertex, in the same order * @group transform * @shortname vertices to points * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.vertex.verticesToPoints({ shapes: vertices }); * ``` */ verticesToPoints(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Reads the coordinates of a vertex as a plain `[x, y, z]` point. * @param inputs - The vertex * @returns The point * @group transform * @shortname vertex to point * @drawable true * @example * ```typescript * const point = await bitbybit.occt.shapes.vertex.vertexToPoint({ shape: vertex }); * ``` */ vertexToPoint(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Projects points onto a shape along a direction and gives the points where they land. * * Each point travels along `direction` for exactly that vector's length, so it must be long * enough to reach the shape. Where the path crosses the shape more than once, `projectionType` * keeps the closest hit, the furthest, both or all; a path that misses gives nothing. * @param inputs - The points, the shape, the direction with its length, and which hits to keep * @returns The projected points * @group place * @shortname project points * @drawable true * @example * ```typescript * const onGround = await bitbybit.occt.shapes.vertex.projectPoints({ * points: [[0, 10, 0], [1, 10, 0]], * shape: terrain, * direction: [0, -20, 0], * projectionType: Bit.Inputs.OCCT.pointProjectionTypeEnum.closest, * }); * ``` */ projectPoints(inputs: Inputs.OCCT.ProjectPointsOnShapeDto): Promise; } /** * Wires in OpenCascade: chains of edges joined end to end, open like a path or closed like an * outline. Build them from points and curves (polylines, B-splines, Beziers, interpolations, * helices, spirals), as ready-made flat outlines (circles, rectangles, stars, beam profiles, text) * that lie on the ground plane unless `direction` says otherwise, or by joining and splitting * existing edges and wires; read them back as points, tangents, lengths and centers; map them onto * faces or project them onto shapes. Parameters along a wire run from 0 at its start to 1 at its * end and follow each edge's own parameter, not distance. A closed wire is what `shapes.face` fills * to make a face. */ declare class OCCTWire { private readonly occWorkerManager; /** * Rebuilds every edge of a wire as a B-spline of a given degree, within a tolerance, and joins * the results back into a wire. * * Lowering the degree simplifies the curves, raising it gives later operations more freedom; * either way each new curve stays within `tolerance` of the old. * @param inputs - The wire, the degree to rebuild to and the tolerance * @returns A new wire with the rebuilt edges * @group rebuild * @shortname rebuild wire degree * @drawable true * @example * ```typescript * const simpler = await bitbybit.occt.shapes.wire.rebuildWireDegree({ shape: wire, degree: 3, tolerance: 1e-3 }); * ``` */ rebuildWireDegree(inputs: Inputs.OCCT.RebuildCurveDegreeDto): Promise; /** * Moves the seam of a closed periodic wire, the point where it starts and ends, to a given * parameter along its curve. * * The geometry does not change; only where the wire is considered to begin. Meant for * single-edge wires such as circles: each periodic edge is moved, edges that are not periodic * stay as they are. * @param inputs - The periodic wire and the parameter of the new seam * @returns A new wire starting at the seam * @group seam * @shortname move wire seam by param * @drawable true * @example * ```typescript * const rotated = await bitbybit.occt.shapes.wire.moveWireSeamByParameter({ shape: circle, parameter: 1.57 }); * ``` */ moveWireSeamByParameter(inputs: Inputs.OCCT.CurveSeamByParameterDto): Promise; /** * Moves the seam of a closed periodic wire, the point where it starts and ends, by a distance * along the curve from its current start. * * The geometry does not change; only where the wire is considered to begin. Meant for * single-edge wires such as circles: each periodic edge is moved, edges that are not periodic * stay as they are. * @param inputs - The periodic wire and the distance to move the seam * @returns A new wire starting at the seam * @group seam * @shortname move wire seam by length * @drawable true * @example * ```typescript * const rotated = await bitbybit.occt.shapes.wire.moveWireSeamByLength({ shape: circle, length: 2.5 }); * ``` */ moveWireSeamByLength(inputs: Inputs.OCCT.CurveSeamByLengthDto): Promise; /** * Collects diagnostic facts about a wire: how many edges it has, whether it is closed, its * total length and, for every edge, the curve report `shapes.edge.debugInfo` gives. * * An empty or null wire gives a report marked invalid with zero counts. * @param inputs - The wire to inspect * @returns The report with the edge count, the closed flag, the length and one entry per edge * @group debug * @shortname wire debug info * @drawable false * @example * ```typescript * const info = await bitbybit.occt.shapes.wire.debugInfo({ shape: wire }); * console.log(info.nbEdges, info.closed, info.totalLength); * ``` */ debugInfo(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Makes a straight single-edge wire from a line object of the form `{ start, end }`. * @param inputs - The line * @returns The straight wire * @group from base * @shortname wire from base line * @drawable true * @example * ```typescript * const wire = await bitbybit.occt.shapes.wire.fromBaseLine({ line: { start: [0, 0, 0], end: [10, 0, 0] } }); * ``` */ fromBaseLine(inputs: Inputs.OCCT.LineBaseDto): Promise; /** * Makes one straight single-edge wire per line object of the form `{ start, end }`. * @param inputs - The lines * @returns One wire per line, in the same order * @group from base * @shortname wires from base lines * @drawable true * @example * ```typescript * const wires = await bitbybit.occt.shapes.wire.fromBaseLines({ lines: [{ start: [0, 0, 0], end: [10, 0, 0] }, { start: [10, 0, 0], end: [10, 10, 0] }] }); * ``` */ fromBaseLines(inputs: Inputs.OCCT.LinesBaseDto): Promise; /** * Makes a straight single-edge wire from a segment, a pair of points `[start, end]`. * @param inputs - The segment * @returns The straight wire * @group from base * @shortname wire from base segment * @drawable true * @example * ```typescript * const wire = await bitbybit.occt.shapes.wire.fromBaseSegment({ segment: [[0, 0, 0], [10, 0, 0]] }); * ``` */ fromBaseSegment(inputs: Inputs.OCCT.SegmentBaseDto): Promise; /** * Makes one straight single-edge wire per segment, each a pair of points `[start, end]`. * @param inputs - The segments * @returns One wire per segment, in the same order * @group from base * @shortname wires from base segments * @drawable true * @example * ```typescript * const wires = await bitbybit.occt.shapes.wire.fromBaseSegments({ segments: [[[0, 0, 0], [10, 0, 0]], [[10, 0, 0], [10, 10, 0]]] }); * ``` */ fromBaseSegments(inputs: Inputs.OCCT.SegmentsBaseDto): Promise; /** * Joins a list of points in order with straight edges into one wire. * * Fewer than two points throw an error. When the last point repeats the first, the repeat is * dropped and the wire is closed back to the first point; otherwise the wire stays open. For a * closed outline without repeating a point use `createPolygonWire`. * @param inputs - The points, in order * @returns The wire through the points * @group from base * @shortname wire from points * @drawable true * @example * ```typescript * const path = await bitbybit.occt.shapes.wire.fromPoints({ points: [[0, 0, 0], [10, 0, 0], [10, 10, 0]] }); * const outline = await bitbybit.occt.shapes.wire.fromPoints({ points: [[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 0, 0]] }); * ``` */ fromPoints(inputs: Inputs.OCCT.PointsDto): Promise; /** * Makes a wire from a polyline object, one straight edge per segment; a polyline marked closed * also gets the edge from its last point back to its first. * @param inputs - The polyline * @returns The wire * @group from base * @shortname wire from polyline * @drawable true * @example * ```typescript * const outline = await bitbybit.occt.shapes.wire.fromBasePolyline({ polyline: { points: [[0, 0, 0], [10, 0, 0], [10, 0, 10]], isClosed: true } }); * ``` */ fromBasePolyline(inputs: Inputs.OCCT.PolylineBaseDto): Promise; /** * Makes a closed three-edge wire from a triangle given as three points. * @param inputs - The triangle * @returns The closed wire * @group from base * @shortname wire from triangle * @drawable true * @example * ```typescript * const outline = await bitbybit.occt.shapes.wire.fromBaseTriangle({ triangle: [[0, 0, 0], [10, 0, 0], [0, 0, 10]] }); * ``` */ fromBaseTriangle(inputs: Inputs.OCCT.TriangleBaseDto): Promise; /** * Makes one closed three-edge wire per triangle of a mesh. * * A triangle whose wire cannot be built is skipped with a warning rather than stopping the * rest. * @param inputs - The mesh as a list of triangles * @returns One wire per triangle that could be built * @group from base * @shortname wires from mesh * @drawable true * @example * ```typescript * const outlines = await bitbybit.occt.shapes.wire.fromBaseMesh({ mesh: triangles }); * ``` */ fromBaseMesh(inputs: Inputs.OCCT.MeshBaseDto): Promise; /** * Makes a closed wire of straight edges through a list of corner points, adding the edge from * the last point back to the first. * * The points need not lie in one plane; a flat face needs a planar outline though. * @param inputs - The corner points, in order * @returns The closed wire * @group via points * @shortname polygon * @drawable true * @example * ```typescript * const square = await bitbybit.occt.shapes.wire.createPolygonWire({ points: [[0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]] }); * ``` */ createPolygonWire(inputs: Inputs.OCCT.PolygonDto): Promise; /** * Makes one closed polygon wire per point list, as `createPolygonWire` does. * * With `returnCompound` true the wires are packed into one compound shape instead of a list. * @param inputs - The polygons and whether to pack them into a compound * @returns The wires in order, or one compound holding them * @group multiple * @shortname polygons * @drawable true * @example * ```typescript * const outlines = await bitbybit.occt.shapes.wire.createPolygons({ * polygons: [{ points: [[0, 0, 0], [5, 0, 0], [5, 0, 5]] }, { points: [[10, 0, 0], [15, 0, 0], [15, 0, 5]] }], * returnCompound: false, * }); * ``` */ createPolygons(inputs: Inputs.OCCT.PolygonsDto): Promise; /** * Makes a straight single-edge wire between two points. * @param inputs - The start and end points * @returns The straight wire * @group via points * @shortname line * @drawable true * @example * ```typescript * const line = await bitbybit.occt.shapes.wire.createLineWire({ start: [0, 0, 0], end: [10, 0, 0] }); * ``` */ createLineWire(inputs: Inputs.OCCT.LineDto): Promise; /** * Makes a straight single-edge wire between two points and lengthens it beyond each of them. * * `extensionStart` and `extensionEnd` are distances in model units added past the start and the * end along the line; the two points must differ or an error is thrown. * @param inputs - The start and end points and the two extension lengths * @returns The extended straight wire * @group via points * @shortname line with extensions * @drawable true * @example * ```typescript * const longer = await bitbybit.occt.shapes.wire.createLineWireWithExtensions({ start: [0, 0, 0], end: [10, 0, 0], extensionStart: 2, extensionEnd: 5 }); * ``` */ createLineWireWithExtensions(inputs: Inputs.OCCT.LineWithExtensionsDto): Promise; /** * Makes one straight single-edge wire per line definition. * * With `returnCompound` true the wires are packed into one compound shape instead of a list. * @param inputs - The lines and whether to pack them into a compound * @returns The wires in order, or one compound holding them * @group multiple * @shortname lines * @drawable true * @example * ```typescript * const lines = await bitbybit.occt.shapes.wire.createLines({ * lines: [{ start: [0, 0, 0], end: [10, 0, 0] }, { start: [0, 0, 5], end: [10, 0, 5] }], * returnCompound: false, * }); * ``` */ createLines(inputs: Inputs.OCCT.LinesDto): Promise; /** * Cuts a wire into pieces at the given points. * * Each point is moved to the closest place on the wire before cutting, so it need not lie * exactly on it; repeated points are ignored. The pieces come back in order along the wire, * from its start to its end. * @param inputs - The wire and the points to cut at * @returns The pieces of the wire, in order * @group extract * @shortname split on points * @drawable true * @example * ```typescript * const pieces = await bitbybit.occt.shapes.wire.splitOnPoints({ shape: wire, points: [[3, 0, 0], [7, 0, 0]] }); * ``` */ splitOnPoints(inputs: Inputs.OCCT.SplitWireOnPointsDto): Promise; /** * Turns every wire of a shape into a run of points that follows its curves closely enough to * draw it, one list per wire. * * The deflection settings say how tightly the points hug curved edges; where one edge ends and * the next begins the shared point appears once. * @param inputs - The shape and the deflection settings * @returns One list of points per wire * @group extract * @shortname wires to points * @drawable false * @example * ```typescript * const polylines = await bitbybit.occt.shapes.wire.wiresToPoints({ * shape: wire, * angularDeflection: 0.1, * curvatureDeflection: 0.1, * minimumOfPoints: 2, * uTolerance: 1e-9, * minimumLength: 1e-7, * }); * ``` */ wiresToPoints(inputs: Inputs.OCCT.WiresToPointsDto): Promise; /** * Makes an open wire of straight edges through a list of points, in order. * * The wire is not closed; `createPolygonWire` adds the edge back to the first point. * @param inputs - The points, in order * @returns The open wire * @group via points * @shortname polyline * @drawable true * @example * ```typescript * const path = await bitbybit.occt.shapes.wire.createPolylineWire({ points: [[0, 0, 0], [10, 0, 0], [10, 0, 10]] }); * ``` */ createPolylineWire(inputs: Inputs.OCCT.PolylineDto): Promise; /** * Draws a zig-zag line that bounces between two wires: both are divided into the same number of * points and a polyline visits them alternately. * * `nrZigZags` sets the number of bounces; `inverse` starts on the second wire; * `divideByEqualDistance` spaces the points by length rather than by parameter; with * `zigZagsPerEdge` true each edge gets its own zig-zag, so edge counts must match. * @param inputs - The two wires, the number of zig-zags and the spacing options * @returns The zig-zag wire * @group via wires * @shortname zig zag between two wires * @drawable true * @example * ```typescript * const zigzag = await bitbybit.occt.shapes.wire.createZigZagBetweenTwoWires({ wire1: lower, wire2: upper, nrZigZags: 20, inverse: false, divideByEqualDistance: true, zigZagsPerEdge: false }); * ``` */ createZigZagBetweenTwoWires(inputs: Inputs.OCCT.ZigZagBetweenTwoWiresDto): Promise; /** * Connects the start points of several wires or edges into one new wire and their end points * into another. * * `wireType` makes them polylines or smooth interpolated curves, `closed` joins the last point * back to the first, and `tolerance` is used for the interpolation. Fewer than two shapes throw * an error. * @param inputs - The wires or edges, the kind of wire to build, whether to close it and the tolerance * @returns Two wires: one through the start points, one through the end points * @group via wires * @shortname wires between start end points * @drawable true * @example * ```typescript * const [starts, ends] = await bitbybit.occt.shapes.wire.createWiresBetweenStartEndPointsOfWiresAndEdges({ * shapes: [wireA, wireB, wireC], * wireType: Bit.Inputs.OCCT.wireFromPointsTypeEnum.interpolated, * closed: false, * tolerance: 1e-7, * }); * ``` */ createWiresBetweenStartEndPointsOfWiresAndEdges(inputs: Inputs.OCCT.WiresBetweenStartEndPointsOfWiresAndEdgesDto): Promise; /** * Divides several wires or edges into the same number of points and connects the points at each * position into a new wire, like the rungs of a ladder. * * `nrOfDivisions` steps give one rung more than that; `divideByEqualDistance` spaces the points * by length rather than by parameter; `wireType` makes the rungs polylines or smooth curves, * `closed` joins each into a loop. * @param inputs - The wires or edges, the number of divisions, the spacing, the kind of wire to build, whether to close it and the tolerance * @returns One wire per division point, in order along the shapes * @group via wires * @shortname wires between subdivided points * @drawable true * @example * ```typescript * const rungs = await bitbybit.occt.shapes.wire.createWiresBetweenSubdividedPointsOfWiresAndEdges({ * shapes: [rail1, rail2], * nrOfDivisions: 10, * divideByEqualDistance: true, * wireType: Bit.Inputs.OCCT.wireFromPointsTypeEnum.polyline, * closed: false, * tolerance: 1e-7, * }); * ``` */ createWiresBetweenSubdividedPointsOfWiresAndEdges(inputs: Inputs.OCCT.WiresBetweenSubdividedPointsOfWiresAndEdgesDto): Promise; /** * Draws a closed outline around two circles that lie in one plane, joining them with tangent * lines: a belt or a capsule shape. * * `keepLines` picks the outer tangent lines (the belt) or the crossing inner ones; * `circleRemainders` picks which arc of each circle stays in the outline. Each circle wire must * consist of a single edge. * @param inputs - The two circle wires, which tangent lines and arcs to keep, and the tolerance * @returns The closed outline wire * @group via wires * @shortname tangent wire from two circles * @drawable true * @example * ```typescript * const belt = await bitbybit.occt.shapes.wire.createWireFromTwoCirclesTan({ * circle1, * circle2, * keepLines: Bit.Inputs.OCCT.twoSidesStrictEnum.outside, * circleRemainders: Bit.Inputs.OCCT.fourSidesStrictEnum.outside, * tolerance: 1e-7, * }); * ``` */ createWireFromTwoCirclesTan(inputs: Inputs.OCCT.WireFromTwoCirclesTanDto): Promise; /** * Makes one open polyline wire per point list, as `createPolylineWire` does. * * With `returnCompound` true the wires are packed into one compound shape instead of a list. * @param inputs - The polylines and whether to pack them into a compound * @returns The wires in order, or one compound holding them * @group multiple * @shortname polylines * @drawable true * @example * ```typescript * const paths = await bitbybit.occt.shapes.wire.createPolylines({ * polylines: [{ points: [[0, 0, 0], [5, 0, 0], [5, 0, 5]] }, { points: [[10, 0, 0], [15, 0, 0]] }], * returnCompound: false, * }); * ``` */ createPolylines(inputs: Inputs.OCCT.PolylinesDto): Promise; /** * Makes a smooth Bezier wire steered by control points: it starts at the first point, ends at * the last and is pulled toward the ones between without passing through them. * * `closed` appends the first point again so the ends meet; `periodic` instead builds a closed * curve that is smooth across the seam. `degree` caps how many neighbors shape each part. * @param inputs - The control points and the closing and degree options * @returns The Bezier wire * @group via points * @shortname bezier * @drawable true * @example * ```typescript * const curve = await bitbybit.occt.shapes.wire.createBezier({ points: [[0, 0, 0], [5, 0, 10], [10, 0, -10], [15, 0, 0]], closed: false, periodic: false }); * ``` */ createBezier(inputs: Inputs.OCCT.BezierDto): Promise; /** * Makes a Bezier wire like `createBezier`, with a weight per control point that says how * strongly it pulls the curve. * * A weight above 1 draws the curve toward its point, below 1 lets it go. The weights must match * the points: the same count, or one more when `closed` is true and `periodic` false, as the * first point repeats. * @param inputs - The control points, their weights and the closing and degree options * @returns The weighted Bezier wire * @group via points * @shortname bezier weights * @drawable true * @example * ```typescript * const curve = await bitbybit.occt.shapes.wire.createBezierWeights({ * points: [[0, 0, 0], [5, 0, 10], [10, 0, 0]], * weights: [1, 3, 1], * closed: false, * periodic: false, * }); * ``` */ createBezierWeights(inputs: Inputs.OCCT.BezierWeightsDto): Promise; /** * Makes one Bezier wire per definition, as `createBezier` does. * * With `returnCompound` true the wires are packed into one compound shape instead of a list. * @param inputs - The Bezier definitions and whether to pack them into a compound * @returns The wires in order, or one compound holding them * @group multiple * @shortname bezier wires * @drawable true * @example * ```typescript * const curves = await bitbybit.occt.shapes.wire.createBezierWires({ * bezierWires: [{ points: [[0, 0, 0], [5, 0, 10], [10, 0, 0]], closed: false }, { points: [[0, 0, 5], [5, 0, 15], [10, 0, 5]], closed: false }], * returnCompound: false, * }); * ``` */ createBezierWires(inputs: Inputs.OCCT.BezierWiresDto): Promise; /** * Makes a smooth B-spline wire that passes through every point in order. * * `periodic` closes the curve so it is smooth across the seam, which gives nicely shaped loops. * `parametrization` controls the spacing between points: `centripetal` resists cusps and * overshoot when the points are uneven. `startTangent` and `endTangent`, or one `tangents` * entry per point, force the curve's direction there. * @param inputs - The points, whether to close the curve, the tolerance, the parametrization and optional tangents * @returns The B-spline wire through the points * @group via points * @shortname interpolate * @drawable true * @example * ```typescript * const loop = await bitbybit.occt.shapes.wire.interpolatePoints({ * points: [[0, 0, 0], [10, 0, 5], [10, 0, 15], [0, 0, 10]], * periodic: true, * tolerance: 1e-7, * parametrization: Bit.Inputs.OCCT.bSplineParametrizationEnum.centripetal, * }); * ``` */ interpolatePoints(inputs: Inputs.OCCT.InterpolationDto): Promise; /** * Makes a closed, smooth B-spline wire through the points whose shape is mirror-symmetric * whenever the points are, with no odd-looking start or end point. * * A plain periodic `interpolatePoints` can look skewed at its seam for symmetric inputs such as * a square or a triangle; this variant does not. It fails with an error if the points cannot be * interpolated. * @param inputs - The points and the tolerance * @returns The closed symmetric B-spline wire * @group via points * @shortname interpolate symmetric * @drawable true * @example * ```typescript * const rounded = await bitbybit.occt.shapes.wire.interpolatePointsSymmetric({ points: [[0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]], tolerance: 1e-7 }); * ``` */ interpolatePointsSymmetric(inputs: Inputs.OCCT.InterpolateSymmetricDto): Promise; /** * Makes one interpolated B-spline wire per definition, as `interpolatePoints` does. * * With `returnCompound` true the wires are packed into one compound shape instead of a list. * @param inputs - The interpolation definitions and whether to pack them into a compound * @returns The wires in order, or one compound holding them * @group multiple * @shortname interpolate wires * @drawable true * @example * ```typescript * const curves = await bitbybit.occt.shapes.wire.interpolateWires({ * interpolations: [{ points: [[0, 0, 0], [5, 0, 5], [10, 0, 0]], periodic: false, tolerance: 1e-7 }, { points: [[0, 0, 5], [5, 0, 10], [10, 0, 5]], periodic: false, tolerance: 1e-7 }], * returnCompound: false, * }); * ``` */ interpolateWires(inputs: Inputs.OCCT.InterpolateWiresDto): Promise; /** * Makes a smooth B-spline wire that approximates a list of points: it follows them closely but * need not pass through each one exactly. * * `closed` appends the first point again so the ends meet. The fit uses a degree between 3 and * 8 and a tolerance of 0.001 model units; use `interpolatePoints` when the curve must go * through the points. * @param inputs - The points and whether to close the curve * @returns The B-spline wire * @group via points * @shortname bspline * @drawable true * @example * ```typescript * const curve = await bitbybit.occt.shapes.wire.createBSpline({ points: [[0, 0, 0], [5, 0, 5], [10, 0, 0], [15, 0, 5]], closed: false }); * ``` */ createBSpline(inputs: Inputs.OCCT.BSplineDto): Promise; /** * Makes one approximating B-spline wire per definition, as `createBSpline` does. * * With `returnCompound` true the wires are packed into one compound shape instead of a list. * @param inputs - The B-spline definitions and whether to pack them into a compound * @returns The wires in order, or one compound holding them * @group multiple * @shortname bsplines * @drawable true * @example * ```typescript * const curves = await bitbybit.occt.shapes.wire.createBSplines({ * bSplines: [{ points: [[0, 0, 0], [5, 0, 5], [10, 0, 0]], closed: false }, { points: [[0, 0, 5], [5, 0, 10], [10, 0, 5]], closed: false }], * returnCompound: false, * }); * ``` */ createBSplines(inputs: Inputs.OCCT.BSplinesDto): Promise; /** * Joins edges and wires that touch end to end into one wire. * * The pieces must connect; a set with a gap or a stray piece throws an error. Shapes of other * kinds in the list are ignored. * @param inputs - The edges and wires to join * @returns The joined wire * @group build * @shortname combine * @drawable true * @example * ```typescript * const outline = await bitbybit.occt.shapes.wire.combineEdgesAndWiresIntoAWire({ shapes: [arc, line1, line2] }); * ``` */ combineEdgesAndWiresIntoAWire(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Wraps a single edge into a wire, so it can go where a wire is expected. * @param inputs - The edge * @returns The wire holding that edge * @group build * @shortname wire from edge * @drawable true * @example * ```typescript * const wire = await bitbybit.occt.shapes.wire.createWireFromEdge({ shape: edge }); * ``` */ createWireFromEdge(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Extends a wire with more edges and wires that touch it end to end. * * The pieces must connect to the wire or to each other; a gap throws an error. Shapes of other * kinds in the list are ignored. * @param inputs - The wire to extend and the edges and wires to add * @returns The extended wire * @group build * @shortname extend * @drawable true * @example * ```typescript * const longer = await bitbybit.occt.shapes.wire.addEdgesAndWiresToWire({ shape: wire, shapes: [nextEdge, nextWire] }); * ``` */ addEdgesAndWiresToWire(inputs: Inputs.OCCT.ShapeShapesDto): Promise; /** * Places points along a wire at equal steps of its parameter, from start to end. * * `nrOfDivisions` steps give one more point than that; `removeStartPoint` and `removeEndPoint` * drop the ends. The parameter follows each edge's own curve parameter, so equal steps are not * equal distances; use `divideWireByEqualDistanceToPoints` for those. * @param inputs - The wire, the number of divisions and whether to drop the end points * @returns The points along the wire, in order * @group extract * @shortname points by params * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.wire.divideWireByParamsToPoints({ shape: wire, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false }); * ``` */ divideWireByParamsToPoints(inputs: Inputs.OCCT.DivideDto): Promise; /** * Runs `divideWireByParamsToPoints` on several wires with the same settings. * @param inputs - The wires, the number of divisions and whether to drop the end points * @returns One list of points per wire, in the same order * @group extract from wires * @shortname points by params * @drawable true * @example * ```typescript * const lists = await bitbybit.occt.shapes.wire.divideWiresByParamsToPoints({ shapes: wires, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false }); * ``` */ divideWiresByParamsToPoints(inputs: Inputs.OCCT.DivideShapesDto): Promise; /** * Places points along a wire at equal distances measured along its curves, from start to end. * * `nrOfDivisions` steps give one more point than that; `removeStartPoint` and `removeEndPoint` * drop the ends. * @param inputs - The wire, the number of divisions and whether to drop the end points * @returns The points along the wire, in order * @group extract * @shortname points by distance * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.wire.divideWireByEqualDistanceToPoints({ shape: wire, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false }); * ``` */ divideWireByEqualDistanceToPoints(inputs: Inputs.OCCT.DivideDto): Promise; /** * Runs `divideWireByEqualDistanceToPoints` on several wires with the same settings. * @param inputs - The wires, the number of divisions and whether to drop the end points * @returns One list of points per wire, in the same order * @group extract from wires * @shortname points by distance * @drawable true * @example * ```typescript * const lists = await bitbybit.occt.shapes.wire.divideWiresByEqualDistanceToPoints({ shapes: wires, nrOfDivisions: 10, removeStartPoint: false, removeEndPoint: false }); * ``` */ divideWiresByEqualDistanceToPoints(inputs: Inputs.OCCT.DivideShapesDto): Promise; /** * Finds the point a fraction of the way along a wire: 0 is the start, 1 the end. * * The fraction follows the parameters of the edges, not distance, so 0.5 is not always the * middle by length; use `pointOnWireAtLength` for a distance. * @param inputs - The wire and the fraction from 0 to 1 * @returns The point on the wire * @group extract * @shortname point at param * @drawable true * @example * ```typescript * const point = await bitbybit.occt.shapes.wire.pointOnWireAtParam({ shape: wire, param: 0.25 }); * ``` */ pointOnWireAtParam(inputs: Inputs.OCCT.DataOnGeometryAtParamDto): Promise; /** * Finds the point a given distance along a wire from its start, measured along its curves in * model units. * @param inputs - The wire and the distance from its start * @returns The point on the wire * @group extract * @shortname point at length * @drawable true * @example * ```typescript * const point = await bitbybit.occt.shapes.wire.pointOnWireAtLength({ shape: wire, length: 2.5 }); * ``` */ pointOnWireAtLength(inputs: Inputs.OCCT.DataOnGeometryAtLengthDto): Promise; /** * Finds the points at several distances along a wire from its start, measured along its curves * in model units. * @param inputs - The wire and the distances from its start * @returns One point per distance, in the same order * @group extract * @shortname points at lengths * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.wire.pointsOnWireAtLengths({ shape: wire, lengths: [1, 2.5, 4] }); * ``` */ pointsOnWireAtLengths(inputs: Inputs.OCCT.DataOnGeometryAtLengthsDto): Promise; /** * Places points along a wire every `length` model units from its start, as many as fit. * * `includeFirst` keeps the point at the start, `includeLast` appends the end point whatever the * spacing, and `tryNext` asks for one more point a step beyond the last one that fit. * @param inputs - The wire, the spacing and which end points to include * @returns The points along the wire, in order * @group extract * @shortname points at equal length * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.wire.pointsOnWireAtEqualLength({ shape: wire, length: 2, tryNext: false, includeFirst: true, includeLast: false }); * ``` */ pointsOnWireAtEqualLength(inputs: Inputs.OCCT.PointsOnWireAtEqualLengthDto): Promise; /** * Places points along a wire at a repeating pattern of gaps, such as 1, 3, 1, 3, until the wire * runs out. * * `lengths` is the pattern of gaps in model units, repeated from the start; `includeFirst` * keeps the start point, `includeLast` appends the end point, and `tryNext` asks for one more * point at the next gap past the last. * @param inputs - The wire, the pattern of gaps and which end points to include * @returns The points along the wire, in order * @group extract * @shortname points at pattern of lengths * @drawable true * @example * ```typescript * const points = await bitbybit.occt.shapes.wire.pointsOnWireAtPatternOfLengths({ shape: wire, lengths: [1, 3], tryNext: false, includeFirst: true, includeLast: false }); * ``` */ pointsOnWireAtPatternOfLengths(inputs: Inputs.OCCT.PointsOnWireAtPatternOfLengthsDto): Promise; /** * Finds the direction the wire is heading at a fraction of the way along it, from 0 at the * start to 1 at the end. * * The fraction follows the parameters of the edges, not distance. * @param inputs - The wire and the fraction from 0 to 1 * @returns The tangent direction * @group extract * @shortname tangent at param * @drawable true * @example * ```typescript * const tangent = await bitbybit.occt.shapes.wire.tangentOnWireAtParam({ shape: wire, param: 0.5 }); * ``` */ tangentOnWireAtParam(inputs: Inputs.OCCT.DataOnGeometryAtParamDto): Promise; /** * Finds the direction the wire is heading at a given distance from its start, measured along * its curves in model units. * @param inputs - The wire and the distance from its start * @returns The tangent direction * @group extract * @shortname tangent at length * @drawable true * @example * ```typescript * const tangent = await bitbybit.occt.shapes.wire.tangentOnWireAtLength({ shape: wire, length: 2.5 }); * ``` */ tangentOnWireAtLength(inputs: Inputs.OCCT.DataOnGeometryAtLengthDto): Promise; /** * Computes the first, second and third derivatives of a wire's curve at a given distance from * its start. * * The first derivative is the tangent with its speed, the second tells how the curve bends, the * third how that bending changes; all are with respect to the curve's parameter. The distance * is measured along the curves in model units. * @param inputs - The wire and the distance from its start * @returns The three derivative vectors, first to third * @group extract * @shortname derivatives at length * @drawable false * @example * ```typescript * const [first, second, third] = await bitbybit.occt.shapes.wire.derivativesOnWireAtLength({ shape: wire, length: 2.5 }); * ``` */ derivativesOnWireAtLength(inputs: Inputs.OCCT.DataOnGeometryAtLengthDto): Promise<[ Inputs.Base.Vector3, Inputs.Base.Vector3, Inputs.Base.Vector3 ]>; /** * Computes the first, second and third derivatives of a wire's curve at a fraction of the way * along it, from 0 at the start to 1 at the end. * * The first derivative is the tangent with its speed, the second tells how the curve bends, the * third how that bending changes; all are with respect to the curve's parameter. * @param inputs - The wire and the fraction from 0 to 1 * @returns The three derivative vectors, first to third * @group extract * @shortname derivatives at param * @drawable false * @example * ```typescript * const [first, second, third] = await bitbybit.occt.shapes.wire.derivativesOnWireAtParam({ shape: wire, param: 0.5 }); * ``` */ derivativesOnWireAtParam(inputs: Inputs.OCCT.DataOnGeometryAtParamDto): Promise<[ Inputs.Base.Vector3, Inputs.Base.Vector3, Inputs.Base.Vector3 ]>; /** * Reads the point where a wire starts, in the wire's own direction. * @param inputs - The wire * @returns The start point * @group extract * @shortname start point * @drawable true * @example * ```typescript * const start = await bitbybit.occt.shapes.wire.startPointOnWire({ shape: wire }); * ``` */ startPointOnWire(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the point halfway along a wire's parameter range. * * The parameter follows the edges' own curves, not distance, so on a wire of unequal edges this * is not always the middle by length; `pointOnWireAtLength` with half of `getWireLength` gives * that. * @param inputs - The wire * @returns The point at parameter 0.5 * @group extract * @shortname mid point * @drawable true * @example * ```typescript * const middle = await bitbybit.occt.shapes.wire.midPointOnWire({ shape: wire }); * ``` */ midPointOnWire(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Reads the point where a wire ends, in the wire's own direction. * @param inputs - The wire * @returns The end point * @group extract * @shortname end point * @drawable true * @example * ```typescript * const end = await bitbybit.occt.shapes.wire.endPointOnWire({ shape: wire }); * ``` */ endPointOnWire(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Makes a full circle as a closed single-edge wire, lying in the plane whose normal is * `direction`; the default `[0, 1, 0]` lays it flat on the ground. * @param inputs - The radius, the center and the plane normal * @returns The circle wire * @group primitives * @shortname circle * @drawable true * @example * ```typescript * const circle = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createCircleWire(inputs: Inputs.OCCT.CircleDto): Promise; /** * Fills a rectangle on the ground plane with a grid of closed hexagon wires, centered on the * origin. * * The hexagons are scaled so `nrHexagonsInWidth` fit across `width` and `nrHexagonsInHeight` * across `height`. The scale, fillet and inclusion patterns are read hexagon by hexagon and * repeat; the extend flags stretch the outer rows past the edges to cover the rectangle. * @param inputs - The rectangle size, the hexagon counts, the extend flags and the optional patterns * @returns One wire per hexagon, row by row * @group primitives * @shortname hegagons in grid * @drawable true * @example * ```typescript * const cells = await bitbybit.occt.shapes.wire.hexagonsInGrid({ * width: 20, * height: 10, * nrHexagonsInWidth: 8, * nrHexagonsInHeight: 4, * flatTop: false, * scalePatternWidth: [0.9], * scalePatternHeight: [0.9], * }); * ``` */ hexagonsInGrid(inputs: Inputs.OCCT.HexagonsInGridDto): Promise; /** * Makes a closed square wire centered on `center`. * * `direction` is the normal of its plane: the default `[0, 1, 0]` lays it flat on the ground. * @param inputs - The side length, the center and the plane normal * @returns The square wire * @group primitives * @shortname square * @drawable true * @example * ```typescript * const square = await bitbybit.occt.shapes.wire.createSquareWire({ size: 10, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createSquareWire(inputs: Inputs.OCCT.SquareDto): Promise; /** * Makes a closed star-shaped wire with `numRays` points. * * The points reach `outerRadius` and the notches between them `innerRadius`; `offsetOuterEdges` * lifts the ray tips out of the plane by that distance, making a 3D star, and `half` keeps the * first half of the rays as an open wire. It lies flat on the ground unless `direction` says * otherwise. * @param inputs - The two radii, the number of rays, the center, the plane normal and the options * @returns The star wire * @group primitives * @shortname star * @drawable true * @example * ```typescript * const star = await bitbybit.occt.shapes.wire.createStarWire({ outerRadius: 5, innerRadius: 2, numRays: 5, center: [0, 0, 0], direction: [0, 1, 0], offsetOuterEdges: 0, half: false }); * ``` */ createStarWire(inputs: Inputs.OCCT.StarDto): Promise; /** * Makes a closed wire shaped like a stylized Christmas tree: `nrSkirts` layers of branches, * narrowing from `outerDist` to `innerDist` off the trunk line, on a trunk of `trunkHeight` and * `trunkWidth`. * * Unlike the other flat shapes here it stands upright in the XY plane, tip along Y; `direction` * is the trunk-to-tip direction, `rotation` spins it about that axis, in degrees. * @param inputs - The tree proportions, the trunk size, the options, the origin and the trunk-to-tip direction * @returns The tree wire * @group primitives * @shortname christmas tree * @drawable true * @example * ```typescript * const tree = await bitbybit.occt.shapes.wire.createChristmasTreeWire({ * height: 10, * innerDist: 1.5, * outerDist: 4, * nrSkirts: 4, * trunkHeight: 1.5, * trunkWidth: 1, * half: false, * rotation: 0, * origin: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createChristmasTreeWire(inputs: Inputs.OCCT.ChristmasTreeDto): Promise; /** * Makes a closed regular polygon wire with `nrCorners` corners, all on a circle of `radius`. * * `direction` is the normal of the plane; the default `[0, 1, 0]` lays it flat on the ground. * @param inputs - The number of corners, the radius, the center and the plane normal * @returns The polygon wire * @group primitives * @shortname n-gon * @drawable true * @example * ```typescript * const hexagon = await bitbybit.occt.shapes.wire.createNGonWire({ nrCorners: 6, radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createNGonWire(inputs: Inputs.OCCT.NGonWireDto): Promise; /** * Makes a closed parallelogram wire: a rectangle of `width` and `height` whose sides lean over * by `angle` degrees. * * With `aroundCenter` true the shape is centered on `center`; otherwise it starts there and * extends in the positive directions. `direction` is the plane normal; the default `[0, 1, 0]` * lays it flat on the ground. * @param inputs - The width, the height, the lean angle, whether to center it, the center and the plane normal * @returns The parallelogram wire * @group primitives * @shortname parallelogram * @drawable true * @example * ```typescript * const shape = await bitbybit.occt.shapes.wire.createParallelogramWire({ width: 10, height: 5, angle: 30, aroundCenter: true, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createParallelogramWire(inputs: Inputs.OCCT.ParallelogramDto): Promise; /** * Makes a closed heart-shaped wire of two smooth halves that fits roughly into a square of * `sizeApprox`. * * `rotation` turns it in its plane, in degrees. `direction` is the plane normal; the default * `[0, 1, 0]` lays it flat on the ground. * @param inputs - The approximate size, the rotation, the center and the plane normal * @returns The heart wire * @group primitives * @shortname heart * @drawable true * @example * ```typescript * const heart = await bitbybit.occt.shapes.wire.createHeartWire({ sizeApprox: 10, rotation: 0, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createHeartWire(inputs: Inputs.OCCT.Heart2DDto): Promise; /** * Makes a closed rectangle wire centered on `center`. * * On the ground plane `width` runs along X and `length` along Z; `direction` is the normal of * the plane, and the default `[0, 1, 0]` keeps the wire flat on the ground. * @param inputs - The width, the length, the center and the plane normal * @returns The rectangle wire * @group primitives * @shortname rectangle * @drawable true * @example * ```typescript * const rectangle = await bitbybit.occt.shapes.wire.createRectangleWire({ width: 20, length: 10, center: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ createRectangleWire(inputs: Inputs.OCCT.RectangleDto): Promise; /** * Makes a closed L-shaped wire: two rectangular legs joined at a corner. * * The first leg has `widthFirst` and `lengthFirst`, the second `widthSecond` and * `lengthSecond`; `align` puts the corner on the outside, inside or middle of the legs, and * `rotation` turns the shape in its plane, in degrees. It lies flat on the ground unless * `direction` says otherwise. * @param inputs - The two leg sizes, the alignment, the rotation, the center and the plane normal * @returns The L-shaped wire * @group primitives * @shortname L polygon * @drawable true * @example * ```typescript * const outline = await bitbybit.occt.shapes.wire.createLPolygonWire({ * widthFirst: 2, * lengthFirst: 10, * widthSecond: 2, * lengthSecond: 6, * align: Bit.Inputs.OCCT.directionEnum.outside, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createLPolygonWire(inputs: Inputs.OCCT.LPolygonDto): Promise; /** * Makes the closed outline of an I-beam cross-section: two horizontal flanges joined by a * vertical web. * * `width` is the flange width, `height` the total height, `webThickness` and `flangeThickness` * the wall thicknesses; `alignment` says which point of the profile's box sits on `center`, * `rotation` turns it in its plane, in degrees. It lies on the ground, ready to extrude. * @param inputs - The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal * @returns The I-beam outline wire * @group beam profiles * @shortname I-beam profile * @drawable true * @example * ```typescript * const profile = await bitbybit.occt.shapes.wire.createIBeamProfileWire({ * width: 10, * height: 20, * webThickness: 2, * flangeThickness: 3, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createIBeamProfileWire(inputs: Inputs.OCCT.IBeamProfileDto): Promise; /** * Makes the closed outline of an H-beam cross-section: two vertical flanges joined by a * horizontal web, an I-beam on its side. * * `width` is the total width, `height` the flange height, `webThickness` and `flangeThickness` * the wall thicknesses; `alignment` says which point of the profile's box sits on `center`, * `rotation` turns it in its plane, in degrees. * @param inputs - The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal * @returns The H-beam outline wire * @group beam profiles * @shortname H-beam profile * @drawable true * @example * ```typescript * const profile = await bitbybit.occt.shapes.wire.createHBeamProfileWire({ * width: 20, * height: 10, * webThickness: 2, * flangeThickness: 3, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createHBeamProfileWire(inputs: Inputs.OCCT.HBeamProfileDto): Promise; /** * Makes the closed outline of a T-beam cross-section: a horizontal flange with a vertical web * hanging from its middle. * * `width` is the flange width, `height` the total height, `webThickness` and `flangeThickness` * the wall thicknesses; `alignment` says which point of the profile's box sits on `center`, * `rotation` turns it in its plane, in degrees. It lies on the ground. * @param inputs - The profile size, the two thicknesses, the alignment, the rotation, the center and the plane normal * @returns The T-beam outline wire * @group beam profiles * @shortname T-beam profile * @drawable true * @example * ```typescript * const profile = await bitbybit.occt.shapes.wire.createTBeamProfileWire({ * width: 10, * height: 12, * webThickness: 2, * flangeThickness: 2, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createTBeamProfileWire(inputs: Inputs.OCCT.TBeamProfileDto): Promise; /** * Makes the closed outline of a U-beam cross-section, a channel: a web with two flanges of * `flangeWidth` standing up from its ends. * * `width` and `height` are the total size, `webThickness` and `flangeThickness` the wall * thicknesses; `alignment` says which point of the profile's box sits on `center`, `rotation` * turns it in its plane, in degrees. It lies on the ground. * @param inputs - The profile size, the thicknesses, the flange width, the alignment, the rotation, the center and the plane normal * @returns The U-beam outline wire * @group beam profiles * @shortname U-beam profile * @drawable true * @example * ```typescript * const profile = await bitbybit.occt.shapes.wire.createUBeamProfileWire({ * width: 10, * height: 6, * webThickness: 1, * flangeThickness: 1, * flangeWidth: 3, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * rotation: 0, * center: [0, 0, 0], * direction: [0, 1, 0], * }); * ``` */ createUBeamProfileWire(inputs: Inputs.OCCT.UBeamProfileDto): Promise; /** * Makes a full ellipse as a closed single-edge wire, lying in the plane whose normal is * `direction`. * * `radiusMajor` must not be smaller than `radiusMinor`, or the kernel refuses the ellipse; the * default direction `[0, 1, 0]` lays it flat on the ground. * @param inputs - The center, the plane normal and the two radii * @returns The ellipse wire * @group primitives * @shortname ellipse * @drawable true * @example * ```typescript * const ellipse = await bitbybit.occt.shapes.wire.createEllipseWire({ center: [0, 0, 0], direction: [0, 1, 0], radiusMinor: 3, radiusMajor: 6 }); * ``` */ createEllipseWire(inputs: Inputs.OCCT.EllipseDto): Promise; /** * Makes a helix wire, a coil of constant `radius` that climbs `pitch` model units per turn * until it reaches `height`. * * It starts beside `center` and climbs along `direction`; `clockwise` reverses the winding. The * helix is approximated by a smooth curve within `tolerance`. A radius, pitch or height of 0 or * less gives a null wire. * @param inputs - The radius, the pitch, the height, the base center, the axis direction, the winding and the tolerance * @returns The helix wire * @group primitives * @shortname helix * @drawable true * @example * ```typescript * const spring = await bitbybit.occt.shapes.wire.createHelixWire({ radius: 2, pitch: 1, height: 10, center: [0, 0, 0], direction: [0, 1, 0], clockwise: false, tolerance: 1e-4 }); * ``` */ createHelixWire(inputs: Inputs.OCCT.HelixWireDto): Promise; /** * Makes a helix wire like `createHelixWire`, but sized by `numTurns` instead of a height: the * coil climbs `pitch` model units per turn, `numTurns` times. * @param inputs - The radius, the pitch, the number of turns, the base center, the axis direction, the winding and the tolerance * @returns The helix wire * @group primitives * @shortname helix by turns * @drawable true * @example * ```typescript * const spring = await bitbybit.occt.shapes.wire.createHelixWireByTurns({ radius: 2, pitch: 1, numTurns: 5, center: [0, 0, 0], direction: [0, 1, 0], clockwise: false, tolerance: 1e-4 }); * ``` */ createHelixWireByTurns(inputs: Inputs.OCCT.HelixWireByTurnsDto): Promise; /** * Makes a conical helix wire whose radius changes evenly from `startRadius` at the base to * `endRadius` at the top, climbing `pitch` model units per turn until it reaches `height`. * * It starts beside `center` and climbs along `direction`; `clockwise` reverses the winding. The * curve is approximated within `tolerance`. * @param inputs - The start and end radii, the pitch, the height, the base center, the axis direction, the winding and the tolerance * @returns The tapered helix wire * @group primitives * @shortname tapered helix * @drawable true * @example * ```typescript * const cone = await bitbybit.occt.shapes.wire.createTaperedHelixWire({ startRadius: 3, endRadius: 0.5, pitch: 1, height: 8, center: [0, 0, 0], direction: [0, 1, 0], clockwise: false, tolerance: 1e-4 }); * ``` */ createTaperedHelixWire(inputs: Inputs.OCCT.TaperedHelixWireDto): Promise; /** * Makes a flat spiral wire in the plane whose normal is `direction`: `numTurns` turns whose * radius grows evenly from `startRadius` to `endRadius`. * * The default direction `[0, 1, 0]` lays it flat on the ground; `clockwise` reverses the * winding, and the curve is approximated within `tolerance`. * @param inputs - The start and end radii, the number of turns, the center, the plane normal, the winding and the tolerance * @returns The spiral wire * @group primitives * @shortname flat spiral * @drawable true * @example * ```typescript * const spiral = await bitbybit.occt.shapes.wire.createFlatSpiralWire({ startRadius: 0.5, endRadius: 5, numTurns: 4, center: [0, 0, 0], direction: [0, 1, 0], clockwise: false, tolerance: 1e-4 }); * ``` */ createFlatSpiralWire(inputs: Inputs.OCCT.FlatSpiralWireDto): Promise; /** * Writes text as stroke wires on the ground plane in the single-line Hershey simplex font, one * open polyline wire per pen stroke. * * `height` is the height of a capital letter in model units, `lineSpacing` and `letterSpacing` * are multiples of it, `align` lines up lines of different length, and `centerOnOrigin` moves * the block to the origin. * @param inputs - The text, its size and spacing, the alignment and the placement options * @returns One wire per stroke, in writing order * @group primitives * @shortname text wires * @drawable true * @example * ```typescript * const strokes = await bitbybit.occt.shapes.wire.textWires({ * text: "Hello", * height: 5, * lineSpacing: 1.5, * letterSpacing: 0, * align: Bit.Inputs.Base.horizontalAlignEnum.left, * centerOnOrigin: true, * }); * ``` */ textWires(inputs: Inputs.OCCT.TextWiresDto): Promise; /** * Writes text as stroke wires like `textWires` and packs them into compounds, with the size of * the block alongside. * * The result carries `compound` with the whole text, `characters` with one compound per * character in writing order, `width` and `height` as the extent of the block along X and * along Z, and `center` as the middle of the block. * @param inputs - The text, its size and spacing, the alignment and the placement options * @returns The text compound, the character compounds and the measured size * @group primitives * @shortname text wires deriv * @drawable true * @example * ```typescript * const text = await bitbybit.occt.shapes.wire.textWiresWithData({ * text: "Hi", * height: 5, * lineSpacing: 1.5, * letterSpacing: 0, * align: Bit.Inputs.Base.horizontalAlignEnum.left, * centerOnOrigin: false, * }); * console.log(text.width, text.height, text.characters.length); * ``` */ textWiresWithData(inputs: Inputs.OCCT.TextWiresDto): Promise>; /** * Picks one wire out of a shape by its position, counting from 0, in the order the kernel walks * the shape. * * The shape must be a wire or something built from wires; an index beyond the last wire throws * an error. * @param inputs - The shape and the 0-based index * @returns The wire at that index * @group get * @shortname wire * @drawable true * @example * ```typescript * const outer = await bitbybit.occt.shapes.wire.getWire({ shape: face, index: 0 }); * ``` */ getWire(inputs: Inputs.OCCT.ShapeIndexDto): Promise; /** * Lists every wire of a shape in the order the kernel walks it. * @param inputs - The shape * @returns The wires found in the shape * @group get * @shortname wires * @drawable true * @example * ```typescript * const wires = await bitbybit.occt.shapes.wire.getWires({ shape: face }); * ``` */ getWires(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the center of mass of a wire, the balance point of its curves; for a circle that is its * center, off the wire itself. * @param inputs - The wire * @returns The center of mass point * @group get * @shortname center of mass * @drawable true * @example * ```typescript * const center = await bitbybit.occt.shapes.wire.getWireCenterOfMass({ shape: wire }); * ``` */ getWireCenterOfMass(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the center of mass of each wire in a list. * @param inputs - The wires * @returns One point per wire, in the same order * @group get * @shortname centers of mass * @drawable true * @example * ```typescript * const centers = await bitbybit.occt.shapes.wire.getWiresCentersOfMass({ shapes: wires }); * ``` */ getWiresCentersOfMass(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Flips the direction of a wire, so its start becomes its end. * * The edges keep their own order and direction flags; the wire as a whole is marked reversed, * which is what most operations read. `reversedWireFromReversedEdges` rebuilds the wire edge by * edge instead. * @param inputs - The wire * @returns A new wire running the other way * @group get * @shortname reversed * @drawable true * @example * ```typescript * const back = await bitbybit.occt.shapes.wire.reversedWire({ shape: wire }); * ``` */ reversedWire(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Flips the direction of a wire by reversing every edge and joining them again in the opposite * order. * * The result is a wire that runs the other way through and through, which some operations need * where the plain `reversedWire` flag is not enough. * @param inputs - The wire * @returns A new wire running the other way * @group get * @shortname reversed wire by rev edges * @drawable true * @example * ```typescript * const back = await bitbybit.occt.shapes.wire.reversedWireFromReversedEdges({ shape: wire }); * ``` */ reversedWireFromReversedEdges(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Tells whether a wire is closed, which is when its start and end points coincide within a * small tolerance. * @param inputs - The wire * @returns True when the ends meet * @group get * @shortname is wire closed * @drawable false * @example * ```typescript * const wireIsClosed = await bitbybit.occt.shapes.wire.isWireClosed({ shape: wire }); * ``` */ isWireClosed(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Measures the length of a wire along its curves, in model units. * @param inputs - The wire * @returns The length * @group get * @shortname length * @drawable false * @example * ```typescript * const len = await bitbybit.occt.shapes.wire.getWireLength({ shape: wire }); * ``` */ getWireLength(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Measures the length of each wire in a list along its curves, in model units. * @param inputs - The wires * @returns One length per wire, in the same order * @group get * @shortname lengths * @drawable false * @example * ```typescript * const lengths = await bitbybit.occt.shapes.wire.getWiresLengths({ shapes: wires }); * ``` */ getWiresLengths(inputs: Inputs.OCCT.ShapesDto): Promise; /** * Maps a flat wire drawn on the ground plane onto the surface of a face, as if the drawing were * wrapped around it. * * The wire's Z coordinate is read as U and its X coordinate as V, in the face's real UV values, * which `shapes.face.getUMinBound` and its siblings report; a drawing that fits inside those * bounds lands on the face. * @param inputs - The wire on the ground plane and the face * @returns The wire lying on the face's surface * @group place * @shortname wire on face * @drawable true * @example * ```typescript * const onSurface = await bitbybit.occt.shapes.wire.placeWireOnFace({ wire: flatWire, face: cylinderFace }); * ``` */ placeWireOnFace(inputs: Inputs.OCCT.WireOnFaceDto): Promise; /** * Maps several flat wires drawn on the ground plane onto the surface of a face, as * `placeWireOnFace` does for one. * @param inputs - The wires on the ground plane and the face * @returns The wires lying on the face's surface, in the same order * @group place * @shortname wires on face * @drawable true * @example * ```typescript * const onSurface = await bitbybit.occt.shapes.wire.placeWiresOnFace({ wires: flatWires, face: cylinderFace }); * ``` */ placeWiresOnFace(inputs: Inputs.OCCT.WiresOnFaceDto): Promise; /** * Closes an open wire with a straight edge from its end point back to its start point. * * A wire whose ends already meet is returned as it is. * @param inputs - The wire to close * @returns The closed wire * @group edit * @shortname close open wire * @drawable true * @example * ```typescript * const closedWire = await bitbybit.occt.shapes.wire.closeOpenWire({ shape: openWire }); * ``` */ closeOpenWire(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Projects a wire onto a shape along a direction, like casting its shadow onto the surface. * * The result is a compound of the curves where the projection meets the shape's faces, which * can be on both its near and far side. Cut a face with it through * `shapes.face.createFaceFromWireOnFace` or use it as a path. * @param inputs - The wire, the shape to project onto and the direction * @returns A compound of the projected curves * @group place * @shortname project * @drawable true * @example * ```typescript * const shadow = await bitbybit.occt.shapes.wire.project({ wire: circle, shape: sphere, direction: [0, -1, 0] }); * ``` */ project(inputs: Inputs.OCCT.ProjectWireDto): Promise; /** * Projects several wires onto a shape along one direction, as `project` does for one. * @param inputs - The wires, the shape to project onto and the direction * @returns One compound of projected curves per wire, in the same order * @group place * @shortname project wires * @drawable true * @example * ```typescript * const shadows = await bitbybit.occt.shapes.wire.projectWires({ wires: [circle, square], shape: sphere, direction: [0, -1, 0] }); * ``` */ projectWires(inputs: Inputs.OCCT.ProjectWiresDto): Promise; } /** * Importing SVG drawings as OpenCascade shapes. The importer parses the document (paths, basic * shapes, transforms and the style cascade), reduces every element to the generic path vocabulary * of `path` and builds wires, and faces where it can, laid on the ground plane and placed by the * import options. `loadSVG` gives one compound for the whole drawing; `loadSVGStructured` gives one * shape per element with its fill and stroke. */ declare class OCCTSVG { private readonly occWorkerManager; /** * Parses an SVG document and builds every drawable element into one compound shape on the * ground plane, ready to draw, extrude or transform as a whole. * * `faceStrategy` decides whether closed outlines become faces, `scale` and `flipY` map SVG * units and its downward Y axis, and `alignment`, `direction` and `center` place the result. * Invisible elements are skipped unless asked for. * @param inputs - The SVG text and the import and placement options * @returns One compound holding every element * @group io * @shortname load svg * @drawable true * @example * ```typescript * const drawing = await bitbybit.occt.svg.loadSVG({ * svg: svgText, * faceStrategy: Bit.Inputs.OCCT.svgFaceStrategyEnum.auto, * makeRibbons: false, * includeInvisible: false, * joinSegments: true, * tolerance: 1e-7, * scale: 0.1, * flipY: true, * alignment: Bit.Inputs.Base.basicAlignmentEnum.midMid, * direction: [0, 1, 0], * center: [0, 0, 0], * }); * ``` */ loadSVG(inputs: Inputs.OCCT.LoadSVGDto): Promise; /** * Parses an SVG document and builds one shape per drawable element, each bundled with its * resolved fill, stroke and stroke width, plus the parse warnings and the SVG view box. * * Use it when the elements need their own colors or separate handling; `loadSVG` gives the * whole drawing as one shape. Faces are built where the outline allows it. * @param inputs - The SVG text and the import and placement options * @returns The shapes with their styles, the warnings and the view box * @group io * @shortname load svg structured * @drawable false * @example * ```typescript * const options = new Bit.Inputs.OCCT.LoadSVGDto(); * options.svg = svgText; * options.scale = 0.1; * const result = await bitbybit.occt.svg.loadSVGStructured(options); * result.shapes.forEach(s => console.log(s.fill, s.stroke)); * ``` */ loadSVGStructured(inputs: Inputs.OCCT.LoadSVGDto): Promise>; } /** * Moving, turning, scaling and mirroring OpenCascade shapes, and building the 4x4 matrices that * describe such moves. Every method returns a new shape and leaves the input as it was. Angles are * in degrees, distances in model units, and a rotation axis passes through the origin unless a * method takes a center. Matrices are 16 numbers in column-major order (the translation sits at * indices 12 to 14); a list of matrices is applied first to last as one combined move, which is how * `transformByMatrix` and the `...ToMatrix` builders fit together. */ declare class OCCTTransforms { private readonly occWorkerManager; /** * Scales, rotates and moves a shape in one go: first the scale about the origin, then the * rotation about an axis through the origin, then the translation. * * Because the scale and the rotation happen about the origin, a shape that is not there also * swings around it; move it first, or use `rotateAroundCenter` and `scale3d` for a chosen * center. * @param inputs - The shape, the translation, the rotation axis and angle in degrees, and the scale factor * @returns The transformed shape * @group on single shape * @shortname transform * @drawable true * @example * ```typescript * const moved = await bitbybit.occt.transforms.transform({ * shape: box, * translation: [10, 0, 0], * rotationAxis: [0, 1, 0], * rotationAngle: 45, * scaleFactor: 2, * }); * ``` */ transform(inputs: Inputs.OCCT.TransformDto): Promise; /** * Rotates a shape about an axis that passes through the origin, by an angle in degrees. * * The rotation follows the right-hand rule: with the thumb along `axis`, the fingers show the * positive direction. A shape away from the origin swings around it; `rotateAroundCenter` * rotates about a chosen point instead. * @param inputs - The shape, the axis direction and the angle in degrees * @returns The rotated shape * @group on single shape * @shortname rotate * @drawable true * @example * ```typescript * const turned = await bitbybit.occt.transforms.rotate({ shape: box, axis: [0, 1, 0], angle: 90 }); * ``` */ rotate(inputs: Inputs.OCCT.RotateDto): Promise; /** * Rotates a shape about an axis that passes through a chosen point, by an angle in degrees. * * The shape is moved so the point sits at the origin, rotated there with the right-hand rule * about `axis`, and moved back. * @param inputs - The shape, the angle in degrees, the point the axis passes through and the axis direction * @returns The rotated shape * @group on single shape * @shortname rotate around center * @drawable true * @example * ```typescript * const turned = await bitbybit.occt.transforms.rotateAroundCenter({ shape: box, angle: 90, center: [5, 0, 5], axis: [0, 1, 0] }); * ``` */ rotateAroundCenter(inputs: Inputs.OCCT.RotateAroundCenterDto): Promise; /** * Moves a shape so that one point and direction on it land on another point and direction: the * frame `fromOrigin` with `fromDirection` is carried onto `toOrigin` with `toDirection`. * * This is the way to stand a shape on a surface or point it along a line: the shape is both * moved and turned, never scaled. * @param inputs - The shape, the point and direction to take from, and the point and direction to land on * @returns The aligned shape * @group on single shape * @shortname align * @drawable true * @example * ```typescript * const standing = await bitbybit.occt.transforms.align({ * shape: cylinder, * fromOrigin: [0, 0, 0], * fromDirection: [0, 1, 0], * toOrigin: [10, 5, 0], * toDirection: [1, 0, 0], * }); * ``` */ align(inputs: Inputs.OCCT.AlignDto): Promise; /** * Moves a shape so that a full frame on it lands on another frame: a point, its normal and one * axis in the plane of that normal are carried onto their targets. * * Where `align` fixes one direction and leaves the spin around it free, this also fixes the * spin, which matters for shapes that are not round about their axis. * @param inputs - The shape, the point, normal and axis to take from, and the point, normal and axis to land on * @returns The aligned shape * @group on single shape * @shortname align normal and axis * @drawable true * @example * ```typescript * const placed = await bitbybit.occt.transforms.alignNormAndAxis({ * shape: bracket, * fromOrigin: [0, 0, 0], * fromNorm: [0, 1, 0], * fromAx: [1, 0, 0], * toOrigin: [10, 0, 0], * toNorm: [0, 0, 1], * toAx: [0, 1, 0], * }); * ``` */ alignNormAndAxis(inputs: Inputs.OCCT.AlignNormAndAxisDto): Promise; /** * Turns a shape so that its Y axis points along `direction`, then moves it to `center`. * * The flat shapes and primitives of this package are built on the ground with Y up, so this is * the one call that places any of them: the direction becomes their new up, and the center * where they sit. * @param inputs - The shape, the direction its Y axis should point along and the point to move it to * @returns The placed shape * @group on single shape * @shortname align and translate * @drawable true * @example * ```typescript * const placed = await bitbybit.occt.transforms.alignAndTranslate({ shape: profile, direction: [1, 0, 0], center: [10, 0, 0] }); * ``` */ alignAndTranslate(inputs: Inputs.OCCT.AlignAndTranslateDto): Promise; /** * Moves a shape by a vector, in model units. * @param inputs - The shape and the vector to move it by * @returns The moved shape * @group on single shape * @shortname translate * @drawable true * @example * ```typescript * const moved = await bitbybit.occt.transforms.translate({ shape: box, translation: [10, 0, 0] }); * ``` */ translate(inputs: Inputs.OCCT.TranslateDto): Promise; /** * Scales a shape uniformly about the origin by a factor. * * A shape away from the origin also moves away from or toward it; `scaleFromCenter` scales * about a chosen point and `scale3d` scales each axis by its own factor. * @param inputs - The shape and the factor * @returns The scaled shape * @group on single shape * @shortname scale * @drawable true * @example * ```typescript * const bigger = await bitbybit.occt.transforms.scale({ shape: box, factor: 2 }); * ``` */ scale(inputs: Inputs.OCCT.ScaleDto): Promise; /** * Scales a shape by a separate factor along X, Y and Z, about a chosen center point. * * Unequal factors stretch the shape, which turns circles into ellipses and can make later * operations, such as fillets, slower or fail; keep the factors equal when the shape only needs * to grow. * @param inputs - The shape, the three factors and the point to scale about * @returns The scaled shape * @group on single shape * @shortname scale 3d * @drawable true * @example * ```typescript * const stretched = await bitbybit.occt.transforms.scale3d({ shape: box, scale: [1, 2, 1], center: [0, 0, 0] }); * ``` */ scale3d(inputs: Inputs.OCCT.Scale3DDto): Promise; /** * Mirrors a shape across a line: the axis through `origin` along `direction`. * * Every point lands as far behind the line as it was in front, which in 3D is the same as a * half turn about that axis. * @param inputs - The shape, a point on the axis and the axis direction * @returns The mirrored shape * @group on single shape * @shortname mirror * @drawable true * @example * ```typescript * const flipped = await bitbybit.occt.transforms.mirror({ shape: box, origin: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ mirror(inputs: Inputs.OCCT.MirrorDto): Promise; /** * Mirrors a shape across a plane given by a point on it and its normal. * * This is the usual mirror image, the kind a symmetric part needs; the result is turned inside * out in the sense that a left-hand shape becomes a right-hand one. * @param inputs - The shape, a point on the mirror plane and the plane's normal * @returns The mirrored shape * @group on single shape * @shortname mirror normal * @drawable true * @example * ```typescript * const other = await bitbybit.occt.transforms.mirrorAlongNormal({ shape: leftHalf, origin: [0, 0, 0], normal: [1, 0, 0] }); * ``` */ mirrorAlongNormal(inputs: Inputs.OCCT.MirrorAlongNormalDto): Promise; /** * Applies `transform` to several shapes, each with its own translation, rotation axis, angle * and scale factor. * * All the lists must have the same length, or an error is thrown. * @param inputs - The shapes and one translation, rotation axis, angle in degrees and scale factor per shape * @returns The transformed shapes, in the same order * @group on shapes * @shortname transforms * @drawable true * @example * ```typescript * const moved = await bitbybit.occt.transforms.transformShapes({ * shapes: [box, sphere], * translations: [[10, 0, 0], [-10, 0, 0]], * rotationAxes: [[0, 1, 0], [0, 1, 0]], * rotationAngles: [45, 0], * scaleFactors: [1, 2], * }); * ``` */ transformShapes(inputs: Inputs.OCCT.TransformShapesDto): Promise; /** * Applies `rotate` to several shapes, each about its own axis through the origin and by its own * angle in degrees. * * All the lists must have the same length, or an error is thrown. * @param inputs - The shapes and one axis and angle per shape * @returns The rotated shapes, in the same order * @group on shapes * @shortname rotations * @drawable true * @example * ```typescript * const turned = await bitbybit.occt.transforms.rotateShapes({ shapes: [box, sphere], axes: [[0, 1, 0], [1, 0, 0]], angles: [90, 45] }); * ``` */ rotateShapes(inputs: Inputs.OCCT.RotateShapesDto): Promise; /** * Applies `rotateAroundCenter` to several shapes, each with its own angle in degrees, center * and axis. * * All the lists must have the same length, or an error is thrown. * @param inputs - The shapes and one angle, center and axis per shape * @returns The rotated shapes, in the same order * @group on shapes * @shortname rotations around center * @drawable true * @example * ```typescript * const turned = await bitbybit.occt.transforms.rotateAroundCenterShapes({ * shapes: [box, sphere], * angles: [90, 45], * centers: [[5, 0, 5], [0, 0, 0]], * axes: [[0, 1, 0], [0, 1, 0]], * }); * ``` */ rotateAroundCenterShapes(inputs: Inputs.OCCT.RotateAroundCenterShapesDto): Promise; /** * Applies `align` to several shapes, each with its own from and to frames. * * All the lists must have the same length, or an error is thrown. * @param inputs - The shapes and one from origin, from direction, to origin and to direction per shape * @returns The aligned shapes, in the same order * @group on shapes * @shortname alignments * @drawable true * @example * ```typescript * const placed = await bitbybit.occt.transforms.alignShapes({ * shapes: [cylinder, cylinder2], * fromOrigins: [[0, 0, 0], [0, 0, 0]], * fromDirections: [[0, 1, 0], [0, 1, 0]], * toOrigins: [[10, 0, 0], [20, 0, 0]], * toDirections: [[1, 0, 0], [0, 0, 1]], * }); * ``` */ alignShapes(inputs: Inputs.OCCT.AlignShapesDto): Promise; /** * Applies `alignAndTranslate` to several shapes, each with its own direction and center. * * All the lists must have the same length, or an error is thrown. * @param inputs - The shapes and one direction and center per shape * @returns The placed shapes, in the same order * @group on shapes * @shortname align and translate * @drawable true * @example * ```typescript * const placed = await bitbybit.occt.transforms.alignAndTranslateShapes({ * shapes: [profile, profile2], * directions: [[1, 0, 0], [0, 0, 1]], * centers: [[10, 0, 0], [0, 0, 10]], * }); * ``` */ alignAndTranslateShapes(inputs: Inputs.OCCT.AlignAndTranslateShapesDto): Promise; /** * Applies `translate` to several shapes, each by its own vector. * * The two lists must have the same length, or an error is thrown. * @param inputs - The shapes and one translation vector per shape * @returns The moved shapes, in the same order * @group on shapes * @shortname translations * @drawable true * @example * ```typescript * const moved = await bitbybit.occt.transforms.translateShapes({ shapes: [box, sphere], translations: [[10, 0, 0], [-10, 0, 0]] }); * ``` */ translateShapes(inputs: Inputs.OCCT.TranslateShapesDto): Promise; /** * Applies `scale` to several shapes, each uniformly about the origin by its own factor. * * The two lists must have the same length, or an error is thrown. * @param inputs - The shapes and one factor per shape * @returns The scaled shapes, in the same order * @group on shapes * @shortname scales * @drawable true * @example * ```typescript * const scaled = await bitbybit.occt.transforms.scaleShapes({ shapes: [box, sphere], factors: [2, 0.5] }); * ``` */ scaleShapes(inputs: Inputs.OCCT.ScaleShapesDto): Promise; /** * Applies `scale3d` to several shapes, each with its own three factors and center. * * All the lists must have the same length, or an error is thrown. * @param inputs - The shapes and one scale vector and center per shape * @returns The scaled shapes, in the same order * @group on shapes * @shortname scales 3d * @drawable true * @example * ```typescript * const scaled = await bitbybit.occt.transforms.scale3dShapes({ * shapes: [box, sphere], * scales: [[1, 2, 1], [2, 2, 2]], * centers: [[0, 0, 0], [10, 0, 0]], * }); * ``` */ scale3dShapes(inputs: Inputs.OCCT.Scale3DShapesDto): Promise; /** * Applies `mirror` to several shapes, each across its own axis. * * All the lists must have the same length, or an error is thrown. * @param inputs - The shapes and one axis origin and direction per shape * @returns The mirrored shapes, in the same order * @group on shapes * @shortname mirrors * @drawable true * @example * ```typescript * const flipped = await bitbybit.occt.transforms.mirrorShapes({ * shapes: [box, sphere], * origins: [[0, 0, 0], [0, 0, 0]], * directions: [[0, 1, 0], [1, 0, 0]], * }); * ``` */ mirrorShapes(inputs: Inputs.OCCT.MirrorShapesDto): Promise; /** * Applies `mirrorAlongNormal` to several shapes, each across its own plane. * * All the lists must have the same length, or an error is thrown. * @param inputs - The shapes and one plane origin and normal per shape * @returns The mirrored shapes, in the same order * @group on shapes * @shortname mirrors normal * @drawable true * @example * ```typescript * const others = await bitbybit.occt.transforms.mirrorAlongNormalShapes({ * shapes: [leftArm, leftLeg], * origins: [[0, 0, 0], [0, 0, 0]], * normals: [[1, 0, 0], [1, 0, 0]], * }); * ``` */ mirrorAlongNormalShapes(inputs: Inputs.OCCT.MirrorAlongNormalShapesDto): Promise; /** * Scales a shape uniformly about a chosen point by a factor. * * The point stays where it is and everything else moves away from it or toward it. * @param inputs - The shape, the factor and the point to scale about * @returns The scaled shape * @group on single shape * @shortname scale from center * @drawable true * @example * ```typescript * const bigger = await bitbybit.occt.transforms.scaleFromCenter({ shape: box, factor: 2, center: [5, 0, 5] }); * ``` */ scaleFromCenter(inputs: Inputs.OCCT.ScaleFromCenterDto): Promise; /** * Mirrors a shape through a point: every point of the shape lands as far beyond the point as it * was before it, on the opposite side. * * The result is turned inside out, the way a plane mirror turns a left hand into a right hand. * @param inputs - The shape and the point to mirror through * @returns The mirrored shape * @group on single shape * @shortname mirror about point * @drawable true * @example * ```typescript * const inverted = await bitbybit.occt.transforms.mirrorAboutPoint({ shape: box, point: [0, 0, 0] }); * ``` */ mirrorAboutPoint(inputs: Inputs.OCCT.MirrorAboutPointDto): Promise; /** * Rotates a shape about the origin by a quaternion given as `[x, y, z, w]`. * * The quaternion is normalized first, so its length does not matter. Quaternions are what * animation and physics libraries hand out, so this saves converting them to an axis and an * angle. * @param inputs - The shape and the quaternion * @returns The rotated shape * @group on single shape * @shortname rotate by quaternion * @drawable true * @example * ```typescript * const turned = await bitbybit.occt.transforms.rotateByQuaternion({ shape: box, quaternion: [0, 0.7071, 0, 0.7071] }); * ``` */ rotateByQuaternion(inputs: Inputs.OCCT.RotateByQuaternionDto): Promise; /** * Applies a 4x4 matrix, or a list of matrices applied first to last, to a shape. * * The matrix is column-major, so the translation sits at indices 12 to 14. A matrix that * stretches or shears is allowed; build matrices with the `...ToMatrix` methods and combine * them with `multiplyTransforms`. A matrix the kernel cannot apply throws an error. * @param inputs - The shape and the matrix or list of matrices * @returns The transformed shape * @group by matrix * @shortname transform by matrix * @drawable true * @example * ```typescript * const move = await bitbybit.occt.transforms.translationToMatrix({ translation: [10, 0, 0] }); * const turn = await bitbybit.occt.transforms.rotationAxisAngleToMatrix({ axis: [0, 1, 0], angle: 90, center: [0, 0, 0] }); * const placed = await bitbybit.occt.transforms.transformByMatrix({ shape: box, transformation: [turn, move] }); * ``` */ transformByMatrix(inputs: Inputs.OCCT.TransformByMatrixDto): Promise; /** * Applies the same 4x4 matrix, or list of matrices applied first to last, to several shapes, as * `transformByMatrix` does for one. * @param inputs - The shapes and the matrix or list of matrices * @returns The transformed shapes, in the same order * @group by matrix * @shortname transform shapes by matrix * @drawable true * @example * ```typescript * const moved = await bitbybit.occt.transforms.transformShapesByMatrix({ shapes: [box, sphere], transformation: matrix }); * ``` */ transformShapesByMatrix(inputs: Inputs.OCCT.TransformShapesByMatrixDto): Promise; /** * Reads the placement a shape carries, the transform stored on it rather than baked into its * geometry, as a matrix plus its translation, rotation quaternion and uniform scale. * * A shape placed with `align` or through an assembly carries such a placement; most other * methods here bake the move into the geometry, and such a shape reports the identity. * @param inputs - The shape to read * @returns The matrix, the translation, the quaternion as `[x, y, z, w]` and the scale * @group by matrix * @shortname get shape transform * @drawable false * @example * ```typescript * const placement = await bitbybit.occt.transforms.getShapeTransform({ shape: movedBox }); * console.log(placement.translation, placement.scale); * ``` */ getShapeTransform(inputs: Inputs.OCCT.ShapeTransformQueryDto): Promise; /** * Builds the identity matrix, the transform that changes nothing, as a starting point for * composing others. * @returns The identity matrix, column-major * @group matrix builders * @shortname identity matrix * @drawable false * @example * ```typescript * const identity = await bitbybit.occt.transforms.identityTransform(); * ``` */ identityTransform(): Promise; /** * Builds one matrix from a translation, three rotation angles in degrees about X, Y and Z, and * a uniform scale. * * The scale is applied first, then the rotations (Z first, then Y, then X), then the * translation, which is the order assembly placements use. Any part left out is taken as no * change. * @param inputs - The translation, the three rotation angles in degrees and the scale factor * @returns The combined matrix, column-major * @group matrix builders * @shortname compose transform * @drawable false * @example * ```typescript * const placement = await bitbybit.occt.transforms.composeTransform({ translation: [10, 0, 0], rotation: [0, 90, 0], scale: 1 }); * ``` */ composeTransform(inputs: Inputs.OCCT.ComposeTransformDto): Promise; /** * Folds a list of matrices into one, applied first to last, so a chain of moves becomes a * single matrix. * * A single matrix is returned unchanged and an empty list gives the identity. * @param inputs - The matrix or list of matrices * @returns The combined matrix, column-major * @group matrix builders * @shortname multiply transforms * @drawable false * @example * ```typescript * const combined = await bitbybit.occt.transforms.multiplyTransforms({ transformation: [turn, move] }); * ``` */ multiplyTransforms(inputs: Inputs.OCCT.MultiplyTransformsDto): Promise; /** * Inverts a matrix, giving the transform that undoes it: applying a matrix and then its inverse * puts a shape back where it was. * @param inputs - The matrix to invert * @returns The inverse matrix, column-major * @group matrix builders * @shortname invert transform * @drawable false * @example * ```typescript * const back = await bitbybit.occt.transforms.invertTransform({ transformation: placement }); * ``` */ invertTransform(inputs: Inputs.OCCT.InvertTransformDto): Promise; /** * Builds the matrix of a move by a vector, in model units. * @param inputs - The translation vector * @returns The translation matrix, column-major * @group matrix builders * @shortname translation to matrix * @drawable false * @example * ```typescript * const move = await bitbybit.occt.transforms.translationToMatrix({ translation: [10, 0, 0] }); * ``` */ translationToMatrix(inputs: Inputs.OCCT.TranslationToMatrixDto): Promise; /** * Builds the matrix of a rotation by an angle in degrees about an axis, through the origin or * through an optional center point. * * The rotation follows the right-hand rule about `axis`. * @param inputs - The axis direction, the angle in degrees and the optional point the axis passes through * @returns The rotation matrix, column-major * @group matrix builders * @shortname rotation axis angle to matrix * @drawable false * @example * ```typescript * const turn = await bitbybit.occt.transforms.rotationAxisAngleToMatrix({ axis: [0, 1, 0], angle: 90, center: [5, 0, 5] }); * ``` */ rotationAxisAngleToMatrix(inputs: Inputs.OCCT.RotationAxisAngleToMatrixDto): Promise; /** * Builds the matrix of a uniform scale by a factor about the origin or an optional center * point. * @param inputs - The factor and the optional point to scale about * @returns The scale matrix, column-major * @group matrix builders * @shortname scale uniform to matrix * @drawable false * @example * ```typescript * const grow = await bitbybit.occt.transforms.scaleUniformToMatrix({ factor: 2, center: [0, 0, 0] }); * ``` */ scaleUniformToMatrix(inputs: Inputs.OCCT.ScaleUniformToMatrixDto): Promise; /** * Builds the matrix of a mirror through a point, the transform `mirrorAboutPoint` applies. * @param inputs - The point to mirror through * @returns The mirror matrix, column-major * @group matrix builders * @shortname mirror point to matrix * @drawable false * @example * ```typescript * const invert = await bitbybit.occt.transforms.mirrorPointToMatrix({ point: [0, 0, 0] }); * ``` */ mirrorPointToMatrix(inputs: Inputs.OCCT.MirrorPointToMatrixDto): Promise; /** * Builds the matrix of a mirror across a line, the transform `mirror` applies: the axis through * `origin` along `direction`. * @param inputs - A point on the axis and the axis direction * @returns The mirror matrix, column-major * @group matrix builders * @shortname mirror axis to matrix * @drawable false * @example * ```typescript * const flip = await bitbybit.occt.transforms.mirrorAxisToMatrix({ origin: [0, 0, 0], direction: [0, 1, 0] }); * ``` */ mirrorAxisToMatrix(inputs: Inputs.OCCT.MirrorAxisToMatrixDto): Promise; /** * Builds the matrix of a mirror across a plane, the transform `mirrorAlongNormal` applies: the * plane through `origin` with the given normal. * @param inputs - A point on the plane and the plane's normal * @returns The mirror matrix, column-major * @group matrix builders * @shortname mirror plane to matrix * @drawable false * @example * ```typescript * const reflect = await bitbybit.occt.transforms.mirrorPlaneToMatrix({ origin: [0, 0, 0], normal: [1, 0, 0] }); * ``` */ mirrorPlaneToMatrix(inputs: Inputs.OCCT.MirrorPlaneToMatrixDto): Promise; /** * Builds the rotation matrix of a quaternion given as `[x, y, z, w]`. * * The quaternion is normalized first, so its length does not matter. * @param inputs - The quaternion * @returns The rotation matrix, column-major * @group matrix builders * @shortname quaternion to matrix * @drawable false * @example * ```typescript * const turn = await bitbybit.occt.transforms.quaternionToMatrix({ quaternion: [0, 0.7071, 0, 0.7071] }); * ``` */ quaternionToMatrix(inputs: Inputs.OCCT.QuaternionToMatrixDto): Promise; } /** * The BabylonJS side of the library: everything that lives in the rendered scene rather than in a * CAD kernel. Meshes, nodes, cameras, lights, materials, textures, the scene itself, model import * and export, picking with rays, on-screen gizmos, the 2D GUI, decals, Gaussian splats and WebXR * are each behind their own property. */ declare class Babylon { mesh: BabylonMesh; gaussianSplatting: BabylonGaussianSplatting; camera: BabylonCamera; webXr: BabylonWebXR; node: BabylonNode; engine: BabylonEngine; scene: BabylonScene; gltf: BabylonGltf; decal: BabylonDecal; transforms: BabylonTransforms; io: BabylonIO; ray: BabylonRay; pick: BabylonPick; material: BabylonMaterial; lights: BabylonLights; meshBuilder: BabylonMeshBuilder; texture: BabylonTexture; tools: BabylonTools; gui: BabylonGui; gizmo: BabylonGizmo; } /** * The orbiting camera: it circles a target point at a distance, the way you would turn a product in * your hands, and is the camera this library uses by default. Angles are given in degrees: `alpha` * around the vertical axis, `beta` down from the top. */ declare class BabylonArcRotateCamera { private readonly context; /** * Creates a camera that orbits `target` at distance `radius`, controlled by the pointer on the * canvas, and adds it to the scene without activating it. * * `alpha` and `beta` place it in degrees, `beta` counted down from straight above; the limits * fence how far it can zoom and orbit, and the sensibilities set how fast it reacts, lower * being faster. * @param inputs - The radius, target, angles, limits and sensitivities * @returns The orbiting camera * @group create * @shortname new arc rotate camera * @example * ```typescript * const camera = bitbybit.babylon.camera.arcRotate.create({ radius: 20, target: [0, 0, 0], alpha: 45, beta: 70, lowerBetaLimit: 1, upperBetaLimit: 179, angularSensibilityX: 1000, angularSensibilityY: 1000, panningSensibility: 1000, wheelPrecision: 3, maxZ: 1000 }); * bitbybit.babylon.scene.activateCamera({ camera }); * ``` */ create(inputs: Inputs.BabylonCamera.ArcRotateCameraDto): BABYLON.ArcRotateCamera; private getRadians; } /** * Cameras of the BabylonJS scene: `arcRotate` orbits a target and is the usual choice for looking * at a model, `free` flies with keyboard and pointer, `target` looks at a point without user * control. The methods here set a camera's position, target, speed and clipping distances and * switch it between perspective and orthographic projection. */ declare class BabylonCamera { private readonly context; free: BabylonFreeCamera; arcRotate: BabylonArcRotateCamera; target: BabylonTargetCamera; /** * Stops a camera from recomputing its projection every frame, saving work when its field of * view and clipping distances no longer change. * @param inputs - The camera * @group adjust * @shortname freeze projection matrix */ freezeProjectionMatrix(inputs: Inputs.BabylonCamera.CameraDto): void; /** * Lets a frozen camera recompute its projection again, needed after changing its field of view * or clipping distances. * @param inputs - The camera * @group adjust * @shortname unfreeze projection matrix */ unfreezeProjectionMatrix(inputs: Inputs.BabylonCamera.CameraDto): void; /** * Moves a camera to a point in the scene; a target camera keeps looking at its target from * there. * @param inputs - The camera and the position * @group set * @shortname set camera position * @example * ```typescript * bitbybit.babylon.camera.setPosition({ camera, position: [20, 20, 20] }); * ``` */ setPosition(inputs: Inputs.BabylonCamera.PositionDto): void; /** * Reads where a camera is in the scene, as a point. * @param inputs - The camera * @returns The position as a point * @group get * @shortname get camera position */ getPosition(inputs: Inputs.BabylonCamera.PositionDto): Base.Point3; /** * Turns a camera to look at a point in the scene. * @param inputs - The camera and the target point * @group set * @shortname set camera target * @example * ```typescript * bitbybit.babylon.camera.setTarget({ camera, target: [0, 5, 0] }); * ``` */ setTarget(inputs: Inputs.BabylonCamera.TargetDto): void; /** * Reads the point a camera is looking at. * @param inputs - The camera * @returns The target as a point * @group get * @shortname get camera target */ getTarget(inputs: Inputs.BabylonCamera.PositionDto): Base.Point3; /** * Sets how fast a camera moves in response to its keyboard and pointer controls; 1 is the * default pace. * @param inputs - The camera and the speed * @group set * @shortname set camera speed */ setSpeed(inputs: Inputs.BabylonCamera.SpeedDto): void; /** * Reads how fast a camera moves in response to its controls. * @param inputs - The camera * @returns The speed * @group get * @shortname get camera speed */ getSpeed(inputs: Inputs.BabylonCamera.PositionDto): number; /** * Sets the near clipping distance of a camera: anything closer than `minZ` scene units is not * drawn. Too small a value costs depth precision on large scenes. * @param inputs - The camera and the near distance * @group set * @shortname set camera min z */ setMinZ(inputs: Inputs.BabylonCamera.MinZDto): void; /** * Sets the far clipping distance of a camera: anything farther than `maxZ` scene units is not * drawn. * @param inputs - The camera and the far distance * @group set * @shortname camera max z */ setMaxZ(inputs: Inputs.BabylonCamera.MaxZDto): void; /** * Switches a camera to orthographic projection, where objects keep their size whatever their * distance, as in technical drawings. * * The four `ortho` values are the edges of the view in scene units; a 0 falls back to the * default of 1 unit each way. * @param inputs - The camera and the four edges of the orthographic view * @group adjust * @shortname enable orthographic mode * @example * ```typescript * bitbybit.babylon.camera.makeCameraOrthographic({ camera, orthoLeft: -20, orthoRight: 20, orthoBottom: -10, orthoTop: 10 }); * ``` */ makeCameraOrthographic(inputs: Inputs.BabylonCamera.OrthographicDto): void; /** * Switches a camera back to perspective projection, where distant objects look smaller, the * default for cameras. * @param inputs - The camera * @group adjust * @shortname enable perspective mode */ makeCameraPerspective(inputs: Inputs.BabylonCamera.CameraDto): void; } /** * The flying camera: it sits at a position, looks at a target and moves freely with the keyboard * and pointer, for walking through a scene rather than looking at one object. */ declare class BabylonFreeCamera { private readonly context; /** * Creates a camera at `position` looking at `target` that the keyboard and pointer fly around, * and adds it to the scene without activating it. * @param inputs - The position and the target * @returns The free camera * @group create * @shortname new free camera * @example * ```typescript * const camera = bitbybit.babylon.camera.free.create({ position: [20, 20, 20], target: [0, 0, 0] }); * bitbybit.babylon.scene.activateCamera({ camera }); * ``` */ create(inputs: Inputs.BabylonCamera.FreeCameraDto): BABYLON.FreeCamera; } /** * The fixed camera: it sits at a position looking at a target with no navigation controls of its * own, for views a script places itself. */ declare class BabylonTargetCamera { private readonly context; /** * Creates a camera at `position` looking at `target` with no navigation controls of its own, * and adds it to the scene without activating it. * @param inputs - The position and the target * @returns The target camera * @group create * @shortname new target camera * @example * ```typescript * const camera = bitbybit.babylon.camera.target.create({ position: [20, 20, 20], target: [0, 0, 0] }); * bitbybit.babylon.scene.activateCamera({ camera }); * ``` */ create(inputs: Inputs.BabylonCamera.TargetCameraDto): BABYLON.TargetCamera; } /** * Sticking images onto meshes, the way a label or a logo sits on a product. A geometry decal is a * thin clipped mesh hugging the surface, which works on any static mesh; a decal map paints into * the mesh's own texture space instead, adds no geometry, follows deformation and lets many * projections build up, but needs clean UV coordinates. */ declare class BabylonDecal { private readonly context; /** * Creates a geometry decal that projects an image onto a mesh. The decal is a clipped child mesh that hugs the * surface of the source mesh, which makes it work with any material and on any static mesh. It adds geometry, so * for deforming meshes or many accumulating decals prefer the decal map approach instead. * @param inputs source mesh, image texture and projection parameters * @returns Babylon mesh representing the decal, parented to the source mesh * @group create * @shortname mesh decal * @disposableOutput true * @drawable true */ createMeshDecal(inputs: Inputs.BabylonDecal.CreateMeshDecalDto): BABYLON.Mesh; /** * Enables a UV-space decal map on a mesh and turns on the decal map plugin of its material. Unlike geometry decals * this projects images directly into the mesh texture space, so no geometry is added, decals follow deformation and * multiple projections accumulate into a single map. The mesh must have proper, non-overlapping UV coordinates. * @param inputs mesh, its material and the resolution of the decal map * @returns Babylon decal map renderer used to project images * @group create * @shortname enable decal map * @disposableOutput true */ enableDecalMap(inputs: Inputs.BabylonDecal.EnableDecalMapDto): BABYLON.MeshUVSpaceRenderer; /** * Projects an image into a decal map. Each call adds the image at the given location, accumulating onto previously * projected decals. Use it together with a decal map enabled on the mesh. * @param inputs decal map renderer, image texture and projection parameters * @group update * @shortname project decal */ projectDecal(inputs: Inputs.BabylonDecal.ProjectDecalDto): void; /** * Clears all projected decals from a decal map, resetting it to empty. * @param inputs decal map renderer * @group update * @shortname clear decal map */ clearDecalMap(inputs: Inputs.BabylonDecal.DecalMapDto): void; } /** * The rendering engine itself: the render loop, canvas sizing and resolution, hardware scaling and * the frame-level settings that decide how much work each frame does. Reach for it when you need to * control rendering rather than what is rendered. */ declare class BabylonEngine { private readonly context; /** * Gets the engine for the current context * @ignore true * @group engine * @shortname get engine */ getEngine(): BABYLON.Engine | BABYLON.WebGPUEngine; /** * Gets the rendering canvas on which scene cameras can be attached * @ignore true * @group engine * @shortname get rendering canvas */ getRenderingCanvas(): HTMLCanvasElement; } /** * Gaussian splatting scenes, captured real-world environments stored as clouds of soft colored * blobs in `.ply` files, loaded into the scene as meshes that can be moved, cloned and shadowed * like any other. */ declare class BabylonGaussianSplatting { private readonly context; /** * Loads a Gaussian splatting `.ply` file from a URL into the scene as a mesh that casts and * receives shadows; nothing is loaded without a URL. * @param inputs - The URL of the file * @returns The splatting mesh * @group create * @shortname gaussian splatting mesh * @disposableOutput true * @example * ```typescript * const splat = await bitbybit.babylon.gaussianSplatting.create({ url: "https://example.com/scans/room.ply" }); * ``` */ create(inputs: Inputs.BabylonGaussianSplatting.CreateGaussianSplattingMeshDto): Promise; /** * Makes a copy of a Gaussian splatting mesh that shares its splat data, so the same capture can * appear at several places cheaply. * @param inputs - The splatting mesh to copy * @returns The copy * @group multiply * @shortname clone splat * @disposableOutput true * @example * ```typescript * const copy = bitbybit.babylon.gaussianSplatting.clone({ babylonMesh: splat }); * bitbybit.babylon.mesh.setPosition({ babylonMesh: copy, position: [10, 0, 0] }); * ``` */ clone(inputs: Inputs.BabylonGaussianSplatting.GaussianSplattingMeshDto): BABYLON.GaussianSplattingMeshBase; /** * Reads the center point of every splat in a Gaussian splatting mesh, in its own coordinates; * the engine stores four numbers per splat and only the first three are the point. An unloaded * mesh gives an empty list. * @param inputs - The splatting mesh * @returns One point per splat * @group get * @shortname get splat positions * @drawable true * @example * ```typescript * const centers = bitbybit.babylon.gaussianSplatting.getSplatPositions({ babylonMesh: splat }); * ``` */ getSplatPositions(inputs: Inputs.BabylonGaussianSplatting.GaussianSplattingMeshDto): Inputs.Base.Point3[]; private enableShadows; } /** * One arrow of a position gizmo, dragging along a single axis; reach it through * `positionGizmo.getXGizmo` and its siblings to switch that axis on or off. */ declare class BabylonGizmoAxisDragGizmo { /** * Shows or hides one axis arrow of a position gizmo, so the mesh can be locked against moving * along that axis. * @param inputs - The axis drag gizmo and the flag * @returns The same axis drag gizmo * @group set * @shortname set is axis enabled * @example * ```typescript * const yArrow = bitbybit.babylon.gizmo.positionGizmo.getYGizmo({ positionGizmo }); * bitbybit.babylon.gizmo.axisDragGizmo.setIsEnabled({ axisDragGizmo: yArrow, isEnabled: false }); * ``` */ setIsEnabled(inputs: Inputs.BabylonGizmo.SetIsEnabledAxisDragGizmoDto): BABYLON.IAxisDragGizmo; /** * Reads whether one axis arrow of a position gizmo is shown. * @param inputs - The axis drag gizmo * @returns True when the arrow is shown * @group get * @shortname is axis enabled */ getIsEnabled(inputs: Inputs.BabylonGizmo.AxisDragGizmoDto): boolean; } /** * One handle of a scale gizmo, stretching along a single axis; reach it through * `scaleGizmo.getXGizmo` and its siblings to switch that axis on or off. */ declare class BabylonGizmoAxisScaleGizmo { /** * Shows or hides one axis handle of a scale gizmo, so the mesh can be locked against scaling * along that axis. * @param inputs - The axis scale gizmo and the flag * @returns The same axis scale gizmo * @group set * @shortname set is axis enabled * @example * ```typescript * const yHandle = bitbybit.babylon.gizmo.scaleGizmo.getYGizmo({ scaleGizmo }); * bitbybit.babylon.gizmo.axisScaleGizmo.setIsEnabled({ axisScaleGizmo: yHandle, isEnabled: false }); * ``` */ setIsEnabled(inputs: Inputs.BabylonGizmo.SetIsEnabledAxisScaleGizmoDto): BABYLON.IAxisScaleGizmo; /** * Reads whether one axis handle of a scale gizmo is shown. * @param inputs - The axis scale gizmo * @returns True when the handle is shown * @group get * @shortname is axis enabled */ getIsEnabled(inputs: Inputs.BabylonGizmo.AxisScaleGizmoDto): boolean; } /** * The bounding box gizmo: a frame around the attached mesh with corner boxes that scale it and * spheres that rotate it. The handles can keep a constant screen size, snap in steps, scale from a * chosen pivot and respond with a different speed per axis. */ declare class BabylonGizmoBoundingBoxGizmo { /** * Sets the size of the round rotation handles on a bounding box gizmo's edges. * @param inputs - The bounding box gizmo and the sphere size * @returns The same bounding box gizmo * @group set * @shortname set rotation sphere size */ setRotationSphereSize(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoRotationSphereSizeDto): BABYLON.BoundingBoxGizmo; /** * When true, the rotation spheres and scale boxes of a bounding box gizmo keep the same size on * screen whatever the distance to the camera; it takes precedence over * `fixedDragMeshBoundsSize`. * @param inputs - The bounding box gizmo and the flag * @returns The same bounding box gizmo * @group set * @shortname set fixed drag mesh screen size * @example * ```typescript * bitbybit.babylon.gizmo.boundingBoxGizmo.setFixedDragMeshScreenSize({ boundingBoxGizmo, fixedDragMeshScreenSize: true }); * ``` */ setFixedDragMeshScreenSize(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoFixedDragMeshScreenSizeDto): BABYLON.BoundingBoxGizmo; /** * When true, the handles of a bounding box gizmo are sized relative to the bounds of the * attached mesh instead of a fixed world size. * @param inputs - The bounding box gizmo and the flag * @returns The same bounding box gizmo * @group set * @shortname set fixed drag mesh bounds size */ setFixedDragMeshBoundsSize(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoFixedDragMeshBoundsSizeDto): BABYLON.BoundingBoxGizmo; /** * Sets the camera distance at which a bounding box gizmo's handles appear at their world size * when `fixedDragMeshScreenSize` is on; the default is 10. * @param inputs - The bounding box gizmo and the distance factor * @returns The same bounding box gizmo * @group set * @shortname set fixed drag mesh screen size dist factor */ setFixedDragMeshScreenSizeDistanceFactor(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoFixedDragMeshScreenSizeDistanceFactorDto): BABYLON.BoundingBoxGizmo; /** * Makes a bounding box gizmo scale the mesh in steps of `scalingSnapDistance` scene units of * drag instead of smoothly; 0 turns snapping off. * @param inputs - The bounding box gizmo and the step size * @returns The same bounding box gizmo * @group set * @shortname set scaling snap dist. */ setScalingSnapDistance(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoScalingSnapDistanceDto): BABYLON.BoundingBoxGizmo; /** * Makes a bounding box gizmo rotate the mesh in steps of `rotationSnapDistance` radians instead * of smoothly; 0 turns snapping off. * @param inputs - The bounding box gizmo and the step in radians * @returns The same bounding box gizmo * @group set * @shortname set rotation snap dist. */ setRotationSnapDistance(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoRotationSnapDistanceDto): BABYLON.BoundingBoxGizmo; /** * Sets the size of the square scale handles on a bounding box gizmo's corners. * @param inputs - The bounding box gizmo and the box size * @returns The same bounding box gizmo * @group set * @shortname set scale box size */ setScaleBoxSize(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoScaleBoxSizeDto): BABYLON.BoundingBoxGizmo; /** * Chooses how a bounding box gizmo's scale snapping steps combine: incremental steps add up, * 1.1 then 1.2 then 1.3 for a step of 0.1, while the default multiplies, 1.1 then 1.21 then * 1.33. * @param inputs - The bounding box gizmo and the flag * @returns The same bounding box gizmo * @group set * @shortname set incremental snap */ setIncrementalSnap(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoIncrementalSnapDto): BABYLON.BoundingBoxGizmo; /** * Sets the point a bounding box gizmo scales the mesh around, as fractions of its bounds: * `[0.5, 0.5, 0.5]` is the center and `[0.5, 0, 0.5]` the bottom; by default it scales from the * opposite corner. * @param inputs - The bounding box gizmo and the pivot fractions * @returns The same bounding box gizmo * @group set * @shortname set scale pivot * @example * ```typescript * bitbybit.babylon.gizmo.boundingBoxGizmo.setScalePivot({ boundingBoxGizmo, scalePivot: [0.5, 0, 0.5] }); * ``` */ setScalePivot(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoScalePivotDto): BABYLON.BoundingBoxGizmo; /** * Sets a separate drag sensitivity per axis for a bounding box gizmo, so scaling along one axis * can respond faster or slower than the others. * @param inputs - The bounding box gizmo and the factor per axis * @returns The same bounding box gizmo * @group set * @shortname set axis factor */ setAxisFactor(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoAxisFactorDto): BABYLON.BoundingBoxGizmo; /** * Sets how fast a bounding box gizmo scales the mesh for a given drag; 1 is the default. * @param inputs - The bounding box gizmo and the drag speed * @returns The same bounding box gizmo * @group set * @shortname set scale drag speed */ setScaleDragSpeed(inputs: Inputs.BabylonGizmo.SetBoundingBoxGizmoScaleDragSpeedDto): BABYLON.BoundingBoxGizmo; /** * Reads the size of the rotation handles of a bounding box gizmo. * @param inputs - The bounding box gizmo * @returns The rotation sphere size * @group get * @shortname get rotation sphere size */ getRotationSphereSize(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): number; /** * Reads the size of the scale handles of a bounding box gizmo. * @param inputs - The bounding box gizmo * @returns The scale box size * @group get * @shortname get scale box size */ getScaleBoxSize(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): number; /** * Reads whether the handles of a bounding box gizmo keep a constant screen size. * @param inputs - The bounding box gizmo * @returns True when the handles keep their screen size * @group get * @shortname get fixed drag mesh screen size */ getFixedDragMeshScreenSize(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): boolean; /** * Reads whether the handles of a bounding box gizmo are sized relative to the mesh bounds. * @param inputs - The bounding box gizmo * @returns True when the handles follow the bounds * @group get * @shortname get fixed drag mesh bounds size */ getFixedDragMeshBoundsSize(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): boolean; /** * Reads the camera distance at which a bounding box gizmo's handles appear at their world size. * @param inputs - The bounding box gizmo * @returns The distance factor * @group get * @shortname get fixed drag mesh screen size distance factor */ getFixedDragMeshScreenSizeDistanceFactor(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): number; /** * Reads the drag step a bounding box gizmo snaps scaling to, 0 meaning smooth scaling. * @param inputs - The bounding box gizmo * @returns The scaling snap distance * @group get * @shortname get scaling snap distance */ getScalingSnapDistance(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): number; /** * Reads the angle step in radians a bounding box gizmo snaps rotation to, 0 meaning smooth * rotation. * @param inputs - The bounding box gizmo * @returns The rotation snap distance in radians * @group get * @shortname get rotation snap distance */ getRotationSnapDistance(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): number; /** * Reads whether a bounding box gizmo's scale snapping steps add up rather than multiply. * @param inputs - The bounding box gizmo * @returns True when snapping is incremental * @group get * @shortname get incremental snap */ getIncrementalSnap(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): boolean; /** * Reads the pivot fractions a bounding box gizmo scales around. * @param inputs - The bounding box gizmo * @returns The pivot as fractions of the bounds * @group get * @shortname get scale pivot */ getScalePivot(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): Inputs.Base.Vector3; /** * Reads the drag sensitivity per axis of a bounding box gizmo. * @param inputs - The bounding box gizmo * @returns The factor per axis * @group get * @shortname get axis factor */ getAxisFactor(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): Inputs.Base.Vector3; /** * Reads how fast a bounding box gizmo scales the mesh for a given drag. * @param inputs - The bounding box gizmo * @returns The scale drag speed * @group get * @shortname get scale drag speed */ getScaleDragSpeed(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoDto): number; /** * Passes through the name of a bounding box gizmo event as a typed selector for code that * subscribes to gizmo events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname bounding box gizmo observable selector * @example * ```typescript * const selector = bitbybit.babylon.gizmo.boundingBoxGizmo.createBoundingBoxGizmoObservableSelector({ selector: Bit.Inputs.BabylonGizmo.boundingBoxGizmoObservableSelectorEnum.onScaleBoxDragEndObservable }); * ``` */ createBoundingBoxGizmoObservableSelector(inputs: Inputs.BabylonGizmo.BoundingBoxGizmoObservableSelectorDto): Inputs.BabylonGizmo.boundingBoxGizmoObservableSelectorEnum; } /** * Settings shared by every gizmo: the scale ratio that sets how large the handles are drawn on * screen, independent of the size of the mesh they are attached to. */ declare class BabylonGizmoBase { /** * Sets how large a gizmo's handles are drawn; 1 is the default size and 2 doubles it, whatever * the attached mesh's size. * @param inputs - The gizmo and the scale ratio * @returns The same gizmo * @group set * @shortname set scale ratio * @example * ```typescript * bitbybit.babylon.gizmo.base.scaleRatio({ gizmo: positionGizmo, scaleRatio: 1.5 }); * ``` */ scaleRatio(inputs: Inputs.BabylonGizmo.SetGizmoScaleRatioDto): BABYLON.IGizmo; /** * Reads how large a gizmo's handles are drawn relative to the default size. * @param inputs - The gizmo * @returns The scale ratio * @group get * @shortname get scale ratio */ getScaleRatio(inputs: Inputs.BabylonGizmo.GizmoDto): number; } /** * The on-screen manipulators that let a user move, rotate and scale an object by dragging it. * Attach one to a mesh, choose which axes are active and what the snapping increments are, and read * back the transform the user produced. */ declare class BabylonGizmo { manager: BabylonGizmoManager; base: BabylonGizmoBase; positionGizmo: BabylonGizmoPositionGizmo; rotationGizmo: BabylonGizmoRotationGizmo; scaleGizmo: BabylonGizmoScaleGizmo; boundingBoxGizmo: BabylonGizmoBoundingBoxGizmo; axisDragGizmo: BabylonGizmoAxisDragGizmo; axisScaleGizmo: BabylonGizmoAxisScaleGizmo; planeDragGizmo: BabylonGizmoPlaneDragGizmo; planeRotationGizmo: BabylonGizmoPlaneRotationGizmo; } /** * The gizmo manager owns the on-screen manipulators for one attached mesh at a time and, by * default, attaches them to whatever the pointer clicks. Create it with the gizmos you want * enabled, then read the individual position, rotation, scale and bounding box gizmos from it to * tune them. */ declare class BabylonGizmoManager { private readonly context; /** * Creates a gizmo manager with the chosen gizmos enabled: position arrows, rotation rings, * scale handles and a bounding box. * * With `usePointerToAttachGizmos` true the gizmos attach to the mesh the user clicks, limited * to `attachableMeshes` when that list is given; `clearGizmoOnEmptyPointerEvent` detaches them * on a click into empty space. * @param inputs - Which gizmos to enable, the attachable meshes, the pointer behavior and the scale ratio * @returns The gizmo manager * @group create * @shortname create gizmo manager * @disposableOutput true * @example * ```typescript * const manager = bitbybit.babylon.gizmo.manager.createGizmoManager({ positionGizmoEnabled: true, rotationGizmoEnabled: true, scaleGizmoEnabled: false, boundingBoxGizmoEnabled: false, attachableMeshes: [], usePointerToAttachGizmos: false, clearGizmoOnEmptyPointerEvent: false, scaleRatio: 1 }); * bitbybit.babylon.gizmo.manager.attachToMesh({ gizmoManager: manager, mesh }); * ``` */ createGizmoManager(inputs: Inputs.BabylonGizmo.CreateGizmoDto): BABYLON.GizmoManager; /** * Reads the position gizmo of a manager, the arrows that drag the mesh along an axis, for * tuning its snapping and planes; it exists only when position gizmos are enabled. * @param inputs - The gizmo manager * @returns The position gizmo * @group get * @shortname get position gizmo * @example * ```typescript * const positionGizmo = bitbybit.babylon.gizmo.manager.getPositionGizmo({ gizmoManager: manager }); * bitbybit.babylon.gizmo.positionGizmo.snapDistance({ positionGizmo, snapDistance: 1 }); * ``` */ getPositionGizmo(inputs: Inputs.BabylonGizmo.GizmoManagerDto): BABYLON.IPositionGizmo; /** * Reads the rotation gizmo of a manager, the rings that turn the mesh around an axis, for * tuning its snapping and sensitivity; it exists only when rotation gizmos are enabled. * @param inputs - The gizmo manager * @returns The rotation gizmo * @group get * @shortname get rotation gizmo * @example * ```typescript * const rotationGizmo = bitbybit.babylon.gizmo.manager.getRotationGizmo({ gizmoManager: manager }); * bitbybit.babylon.gizmo.rotationGizmo.snapDistance({ rotationGizmo, snapDistance: 0.2 }); * ``` */ getRotationGizmo(inputs: Inputs.BabylonGizmo.GizmoManagerDto): BABYLON.IRotationGizmo; /** * Reads the scale gizmo of a manager, the handles that stretch the mesh along an axis, for * tuning its snapping and sensitivity; it exists only when scale gizmos are enabled. * @param inputs - The gizmo manager * @returns The scale gizmo * @group get * @shortname get scale gizmo */ getScaleGizmo(inputs: Inputs.BabylonGizmo.GizmoManagerDto): BABYLON.IScaleGizmo; /** * Reads the bounding box gizmo of a manager, the frame with corner handles for scaling and * rotating, for tuning its handles and snapping; it exists only when bounding box gizmos are * enabled. * @param inputs - The gizmo manager * @returns The bounding box gizmo * @group get * @shortname get bounding box gizmo */ getBoundingBoxGizmo(inputs: Inputs.BabylonGizmo.GizmoManagerDto): BABYLON.IBoundingBoxGizmo; /** * Shows the manager's enabled gizmos on a mesh so the user can manipulate it; any mesh attached * before is released. * @param inputs - The gizmo manager and the mesh * @returns The same gizmo manager * @group update * @shortname attach to mesh * @example * ```typescript * bitbybit.babylon.gizmo.manager.attachToMesh({ gizmoManager: manager, mesh }); * ``` */ attachToMesh(inputs: Inputs.BabylonGizmo.AttachToMeshDto): BABYLON.GizmoManager; /** * Hides the manager's gizmos by releasing the mesh they were attached to. * @param inputs - The gizmo manager * @returns The same gizmo manager * @group update * @shortname detach mesh * @example * ```typescript * bitbybit.babylon.gizmo.manager.detachMesh({ gizmoManager: manager }); * ``` */ detachMesh(inputs: Inputs.BabylonGizmo.GizmoManagerDto): BABYLON.GizmoManager; } /** * One plane handle of a position gizmo, dragging within a single plane; reach it through * `positionGizmo.getXPlaneGizmo` and its siblings to switch that plane on or off. */ declare class BabylonGizmoPlaneDragGizmo { /** * Shows or hides one plane handle of a position gizmo, so the mesh can be locked against * sliding in that plane. * @param inputs - The plane drag gizmo and the flag * @returns The same plane drag gizmo * @group set * @shortname set is plane enabled * @example * ```typescript * const xzHandle = bitbybit.babylon.gizmo.positionGizmo.getYPlaneGizmo({ positionGizmo }); * bitbybit.babylon.gizmo.planeDragGizmo.setIsEnabled({ planeDragGizmo: xzHandle, isEnabled: true }); * ``` */ setIsEnabled(inputs: Inputs.BabylonGizmo.SetIsEnabledPlaneDragGizmoDto): BABYLON.IPlaneDragGizmo; /** * Reads whether one plane handle of a position gizmo is shown. * @param inputs - The plane drag gizmo * @returns True when the handle is shown * @group get * @shortname is plane enabled */ getIsEnabled(inputs: Inputs.BabylonGizmo.PlaneDragGizmoDto): boolean; } /** * One ring of a rotation gizmo, turning around a single axis; reach it through * `rotationGizmo.getXGizmo` and its siblings to switch that ring on or off. */ declare class BabylonGizmoPlaneRotationGizmo { /** * Shows or hides one ring of a rotation gizmo, so the mesh can be locked against turning around * that axis. * @param inputs - The plane rotation gizmo and the flag * @returns The same plane rotation gizmo * @group set * @shortname set is plane enabled * @example * ```typescript * const xRing = bitbybit.babylon.gizmo.rotationGizmo.getXGizmo({ rotationGizmo }); * bitbybit.babylon.gizmo.planeRotationGizmo.setIsEnabled({ planeRotationGizmo: xRing, isEnabled: false }); * ``` */ setIsEnabled(inputs: Inputs.BabylonGizmo.SetIsEnabledPlaneRotationGizmoDto): BABYLON.IPlaneRotationGizmo; /** * Reads whether one ring of a rotation gizmo is shown. * @param inputs - The plane rotation gizmo * @returns True when the ring is shown * @group get * @shortname is plane enabled */ getIsEnabled(inputs: Inputs.BabylonGizmo.PlaneRotationGizmoDto): boolean; } /** * The position gizmo: three arrows that drag the attached mesh along X, Y or Z, plus optional * square handles that drag it within a plane. Snapping moves the mesh in fixed steps, and the axis * and plane parts can be reached one by one to enable or disable them. */ declare class BabylonGizmoPositionGizmo { /** * Shows or hides the square handles of a position gizmo that drag the mesh within the XY, YZ * and XZ planes, in addition to the axis arrows. * @param inputs - The position gizmo and the flag * @returns The same position gizmo * @group set * @shortname set planar gizmo enabled * @example * ```typescript * bitbybit.babylon.gizmo.positionGizmo.planarGizmoEnabled({ positionGizmo, planarGizmoEnabled: true }); * ``` */ planarGizmoEnabled(inputs: Inputs.BabylonGizmo.SetPlanarGizmoEnabled): BABYLON.IPositionGizmo; /** * Makes a position gizmo move the mesh in steps of `snapDistance` scene units instead of * smoothly; 0 turns snapping off. * @param inputs - The position gizmo and the step size * @returns The same position gizmo * @group set * @shortname set snap distance * @example * ```typescript * bitbybit.babylon.gizmo.positionGizmo.snapDistance({ positionGizmo, snapDistance: 0.5 }); * ``` */ snapDistance(inputs: Inputs.BabylonGizmo.SetPositionGizmoSnapDistanceDto): BABYLON.IPositionGizmo; /** * Reads the mesh a position gizmo is currently attached to. * @param inputs - The position gizmo * @returns The attached mesh * @group get * @shortname get attached mesh */ getAttachedMesh(inputs: Inputs.BabylonGizmo.PositionGizmoDto): BABYLON.AbstractMesh; /** * Reads the node a position gizmo is currently attached to, which may be a transform node * rather than a mesh. * @param inputs - The position gizmo * @returns The attached node * @group get * @shortname get attached node */ getAttachedNode(inputs: Inputs.BabylonGizmo.PositionGizmoDto): BABYLON.Node; /** * Reads the arrow of a position gizmo that drags along X, to enable or disable it on its own. * @param inputs - The position gizmo * @returns The X axis drag gizmo * @group get * @shortname get x gizmo */ getXGizmo(inputs: Inputs.BabylonGizmo.PositionGizmoDto): BABYLON.IAxisDragGizmo; /** * Reads the arrow of a position gizmo that drags along Y, to enable or disable it on its own. * @param inputs - The position gizmo * @returns The Y axis drag gizmo * @group get * @shortname get y gizmo */ getYGizmo(inputs: Inputs.BabylonGizmo.PositionGizmoDto): BABYLON.IAxisDragGizmo; /** * Reads the arrow of a position gizmo that drags along Z, to enable or disable it on its own. * @param inputs - The position gizmo * @returns The Z axis drag gizmo * @group get * @shortname get z gizmo */ getZGizmo(inputs: Inputs.BabylonGizmo.PositionGizmoDto): BABYLON.IAxisDragGizmo; /** * Reads the handle of a position gizmo that drags within the plane facing X, the YZ plane, to * enable or disable it on its own. * @param inputs - The position gizmo * @returns The X plane drag gizmo * @group get * @shortname get x plane gizmo */ getXPlaneGizmo(inputs: Inputs.BabylonGizmo.PositionGizmoDto): BABYLON.IPlaneDragGizmo; /** * Reads the handle of a position gizmo that drags within the plane facing Y, the XZ plane, to * enable or disable it on its own. * @param inputs - The position gizmo * @returns The Y plane drag gizmo * @group get * @shortname get y plane gizmo */ getYPlaneGizmo(inputs: Inputs.BabylonGizmo.PositionGizmoDto): BABYLON.IPlaneDragGizmo; /** * Reads the handle of a position gizmo that drags within the plane facing Z, the XY plane, to * enable or disable it on its own. * @param inputs - The position gizmo * @returns The Z plane drag gizmo * @group get * @shortname get z plane gizmo */ getZPlaneGizmo(inputs: Inputs.BabylonGizmo.PositionGizmoDto): BABYLON.IPlaneDragGizmo; /** * Reads whether a position gizmo shows its plane handles. * @param inputs - The position gizmo * @returns True when the plane handles are shown * @group get * @shortname get planar gizmo enabled */ getPlanarGizmoEnabled(inputs: Inputs.BabylonGizmo.PositionGizmoDto): boolean; /** * Reads the step size a position gizmo snaps to, 0 meaning smooth movement. * @param inputs - The position gizmo * @returns The snap distance * @group get * @shortname get snap distance */ getSnapDistance(inputs: Inputs.BabylonGizmo.PositionGizmoDto): number; /** * Tells whether the user is dragging a position gizmo right now. * @param inputs - The position gizmo * @returns True while a drag is in progress * @group get * @shortname get is dragging */ getIsDragging(inputs: Inputs.BabylonGizmo.PositionGizmoDto): boolean; /** * Passes through the name of a position gizmo event, drag start, drag or drag end, as a typed * selector for code that subscribes to gizmo events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname position gizmo observable selector * @example * ```typescript * const selector = bitbybit.babylon.gizmo.positionGizmo.createPositionGizmoObservableSelector({ selector: Bit.Inputs.BabylonGizmo.positionGizmoObservableSelectorEnum.onDragEndObservable }); * ``` */ createPositionGizmoObservableSelector(inputs: Inputs.BabylonGizmo.PositionGizmoObservableSelectorDto): Inputs.BabylonGizmo.positionGizmoObservableSelectorEnum; } /** * The rotation gizmo: three rings that turn the attached mesh around X, Y or Z. Snapping turns it * in fixed angle steps, sensitivity sets how far a drag turns it, and each ring can be reached on * its own to enable or disable it. */ declare class BabylonGizmoRotationGizmo { /** * Makes a rotation gizmo turn the mesh in steps of `snapDistance` radians instead of smoothly; * 0 turns snapping off. * @param inputs - The rotation gizmo and the step in radians * @returns The same rotation gizmo * @group set * @shortname set snap distance * @example * ```typescript * bitbybit.babylon.gizmo.rotationGizmo.snapDistance({ rotationGizmo, snapDistance: Math.PI / 12 }); * ``` */ snapDistance(inputs: Inputs.BabylonGizmo.SetRotationGizmoSnapDistanceDto): BABYLON.IRotationGizmo; /** * Sets how far a rotation gizmo turns the mesh for a given drag; 1 is the default and higher * values turn it faster. * @param inputs - The rotation gizmo and the sensitivity * @returns The same rotation gizmo * @group set * @shortname set sensitivity */ sensitivity(inputs: Inputs.BabylonGizmo.SetRotationGizmoSensitivityDto): BABYLON.IRotationGizmo; /** * Reads the mesh a rotation gizmo is currently attached to, or null when none is. * @param inputs - The rotation gizmo * @returns The attached mesh, or null * @group get * @shortname get attached mesh */ getAttachedMesh(inputs: Inputs.BabylonGizmo.RotationGizmoDto): BABYLON.Nullable; /** * Reads the node a rotation gizmo is currently attached to, which may be a transform node * rather than a mesh. * @param inputs - The rotation gizmo * @returns The attached node * @group get * @shortname get attached node */ getAttachedNode(inputs: Inputs.BabylonGizmo.RotationGizmoDto): BABYLON.Node; /** * Reads the ring of a rotation gizmo that turns around X, to enable or disable it on its own. * @param inputs - The rotation gizmo * @returns The X plane rotation gizmo * @group get * @shortname get x gizmo */ getXGizmo(inputs: Inputs.BabylonGizmo.RotationGizmoDto): BABYLON.IPlaneRotationGizmo; /** * Reads the ring of a rotation gizmo that turns around Y, to enable or disable it on its own. * @param inputs - The rotation gizmo * @returns The Y plane rotation gizmo * @group get * @shortname get y gizmo */ getYGizmo(inputs: Inputs.BabylonGizmo.RotationGizmoDto): BABYLON.IPlaneRotationGizmo; /** * Reads the ring of a rotation gizmo that turns around Z, to enable or disable it on its own. * @param inputs - The rotation gizmo * @returns The Z plane rotation gizmo * @group get * @shortname get z gizmo */ getZGizmo(inputs: Inputs.BabylonGizmo.RotationGizmoDto): BABYLON.IPlaneRotationGizmo; /** * Reads the angle step in radians a rotation gizmo snaps to, 0 meaning smooth rotation. * @param inputs - The rotation gizmo * @returns The snap distance in radians * @group get * @shortname get snap distance */ getSnapDistance(inputs: Inputs.BabylonGizmo.RotationGizmoDto): number; /** * Reads how far a rotation gizmo turns the mesh for a given drag. * @param inputs - The rotation gizmo * @returns The sensitivity * @group get * @shortname get sensitivity */ getSensitivity(inputs: Inputs.BabylonGizmo.RotationGizmoDto): number; /** * Passes through the name of a rotation gizmo event, drag start, drag or drag end, as a typed * selector for code that subscribes to gizmo events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname rotation gizmo observable selector * @example * ```typescript * const selector = bitbybit.babylon.gizmo.rotationGizmo.createRotationGizmoObservableSelector({ selector: Bit.Inputs.BabylonGizmo.rotationGizmoObservableSelectorEnum.onDragEndObservable }); * ``` */ createRotationGizmoObservableSelector(inputs: Inputs.BabylonGizmo.RotationGizmoObservableSelectorDto): Inputs.BabylonGizmo.rotationGizmoObservableSelectorEnum; } /** * The scale gizmo: three handles that stretch the attached mesh along X, Y or Z and a center handle * that scales it evenly. Snapping scales in fixed steps, sensitivity sets how much a drag scales, * and each axis handle can be reached on its own. */ declare class BabylonGizmoScaleGizmo { /** * Reads the handle of a scale gizmo that stretches along X, to enable or disable it on its own. * @param inputs - The scale gizmo * @returns The X axis scale gizmo * @group get * @shortname get x gizmo */ getXGizmo(inputs: Inputs.BabylonGizmo.ScaleGizmoDto): BABYLON.IAxisScaleGizmo; /** * Reads the handle of a scale gizmo that stretches along Y, to enable or disable it on its own. * @param inputs - The scale gizmo * @returns The Y axis scale gizmo * @group get * @shortname get y gizmo */ getYGizmo(inputs: Inputs.BabylonGizmo.ScaleGizmoDto): BABYLON.IAxisScaleGizmo; /** * Reads the handle of a scale gizmo that stretches along Z, to enable or disable it on its own. * @param inputs - The scale gizmo * @returns The Z axis scale gizmo * @group get * @shortname get z gizmo */ getZGizmo(inputs: Inputs.BabylonGizmo.ScaleGizmoDto): BABYLON.IAxisScaleGizmo; /** * Makes a scale gizmo change the scale in steps of `snapDistance` instead of smoothly; 0 turns * snapping off. `setIncrementalSnap` chooses how the steps combine. * @param inputs - The scale gizmo and the step size * @returns The same scale gizmo * @group set * @shortname set snap distance * @example * ```typescript * bitbybit.babylon.gizmo.scaleGizmo.snapDistance({ scaleGizmo, snapDistance: 0.1 }); * bitbybit.babylon.gizmo.scaleGizmo.setIncrementalSnap({ scaleGizmo, incrementalSnap: true }); * ``` */ snapDistance(inputs: Inputs.BabylonGizmo.SetScaleGizmoSnapDistanceDto): BABYLON.IScaleGizmo; /** * Chooses how a scale gizmo's snapping steps combine: incremental steps add up, 1.1 then 1.2 * then 1.3 for a step of 0.1, while the default multiplies, 1.1 then 1.21 then 1.33. * @param inputs - The scale gizmo and the flag * @returns The same scale gizmo * @group set * @shortname set incremental snap */ setIncrementalSnap(inputs: Inputs.BabylonGizmo.SetScaleGizmoIncrementalSnapDto): BABYLON.IScaleGizmo; /** * Sets how much a scale gizmo changes the scale for a given drag; 1 is the default and higher * values scale faster. * @param inputs - The scale gizmo and the sensitivity * @returns The same scale gizmo * @group set * @shortname set sensitivity */ sensitivity(inputs: Inputs.BabylonGizmo.SetScaleGizmoSensitivityDto): BABYLON.IScaleGizmo; /** * Reads whether a scale gizmo's snapping steps add up rather than multiply. * @param inputs - The scale gizmo * @returns True when snapping is incremental * @group get * @shortname get incremental snap */ getIncrementalSnap(inputs: Inputs.BabylonGizmo.ScaleGizmoDto): boolean; /** * Reads the step size a scale gizmo snaps to, 0 meaning smooth scaling. * @param inputs - The scale gizmo * @returns The snap distance * @group get * @shortname get snap distance */ getSnapDistance(inputs: Inputs.BabylonGizmo.ScaleGizmoDto): number; /** * Reads how much a scale gizmo changes the scale for a given drag. * @param inputs - The scale gizmo * @returns The sensitivity * @group get * @shortname get sensitivity */ getSensitivity(inputs: Inputs.BabylonGizmo.ScaleGizmoDto): number; /** * Passes through the name of a scale gizmo event, drag start, drag or drag end, as a typed * selector for code that subscribes to gizmo events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname scale gizmo observable selector * @example * ```typescript * const selector = bitbybit.babylon.gizmo.scaleGizmo.createScaleGizmoObservableSelector({ selector: Bit.Inputs.BabylonGizmo.scaleGizmoObservableSelectorEnum.onDragEndObservable }); * ``` */ createScaleGizmoObservableSelector(inputs: Inputs.BabylonGizmo.ScaleGizmoObservableSelectorDto): Inputs.BabylonGizmo.scaleGizmoObservableSelectorEnum; } /** * Advanced glTF/glb tooling on top of the basic import/export in io. It keeps the rich asset container * instead of collapsing everything into a single mesh, which unlocks KHR_materials_variants, animation * groups and other glTF level features that need the loaded asset graph. */ declare class BabylonGltf { private readonly context; /** * Loads a glTF or glb file from a url into the scene and returns the asset container. The container keeps references * to the meshes, materials, animation groups and the root node so that features like material variants keep working. * @param inputs asset file name and root url * @returns Babylon asset container of the loaded gltf * @group load * @shortname gltf container from url */ loadAssetContainerFromUrl(inputs: Inputs.Asset.AssetFileByUrlDto): Promise; /** * Loads a glTF or glb file from an uploaded asset file into the scene and returns the asset container. * @param inputs asset file * @returns Babylon asset container of the loaded glTF * @group load * @shortname gltf container from file */ loadAssetContainer(inputs: Inputs.Asset.AssetFileDto): Promise; /** * Gets the root transform node of a loaded glTF asset. Material variant operations require this node. * @param inputs asset container * @returns root transform node * @group get * @shortname gltf root node */ getRootNode(inputs: Inputs.BabylonGltf.AssetContainerDto): BABYLON.TransformNode; /** * Gets all meshes of a loaded glTF asset container. * @param inputs asset container * @returns meshes * @group get * @shortname gltf meshes */ getMeshes(inputs: Inputs.BabylonGltf.AssetContainerDto): BABYLON.AbstractMesh[]; /** * Lists the names of the KHR_materials_variants material variants declared by a loaded glTF asset. * @param inputs glTF root node * @returns names of available material variants * @group variants * @shortname list material variants */ listMaterialVariants(inputs: Inputs.BabylonGltf.GltfRootNodeDto): string[]; /** * Activates a KHR_materials_variants material variant by name, swapping the materials of the asset accordingly. * @param inputs glTF root node and variant name * @group variants * @shortname select material variant */ selectMaterialVariant(inputs: Inputs.BabylonGltf.SelectVariantDto): void; /** * Gets the currently selected KHR_materials_variants material variant of a loaded glTF asset. * @param inputs glTF root node * @returns name of the selected material variant, or nothing if none is selected * @group variants * @shortname get selected material variant */ getSelectedMaterialVariant(inputs: Inputs.BabylonGltf.GltfRootNodeDto): string | string[]; /** * Resets the materials of a loaded glTF asset back to the original KHR_materials_variants default. * @param inputs glTF root node * @group variants * @shortname reset material variant */ resetMaterialVariant(inputs: Inputs.BabylonGltf.GltfRootNodeDto): void; /** * Gets the animation groups of a loaded glTF asset container. * @param inputs asset container * @returns animation groups * @group animations * @shortname gltf animation groups */ getAnimationGroups(inputs: Inputs.BabylonGltf.AssetContainerDto): BABYLON.AnimationGroup[]; /** * Lists the names of the animation groups of a loaded glTF asset container. * @param inputs asset container * @returns names of the animation groups * @group animations * @shortname list animation groups */ listAnimationGroupNames(inputs: Inputs.BabylonGltf.AssetContainerDto): string[]; /** * Starts playing an animation group of a loaded glTF asset. * @param inputs animation group and playback options * @group animations * @shortname play animation group */ playAnimationGroup(inputs: Inputs.BabylonGltf.PlayAnimationGroupDto): void; /** * Stops an animation group of a loaded glTF asset. * @param inputs animation group * @group animations * @shortname stop animation group */ stopAnimationGroup(inputs: Inputs.BabylonGltf.AnimationGroupDto): void; private addContainer; } /** * The surface GUI controls are drawn on: a full-screen layer over the canvas, or a texture wrapped * onto a mesh so the controls sit in the 3D scene. Every control has to be added to one of these, * directly or through a container, before it shows. */ declare class BabylonGuiAdvancedDynamicTexture { private readonly context; /** * Creates the full-screen layer that GUI controls are added to, drawn over the whole canvas in * front of the scene when `foreground` is true; `adaptiveScaling` scales the layer with the * screen's pixel density. * @param inputs - The name, the foreground flag and the adaptive scaling flag * @returns The full-screen UI texture * @group spaces * @shortname create full screen ui * @disposableOutput true * @example * ```typescript * const ui = bitbybit.babylon.gui.advancedDynamicTexture.createFullScreenUI({ name: "ui", foreground: true, adaptiveScaling: false }); * const panel = bitbybit.babylon.gui.stackPanel.createStackPanel({ name: "panel", isVertical: true, spacing: 8, width: "300px", height: "400px", color: "#00000000", background: "#00000055" }); * ui.addControl(panel); * ``` */ createFullScreenUI(inputs: Inputs.BabylonGui.CreateFullScreenUIDto): BABYLON.GUI.AdvancedDynamicTexture; /** * Creates a GUI texture wrapped onto a mesh, so controls added to it appear on the mesh's * surface in the scene; the mesh needs texture coordinates, a plane being the usual choice. * * `width` and `height` size the texture in pixels, `supportPointerMove` lets controls react to * hover, and `onlyAlphaTesting` draws it without blending. * @param inputs - The mesh, the texture size, the pointer, alpha, flip and sampling options * @returns The GUI texture on the mesh * @group spaces * @shortname create for mesh * @disposableOutput true * @example * ```typescript * const plane = bitbybit.babylon.meshBuilder.createRectanglePlane({ width: 4, height: 2, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: false }); * const ui = bitbybit.babylon.gui.advancedDynamicTexture.createForMesh({ mesh: plane, width: 1024, height: 512, supportPointerMove: true, onlyAlphaTesting: false, invertY: true, sampling: Bit.Inputs.BabylonTexture.samplingModeEnum.trilinear }); * ``` */ createForMesh(inputs: Inputs.BabylonGui.CreateForMeshDto): BABYLON.GUI.AdvancedDynamicTexture; } /** * Push buttons with a text label. Subscribe to the button's pointer click event to run code when it * is pressed; the label, colors and size can be changed after creation with the `control` methods. */ declare class BabylonGuiButton { /** * Creates a button with a text label, text color, background and font size; sizes are pixel * strings or fractions of the parent, and a size left out is chosen by the engine. * @param inputs - The name, the label, the colors, the optional size and the font size * @returns The button * @group create * @shortname create simple button * @disposableOutput true * @example * ```typescript * const button = bitbybit.babylon.gui.button.createSimpleButton({ name: "run", label: "Run", color: "black", background: "#f0cebb", width: "200px", height: "40px", fontSize: 24 }); * panel.addControl(button); * button.onPointerClickObservable.add(() => { console.log("clicked"); }); * ``` */ createSimpleButton(inputs: Inputs.BabylonGui.CreateButtonDto): BABYLON.GUI.Button; /** * Changes the label shown on a button to the given text. * @param inputs - The button and the text * @returns The same button * @group set * @shortname set button text */ setButtonText(inputs: Inputs.BabylonGui.SetButtonTextDto): BABYLON.GUI.Button; /** * Reads the label currently shown on a button. * @param inputs - The button * @returns The label text * @group get * @shortname get button text */ getButtonText(inputs: Inputs.BabylonGui.ButtonDto): string; } /** * Checkboxes: square toggles that are on or off, for yes or no choices. Subscribe to the checked * changed event to react to the user. */ declare class BabylonGuiCheckbox { /** * Creates a checkbox that starts checked or not; `checkSizeRatio` is how much of the square the * inner mark fills. * @param inputs - The name, the checked state, the mark size, the colors and the optional size * @returns The checkbox * @group create * @shortname create checkbox * @disposableOutput true * @example * ```typescript * const checkbox = bitbybit.babylon.gui.checkbox.createCheckbox({ name: "showEdges", isChecked: true, checkSizeRatio: 0.8, color: "#f0cebb", background: "black", width: "30px", height: "30px" }); * panel.addControl(checkbox); * checkbox.onIsCheckedChangedObservable.add((checked) => { console.log(checked); }); * ``` */ createCheckbox(inputs: Inputs.BabylonGui.CreateCheckboxDto): BABYLON.GUI.Checkbox; /** * Sets the background color of a checkbox's square, as a CSS color. * @param inputs - The checkbox and the background color * @returns The same checkbox * @group set * @shortname set checkbox background */ setBackground(inputs: Inputs.BabylonGui.SetCheckboxBackgroundDto): BABYLON.GUI.Checkbox; /** * Sets how much of a checkbox's square its inner mark fills, from 0 to 1. * @param inputs - The checkbox and the ratio * @returns The same checkbox * @group set * @shortname set checkbox check size ratio */ setCheckSizeRatio(inputs: Inputs.BabylonGui.SetCheckboxCheckSizeRatioDto): BABYLON.GUI.Checkbox; /** * Checks or unchecks a checkbox, which fires its checked changed event like a click would. * @param inputs - The checkbox and the flag * @returns The same checkbox * @group set * @shortname set checkbox is checked */ setIsChecked(inputs: Inputs.BabylonGui.SetCheckboxIsCheckedDto): BABYLON.GUI.Checkbox; /** * Reads how much of a checkbox's square its inner mark fills. * @param inputs - The checkbox * @returns The ratio * @group get * @shortname get check size ratio */ getCheckSizeRatio(inputs: Inputs.BabylonGui.CheckboxDto): number; /** * Reads whether a checkbox is currently checked, true for on. * @param inputs - The checkbox * @returns True when checked * @group get * @shortname get is checked */ getIsChecked(inputs: Inputs.BabylonGui.CheckboxDto): boolean; /** * Reads the background color of a checkbox's square. * @param inputs - The checkbox * @returns The background color * @group get * @shortname get checkbox background */ getBackground(inputs: Inputs.BabylonGui.CheckboxDto): string; /** * Passes through the name of a checkbox event, its checked state changing, as a typed selector * for code that subscribes to checkbox events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname checkbox observable selector */ createCheckboxObservableSelector(inputs: Inputs.BabylonGui.CheckboxObservableSelectorDto): Inputs.BabylonGui.checkboxObservableSelectorEnum; } /** * Color pickers: a color wheel with a square for lightness and saturation, giving a hex color. * Subscribe to the value changed event to react to the user. */ declare class BabylonGuiColorPicker { /** * Creates a color picker starting at `defaultColor`; `size` sets both its width and height, as * a pixel string or a fraction, and defaults to 300 pixels. * @param inputs - The name, the starting color, the color, the optional width, height and size * @returns The color picker * @group create * @shortname color picker * @disposableOutput true * @example * ```typescript * const picker = bitbybit.babylon.gui.colorPicker.createColorPicker({ name: "faceColor", defaultColor: "#f0cebb", color: "#f0cebb", size: "200px" }); * panel.addControl(picker); * picker.onValueChangedObservable.add((color) => { console.log(color.toHexString()); }); * ``` */ createColorPicker(inputs: Inputs.BabylonGui.CreateColorPickerDto): BABYLON.GUI.ColorPicker; /** * Moves a color picker to a hex color, which fires its value changed event like a user pick * would. * @param inputs - The color picker and the hex color * @returns The same color picker * @group set * @shortname set colo picker value */ setColorPickerValue(inputs: Inputs.BabylonGui.SetColorPickerValueDto): BABYLON.GUI.ColorPicker; /** * Sets the width and height of a color picker together, as a pixel string or a fraction of the * parent. * @param inputs - The color picker and the size * @returns The same color picker * @group set * @shortname set color picker size */ setColorPickerSize(inputs: Inputs.BabylonGui.SetColorPickerSizeDto): BABYLON.GUI.ColorPicker; /** * Reads the color a color picker currently holds, as a hex string. * @param inputs - The color picker * @returns The hex color * @group get * @shortname get color picker value */ getColorPickerValue(inputs: Inputs.BabylonGui.ColorPickerDto): string; /** * Reads the size of a color picker, its width and height together. * @param inputs - The color picker * @returns The size * @group get * @shortname get color picker size */ getColorPickerSize(inputs: Inputs.BabylonGui.ColorPickerDto): string | number; /** * Passes through the name of a color picker event, its value changing, as a typed selector for * code that subscribes to color picker events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname color picker observable selector */ createColorPickerObservableSelector(inputs: Inputs.BabylonGui.ColorPickerObservableSelectorDto): Inputs.BabylonGui.colorPickerObservableSelectorEnum; } /** * What every container control shares: adding child controls, a background color and the read-only * state. Stack panels are containers, and so is the root of a GUI texture. */ declare class BabylonGuiContainer { /** * Adds controls to a container in the given order; with `clearControlsFirst` true the container * is emptied first, so the order is exactly the list's. * @param inputs - The container, the controls and whether to empty the container first * @returns The same container * @group controls * @shortname add controls to container * @example * ```typescript * bitbybit.babylon.gui.container.addControls({ container: panel, controls: [title, slider, button], clearControlsFirst: true }); * ``` */ addControls(inputs: Inputs.BabylonGui.AddControlsToContainerDto): BABYLON.GUI.Container; /** * Sets the background color of a container as a CSS color; an eight-digit hex such as * `#00000055` makes it translucent. * @param inputs - The container and the background color * @returns The same container * @group set * @shortname set container background */ setBackground(inputs: Inputs.BabylonGui.SetContainerBackgroundDto): BABYLON.GUI.Container; /** * Makes a container and everything in it read-only or editable again. * @param inputs - The container and the flag * @returns The same container * @group set * @shortname set container is readonly */ setIsReadonly(inputs: Inputs.BabylonGui.SetContainerIsReadonlyDto): BABYLON.GUI.Container; /** * Reads the background color of a container as a CSS color string. * @param inputs - The container * @returns The background color * @group get * @shortname get container background */ getBackground(inputs: Inputs.BabylonGui.ContainerDto): string; /** * Reads whether a container and its children are read-only. * @param inputs - The container * @returns True when the container is read-only * @group get * @shortname get container is readonly */ getIsReadonly(inputs: Inputs.BabylonGui.ContainerDto): boolean; } /** * What every GUI control shares, whatever its kind: padding, alignment inside its parent, size, * color, font size, visibility, the enabled and read-only states and cloning. Sizes are pixel * strings such as `200px` or fractions of the parent from 0 to 1. The setters change the control in * place and give it back so calls can be chained. */ declare class BabylonGuiControl { /** * Sets the space kept clear around a control inside its parent, per side; a side left out keeps * its padding. Values are pixel strings such as `10px` or fractions of the parent. * @param inputs - The control and the four paddings * @returns The same control * @group positioning * @shortname change padding * @example * ```typescript * bitbybit.babylon.gui.control.changeControlPadding({ control: button, paddingLeft: "10px", paddingRight: "10px", paddingTop: "4px", paddingBottom: "4px" }); * ``` */ changeControlPadding(inputs: Inputs.BabylonGui.PaddingLeftRightTopBottomDto): BABYLON.GUI.Control; /** * Sets where a control sits inside its parent: left, center or right, and top, center or * bottom. * @param inputs - The control and the two alignments * @returns The same control * @group positioning * @shortname change alignment * @example * ```typescript * bitbybit.babylon.gui.control.changeControlAlignment({ control: panel, horizontalAlignment: Bit.Inputs.BabylonGui.horizontalAlignmentEnum.left, verticalAlignment: Bit.Inputs.BabylonGui.verticalAlignmentEnum.top }); * ``` */ changeControlAlignment(inputs: Inputs.BabylonGui.AlignmentDto): BABYLON.GUI.Control; /** * Makes a copy of a control with all its settings, names it and adds it to `container` when one * is given; `host` is the GUI texture the copy belongs to. * @param inputs - The control, the optional container, the name and the optional host texture * @returns The copy * @group create * @shortname clone control * @disposableOutput true * @example * ```typescript * const second = bitbybit.babylon.gui.control.cloneControl({ control: button, container: panel, name: "second", host: ui }); * ``` */ cloneControl(inputs: Inputs.BabylonGui.CloneControlDto): BABYLON.GUI.Control; /** * Passes through the name of a control event, such as a pointer click or pointer enter, as a * typed selector for code that subscribes to control events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname control observable selector * @example * ```typescript * const selector = bitbybit.babylon.gui.control.createControlObservableSelector({ selector: Bit.Inputs.BabylonGui.controlObservableSelectorEnum.onPointerClickObservable }); * ``` */ createControlObservableSelector(inputs: Inputs.BabylonGui.ControlObservableSelectorDto): Inputs.BabylonGui.controlObservableSelectorEnum; /** * Finds a control by its name inside a container, searching its children too. * @param inputs - The container and the name * @returns The control with that name * @group get * @shortname get control by name * @example * ```typescript * const button = bitbybit.babylon.gui.control.getControlByName({ container: panel, name: "buttonName" }); * ``` */ getControlByName(inputs: Inputs.BabylonGui.GetControlByNameDto): BABYLON.GUI.Control; /** * Shows or hides a control; a hidden control keeps its place in a stack panel's layout. * @param inputs - The control and the flag * @returns The same control * @group set * @shortname set control is visible */ setIsVisible(inputs: Inputs.BabylonGui.SetControlIsVisibleDto): BABYLON.GUI.Control; /** * Makes a control read-only or editable again; a read-only control is shown normally but * ignores input. * @param inputs - The control and the flag * @returns The same control * @group set * @shortname set control is readonly */ setIsReadonly(inputs: Inputs.BabylonGui.SetControlIsReadonlyDto): BABYLON.GUI.Control; /** * Enables or disables a control; a disabled control is drawn dimmed and ignores input. * @param inputs - The control and the flag * @returns The same control * @group set * @shortname set control is enabled */ setIsEnabled(inputs: Inputs.BabylonGui.SetControlIsEnabledDto): BABYLON.GUI.Control; /** * Sets the height of a control, as a pixel string such as `40px` or a fraction of the parent * from 0 to 1. * @param inputs - The control and the height * @returns The same control * @group set * @shortname set control height */ setHeight(inputs: Inputs.BabylonGui.SetControlHeightDto): BABYLON.GUI.Control; /** * Sets the width of a control, as a pixel string such as `200px` or a fraction of the parent * from 0 to 1. * @param inputs - The control and the width * @returns The same control * @group set * @shortname set control width */ setWidth(inputs: Inputs.BabylonGui.SetControlWidthDto): BABYLON.GUI.Control; /** * Sets the main color of a control, the text color of a button or text block and the fill color * of a slider or checkbox, as a CSS color. * @param inputs - The control and the color * @returns The same control * @group set * @shortname set control color */ setColor(inputs: Inputs.BabylonGui.SetControlColorDto): BABYLON.GUI.Control; /** * Sets the font size of a control's text, as a number of pixels or a string such as `24px`. * @param inputs - The control and the font size * @returns The same control * @group set * @shortname set control font size */ setFontSize(inputs: Inputs.BabylonGui.SetControlFontSizeDto): BABYLON.GUI.Control; /** * Reads the height of a control, as a pixel string or a fraction of the parent. * @param inputs - The control * @returns The height * @group get * @shortname get control height */ getHeight(inputs: Inputs.BabylonGui.ControlDto): string | number; /** * Reads the width of a control, as a pixel string or a fraction of the parent. * @param inputs - The control * @returns The width * @group get * @shortname get control width */ getWidth(inputs: Inputs.BabylonGui.ControlDto): string | number; /** * Reads the main color of a control as a CSS color string. * @param inputs - The control * @returns The color * @group get * @shortname get control color */ getColor(inputs: Inputs.BabylonGui.ControlDto): string; /** * Reads the font size of a control's text, as a string such as `24px` or a number of pixels. * @param inputs - The control * @returns The font size * @group get * @shortname get control font size */ getFontSize(inputs: Inputs.BabylonGui.ControlDto): string | number; /** * Reads whether a control is shown rather than hidden. * @param inputs - The control * @returns True when the control is visible * @group get * @shortname get control is visible */ getIsVisible(inputs: Inputs.BabylonGui.ControlDto): boolean; /** * Reads whether a control ignores input while still being shown normally. * @param inputs - The control * @returns True when the control is read-only * @group get * @shortname get control is readonly */ getIsReadonly(inputs: Inputs.BabylonGui.ControlDto): boolean; /** * Reads whether a control is enabled rather than dimmed and inactive. * @param inputs - The control * @returns True when the control is enabled * @group get * @shortname get control is enabled */ getIsEnabled(inputs: Inputs.BabylonGui.ControlDto): boolean; } /** * The in-scene 2D interface: buttons, sliders, checkboxes, color pickers, text blocks, input * fields, images and the containers that lay them out. Use it for controls that live inside the 3D * canvas - a slider floating next to the model - rather than in the surrounding page. */ declare class BabylonGui { advancedDynamicTexture: BabylonGuiAdvancedDynamicTexture; control: BabylonGuiControl; container: BabylonGuiContainer; stackPanel: BabylonGuiStackPanel; button: BabylonGuiButton; slider: BabylonGuiSlider; textBlock: BabylonGuiTextBlock; radioButton: BabylonGuiRadioButton; checkbox: BabylonGuiCheckbox; inputText: BabylonGuiInputText; colorPicker: BabylonGuiColorPicker; image: BabylonGuiImage; } /** * Images shown as GUI controls, loaded from a URL, for logos, icons and pictures beside other * controls. */ declare class BabylonGuiImage { /** * Creates an image control that loads its picture from `url`; sizes are pixel strings or * fractions of the parent, and a size left out is chosen by the engine. * @param inputs - The name, the URL, the color and the optional size * @returns The image control * @group create * @shortname create image * @disposableOutput true * @example * ```typescript * const logo = bitbybit.babylon.gui.image.createImage({ name: "logo", url: "https://example.com/logo.png", color: "black", width: "120px", height: "60px" }); * panel.addControl(logo); * ``` */ createImage(inputs: Inputs.BabylonGui.CreateImageDto): BABYLON.GUI.Image; /** * Changes the picture an image control shows by giving it a new URL to load. * @param inputs - The image control and the URL * @returns The same image control * @group set * @shortname set image source url */ setSourceUrl(inputs: Inputs.BabylonGui.SetImageUrlDto): BABYLON.GUI.Image; /** * Reads the URL an image control loads its picture from. * @param inputs - The image control * @returns The URL * @group get * @shortname get image source url */ getSourceUrl(inputs: Inputs.BabylonGui.ImageDto): string; } /** * Single-line text fields the user can type into, with a placeholder shown while empty. Subscribe * to the text changed event to react to typing. */ declare class BabylonGuiInputText { /** * Creates a text field holding `text`, showing `placeholder` while it is empty, in the given * colors; sizes are pixel strings or fractions of the parent. * @param inputs - The name, the text, the placeholder, the colors and the optional size * @returns The text field * @group create * @shortname create input text * @disposableOutput true * @example * ```typescript * const input = bitbybit.babylon.gui.inputText.createInputText({ name: "label", text: "", placeholder: "Type a label", color: "#f0cebb", background: "black", width: "300px", height: "40px" }); * panel.addControl(input); * input.onTextChangedObservable.add((field) => { console.log(field.text); }); * ``` */ createInputText(inputs: Inputs.BabylonGui.CreateInputTextDto): BABYLON.GUI.InputText; /** * Sets the background color of a text field, as a CSS color. * @param inputs - The text field and the background color * @returns The same text field * @group set * @shortname set input text background */ setBackground(inputs: Inputs.BabylonGui.SetInputTextBackgroundDto): BABYLON.GUI.InputText; /** * Replaces the text a text field holds, which fires its text changed event like typing would. * @param inputs - The text field and the text * @returns The same text field * @group set * @shortname set input text text */ setText(inputs: Inputs.BabylonGui.SetInputTextTextDto): BABYLON.GUI.InputText; /** * Sets the hint a text field shows while it is empty. * @param inputs - The text field and the placeholder * @returns The same text field * @group set * @shortname set input text placeholder */ setPlaceholder(inputs: Inputs.BabylonGui.SetInputTextPlaceholderDto): BABYLON.GUI.InputText; /** * Reads the background color of a text field. * @param inputs - The text field * @returns The background color * @group get * @shortname get input text background */ getBackground(inputs: Inputs.BabylonGui.InputTextDto): string; /** * Reads the text a text field currently holds, as typed by the user. * @param inputs - The text field * @returns The text * @group get * @shortname get input text text */ getText(inputs: Inputs.BabylonGui.InputTextDto): string; /** * Reads the hint a text field shows while it is empty. * @param inputs - The text field * @returns The placeholder * @group get * @shortname get input text placeholder */ getPlaceholder(inputs: Inputs.BabylonGui.InputTextDto): string; /** * Passes through the name of a text field event, its text changing, as a typed selector for * code that subscribes to text field events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname input text observable selector */ createInputTextObservableSelector(inputs: Inputs.BabylonGui.InputTextObservableSelectorDto): Inputs.BabylonGui.inputTextObservableSelectorEnum; } /** * Radio buttons: round toggles of which only one per `group` can be checked at a time, for picking * one option from a few. Subscribe to the checked changed event to react to the user. */ declare class BabylonGuiRadioButton { /** * Creates a radio button in a `group`; checking one radio button unchecks the others of the * same group. `checkSizeRatio` is how much of the circle the inner dot fills. * @param inputs - The name, the group, the checked state, the dot size, the colors and the optional size * @returns The radio button * @group create * @shortname create radio button * @disposableOutput true * @example * ```typescript * const optionA = bitbybit.babylon.gui.radioButton.createRadioButton({ name: "optionA", group: "material", isChecked: true, checkSizeRatio: 0.8, color: "#f0cebb", background: "black", width: "30px", height: "30px" }); * panel.addControl(optionA); * optionA.onIsCheckedChangedObservable.add((checked) => { console.log(checked); }); * ``` */ createRadioButton(inputs: Inputs.BabylonGui.CreateRadioButtonDto): BABYLON.GUI.RadioButton; /** * Sets how much of a radio button's circle its inner dot fills, from 0 to 1. * @param inputs - The radio button and the ratio * @returns The same radio button * @group set * @shortname set radio button check size ratio */ setCheckSizeRatio(inputs: Inputs.BabylonGui.SetRadioButtonCheckSizeRatioDto): BABYLON.GUI.RadioButton; /** * Moves a radio button to a group; only one radio button of a group can be checked at a time. * @param inputs - The radio button and the group name * @returns The same radio button * @group set * @shortname set radio button group */ setGroup(inputs: Inputs.BabylonGui.SetRadioButtonGroupDto): BABYLON.GUI.RadioButton; /** * Sets the background color of a radio button's circle, as a CSS color. * @param inputs - The radio button and the background color * @returns The same radio button * @group set * @shortname set radio button background */ setBackground(inputs: Inputs.BabylonGui.SetRadioButtonBackgroundDto): BABYLON.GUI.RadioButton; /** * Reads how much of a radio button's circle its inner dot fills. * @param inputs - The radio button * @returns The ratio * @group get * @shortname get radio button check size ratio */ getCheckSizeRatio(inputs: Inputs.BabylonGui.RadioButtonDto): number; /** * Reads the group a radio button belongs to. * @param inputs - The radio button * @returns The group name * @group get * @shortname get radio button group */ getGroup(inputs: Inputs.BabylonGui.RadioButtonDto): string; /** * Reads the background color of a radio button's circle. * @param inputs - The radio button * @returns The background color * @group get * @shortname get radio button background */ getBackground(inputs: Inputs.BabylonGui.RadioButtonDto): string; /** * Passes through the name of a radio button event, its checked state changing, as a typed * selector for code that subscribes to radio button events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname radio button observable selector */ createRadioButtonObservableSelector(inputs: Inputs.BabylonGui.RadioButtonObservableSelectorDto): Inputs.BabylonGui.radioButtonObservableSelectorEnum; } /** * Sliders for picking a number between a minimum and a maximum by dragging a thumb, horizontally or * vertically. Subscribe to the value changed event to react to the user; the range, step, value, * colors and thumb can be changed after creation. */ declare class BabylonGuiSlider { /** * Creates a slider that picks a number from `minimum` to `maximum` in multiples of `step`, * starting at `value`. * * A horizontal slider takes the parent's width unless `width` is given; a vertical one takes * its height. The thumb is white until `changeSliderThumb` changes it. * @param inputs - The name, the range, the value, the step, the direction, the colors, the optional size and the thumb flag * @returns The slider * @group create * @shortname create slider * @disposableOutput true * @example * ```typescript * const slider = bitbybit.babylon.gui.slider.createSlider({ name: "radius", minimum: 1, maximum: 20, value: 5, step: 0.5, isVertical: false, color: "#f0cebb", background: "black", width: "300px", height: "40px", displayThumb: true }); * panel.addControl(slider); * slider.onValueChangedObservable.add((value) => { console.log(value); }); * ``` */ createSlider(inputs: Inputs.BabylonGui.CreateSliderDto): BABYLON.GUI.Slider; /** * Restyles the thumb of a slider: round or square, its color and width, whether it stays inside * the track and whether it is shown at all. * @param inputs - The slider, the thumb shape, color and width, the clamped flag and the display flag * @returns The same slider * @group set * @shortname set slider thumb * @example * ```typescript * bitbybit.babylon.gui.slider.changeSliderThumb({ slider, isThumbCircle: true, thumbColor: "white", thumbWidth: "20px", isThumbClamped: true, displayThumb: true }); * ``` */ changeSliderThumb(inputs: Inputs.BabylonGui.SliderThumbDto): BABYLON.GUI.Slider; /** * Sets the color of the line around a slider's track, as a CSS color. * @param inputs - The slider and the border color * @returns The same slider * @group set * @shortname set slider border color */ setBorderColor(inputs: Inputs.BabylonGui.SliderBorderColorDto): BABYLON.GUI.Slider; /** * Sets the color of the unfilled part of a slider's track, as a CSS color. * @param inputs - The slider and the background color * @returns The same slider * @group set * @shortname set slider background color */ setBackgroundColor(inputs: Inputs.BabylonGui.SliderBackgroundColorDto): BABYLON.GUI.Slider; /** * Sets the largest value a slider can reach, the value at its right or top end. * @param inputs - The slider and the maximum * @returns The same slider * @group set * @shortname set slider maximum */ setMaximum(inputs: Inputs.BabylonGui.SetSliderValueDto): BABYLON.GUI.Slider; /** * Sets the smallest value a slider can reach, the value at its left or bottom end. * @param inputs - The slider and the minimum * @returns The same slider * @group set * @shortname set slider minimum */ setMinimum(inputs: Inputs.BabylonGui.SetSliderValueDto): BABYLON.GUI.Slider; /** * Sets the increment a slider moves in, so 1 gives whole numbers only and 0 lets it move * smoothly. * @param inputs - The slider and the step * @returns The same slider * @group set * @shortname set slider step */ setStep(inputs: Inputs.BabylonGui.SetSliderValueDto): BABYLON.GUI.Slider; /** * Moves a slider to a value, which fires its value changed event like a user drag would. * @param inputs - The slider and the value * @returns The same slider * @group set * @shortname set slider value * @example * ```typescript * bitbybit.babylon.gui.slider.setValue({ slider, value: 7.5 }); * ``` */ setValue(inputs: Inputs.BabylonGui.SetSliderValueDto): BABYLON.GUI.Slider; /** * Passes through the name of a slider event, its value changing, as a typed selector for code * that subscribes to slider events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname slider observable selector */ createSliderObservableSelector(inputs: Inputs.BabylonGui.SliderObservableSelectorDto): Inputs.BabylonGui.sliderObservableSelectorEnum; /** * Reads the color of the line around a slider's track. * @param inputs - The slider * @returns The border color * @group get * @shortname get slider border color */ getBorderColor(inputs: Inputs.BabylonGui.SliderDto): string; /** * Reads the color of the unfilled part of a slider's track. * @param inputs - The slider * @returns The background color * @group get * @shortname get slider background color */ getBackgroundColor(inputs: Inputs.BabylonGui.SliderDto): string; /** * Reads the largest value a slider can reach. * @param inputs - The slider * @returns The maximum * @group get * @shortname get slider maximum */ getMaximum(inputs: Inputs.BabylonGui.SliderDto): number; /** * Reads the smallest value a slider can reach. * @param inputs - The slider * @returns The minimum * @group get * @shortname get slider minimum */ getMinimum(inputs: Inputs.BabylonGui.SliderDto): number; /** * Reads the increment a slider moves in, 0 meaning smooth movement. * @param inputs - The slider * @returns The step * @group get * @shortname get slider step */ getStep(inputs: Inputs.BabylonGui.SliderDto): number; /** * Reads the current value of a slider, between its minimum and maximum. * @param inputs - The slider * @returns The value * @group get * @shortname get slider value */ getValue(inputs: Inputs.BabylonGui.SliderDto): number; /** * Reads the color of a slider's thumb as a CSS color string. * @param inputs - The slider * @returns The thumb color * @group get * @shortname get slider thumb color */ getThumbColor(inputs: Inputs.BabylonGui.SliderDto): string; /** * Reads the width of a slider's thumb, as a pixel string or a fraction. * @param inputs - The slider * @returns The thumb width * @group get * @shortname get slider thumb width */ getThumbWidth(inputs: Inputs.BabylonGui.SliderDto): string | number; /** * Reads whether a slider runs bottom to top rather than left to right. * @param inputs - The slider * @returns True when the slider is vertical * @group get * @shortname get slider is vertical */ getIsVertical(inputs: Inputs.BabylonGui.SliderDto): boolean; /** * Reads whether a slider shows its thumb or only the track. * @param inputs - The slider * @returns True when the thumb is shown * @group get * @shortname get slider display thumb */ getDisplayThumb(inputs: Inputs.BabylonGui.SliderDto): boolean; /** * Reads whether a slider's thumb is round rather than square. * @param inputs - The slider * @returns True when the thumb is round * @group get * @shortname get slider is thumb circle */ getIsThumbCircle(inputs: Inputs.BabylonGui.SliderDto): boolean; /** * Reads whether a slider's thumb stays inside the track at the ends instead of overhanging it. * @param inputs - The slider * @returns True when the thumb is clamped * @group get * @shortname get slider is thumb clamped */ getIsThumbClamped(inputs: Inputs.BabylonGui.SliderDto): boolean; } /** * A stack panel lays its child controls out one after another, top to bottom or left to right, with * a spacing between them, and is the usual way to build a column of controls. Add it to a GUI * texture and its children to it with `container.addControls`. */ declare class BabylonGuiStackPanel { /** * Creates a panel that stacks its children vertically, or horizontally when `isVertical` is * false, with `spacing` pixels between them. * * Give a vertical panel a width and a horizontal one a height; the other size grows with the * children. * @param inputs - The name, the direction, the spacing, the optional sizes and the colors * @returns The stack panel * @group create * @shortname create stack panel * @disposableOutput true * @example * ```typescript * const panel = bitbybit.babylon.gui.stackPanel.createStackPanel({ name: "panel", isVertical: true, spacing: 8, width: "300px", height: "400px", color: "#00000000", background: "#00000055" }); * ui.addControl(panel); * ``` */ createStackPanel(inputs: Inputs.BabylonGui.CreateStackPanelDto): BABYLON.GUI.StackPanel; /** * Switches a stack panel between stacking its children top to bottom, when true, and left to * right. * @param inputs - The stack panel and the flag * @returns The same stack panel * @group set * @shortname set stack panel is vertical */ setIsVertical(inputs: Inputs.BabylonGui.SetStackPanelIsVerticalDto): BABYLON.GUI.StackPanel; /** * Sets the gap in pixels between the children of a stack panel. * @param inputs - The stack panel and the spacing * @returns The same stack panel * @group set * @shortname set stack panel spacing */ setSpacing(inputs: Inputs.BabylonGui.SetStackPanelSpacingDto): BABYLON.GUI.StackPanel; /** * Sets the width of a stack panel, as a pixel string or a fraction of the parent; a horizontal * panel sizes its width from its children instead. * @param inputs - The stack panel and the width * @returns The same stack panel * @group set * @shortname set stack panel width */ setWidth(inputs: Inputs.BabylonGui.SetStackPanelWidthDto): BABYLON.GUI.StackPanel; /** * Sets the height of a stack panel, as a pixel string or a fraction of the parent; a vertical * panel sizes its height from its children instead. * @param inputs - The stack panel and the height * @returns The same stack panel * @group set * @shortname set stack panel height */ setHeight(inputs: Inputs.BabylonGui.SetStackPanelHeightDto): BABYLON.GUI.StackPanel; /** * Reads whether a stack panel stacks its children top to bottom. * @param inputs - The stack panel * @returns True when the panel is vertical * @group get * @shortname get stack panel is vertical */ getIsVertical(inputs: Inputs.BabylonGui.StackPanelDto): boolean; /** * Reads the gap in pixels between the children of a stack panel. * @param inputs - The stack panel * @returns The spacing * @group get * @shortname get stack panel spacing */ getSpacing(inputs: Inputs.BabylonGui.StackPanelDto): number; /** * Reads the width of a stack panel, as a pixel string or a fraction. * @param inputs - The stack panel * @returns The width * @group get * @shortname get stack panel width */ getWidth(inputs: Inputs.BabylonGui.StackPanelDto): string | number; /** * Reads the height of a stack panel, as a pixel string or a fraction. * @param inputs - The stack panel * @returns The height * @group get * @shortname get stack panel height */ getHeight(inputs: Inputs.BabylonGui.StackPanelDto): string | number; } /** * Text labels: a block of text with a color, font size, alignment, optional outline, wrapping and * line spacing. Use one for titles and readouts next to other controls. */ declare class BabylonGuiTextBlock { /** * Creates a block of text with a color and font size; sizes are pixel strings or fractions of * the parent, and a size left out is chosen by the engine. * @param inputs - The name, the text, the color, the optional size and the font size * @returns The text block * @group create * @shortname create text block * @disposableOutput true * @example * ```typescript * const title = bitbybit.babylon.gui.textBlock.createTextBlock({ name: "title", text: "Radius", color: "#f0cebb", width: "300px", height: "40px", fontSize: 24 }); * panel.addControl(title); * ``` */ createTextBlock(inputs: Inputs.BabylonGui.CreateTextBlockDto): BABYLON.GUI.TextBlock; /** * Sets where the text sits inside its block: left, center or right, and top, center or bottom. * @param inputs - The text block and the two alignments * @returns The same text block * @group positioning * @shortname align text block text * @example * ```typescript * bitbybit.babylon.gui.textBlock.alignText({ control: title, horizontalAlignment: Bit.Inputs.BabylonGui.horizontalAlignmentEnum.left, verticalAlignment: Bit.Inputs.BabylonGui.verticalAlignmentEnum.center }); * ``` */ alignText(inputs: Inputs.BabylonGui.AlignmentDto): BABYLON.GUI.TextBlock; /** * Draws an outline around the letters of a text block, `outlineWidth` pixels wide in * `outlineColor`, which keeps text readable over a busy scene; 0 removes it. * @param inputs - The text block, the outline width and the outline color * @returns The same text block * @group set * @shortname text outline * @example * ```typescript * bitbybit.babylon.gui.textBlock.setTextOutline({ textBlock: title, outlineWidth: 2, outlineColor: "black" }); * ``` */ setTextOutline(inputs: Inputs.BabylonGui.SetTextBlockTextOutlineDto): BABYLON.GUI.TextBlock; /** * Changes the text a text block shows to the given text. * @param inputs - The text block and the text * @returns The same text block * @group set * @shortname set text block text * @example * ```typescript * bitbybit.babylon.gui.textBlock.setText({ textBlock: readout, text: "Radius: 7.5" }); * ``` */ setText(inputs: Inputs.BabylonGui.SetTextBlockTextDto): BABYLON.GUI.TextBlock; /** * Lets a text block grow or shrink to fit its text, when true, instead of keeping its set size. * @param inputs - The text block and the flag * @returns The same text block * @group set * @shortname set resize to fit */ setRsizeToFit(inputs: Inputs.BabylonGui.SetTextBlockResizeToFitDto): BABYLON.GUI.TextBlock; /** * Sets how a text block handles text wider than itself: wrap onto new lines when true, clip * when false, or one of the engine's wrapping modes such as ellipsis. * @param inputs - The text block and the wrapping mode * @returns The same text block * @group set * @shortname set text wrapping */ setTextWrapping(inputs: Inputs.BabylonGui.SetTextBlockTextWrappingDto): BABYLON.GUI.TextBlock; /** * Sets the extra space between the lines of a wrapped text block, as pixels or a string such as * `4px`. * @param inputs - The text block and the line spacing * @returns The same text block * @group set * @shortname set line spacing */ setLineSpacing(inputs: Inputs.BabylonGui.SetTextBlockLineSpacingDto): BABYLON.GUI.TextBlock; /** * Reads the text a text block currently shows. * @param inputs - The text block * @returns The text * @group get * @shortname get text block text */ getText(inputs: Inputs.BabylonGui.TextBlockDto): string; /** * Reads how a text block handles text wider than itself. * @param inputs - The text block * @returns The wrapping mode * @group get * @shortname get text wrapping */ getTextWrapping(inputs: Inputs.BabylonGui.TextBlockDto): boolean | BABYLON.GUI.TextWrapping; /** * Reads the extra space between the lines of a text block. * @param inputs - The text block * @returns The line spacing * @group get * @shortname get line spacing */ getLineSpacing(inputs: Inputs.BabylonGui.TextBlockDto): string | number; /** * Reads the width of the outline around a text block's letters, 0 meaning none. * @param inputs - The text block * @returns The outline width * @group get * @shortname get outline width */ getOutlineWidth(inputs: Inputs.BabylonGui.TextBlockDto): number; /** * Reads whether a text block resizes itself to fit its text. * @param inputs - The text block * @returns True when it resizes to fit * @group get * @shortname get resize to fit */ getResizeToFit(inputs: Inputs.BabylonGui.TextBlockDto): boolean; /** * Reads where the text sits horizontally in its block, as the engine's number for left, center * or right. * @param inputs - The text block * @returns The horizontal alignment code * @group get * @shortname get text horizontal alignment */ getTextHorizontalAlignment(inputs: Inputs.BabylonGui.TextBlockDto): number; /** * Reads where the text sits vertically in its block, as the engine's number for top, center or * bottom. * @param inputs - The text block * @returns The vertical alignment code * @group get * @shortname get text vertical alignment */ getTextVerticalAlignment(inputs: Inputs.BabylonGui.TextBlockDto): number; /** * Passes through the name of a text block event, its text changing, as a typed selector for * code that subscribes to text block events by name. * @param inputs - The event selector * @returns The same selector * @group create * @shortname text block observable selector */ createTextBlockObservableSelector(inputs: Inputs.BabylonGui.TextBlockObservableSelectorDto): Inputs.BabylonGui.textBlockObservableSelectorEnum; } /** * Loading models into the scene and exporting it: glTF, glb, STL and OBJ files come in from a File, * a URL or raw glb bytes as one container mesh with their children under it, and the whole scene or * chosen meshes go out as .babylon, glb or STL downloads. */ declare class BabylonIO { private readonly context; private supportedFileFormats; private objectUrl; /** * Loads a glTF, glb, STL or OBJ model from a File into the scene and gives back a container * mesh with the model's meshes as its children; any other extension throws an error. * * The loaded meshes cast and receive shadows and start hidden when `hidden` is true. * @param inputs - The model file and whether it starts hidden * @returns The container mesh holding the loaded model * @group load * @shortname asset * @drawable true * @example * ```typescript * const file = await bitbybit.asset.getFile({ fileName: "chair.glb" }); * const model = await bitbybit.babylon.io.loadAssetIntoScene({ assetFile: file, hidden: false }); * ``` */ loadAssetIntoScene(inputs: Inputs.Asset.AssetFileDto): Promise; /** * Loads a glTF, glb, STL or OBJ model from a File into the scene, as `loadAssetIntoScene` does, * without giving the mesh back. * @param inputs - The model file and whether it starts hidden * @group load * @shortname asset * @example * ```typescript * const file = await bitbybit.asset.getFile({ fileName: "chair.glb" }); * await bitbybit.babylon.io.loadAssetIntoSceneNoReturn({ assetFile: file, hidden: false }); * ``` */ loadAssetIntoSceneNoReturn(inputs: Inputs.Asset.AssetFileDto): Promise; /** * Loads a glTF, glb, STL or OBJ model from a web address into the scene and gives back a * container mesh with the model's meshes as its children. * * `rootUrl` is the folder and `assetFile` the file name in it, so textures beside the model * resolve too; the server must allow cross-origin requests. * @param inputs - The folder URL, the file name and whether it starts hidden * @returns The container mesh holding the loaded model * @group load * @shortname asset from url * @drawable true * @example * ```typescript * const model = await bitbybit.babylon.io.loadAssetIntoSceneFromRootUrl({ rootUrl: "https://example.com/models/", assetFile: "chair.glb", hidden: false }); * ``` */ loadAssetIntoSceneFromRootUrl(inputs: Inputs.Asset.AssetFileByUrlDto): Promise; /** * Loads a model from a web address into the scene, as `loadAssetIntoSceneFromRootUrl` does, * without giving the mesh back. * @param inputs - The folder URL, the file name and whether it starts hidden * @group load * @shortname asset from url * @example * ```typescript * await bitbybit.babylon.io.loadAssetIntoSceneFromRootUrlNoReturn({ rootUrl: "https://example.com/models/", assetFile: "chair.glb", hidden: false }); * ``` */ loadAssetIntoSceneFromRootUrlNoReturn(inputs: Inputs.Asset.AssetFileByUrlDto): Promise; /** * Loads a glb model held as bytes into the scene, such as the output of * `occt.io.convertStepToGltf`, and gives back a container mesh with the model's meshes as its * children. * @param inputs - The glb bytes, a name for the model and whether it starts hidden * @returns The container mesh holding the loaded model * @group load * @shortname glb from array buffer * @drawable true * @example * ```typescript * const glb = await bitbybit.occt.io.convertStepToGltf({ stepData: file, meshPrecision: 0.005, meshAngle: 0.5, meshRelative: true, internalVerticesMode: false, controlSurfaceDeflection: false }); * const model = await bitbybit.babylon.io.loadGlbFromArrayBuffer({ glbData: glb, fileName: "part.glb", hidden: false }); * ``` */ loadGlbFromArrayBuffer(inputs: Inputs.Asset.AssetGlbDataDto): Promise; /** * Loads a glb model held as bytes into the scene, as `loadGlbFromArrayBuffer` does, without * giving the mesh back. * @param inputs - The glb bytes, a name for the model and whether it starts hidden * @group load * @shortname glb from array buffer no return * @drawable true * @example * ```typescript * await bitbybit.babylon.io.loadGlbFromArrayBufferNoReturn({ glbData: glb, fileName: "part.glb", hidden: false }); * ``` */ loadGlbFromArrayBufferNoReturn(inputs: Inputs.Asset.AssetGlbDataDto): Promise; /** * Downloads the whole scene as a `.babylon` file, the engine's own JSON format that its editors * and loaders read back; the extension is added when missing. * @param inputs - The file name * @group export * @shortname babylon scene * @example * ```typescript * bitbybit.babylon.io.exportBabylon({ fileName: "my-scene" }); * ``` */ exportBabylon(inputs: Inputs.BabylonIO.ExportSceneDto): void; /** * Downloads the whole scene as a glb file, the binary glTF that most 3D tools and web viewers * read; `discardSkyboxAndGrid` leaves out the skybox and ground this library adds. * @param inputs - The file name and whether to leave out the skybox and ground * @group export * @shortname gltf scene * @example * ```typescript * bitbybit.babylon.io.exportGLB({ fileName: "my-scene", discardSkyboxAndGrid: true }); * ``` */ exportGLB(inputs: Inputs.BabylonIO.ExportSceneGlbDto): void; /** * Writes the whole scene, or chosen nodes with their ancestors, as glb bytes without downloading * anything, so they can be saved, sent on or loaded back with `loadGlbFromArrayBuffer`. * * Every ancestor of a chosen node is written too, so the geometry keeps its place, and the * file carries the materials the meshes have at the time of the call. * @param inputs - The nodes to write, whether to leave out the skybox and ground, and whether to compress with Draco * @returns The glb file as bytes * @group export * @shortname gltf scene bytes * @example * ```typescript * const glb = await bitbybit.babylon.io.exportGLBBytes({ nodes: [chair], discardSkyboxAndGrid: true, compressWithDraco: false }); * const copy = await bitbybit.babylon.io.loadGlbFromArrayBuffer({ glbData: glb, fileName: "chair.glb", hidden: false }); * ``` */ exportGLBBytes(inputs: Inputs.BabylonIO.ExportSceneGlbBytesDto): Promise; private glbExportOptions; private withAncestors; /** * Downloads a mesh and its visible child meshes as one STL file, the plain triangle format 3D * printers take; lines are left out. * @param inputs - The mesh and the file name * @returns An empty object once the download has started * @group export * @shortname babylon mesh to stl * @example * ```typescript * await bitbybit.babylon.io.exportMeshToStl({ mesh, fileName: "part" }); * ``` */ exportMeshToStl(inputs: Inputs.BabylonIO.ExportMeshToStlDto): Promise; /** * Downloads several meshes, with their child meshes, as one STL file; lines are left out. * @param inputs - The meshes and the file name * @returns An empty object once the download has started * @group export * @shortname babylon meshes to stl * @example * ```typescript * await bitbybit.babylon.io.exportMeshesToStl({ meshes: [meshA, meshB], fileName: "parts" }); * ``` */ exportMeshesToStl(inputs: Inputs.BabylonIO.ExportMeshesToStlDto): Promise; private loadAsset; } /** * Scene lighting: point, directional, spot and hemispheric lights, their intensity, color and * range, and the shadow settings that go with them. Lighting is what makes a technically correct * model look like a product, so it is usually worth more attention than its size suggests. */ declare class BabylonLights { shadowLight: BabylonShadowLight; } /** * Adjusting lights that cast shadows, the point, directional and spot lights, after they were * created: aim them at a target or move them, and the shadows follow. */ declare class BabylonShadowLight { /** * Aims a shadow-casting light at a point in the scene, turning its direction to point from its * position toward `target`. * @param inputs - The light and the point to aim at * @group set * @shortname set target * @example * ```typescript * bitbybit.babylon.lights.shadowLight.setDirectionToTarget({ shadowLight: sun, target: [0, 0, 0] }); * ``` */ setDirectionToTarget(inputs: Inputs.BabylonLight.ShadowLightDirectionToTargetDto): void; /** * Moves a shadow-casting light to a point in the scene; for a directional light the position * sets where its shadows are computed from. * @param inputs - The light and the position * @group set * @shortname set position * @example * ```typescript * bitbybit.babylon.lights.shadowLight.setPosition({ shadowLight: sun, position: [50, 100, 50] }); * ``` */ setPosition(inputs: Inputs.BabylonLight.ShadowLightPositionDto): void; } /** * Materials: physically-based surfaces with base color, metallic and roughness, emissive and * ambient contributions, transparency, and the texture slots that drive each of them. */ declare class BabylonMaterial { pbrMetallicRoughness: BabylonMaterialPbrMetallicRoughness; skyMaterial: BabylonMaterialSky; } /** * Physically based materials of the metallic-roughness kind, the standard way to describe a real * surface: a base color, how metallic it is from 0 for plastic or paint to 1 for bare metal, how * rough from 0 for a mirror finish to 1 for matte, an opacity and an optional texture. Create one, * then give it to meshes with `mesh.setMaterial` or through the drawing options. */ declare class BabylonMaterialPbrMetallicRoughness { private readonly context; private readonly color; /** * Creates a metallic-roughness material with the given color, metallic and roughness values, * opacity, back-face culling and optional emissive color. * * Metallic 0 looks like paint or plastic and 1 like bare metal; roughness 0 is a mirror finish * and 1 is matte. `alpha` below 1 makes the surface see-through. * @param inputs - The name, colors, metallic and roughness values, opacity, culling and z offset * @returns The material * @group create * @shortname pbr material * @disposableOutput true * @example * ```typescript * const brushed = bitbybit.babylon.material.pbrMetallicRoughness.create({ name: "brushed", baseColor: "#c0c0c0", emissiveColor: "#000000", metallic: 1, roughness: 0.4, alpha: 1, backFaceCulling: true, zOffset: 0 }); * bitbybit.babylon.mesh.setMaterial({ babylonMesh: mesh, material: brushed, includeChildren: true }); * ``` */ create(inputs: Inputs.BabylonMaterial.PBRMetallicRoughnessDto): BABYLON.PBRMetallicRoughnessMaterial; /** * Changes the base color of a material, the color its surface has under white light, from a hex * string. * @param inputs - The material and the hex color * @group set * @shortname set base color */ setBaseColor(inputs: Inputs.BabylonMaterial.BaseColorDto): void; /** * Changes how metallic a material looks, from 0 for paint or plastic to 1 for bare metal. * @param inputs - The material and the metallic value * @group set * @shortname set metallic */ setMetallic(inputs: Inputs.BabylonMaterial.MetallicDto): void; /** * Changes how rough a material's surface is, from 0 for a mirror finish to 1 for fully matte. * @param inputs - The material and the roughness value * @group set * @shortname set roughness */ setRoughness(inputs: Inputs.BabylonMaterial.RoughnessDto): void; /** * Changes the opacity of a material, from 0 for invisible to 1 for solid; values between make * the surface see-through. * @param inputs - The material and the opacity * @group set * @shortname set alpha */ setAlpha(inputs: Inputs.BabylonMaterial.AlphaDto): void; /** * Sets whether the back of each face is skipped when drawing; culling is faster, while drawing * both sides shows the inside of open or single-sided meshes. * @param inputs - The material and the culling flag * @group set * @shortname set back face culling */ setBackFaceCulling(inputs: Inputs.BabylonMaterial.BackFaceCullingDto): void; /** * Gives a material an image texture that replaces its base color across the surface, as * `texture.createSimple` makes one. * @param inputs - The material and the texture * @group set * @shortname set base texture * @example * ```typescript * const texture = bitbybit.babylon.texture.createSimple({ name: "wood", url: "https://example.com/wood.jpg", invertY: false, invertZ: false, wAng: 0, uScale: 1, vScale: 1, uOffset: 0, vOffset: 0, samplingMode: Bit.Inputs.BabylonTexture.samplingModeEnum.trilinear }); * bitbybit.babylon.material.pbrMetallicRoughness.setBaseTexture({ material, baseTexture: texture }); * ``` */ setBaseTexture(inputs: Inputs.BabylonMaterial.BaseTextureDto): void; /** * Reads the base color of a material as a hex string. * @param inputs - The material * @returns The base color as a hex string * @group get * @shortname get base color */ getBaseColor(inputs: Inputs.BabylonMaterial.MaterialPropDto): string; /** * Reads how metallic a material is, from 0 to 1. * @param inputs - The material * @returns The metallic value * @group get * @shortname get metallic */ getMetallic(inputs: Inputs.BabylonMaterial.MaterialPropDto): number; /** * Reads how rough a material's surface is, from 0 to 1. * @param inputs - The material * @returns The roughness value * @group get * @shortname get roughness */ getRoughness(inputs: Inputs.BabylonMaterial.MaterialPropDto): number; /** * Reads the opacity of a material, from 0 to 1. * @param inputs - The material * @returns The opacity * @group get * @shortname get alpha */ getAlpha(inputs: Inputs.BabylonMaterial.MaterialPropDto): number; /** * Reads whether a material skips the back of each face when drawing. * @param inputs - The material * @returns True when back faces are culled * @group get * @shortname get back face culling */ getBackFaceCulling(inputs: Inputs.BabylonMaterial.MaterialPropDto): boolean; /** * Reads the image texture a material uses in place of its base color, if it has one. * @param inputs - The material * @returns The base texture * @group get * @shortname get base texture */ getBaseTexture(inputs: Inputs.BabylonMaterial.MaterialPropDto): BABYLON.BaseTexture; } /** * A procedural daytime sky computed from atmosphere settings rather than an image: where the sun * is, how hazy the air is and how bright the sky glows. Put the material on a large inside-out box * or sphere around the scene and move the sun with `inclination` and `azimuth`, or with an explicit * `sunPosition`. */ declare class BabylonMaterialSky { private readonly context; /** * Creates a sky material from atmosphere settings; only the values you give are applied over * the defaults. * * `inclination` from -0.5 to 0.5 lifts the sun from the horizon and `azimuth` from 0 to 1 turns * it around the sky; `turbidity` adds haze and `luminance` sets the overall brightness. * @param inputs - The atmosphere settings and the sun placement * @returns The sky material * @group create * @shortname sky material * @example * ```typescript * const sky = bitbybit.babylon.material.skyMaterial.create({ luminance: 1, turbidity: 10, rayleigh: 2, mieCoefficient: 0.005, mieDirectionalG: 0.8, distance: 500, inclination: 0.49, azimuth: 0.25, sunPosition: [0, 100, 100], useSunPosition: false, cameraOffset: [0, 0, 0], up: [0, 1, 0], dithering: false }); * const dome = bitbybit.babylon.meshBuilder.createSphere({ diameter: 1000, segments: 32, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.backside, enableShadows: false }); * bitbybit.babylon.mesh.setMaterial({ babylonMesh: dome, material: sky, includeChildren: false }); * ``` */ create(inputs: Inputs.BabylonMaterial.SkyMaterialDto): SkyMaterial; /** * Changes the overall brightness of a sky material, between 0 and 1. * @param inputs - The material and the luminance * @group set * @shortname set luminance */ setLuminance(inputs: Inputs.BabylonMaterial.LuminanceDto): void; /** * Changes how hazy a sky material's air is; more haze whitens the sky and spreads the sun's * glow. * @param inputs - The material and the turbidity * @group set * @shortname set turbidity */ setTurbidity(inputs: Inputs.BabylonMaterial.TurbidityDto): void; /** * Changes how strongly a sky material scatters light in the way that makes a clear sky blue; * higher is a deeper, brighter blue. * @param inputs - The material and the Rayleigh value * @group set * @shortname set rayleigh */ setRayleigh(inputs: Inputs.BabylonMaterial.RayleighDto): void; /** * Changes how much haze a sky material has around the sun, between 0 and 0.1; more makes a * wider, whiter glow. * @param inputs - The material and the Mie coefficient * @group set * @shortname set mieCoefficient */ setMieCoefficient(inputs: Inputs.BabylonMaterial.MieCoefficientDto): void; /** * Changes how tightly a sky material's haze glow gathers around the sun; values near 1 make a * small bright halo, lower values spread it. * @param inputs - The material and the Mie directional value * @group set * @shortname set mieDirectionalG */ setMieDirectionalG(inputs: Inputs.BabylonMaterial.MieDirectionalGDto): void; /** * Changes how far the sky dome sits from the camera in a sky material, which changes how the * horizon reads. * @param inputs - The material and the distance * @group set * @shortname set distance */ setDistance(inputs: Inputs.BabylonMaterial.DistanceDto): void; /** * Changes how high the sun stands in a sky material, from -0.5 below the horizon through 0 at * the horizon to 0.5 overhead; ignored while `useSunPosition` is on. * @param inputs - The material and the inclination * @group set * @shortname set inclination * @example * ```typescript * bitbybit.babylon.material.skyMaterial.setInclination({ material: sky, inclination: 0.1 }); * ``` */ setInclination(inputs: Inputs.BabylonMaterial.InclinationDto): void; /** * Changes where around the horizon the sun stands in a sky material, from 0 to 1 for a full * turn; ignored while `useSunPosition` is on. * @param inputs - The material and the azimuth * @group set * @shortname set azimuth */ setAzimuth(inputs: Inputs.BabylonMaterial.AzimuthDto): void; /** * Places the sun of a sky material at an explicit direction vector; it takes effect only while * `useSunPosition` is on, otherwise inclination and azimuth decide. * @param inputs - The material and the sun position vector * @group set * @shortname set sun position * @example * ```typescript * bitbybit.babylon.material.skyMaterial.setUseSunPosition({ material: sky, useSunPosition: true }); * bitbybit.babylon.material.skyMaterial.setSunPosition({ material: sky, sunPosition: [0, 50, 100] }); * ``` */ setSunPosition(inputs: Inputs.BabylonMaterial.SunPositionDto): void; /** * Chooses whether a sky material places the sun from `sunPosition`, when true, or from * inclination and azimuth, when false. * @param inputs - The material and the flag * @group set * @shortname set use sun position */ setUseSunPosition(inputs: Inputs.BabylonMaterial.UseSunPositionDto): void; /** * Shifts the horizon of a sky material by an offset vector, so the sky can sit higher or lower * relative to the camera. * @param inputs - The material and the offset vector * @group set * @shortname set camera offset */ setCameraOffset(inputs: Inputs.BabylonMaterial.CameraOffsetDto): void; /** * Changes which direction a sky material treats as up, normally `[0, 1, 0]`; change it for * scenes that use another axis as up. * @param inputs - The material and the up vector * @group set * @shortname set up */ setUp(inputs: Inputs.BabylonMaterial.UpDto): void; /** * Turns dithering on or off for a sky material; on, it adds fine noise that hides color banding * in smooth gradients. * @param inputs - The material and the flag * @group set * @shortname set dithering */ setDithering(inputs: Inputs.BabylonMaterial.DitheringDto): void; /** * Reads the overall brightness of a sky material. * @param inputs - The material * @returns The luminance * @group get * @shortname get luminance */ getLuminance(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how hazy a sky material's air is. * @param inputs - The material * @returns The turbidity * @group get * @shortname get turbidity */ getTurbidity(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads the Rayleigh scattering strength of a sky material, the setting behind its blue. * @param inputs - The material * @returns The Rayleigh value * @group get * @shortname get rayleigh */ getRayleigh(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how much haze a sky material has around the sun. * @param inputs - The material * @returns The Mie coefficient * @group get * @shortname get mieCoefficient */ getMieCoefficient(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how tightly a sky material's haze glow gathers around the sun. * @param inputs - The material * @returns The Mie directional value * @group get * @shortname get mieDirectionalG */ getMieDirectionalG(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how far the sky dome sits from the camera in a sky material. * @param inputs - The material * @returns The distance * @group get * @shortname get distance */ getDistance(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads how high the sun stands in a sky material, from -0.5 to 0.5. * @param inputs - The material * @returns The inclination * @group get * @shortname get inclination */ getInclination(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads where around the horizon the sun stands in a sky material, from 0 to 1. * @param inputs - The material * @returns The azimuth * @group get * @shortname get azimuth */ getAzimuth(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): number; /** * Reads the sun direction of a sky material; when `useSunPosition` is off it reflects the * inclination and azimuth. * @param inputs - The material * @returns The sun position vector * @group get * @shortname get sun position */ getSunPosition(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): Inputs.Base.Vector3; /** * Reads whether a sky material places the sun from `sunPosition` rather than from inclination * and azimuth. * @param inputs - The material * @returns True when the explicit sun position is used * @group get * @shortname get use sun position */ getUseSunPosition(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): boolean; /** * Reads the horizon offset vector of a sky material. * @param inputs - The material * @returns The offset vector * @group get * @shortname get camera offset */ getCameraOffset(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): Inputs.Base.Vector3; /** * Reads the direction a sky material treats as up. * @param inputs - The material * @returns The up vector * @group get * @shortname get up */ getUp(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): Inputs.Base.Vector3; /** * Reads whether a sky material dithers its gradients to hide color banding. * @param inputs - The material * @returns True when dithering is on * @group get * @shortname get dithering */ getDithering(inputs: Inputs.BabylonMaterial.SkyMaterialPropDto): boolean; } /** * BabylonJS's own mesh primitives, built straight into the scene as ready-to-render meshes rather * than through a CAD kernel: boxes, spheres, discs, tori, polygons, tubes, polyhedra, capsules, * cylinders, extrusions, ribbons, lathes and grounds. They are quick to make and cheap to draw but * carry no exact geometry, so use the kernels when the shape must be measured, cut or exported. * Every builder centers its mesh on the origin, sets `sideOrientation` and registers it for shadows * unless `enableShadows` is false. */ declare class BabylonMeshBuilder { private readonly context; private readonly mesh; /** * Builds a box centered on the origin with `width` along X, `height` along Y and `depth` along * Z. * @param inputs - The three sizes, the side orientation and the shadow flag * @returns The box mesh * @group create simple * @shortname create box * @disposableOutput true * @drawable true * @example * ```typescript * const box = bitbybit.babylon.meshBuilder.createBox({ width: 10, height: 5, depth: 20, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.frontside, enableShadows: true }); * ``` */ createBox(inputs: Inputs.BabylonMeshBuilder.CreateBoxDto): BABYLON.Mesh; /** * Builds a cube centered on the origin with every edge `size` long. * @param inputs - The edge length, the side orientation and the shadow flag * @returns The cube mesh * @group create simple * @shortname create cube * @disposableOutput true * @drawable true * @example * ```typescript * const cube = bitbybit.babylon.meshBuilder.createCube({ size: 10, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.frontside, enableShadows: true }); * ``` */ createCube(inputs: Inputs.BabylonMeshBuilder.CreateCubeDto): BABYLON.Mesh; /** * Builds a flat square of side `size` centered on the origin in the XY plane, facing the Z * axis; a single-sided plane is invisible from behind unless `sideOrientation` is double-sided. * @param inputs - The side length, the side orientation and the shadow flag * @returns The plane mesh * @group create simple * @shortname square plane * @disposableOutput true * @drawable true * @example * ```typescript * const plane = bitbybit.babylon.meshBuilder.createSquarePlane({ size: 10, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createSquarePlane(inputs: Inputs.BabylonMeshBuilder.CreateSquarePlaneDto): BABYLON.Mesh; /** * Builds a sphere of the given `diameter` centered on the origin; `segments` sets how finely it * is divided, more being rounder and heavier. * @param inputs - The diameter, the segment count, the side orientation and the shadow flag * @returns The sphere mesh * @group create simple * @shortname create sphere * @disposableOutput true * @drawable true * @example * ```typescript * const ball = bitbybit.babylon.meshBuilder.createSphere({ diameter: 10, segments: 32, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.frontside, enableShadows: true }); * ``` */ createSphere(inputs: Inputs.BabylonMeshBuilder.CreateSphereDto): BABYLON.Mesh; /** * Builds a sphere from evenly sized triangles, subdivided from an icosahedron, which shades * more evenly than `createSphere`. * * `radiusX`, `radiusY` and `radiusZ` stretch it per axis and fall back to `radius` when 0; * `flat` gives faceted shading. * @param inputs - The radii, the flat flag, the subdivisions, the side orientation and the shadow flag * @returns The ico sphere mesh * @group create simple * @shortname create ico sphere * @disposableOutput true * @drawable true * @example * ```typescript * const ball = bitbybit.babylon.meshBuilder.createIcoSphere({ radius: 5, radiusX: 0, radiusY: 0, radiusZ: 0, flat: false, subdivisions: 4, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.frontside, enableShadows: true }); * ``` */ createIcoSphere(inputs: Inputs.BabylonMeshBuilder.CreateIcoSphereDto): BABYLON.Mesh; /** * Builds a flat disc of the given `radius` centered on the origin in the XY plane; `arc` below * 1 leaves a pie slice, so 0.5 is a half disc. * @param inputs - The radius, the tessellation, the arc fraction, the side orientation and the shadow flag * @returns The disc mesh * @group create simple * @shortname create disc * @disposableOutput true * @drawable true * @example * ```typescript * const disc = bitbybit.babylon.meshBuilder.createDisc({ radius: 5, tessellation: 32, arc: 1, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createDisc(inputs: Inputs.BabylonMeshBuilder.CreateDiscDto): BABYLON.Mesh; /** * Builds a ring lying in the XZ plane around the origin: `diameter` is the ring's overall * diameter and `thickness` the diameter of its tube. * @param inputs - The diameter, the tube thickness, the tessellation, the side orientation and the shadow flag * @returns The torus mesh * @group create simple * @shortname create torus * @disposableOutput true * @drawable true * @example * ```typescript * const ring = bitbybit.babylon.meshBuilder.createTorus({ diameter: 10, thickness: 2, tessellation: 32, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.frontside, enableShadows: true }); * ``` */ createTorus(inputs: Inputs.BabylonMeshBuilder.CreateTorusDto): BABYLON.Mesh; /** * Builds a tube wound into a knot around the origin: `p` and `q` are how many times it winds * around the ring and through its hole, so 2 and 3 give the classic trefoil. * @param inputs - The radius, the tube radius, the segment counts, the winding numbers, the side orientation and the shadow flag * @returns The torus knot mesh * @group create simple * @shortname create torus knot * @disposableOutput true * @drawable true * @example * ```typescript * const knot = bitbybit.babylon.meshBuilder.createTorusKnot({ radius: 5, tube: 1, radialSegments: 128, tubularSegments: 32, p: 2, q: 3, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.frontside, enableShadows: true }); * ``` */ createTorusKnot(inputs: Inputs.BabylonMeshBuilder.CreateTorusKnotDto): BABYLON.Mesh; /** * Builds a flat filled polygon from its outline points, with optional holes, lying in the XZ * plane; a `depth` above 0 gives it thickness downward. * * The points are 3D but only X and Z are used, and the outline must not cross itself. * @param inputs - The outline, the holes, the depth, the smoothing, the side orientation, the wrap flag and the shadow flag * @returns The polygon mesh * @group create simple * @shortname create polygon * @disposableOutput true * @drawable true * @example * ```typescript * const slab = bitbybit.babylon.meshBuilder.createPolygon({ shape: [[0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]], holes: [], depth: 0, smoothingThreshold: 0.01, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, wrap: false, enableShadows: true }); * ``` */ createPolygon(inputs: Inputs.BabylonMeshBuilder.CreatePolygonDto): BABYLON.Mesh; /** * Builds a solid by extruding a flat polygon, given by its outline points in the XZ plane with * optional holes, downward by `depth`. * @param inputs - The outline, the holes, the depth, the side orientation, the wrap flag and the shadow flag * @returns The extruded mesh * @group create simple * @shortname create extrude polygon * @disposableOutput true * @drawable true * @example * ```typescript * const block = bitbybit.babylon.meshBuilder.extrudePolygon({ shape: [[0, 0, 0], [10, 0, 0], [10, 0, 10], [0, 0, 10]], holes: [[[3, 0, 3], [7, 0, 3], [7, 0, 7], [3, 0, 7]]], depth: 5, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.frontside, wrap: false, enableShadows: true }); * ``` */ extrudePolygon(inputs: Inputs.BabylonMeshBuilder.ExtrudePolygonDto): BABYLON.Mesh; /** * Builds a tube of the given `radius` along a path of points; `cap` closes neither, one or both * ends, and `arc` below 1 leaves the tube open along its length. * @param inputs - The path, the radius, the tessellation, the cap mode, the arc fraction, the side orientation and the shadow flag * @returns The tube mesh * @group create simple * @shortname create tube * @disposableOutput true * @drawable true * @example * ```typescript * const pipe = bitbybit.babylon.meshBuilder.createTube({ path: [[0, 0, 0], [10, 0, 0], [10, 10, 0]], radius: 1, tessellation: 32, cap: 3, arc: 1, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createTube(inputs: Inputs.BabylonMeshBuilder.CreateTubeDto): BABYLON.Mesh; /** * Builds one of the fifteen built-in polyhedra by `type`, from tetrahedron (0) to elongated * pentagonal cupola (14), or your own from `custom` data. * * `sizeX`, `sizeY` and `sizeZ` stretch it per axis and fall back to `size` when 0; `flat` gives * faceted shading. * @param inputs - The size and type, the custom data, the flat flag, the side orientation and the shadow flag * @returns The polyhedron mesh * @group create simple * @shortname create polyhedron * @disposableOutput true * @drawable true * @example * ```typescript * const dodecahedron = bitbybit.babylon.meshBuilder.createPolyhedron({ size: 5, type: 2, sizeX: 0, sizeY: 0, sizeZ: 0, flat: true, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.frontside, enableShadows: true }); * ``` */ createPolyhedron(inputs: Inputs.BabylonMeshBuilder.CreatePolyhedronDto): BABYLON.Mesh; /** * Builds a geodesic sphere, an icosahedron whose faces are subdivided into triangles as `m` and * `n` say, so the surface is made of near-equal triangles. * * `sizeX`, `sizeY` and `sizeZ` stretch it per axis and fall back to `size` when 0. * @param inputs - The subdivision numbers, the sizes, the flat flag, the side orientation and the shadow flag * @returns The geodesic mesh * @group create simple * @shortname create geodesic * @disposableOutput true * @drawable true * @example * ```typescript * const dome = bitbybit.babylon.meshBuilder.createGeodesic({ m: 4, n: 4, size: 5, sizeX: 0, sizeY: 0, sizeZ: 0, flat: false, subdivisions: 4, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.frontside, enableShadows: true }); * ``` */ createGeodesic(inputs: Inputs.BabylonMeshBuilder.CreateGeodesicDto): BABYLON.Mesh; /** * Builds a Goldberg polyhedron, a ball made of hexagons and twelve pentagons like a football, * with `m` and `n` setting how many hexagons there are. * * `sizeX`, `sizeY` and `sizeZ` stretch it per axis and fall back to `size` when 0. * @param inputs - The subdivision numbers, the sizes, the side orientation and the shadow flag * @returns The Goldberg mesh * @group create simple * @shortname create goldberg * @disposableOutput true * @drawable true * @example * ```typescript * const ball = bitbybit.babylon.meshBuilder.createGoldberg({ m: 4, n: 4, size: 5, sizeX: 0, sizeY: 0, sizeZ: 0, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createGoldberg(inputs: Inputs.BabylonMeshBuilder.CreateGoldbergDto): BABYLON.Mesh; /** * Builds a capsule, a cylinder with rounded ends, of the given `height` and `radius` along * `orientation`; `radiusTop` and `radiusBottom` size the two ends separately. * @param inputs - The orientation, the sizes, the subdivision counts, the side orientation and the shadow flag * @returns The capsule mesh * @group create simple * @shortname create capsule * @disposableOutput true * @drawable true * @example * ```typescript * const pill = bitbybit.babylon.meshBuilder.createCapsule({ orientation: [0, 1, 0], subdivisions: 2, tessellation: 16, height: 10, radius: 2, capSubdivisions: 6, radiusTop: 2, radiusBottom: 2, topCapSubdivisions: 6, bottomCapSubdivisions: 6, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createCapsule(inputs: Inputs.BabylonMeshBuilder.CreateCapsuleDto): BABYLON.Mesh; /** * Builds a cylinder standing along Y, centered on the origin; different top and bottom * diameters make a cone or a taper, and 0 closes an end to a point. * @param inputs - The height, the two diameters, the tessellation, the subdivisions, the side orientation and the shadow flag * @returns The cylinder mesh * @group create simple * @shortname create cylinder * @disposableOutput true * @drawable true * @example * ```typescript * const cone = bitbybit.babylon.meshBuilder.createCylinder({ height: 10, diameterTop: 0, diameterBottom: 6, tessellation: 64, subdivisions: 1, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createCylinder(inputs: Inputs.BabylonMeshBuilder.CreateCylinderDto): BABYLON.Mesh; /** * Sweeps a profile along a path: `shape` is the profile as points in the XY plane and `path` * the points it travels through, with `scale` and `rotation` in radians applied step by step * along the way. * * `closeShape` joins the profile's ends, `closePath` joins the path's, and `cap` closes * neither, one or both ends. * @param inputs - The profile, the path, the scale, the rotation per step, the closing flags, the cap mode, the side orientation and the shadow flag * @returns The swept mesh * @group create simple * @shortname create extruded shape * @disposableOutput true * @drawable true * @example * ```typescript * const rail = bitbybit.babylon.meshBuilder.createExtrudedSahpe({ shape: [[-1, 0, 0], [1, 0, 0], [1, 1, 0], [-1, 1, 0]], path: [[0, 0, 0], [10, 0, 0], [10, 0, 10]], scale: 1, rotation: 0, closeShape: true, closePath: false, cap: 3, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createExtrudedSahpe(inputs: Inputs.BabylonMeshBuilder.CreateExtrudedShapeDto): BABYLON.Mesh; /** * Builds a surface through several paths of points, joining neighboring paths with triangles, * like cloth stretched over a set of lines. * * `closePath` joins each path's ends, `closeArray` joins the last path back to the first, and * `offset` shifts how points pair up when only one path is given. * @param inputs - The paths, the closing flags, the offset, the updatable flag, the side orientation and the shadow flag * @returns The ribbon mesh * @group create simple * @shortname create ribbon * @disposableOutput true * @drawable true * @example * ```typescript * const sheet = bitbybit.babylon.meshBuilder.createRibbon({ pathArray: [[[0, 0, 0], [10, 0, 0], [20, 0, 0]], [[0, 5, 5], [10, 5, 5], [20, 5, 5]]], closeArray: false, closePath: false, offset: 0, updatable: false, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createRibbon(inputs: Inputs.BabylonMeshBuilder.CreateRibbonDto): BABYLON.Mesh; /** * Revolves a profile around the Y axis, the way a lathe turns wood: `shape` is the profile as * points in the XY plane with X as the distance from the axis, `radius` pushes it outward, and * `arc` below 1 leaves the revolution open. * @param inputs - The profile, the radius, the tessellation, the arc fraction, the closed flag, the side orientation and the shadow flag * @returns The lathe mesh * @group create simple * @shortname create lathe * @disposableOutput true * @drawable true * @example * ```typescript * const vase = bitbybit.babylon.meshBuilder.createLathe({ shape: [[2, 0, 0], [3, 3, 0], [2, 6, 0], [2.5, 8, 0]], radius: 0, tessellation: 64, arc: 1, closed: true, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createLathe(inputs: Inputs.BabylonMeshBuilder.CreateLatheDto): BABYLON.Mesh; /** * Builds a flat ground plane centered on the origin in the XZ plane, `width` along X and * `height` along Z, divided into a grid of `subdivisionsX` by `subdivisionsY` cells. * @param inputs - The width, the height, the subdivisions, the side orientation and the shadow flag * @returns The ground mesh * @group create simple * @shortname create ground * @disposableOutput true * @drawable true * @example * ```typescript * const ground = bitbybit.babylon.meshBuilder.createGround({ width: 100, height: 100, subdivisionsX: 1, subdivisionsY: 1, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createGround(inputs: Inputs.BabylonMeshBuilder.CreateGroundDto): BABYLON.Mesh; /** * Builds a flat rectangle centered on the origin in the XY plane, `width` along X and `height` * along Y, facing the Z axis. * @param inputs - The width, the height, the side orientation and the shadow flag * @returns The plane mesh * @group create simple * @shortname rectangle plane * @disposableOutput true * @drawable true * @example * ```typescript * const plane = bitbybit.babylon.meshBuilder.createRectanglePlane({ width: 20, height: 10, sideOrientation: Bit.Inputs.BabylonMesh.sideOrientationEnum.doubleside, enableShadows: true }); * ``` */ createRectanglePlane(inputs: Inputs.BabylonMeshBuilder.CreateRectanglePlaneDto): BABYLON.Mesh; private enableShadows; } /** * Working with meshes already in the BabylonJS scene, the objects `draw.drawAnyAsync` gives back: * moving, rotating and scaling them, showing and hiding, parenting, picking and collision flags, * names and ids, cloning and instancing for many copies, and reading their triangles back out. * Rotations are given in degrees; positions and distances are in scene units. */ declare class BabylonMesh { private readonly context; /** * Removes a mesh from the scene and frees its GPU resources; the mesh cannot be used * afterwards. Nothing happens when no mesh is given. * @param inputs - The mesh to remove * @group memory * @shortname dispose * @example * ```typescript * bitbybit.babylon.mesh.dispose({ babylonMesh: mesh }); * ``` */ dispose(inputs: Inputs.BabylonMesh.BabylonMeshDto): void; /** * Moves, rotates, scales and recolors a drawn mesh in place, without drawing it again, which is * faster when only the placement or the color changes. * * `rotation` is in radians here. `colours` is one hex color, or a list with one entry per child * mesh, or per point or line of such a drawing; any other list uses its first entry. * @param inputs - The drawn mesh, its new position, rotation, scaling and colors * @group updates * @shortname update drawn * @example * ```typescript * bitbybit.babylon.mesh.updateDrawn({ babylonMesh: mesh, position: [0, 5, 0], rotation: [0, Math.PI / 2, 0], scaling: [1, 1, 1], colours: "#ff0000" }); * ``` */ updateDrawn(inputs: Inputs.BabylonMesh.UpdateDrawnBabylonMesh): void; /** * Sets how visible a mesh is, from 0 for fully transparent to 1 for fully shown, with the * values between fading it; `includeChildren` applies the same value to its child meshes. * @param inputs - The mesh, the visibility from 0 to 1 and whether children follow * @group visibility * @shortname set visibility * @example * ```typescript * bitbybit.babylon.mesh.setVisibility({ babylonMesh: mesh, visibility: 0.5, includeChildren: true }); * ``` */ setVisibility(inputs: Inputs.BabylonMesh.SetMeshVisibilityDto): void; /** * Hides a mesh without removing it from the scene, and its child meshes too when * `includeChildren` is true; `show` brings it back. * @param inputs - The mesh and whether its children follow * @group visibility * @shortname hide * @example * ```typescript * bitbybit.babylon.mesh.hide({ babylonMesh: mesh, includeChildren: true }); * ``` */ hide(inputs: Inputs.BabylonMesh.ShowHideMeshDto): void; /** * Shows a mesh that `hide` or a hidden draw made invisible, and its child meshes too when * `includeChildren` is true. * @param inputs - The mesh and whether its children follow * @group visibility * @shortname show * @example * ```typescript * bitbybit.babylon.mesh.show({ babylonMesh: mesh, includeChildren: true }); * ``` */ show(inputs: Inputs.BabylonMesh.ShowHideMeshDto): void; /** * Makes one mesh the child of another, so it moves, turns and scales together with its parent * from then on; its position becomes relative to the parent. * @param inputs - The mesh and the mesh to parent it to * @group set * @shortname parent * @example * ```typescript * bitbybit.babylon.mesh.setParent({ babylonMesh: wheel, parentMesh: car }); * ``` */ setParent(inputs: Inputs.BabylonMesh.SetParentDto): void; /** * Reads the node a mesh is parented to, which is what it moves with; a mesh at the top level * has none. * @param inputs - The mesh * @returns The parent node * @group get * @shortname parent */ getParent(inputs: Inputs.BabylonMesh.SetParentDto): BABYLON.Node; /** * Turns collision checking on or off for a mesh, and its children when `includeChildren` is * true, so a camera or another collider with collisions enabled cannot pass through it. * @param inputs - The mesh, the flag and whether children follow * @group set * @shortname check collisions * @example * ```typescript * bitbybit.babylon.mesh.setCheckCollisions({ babylonMesh: walls, checkCollisions: true, includeChildren: true }); * ``` */ setCheckCollisions(inputs: Inputs.BabylonMesh.CheckCollisionsBabylonMeshDto): void; /** * Reads whether a mesh takes part in collision checking. * @param inputs - The mesh * @returns True when collisions are checked against the mesh * @group get * @shortname check collisions */ getCheckCollisions(inputs: Inputs.BabylonMesh.CheckCollisionsBabylonMeshDto): boolean; /** * Sets whether a mesh answers to pointer picking, and its children too when `includeChildren` * is true; an unpickable mesh is skipped by clicks and rays that pick. * @param inputs - The mesh, the flag and whether children follow * @group get * @shortname check collisions * @example * ```typescript * bitbybit.babylon.mesh.setPickable({ babylonMesh: mesh, pickable: true, includeChildren: true }); * ``` */ setPickable(inputs: Inputs.BabylonMesh.PickableBabylonMeshDto): void; /** * Lets a mesh, and its children when `includeChildren` is true, react to the pointer merely * moving over it, which is off by default because it costs a pick on every pointer move. * @param inputs - The mesh and whether children follow * @group set * @shortname enable pointer move events * @example * ```typescript * bitbybit.babylon.mesh.enablePointerMoveEvents({ babylonMesh: mesh, includeChildren: true }); * ``` */ enablePointerMoveEvents(inputs: Inputs.BabylonMesh.BabylonMeshWithChildrenDto): void; /** * Stops a mesh, and its children when `includeChildren` is true, from reacting to pointer * moves, back to the default. * @param inputs - The mesh and whether children follow * @group set * @shortname disable pointer move events * @example * ```typescript * bitbybit.babylon.mesh.disablePointerMoveEvents({ babylonMesh: mesh, includeChildren: true }); * ``` */ disablePointerMoveEvents(inputs: Inputs.BabylonMesh.BabylonMeshWithChildrenDto): void; /** * Reads whether the mesh can be picked with the pointer. * @param inputs - The mesh * @returns True when the mesh answers to picking * @group get * @shortname pickable */ getPickable(inputs: Inputs.BabylonMesh.BabylonMeshDto): boolean; /** * Finds every mesh in the scene whose name contains the given text, case-sensitive, in scene * order. * @param inputs - The text to look for in mesh names * @returns The matching meshes * @group get * @shortname meshes where name contains * @example * ```typescript * const wheels = bitbybit.babylon.mesh.getMeshesWhereNameContains({ name: "wheel" }); * ``` */ getMeshesWhereNameContains(inputs: Inputs.BabylonMesh.ByNameBabylonMeshDto): BABYLON.AbstractMesh[]; /** * Lists the meshes parented under a mesh: all descendants, or only the direct children when * `directDescendantsOnly` is true. * @param inputs - The mesh and whether to stop at direct children * @returns The child meshes * @group get * @shortname child meshes * @example * ```typescript * const parts = bitbybit.babylon.mesh.getChildMeshes({ babylonMesh: model, directDescendantsOnly: false }); * ``` */ getChildMeshes(inputs: Inputs.BabylonMesh.ChildMeshesBabylonMeshDto): BABYLON.AbstractMesh[]; /** * Finds every mesh in the scene with exactly the given id; ids need not be unique, so several * may match. * @param inputs - The id to look for * @returns The meshes with that id * @group get * @shortname meshes by id * @example * ```typescript * const meshes = bitbybit.babylon.mesh.getMeshesOfId({ id: "wheel" }); * ``` */ getMeshesOfId(inputs: Inputs.BabylonMesh.ByIdBabylonMeshDto): BABYLON.AbstractMesh[]; /** * Finds the first mesh in the scene with exactly the given id; use `getMeshesOfId` when several * share it. * @param inputs - The id to look for * @returns The first mesh with that id * @group get * @shortname mesh by id * @example * ```typescript * const mesh = bitbybit.babylon.mesh.getMeshOfId({ id: "wheel" }); * ``` */ getMeshOfId(inputs: Inputs.BabylonMesh.ByIdBabylonMeshDto): BABYLON.AbstractMesh; /** * Finds the mesh with the given unique id, the number the scene assigns to every mesh once, as * `getUniqueId` reads it. * @param inputs - The unique id * @returns The mesh with that unique id * @group get * @shortname mesh by unique id * @example * ```typescript * const id = bitbybit.babylon.mesh.getUniqueId({ babylonMesh: mesh }); * const same = bitbybit.babylon.mesh.getMeshOfUniqueId({ uniqueId: id }); * ``` */ getMeshOfUniqueId(inputs: Inputs.BabylonMesh.UniqueIdBabylonMeshDto): BABYLON.AbstractMesh; /** * Joins several meshes into one new mesh, which draws faster than many separate ones. * * The sources are removed when `disposeSource` is true; set `allow32BitsIndices` when the * meshes together have more than 65 thousand vertices, and use the sub-mesh options to keep * separate materials. * @param inputs - The meshes and the merge options * @returns The merged mesh * @group edit * @shortname merge * @example * ```typescript * const merged = bitbybit.babylon.mesh.mergeMeshes({ arrayOfMeshes: [meshA, meshB], disposeSource: true, allow32BitsIndices: true, subdivideWithSubMeshes: false, multiMultiMaterials: false }); * ``` */ mergeMeshes(inputs: Inputs.BabylonMesh.MergeMeshesDto): BABYLON.Mesh; /** * Gives every triangle of a mesh its own vertices and normals, so faces show as flat facets * instead of being smoothed across edges; the mesh is changed in place and given back. * @param inputs - The mesh * @returns The same mesh, flat shaded * @group edit * @shortname convert to flat shaded * @example * ```typescript * const faceted = bitbybit.babylon.mesh.convertToFlatShadedMesh({ babylonMesh: mesh }); * ``` */ convertToFlatShadedMesh(inputs: Inputs.BabylonMesh.BabylonMeshDto): BABYLON.Mesh; /** * Makes a copy of a mesh, with its children, that shares the geometry of the original and is * placed at the same spot; the copy casts and receives shadows like the original. * @param inputs - The mesh to copy * @returns The copy * @group edit * @shortname clone * @disposableOutput true * @example * ```typescript * const copy = bitbybit.babylon.mesh.clone({ babylonMesh: mesh }); * bitbybit.babylon.mesh.setPosition({ babylonMesh: copy, position: [10, 0, 0] }); * ``` */ clone(inputs: Inputs.BabylonMesh.BabylonMeshDto): BABYLON.Mesh; /** * Makes one copy of a mesh at every given position, in the same order; the copies share the * geometry of the original. * @param inputs - The mesh and the positions * @returns One copy per position * @group edit * @shortname clone to positions * @disposableOutput true * @drawable true * @example * ```typescript * const copies = bitbybit.babylon.mesh.cloneToPositions({ babylonMesh: mesh, positions: [[0, 0, 0], [10, 0, 0], [20, 0, 0]] }); * ``` */ cloneToPositions(inputs: Inputs.BabylonMesh.CloneToPositionsDto): BABYLON.Mesh[]; /** * Sets the id of a mesh, a label that `getMeshOfId` finds it by and that need not be unique. * @param inputs - The mesh and the id * @group set * @shortname id */ setId(inputs: Inputs.BabylonMesh.IdBabylonMeshDto): void; /** * Reads the id of a mesh, the label set by `setId` or by the loader that created it. * @param inputs - The mesh * @returns The id * @group get * @shortname id */ getId(inputs: Inputs.BabylonMesh.IdBabylonMeshDto): string; /** * Reads the unique id of a mesh, the number the scene gives every mesh once and never reuses. * @param inputs - The mesh * @returns The unique id number * @group get * @shortname unique id */ getUniqueId(inputs: Inputs.BabylonMesh.BabylonMeshDto): number; /** * Sets the name of a mesh, and of its children too when `includeChildren` is true; names are * what `getMeshesWhereNameContains` searches. * @param inputs - The mesh, the name and whether children follow * @group set * @shortname name */ setName(inputs: Inputs.BabylonMesh.NameBabylonMeshDto): void; /** * Reads the triangles of a mesh as lists of three points in the mesh's own coordinates, the * form `jscad.shapes.fromPolygonPoints` and similar builders take. The mesh must be made of * triangles. * @param inputs - The mesh * @returns The triangles as lists of three points * @group get * @shortname vertices as polygon points * @example * ```typescript * const triangles = bitbybit.babylon.mesh.getVerticesAsPolygonPoints({ babylonMesh: mesh }); * ``` */ getVerticesAsPolygonPoints(inputs: Inputs.BabylonMesh.BabylonMeshDto): Base.Point3[][]; /** * Reads the name of a mesh, as set by `setName` or by whatever created it. * @param inputs - The mesh * @returns The name * @group get * @shortname name */ getName(inputs: Inputs.BabylonMesh.BabylonMeshDto): string; /** * Gives a mesh a material, and its children too when `includeChildren` is true; the material * decides the color, shininess and transparency of its surface. * @param inputs - The mesh, the material and whether children follow * @group set * @shortname material * @example * ```typescript * const material = bitbybit.babylon.material.pbrMetallicRoughness.create({ name: "red", baseColor: "#ff0000", emissiveColor: "#000000", metallic: 0.2, roughness: 0.6, alpha: 1, backFaceCulling: false, zOffset: 0 }); * bitbybit.babylon.mesh.setMaterial({ babylonMesh: mesh, material, includeChildren: true }); * ``` */ setMaterial(inputs: Inputs.BabylonMesh.MaterialBabylonMeshDto): void; /** * Reads the material of a mesh, the surface description its faces are drawn with. * @param inputs - The mesh * @returns The material * @group get * @shortname material */ getMaterial(inputs: Inputs.BabylonMesh.BabylonMeshDto): BABYLON.Material; /** * Reads the position of a mesh relative to its parent, as a point. * @param inputs - The mesh * @returns The position as a point * @group get * @shortname position */ getPosition(inputs: Inputs.BabylonMesh.BabylonMeshDto): Base.Point3; /** * Reads the position of a mesh in world coordinates, with every parent's transform applied. * @param inputs - The mesh * @returns The world position as a point * @group get * @shortname absolute position */ getAbsolutePosition(inputs: Inputs.BabylonMesh.BabylonMeshDto): Base.Point3; /** * Reads the rotation of a mesh around X, Y and Z, in radians, as its rotation property holds * it. * @param inputs - The mesh * @returns The rotation angles in radians * @group get * @shortname rotation */ getRotation(inputs: Inputs.BabylonMesh.BabylonMeshDto): Base.Point3; /** * Reads the scale factors of a mesh along X, Y and Z; 1 is unscaled. * @param inputs - The mesh * @returns The scale factors * @group get * @shortname scale */ getScale(inputs: Inputs.BabylonMesh.BabylonMeshDto): Base.Point3; /** * Moves a mesh along its own forward direction, the local Z axis, by `distance` scene units; a * turned mesh moves the way it faces. * @param inputs - The mesh and the distance * @group move * @shortname forward * @example * ```typescript * bitbybit.babylon.mesh.moveForward({ babylonMesh: mesh, distance: 5 }); * ``` */ moveForward(inputs: Inputs.BabylonMesh.TranslateBabylonMeshDto): void; /** * Moves a mesh against its own forward direction, the local Z axis, by `distance` scene units. * @param inputs - The mesh and the distance * @group move * @shortname backward */ moveBackward(inputs: Inputs.BabylonMesh.TranslateBabylonMeshDto): void; /** * Moves a mesh along its own up direction, the local Y axis, by `distance` scene units. * @param inputs - The mesh and the distance * @group move * @shortname up */ moveUp(inputs: Inputs.BabylonMesh.TranslateBabylonMeshDto): void; /** * Moves a mesh against its own up direction, the local Y axis, by `distance` scene units. * @param inputs - The mesh and the distance * @group move * @shortname down */ moveDown(inputs: Inputs.BabylonMesh.TranslateBabylonMeshDto): void; /** * Moves a mesh along its own right direction, the local X axis, by `distance` scene units. * @param inputs - The mesh and the distance * @group move * @shortname right */ moveRight(inputs: Inputs.BabylonMesh.TranslateBabylonMeshDto): void; /** * Moves a mesh against its own right direction, the local X axis, by `distance` scene units. * @param inputs - The mesh and the distance * @group move * @shortname left */ moveLeft(inputs: Inputs.BabylonMesh.TranslateBabylonMeshDto): void; /** * Turns a mesh around its own Y axis by `rotate` degrees, on top of its current rotation, the * way a car turns left or right. * @param inputs - The mesh and the angle in degrees * @group move * @shortname yaw * @example * ```typescript * bitbybit.babylon.mesh.yaw({ babylonMesh: mesh, rotate: 45 }); * ``` */ yaw(inputs: Inputs.BabylonMesh.RotateBabylonMeshDto): void; /** * Turns a mesh around its own X axis by `rotate` degrees, on top of its current rotation, the * way a nose tips up or down. * @param inputs - The mesh and the angle in degrees * @group move * @shortname pitch */ pitch(inputs: Inputs.BabylonMesh.RotateBabylonMeshDto): void; /** * Turns a mesh around its own Z axis by `rotate` degrees, on top of its current rotation, the * way a wing banks. * @param inputs - The mesh and the angle in degrees * @group move * @shortname roll */ roll(inputs: Inputs.BabylonMesh.RotateBabylonMeshDto): void; /** * Turns a mesh by `angle` degrees around an axis that passes through `position`, so the mesh * orbits that point rather than spinning in place. * @param inputs - The mesh, the point on the axis, the axis direction and the angle in degrees * @group move * @shortname rotate around axis with position * @example * ```typescript * bitbybit.babylon.mesh.rotateAroundAxisWithPosition({ mesh, position: [0, 0, 0], axis: [0, 1, 0], angle: 90 }); * ``` */ rotateAroundAxisWithPosition(inputs: Inputs.BabylonMesh.RotateAroundAxisNodeDto): void; /** * Places a mesh, or an instance of one, at a point relative to its parent. * @param inputs - The mesh and the position * @group set * @shortname position * @example * ```typescript * bitbybit.babylon.mesh.setPosition({ babylonMesh: mesh, position: [0, 5, 0] }); * ``` */ setPosition(inputs: Inputs.BabylonMesh.UpdateDrawnBabylonMeshPositionDto): void; /** * Sets the rotation of a mesh, or an instance of one, as angles in degrees around X, Y and Z, * replacing its current rotation. * @param inputs - The mesh and the three angles in degrees * @group set * @shortname rotation * @example * ```typescript * bitbybit.babylon.mesh.setRotation({ babylonMesh: mesh, rotation: [0, 90, 0] }); * ``` */ setRotation(inputs: Inputs.BabylonMesh.UpdateDrawnBabylonMeshRotationDto): void; /** * Sets the scale factors of a mesh, or an instance of one, along X, Y and Z, replacing its * current scale; 1 is unscaled. * @param inputs - The mesh and the three scale factors * @group set * @shortname scale * @example * ```typescript * bitbybit.babylon.mesh.setScale({ babylonMesh: mesh, scale: [2, 1, 1] }); * ``` */ setScale(inputs: Inputs.BabylonMesh.UpdateDrawnBabylonMeshScaleDto): void; /** * Multiplies the current scale of a mesh, or an instance of one, by one factor on all axes, so * 2 doubles whatever size it has. * @param inputs - The mesh and the factor * @group set * @shortname scale in place */ setLocalScale(inputs: Inputs.BabylonMesh.ScaleInPlaceDto): void; /** * Tells whether two meshes overlap, judged by their bounding boxes: axis-aligned ones by * default, or boxes that follow each mesh's rotation when `precise` is true; * `includeDescendants` tests their children too. * @param inputs - The two meshes and the precision options * @returns True when the meshes overlap * @group intersects * @shortname mesh * @example * ```typescript * const touching = bitbybit.babylon.mesh.intersectsMesh({ babylonMesh: meshA, babylonMesh2: meshB, precise: true, includeDescendants: false }); * ``` */ intersectsMesh(inputs: Inputs.BabylonMesh.IntersectsMeshDto): boolean; /** * Tells whether a point lies inside the bounding box of a mesh. * @param inputs - The mesh and the point * @returns True when the point is inside the mesh's bounds * @group intersects * @shortname point * @example * ```typescript * const inside = bitbybit.babylon.mesh.intersectsPoint({ babylonMesh: mesh, point: [0, 1, 0] }); * ``` */ intersectsPoint(inputs: Inputs.BabylonMesh.IntersectsPointDto): boolean; /** * Creates a placed instance of a mesh, as `createMeshInstanceAndTransform` does, without giving * it back; for scripts that only need the copy to appear. * @param inputs - The mesh and the position, rotation and scaling of the instance * @group instance * @shortname create and transform * @disposableOutput true * @example * ```typescript * bitbybit.babylon.mesh.createMeshInstanceAndTransformNoReturn({ mesh, position: [10, 0, 0], rotation: [0, 45, 0], scaling: [1, 1, 1] }); * ``` */ createMeshInstanceAndTransformNoReturn(inputs: Inputs.BabylonMesh.MeshInstanceAndTransformDto): void; /** * Creates an instance of a mesh, a lightweight copy that shares its geometry and draws cheaply, * and places it at the given position, rotation in degrees and scaling. * * A mesh with children gets one instance per child, gathered under a new container; the * original is hidden. * @param inputs - The mesh and the position, rotation and scaling of the instance * @returns The container holding the instances * @group instance * @shortname create and transform * @disposableOutput true * @example * ```typescript * const instance = bitbybit.babylon.mesh.createMeshInstanceAndTransform({ mesh, position: [10, 0, 0], rotation: [0, 45, 0], scaling: [1, 1, 1] }); * ``` */ createMeshInstanceAndTransform(inputs: Inputs.BabylonMesh.MeshInstanceAndTransformDto): BABYLON.Mesh; /** * Creates an instance of a mesh, a lightweight copy that shares its geometry and draws cheaply * when many alike are needed, placed where the original is. * * A mesh with children gets one instance per child, gathered under a new container. * @param inputs - The mesh * @returns The instance, or the container holding the child instances * @group instance * @shortname create * @disposableOutput true * @example * ```typescript * const instance = bitbybit.babylon.mesh.createMeshInstance({ mesh }); * bitbybit.babylon.mesh.setPosition({ babylonMesh: instance, position: [10, 0, 0] }); * ``` */ createMeshInstance(inputs: Inputs.BabylonMesh.MeshInstanceDto): BABYLON.Mesh; /** * Turns a side orientation choice into the number the engine uses for it, for building meshes * by hand. * @param sideOrientation - The side orientation choice * @returns The engine's number for that orientation * @ignore true */ getSideOrientation(sideOrientation: Inputs.BabylonMesh.sideOrientationEnum): number; private assignColorToMesh; } /** * Transform nodes: invisible points with a position and an orientation that meshes and other nodes * can be parented to, so a whole group moves as one. Building a hierarchy of nodes is how complex * arrangements are placed: turn the parent and every child turns with it. The methods here create * nodes, read their axes and positions in world or local space, and move, rotate and reparent them; * angles are in degrees. */ declare class BabylonNode { private readonly context; private readonly drawHelper; /** * Draws the three axes of a node as colored lines of the given length, parented to it, so its * position and orientation can be seen; the default colors are red for X, green for Y and blue * for Z. * @param inputs - The node, the axis colors and the axis length * @example * ```typescript * bitbybit.babylon.node.drawNode({ node, colorX: "#ff0000", colorY: "#00ff00", colorZ: "#0000ff", size: 2 }); * ``` */ drawNode(inputs: Inputs.BabylonNode.DrawNodeDto): void; /** * Draws the three axes of several nodes as colored lines of the given length, each set parented * to its node, as `drawNode` does for one. * @param inputs - The nodes, the axis colors and the axis length * @example * ```typescript * bitbybit.babylon.node.drawNodes({ nodes: [nodeA, nodeB], colorX: "#ff0000", colorY: "#00ff00", colorZ: "#0000ff", size: 2 }); * ``` */ drawNodes(inputs: Inputs.BabylonNode.DrawNodesDto): void; /** * Creates a node at `origin` turned by the three `rotation` angles in degrees around X, Y and * Z, inside the coordinate system of `parent` when one is given. * @param inputs - The optional parent, the origin and the rotation angles in degrees * @returns The new node * @example * ```typescript * const node = bitbybit.babylon.node.createNodeFromRotation({ parent: null, origin: [0, 5, 0], rotation: [0, 45, 0] }); * ``` */ createNodeFromRotation(inputs: Inputs.BabylonNode.CreateNodeFromRotationDto): BABYLON.TransformNode; /** * Creates a node parented to the root node of the scene, a fresh starting point for building a * hierarchy at the world origin. * @returns The new node, whose parent is the scene's root node * @example * ```typescript * const world = bitbybit.babylon.node.createWorldNode(); * const arm = bitbybit.babylon.node.createNodeFromRotation({ parent: world, origin: [0, 5, 0], rotation: [0, 0, 30] }); * ``` */ createWorldNode(): BABYLON.TransformNode; /** * Reads the direction a node's local Z axis points in world space, with every parent's rotation * applied. * @param inputs - The node * @returns The forward direction as a vector */ getAbsoluteForwardVector(inputs: Inputs.BabylonNode.NodeDto): number[]; /** * Reads the direction a node's local X axis points in world space, with every parent's rotation * applied. * @param inputs - The node * @returns The right direction as a vector */ getAbsoluteRightVector(inputs: Inputs.BabylonNode.NodeDto): number[]; /** * Reads the direction a node's local Y axis points in world space, with every parent's rotation * applied. * @param inputs - The node * @returns The up direction as a vector */ getAbsoluteUpVector(inputs: Inputs.BabylonNode.NodeDto): number[]; /** * Reads where a node's origin is in world space, with every parent's transform applied. * @param inputs - The node * @returns The world position as a point */ getAbsolutePosition(inputs: Inputs.BabylonNode.NodeDto): number[]; /** * Reads the rotation of a node in world space, with every parent's rotation applied, as a 4x4 * matrix of 16 numbers. * @param inputs - The node * @returns The rotation as a matrix of 16 numbers */ getAbsoluteRotationTransformation(inputs: Inputs.BabylonNode.NodeDto): number[]; /** * Reads the rotation of a node relative to its parent as a 4x4 matrix of 16 numbers; the node * must carry a rotation quaternion, which `rotate` and `setDirection` give it. * @param inputs - The node * @returns The rotation as a matrix of 16 numbers */ getRotationTransformation(inputs: Inputs.BabylonNode.NodeDto): number[]; /** * Lists the nodes and meshes parented directly under a node, the ones that move with it. * @param inputs - The node * @returns The direct children */ getChildren(inputs: Inputs.BabylonNode.NodeDto): BABYLON.Node[]; /** * Reads the node a node is parented to, the one it moves with; a top-level node has none. * @param inputs - The node * @returns The parent node */ getParent(inputs: Inputs.BabylonNode.NodeDto): BABYLON.Node; /** * Reads a node's position measured in its own local axes rather than its parent's, which * differs once the node is rotated. * @param inputs - The node * @returns The position as a point in the node's local space */ getPositionExpressedInLocalSpace(inputs: Inputs.BabylonNode.NodeDto): number[]; /** * Gives the root node of the scene, the top of the hierarchy that `createWorldNode` parents to. * @returns The root node */ getRootNode(): BABYLON.TransformNode; /** * Reads a node's rotation relative to its parent as three angles in degrees around X, Y and Z. * @param inputs - The node * @returns The rotation angles in degrees */ getRotation(inputs: Inputs.BabylonNode.NodeDto): number[]; /** * Turns a node by `angle` degrees around an axis that passes through `position`, so the node * orbits that point rather than spinning in place; its children follow. * @param inputs - The node, the point on the axis, the axis direction and the angle in degrees * @example * ```typescript * bitbybit.babylon.node.rotateAroundAxisWithPosition({ node, position: [0, 0, 0], axis: [0, 1, 0], angle: 90 }); * ``` */ rotateAroundAxisWithPosition(inputs: Inputs.BabylonNode.RotateAroundAxisNodeDto): void; /** * Turns a node by `angle` degrees around an axis through its own origin, on top of its current * rotation; its children follow. * @param inputs - The node, the axis direction and the angle in degrees * @example * ```typescript * bitbybit.babylon.node.rotate({ node, axis: [0, 1, 0], angle: 45 }); * ``` */ rotate(inputs: Inputs.BabylonNode.RotateNodeDto): void; /** * Moves a node to a point in world space, whatever its parents are; its children follow. * @param inputs - The node and the world position * @example * ```typescript * bitbybit.babylon.node.setAbsolutePosition({ node, position: [10, 0, 0] }); * ``` */ setAbsolutePosition(inputs: Inputs.BabylonNode.NodePositionDto): void; /** * Turns a node so its local Z axis points along `direction`; its children follow. * @param inputs - The node and the direction * @example * ```typescript * bitbybit.babylon.node.setDirection({ node, direction: [1, 0, 0] }); * ``` */ setDirection(inputs: Inputs.BabylonNode.NodeDirectionDto): void; /** * Parents a node to another so it moves with it from then on, keeping its current place in the * world; a null parent detaches it. * @param inputs - The node and the new parent * @example * ```typescript * bitbybit.babylon.node.setParent({ node: wheel, parentNode: car }); * ``` */ setParent(inputs: Inputs.BabylonNode.NodeParentDto): void; /** * Moves a node by `distance` scene units along `direction`, given in the node's own local axes; * its children follow. * @param inputs - The node, the direction and the distance * @example * ```typescript * bitbybit.babylon.node.translate({ node, direction: [0, 1, 0], distance: 5 }); * ``` */ translate(inputs: Inputs.BabylonNode.NodeTranslationDto): void; } /** * Finding what is under a ray or the pointer: a pick shoots a ray into the scene and reports the * first pickable mesh it hits, where, how far away and on which face. `pickWithPickingRay` uses the * pointer's current position; the other methods read parts of a picking result. */ declare class BabylonPick { private readonly context; /** * Shoots a ray into the scene and reports the first pickable mesh it hits, with the hit point * and distance; read the parts with the other methods here. * @param inputs - The ray * @returns The picking result * @group pick * @shortname pick with custom ray * @example * ```typescript * const ray = bitbybit.babylon.ray.createRay({ origin: [0, 10, 0], direction: [0, -1, 0], length: 100 }); * const pick = bitbybit.babylon.pick.pickWithRay({ ray }); * const hit = bitbybit.babylon.pick.hit({ pickInfo: pick }); * ``` */ pickWithRay(inputs: Inputs.BabylonPick.RayDto): BABYLON.PickingInfo; /** * Shoots a ray from the active camera through the pointer's current position and reports the * first pickable mesh it hits, the way a click selects. * @returns The picking result * @group pick * @shortname pick with picking ray * @example * ```typescript * bitbybit.babylon.scene.onPointerDown({ statement_update: () => { * const pick = bitbybit.babylon.pick.pickWithPickingRay(); * if (bitbybit.babylon.pick.hit({ pickInfo: pick })) { * console.log(bitbybit.babylon.pick.getPickedPoint({ pickInfo: pick })); * } * } }); * ``` */ pickWithPickingRay(): BABYLON.PickingInfo; /** * Reads how far along the ray the hit was, in scene units; meaningful only when `hit` is true. * @param inputs - The picking result * @returns The distance to the hit * @group get from pick info * @shortname pick distance */ getDistance(inputs: Inputs.BabylonPick.PickInfo): number; /** * Reads the mesh a pick hit; meaningful only when `hit` is true. * @param inputs - The picking result * @returns The mesh that was hit * @group get from pick info * @shortname picked mesh */ getPickedMesh(inputs: Inputs.BabylonPick.PickInfo): BABYLON.AbstractMesh; /** * Reads the point in the scene where a pick hit the mesh; meaningful only when `hit` is true. * @param inputs - The picking result * @returns The hit point * @group get from pick info * @shortname picked point */ getPickedPoint(inputs: Inputs.BabylonPick.PickInfo): Base.Point3; /** * Tells whether a pick hit anything at all; check it before reading the mesh, point or * distance. * @param inputs - The picking result * @returns True when something was hit * @group get from pick info * @shortname hit */ hit(inputs: Inputs.BabylonPick.PickInfo): boolean; /** * Reads the index of the sub-mesh that was hit, for meshes split into several material * sections. * @param inputs - The picking result * @returns The sub-mesh index * @group get from pick info * @shortname sub mesh id */ getSubMeshId(inputs: Inputs.BabylonPick.PickInfo): number; /** * Reads the index of the triangle that was hit within its sub-mesh. * @param inputs - The picking result * @returns The face index * @group get from pick info * @shortname sub mesh face id */ getSubMeshFaceId(inputs: Inputs.BabylonPick.PickInfo): number; /** * Reads the first barycentric coordinate of the hit inside its triangle, the weight of the * triangle's second vertex, used to work out texture coordinates. * @param inputs - The picking result * @returns The barycentric U coordinate * @group get from pick info * @shortname picked bu */ getBU(inputs: Inputs.BabylonPick.PickInfo): number; /** * Reads the second barycentric coordinate of the hit inside its triangle, the weight of the * triangle's third vertex, used to work out texture coordinates. * @param inputs - The picking result * @returns The barycentric V coordinate * @group get from pick info * @shortname picked bv */ getBV(inputs: Inputs.BabylonPick.PickInfo): number; /** * Reads the sprite a pick hit, when sprites rather than meshes were picked. * @param inputs - The picking result * @returns The sprite that was hit * @group get from pick info * @shortname picked sprite */ getPickedSprite(inputs: Inputs.BabylonPick.PickInfo): BABYLON.Sprite; } /** * Rays: a start point and a direction, optionally with a length, used to pick what lies along a * line of sight or to test intersections. `createPickingRay` builds the ray from the camera through * the pointer, the others build one from points. */ declare class BabylonRay { private readonly context; /** * Builds a ray from the active camera through the pointer's current position on the canvas, the * ray a click would pick with. * @returns The ray * @group create * @shortname create picking ray * @example * ```typescript * const ray = bitbybit.babylon.ray.createPickingRay(); * const pick = bitbybit.babylon.pick.pickWithRay({ ray }); * ``` */ createPickingRay(): BABYLON.Ray; /** * Builds a ray starting at `origin` and pointing along `direction`; `length` limits how far it * reaches, and 0 or nothing leaves it unlimited. * @param inputs - The origin, the direction and the optional length * @returns The ray * @group create * @shortname create custom ray * @example * ```typescript * const ray = bitbybit.babylon.ray.createRay({ origin: [0, 10, 0], direction: [0, -1, 0], length: 100 }); * ``` */ createRay(inputs: Inputs.BabylonRay.BaseRayDto): BABYLON.Ray; /** * Builds a ray that starts at `from`, points toward `to` and is exactly as long as the distance * between them. * @param inputs - The start point and the end point * @returns The ray * @group create * @shortname create ray from to * @example * ```typescript * const ray = bitbybit.babylon.ray.createRayFromTo({ from: [0, 10, 0], to: [0, 0, 0] }); * ``` */ createRayFromTo(inputs: Inputs.BabylonRay.FromToDto): BABYLON.Ray; /** * Reads the point a ray starts from, as a point in the scene. * @param inputs - The ray * @returns The origin point * @group get * @shortname get ray origin */ getOrigin(inputs: Inputs.BabylonRay.RayDto): Base.Point3; /** * Reads the direction a ray points in, as a unit vector. * @param inputs - The ray * @returns The direction vector * @group get * @shortname get ray direction */ getDirection(inputs: Inputs.BabylonRay.RayDto): Base.Vector3; /** * Reads how far a ray reaches; an unlimited ray reports a very large number. * @param inputs - The ray * @returns The length * @group get * @shortname get ray length */ getLength(inputs: Inputs.BabylonRay.RayDto): number; } /** * Helper function to initialize a basic BabylonJS scene with lights, shadows, and optional ground plane. * This provides a quick setup for common use cases while remaining fully customizable. * * @param inputs Configuration options for the scene * @returns Object containing the scene, engine, lights, ground, and dispose function * * @example * import { initBabylonJS, BabylonJSScene } from "@bitbybit-dev/babylonjs"; * * // Basic usage with defaults * const { scene, engine } = initBabylonJS(); * * // Custom configuration * const options = new BabylonJSScene.InitBabylonJSDto(); * options.sceneSize = 500; * options.enableGround = true; * options.enableShadows = true; * const { scene, engine, directionalLight } = initBabylonJS(options); */ declare function initBabylonJS(inputs?: BabylonJSScene.InitBabylonJSDto): InitBabylonJSResult; /** * The BabylonJS scene as a whole: the active camera and its limits, lights with shadows, the skybox * and environment lighting, fog, physics, pointer events, the canvas background and clearing * everything drawn. A scene holds every mesh, light and camera; most scripts touch it to set up * lighting and the camera once and then draw into it. */ declare class BabylonScene { private readonly context; /** * Gives the scene every draw call goes into, for direct use of the BabylonJS API on it. * @returns The current scene * @ignore true * @group scene * @shortname get scene */ getScene(): BABYLON.Scene; /** * Makes the given scene the one this library draws into, adding the shadow bookkeeping and root * node it expects; for applications that create the scene themselves. * @param inputs - The scene to use * @returns The same scene, now current * @ignore true * @group scene * @shortname get scene * @example * ```typescript * const scene = bitbybit.babylon.scene.setAndAttachScene({ scene: myScene }); * ``` */ setAndAttachScene(inputs: Inputs.BabylonScene.SceneDto): BABYLON.Scene; /** * Makes a camera the one the scene renders through, detaching the controls of the camera that * was active before. * @param inputs - The camera to activate * @group camera * @shortname activate * @example * ```typescript * const camera = bitbybit.babylon.camera.arcRotate.create({ radius: 20, target: [0, 0, 0], alpha: 45, beta: 70, lowerBetaLimit: 1, upperBetaLimit: 179, angularSensibilityX: 1000, angularSensibilityY: 1000, panningSensibility: 1000, wheelPrecision: 3, maxZ: 1000 }); * bitbybit.babylon.scene.activateCamera({ camera }); * ``` */ activateCamera(inputs: Inputs.BabylonScene.ActiveCameraDto): void; /** * Switches the scene between the left-handed coordinate system BabylonJS uses by default and a * right-handed one, the convention of most CAD tools and of glTF; the active camera is * refreshed to match. * @param inputs - Whether to use the right-handed system * @group system * @shortname hand right * @example * ```typescript * bitbybit.babylon.scene.useRightHandedSystem({ use: true }); * ``` */ useRightHandedSystem(inputs: Inputs.BabylonScene.UseRightHandedSystemDto): void; /** * Adds a point light to the scene, as `drawPointLight` does, without giving it back; for * scripts that only need the light to exist. * @param inputs - The light's position, colors, intensity, bulb radius and shadow settings * @group lights * @shortname point * @disposableOutput true * @example * ```typescript * bitbybit.babylon.scene.drawPointLightNoReturn({ position: [10, 20, 10], intensity: 2000, diffuse: "#ffffff", specular: "#ffffff", radius: 0.5, enableShadows: true, shadowGeneratorMapSize: 1024, shadowDarkness: 0, transparencyShadow: false, shadowUsePercentageCloserFiltering: true, shadowContactHardeningLightSizeUVRatio: 0.2, shadowBias: 0.0001, shadowNormalBias: 0.002, shadowMaxZ: 1000, shadowMinZ: 0.1, shadowRefreshRate: 1 }); * ``` */ drawPointLightNoReturn(inputs: Inputs.BabylonScene.PointLightDto): void; /** * Lists the shadow generators of the lights created through this library, one per light with * shadows enabled; drawn meshes are registered with them as casters. * @returns The shadow generators, or an empty list * @group lights * @shortname point * @disposableOutput true */ getShadowGenerators(): BABYLON.ShadowGenerator[]; /** * Adds a light that shines in every direction from a point, like a bulb, with an optional small * glowing sphere at its position. * * With `enableShadows` true a shadow generator is created and every mesh already in the scene * casts and receives shadows; `intensity` is luminous power, so values in the thousands are * normal. * @param inputs - The light's position, colors, intensity, bulb radius and shadow settings * @returns The point light * @group lights * @shortname point light * @disposableOutput true * @example * ```typescript * const light = bitbybit.babylon.scene.drawPointLight({ position: [10, 20, 10], intensity: 2000, diffuse: "#ffffff", specular: "#ffffff", radius: 0.5, enableShadows: true, shadowGeneratorMapSize: 1024, shadowDarkness: 0, transparencyShadow: false, shadowUsePercentageCloserFiltering: true, shadowContactHardeningLightSizeUVRatio: 0.2, shadowBias: 0.0001, shadowNormalBias: 0.002, shadowMaxZ: 1000, shadowMinZ: 0.1, shadowRefreshRate: 1 }); * ``` */ drawPointLight(inputs: Inputs.BabylonScene.PointLightDto): BABYLON.PointLight; /** * Adds a directional light to the scene, as `drawDirectionalLight` does, without giving it * back; for scripts that only need the light to exist. * @param inputs - The light's direction, colors, intensity and shadow settings * @group lights * @shortname directional * @disposableOutput true * @example * ```typescript * bitbybit.babylon.scene.drawDirectionalLightNoReturn({ direction: [-100, -100, -100], intensity: 0.5, diffuse: "#ffffff", specular: "#ffffff", enableShadows: true, shadowGeneratorMapSize: 1024, shadowDarkness: 0, transparencyShadow: false, shadowUsePercentageCloserFiltering: true, shadowContactHardeningLightSizeUVRatio: 0.2, shadowBias: 0.0001, shadowNormalBias: 0.002, shadowMaxZ: 1000, shadowMinZ: 0, shadowRefreshRate: 1 }); * ``` */ drawDirectionalLightNoReturn(inputs: Inputs.BabylonScene.DirectionalLightDto): void; /** * Adds a light that shines the same way everywhere, like the sun, along `direction`. * * With `enableShadows` true a shadow generator is created and every mesh already in the scene * casts and receives shadows; `intensity` is a plain factor where 1 is full strength. * @param inputs - The light's direction, colors, intensity and shadow settings * @returns The directional light * @group lights * @shortname directional light * @disposableOutput true * @example * ```typescript * const sun = bitbybit.babylon.scene.drawDirectionalLight({ direction: [-100, -100, -100], intensity: 0.5, diffuse: "#ffffff", specular: "#ffffff", enableShadows: true, shadowGeneratorMapSize: 1024, shadowDarkness: 0, transparencyShadow: false, shadowUsePercentageCloserFiltering: true, shadowContactHardeningLightSizeUVRatio: 0.2, shadowBias: 0.0001, shadowNormalBias: 0.002, shadowMaxZ: 1000, shadowMinZ: 0, shadowRefreshRate: 1 }); * ``` */ drawDirectionalLight(inputs: Inputs.BabylonScene.DirectionalLightDto): BABYLON.DirectionalLight; /** * Gives the camera the scene currently renders through. * @returns The active camera * @group camera * @shortname get active camera */ getActiveCamera(): BABYLON.Camera; /** * Repositions the default orbiting camera, the one named `Camera`, and sets its limits and * sensitivities. * * The camera is placed at `position` looking at `lookAt`; the radius, alpha and beta limits * fence how far it can zoom and orbit, angles in degrees, and the sensibilities set how fast it * reacts, lower being faster. * @param inputs - The position, the target and the optional limits and sensitivities * @group camera * @shortname adjust active camera * @example * ```typescript * bitbybit.babylon.scene.adjustActiveArcRotateCamera({ position: [20, 20, 20], lookAt: [0, 0, 0], lowerRadiusLimit: 5, upperRadiusLimit: 100, lowerBetaLimit: 1, upperBetaLimit: 179, angularSensibilityX: 1000, angularSensibilityY: 1000, panningSensibility: 1000, wheelPrecision: 3, maxZ: 1000 }); * ``` */ adjustActiveArcRotateCamera(inputs: Inputs.BabylonScene.CameraConfigurationDto): void; /** * Removes everything drawn from the scene: meshes, materials, textures, lights other than the * default hemispheric one, transform nodes, shadow generators, fog and the environment texture, * and restores the default camera when another was active. * @group environment * @shortname clear all drawn * @example * ```typescript * bitbybit.babylon.scene.clearAllDrawn(); * ``` */ clearAllDrawn(): void; /** * Surrounds the scene with one of the built-in skyboxes and uses it as the environment lighting * that reflective materials pick up. * * `blur` softens the visible sky, `environmentIntensity` scales how much it lights the scene, * and `hideSkybox` keeps the lighting while hiding the sky itself. * @param inputs - The built-in skybox, its size, blur, environment intensity and visibility * @group environment * @shortname skybox * @example * ```typescript * bitbybit.babylon.scene.enableSkybox({ skybox: Bit.Inputs.Base.skyboxEnum.clearSky, size: 1000, blur: 0.1, environmentIntensity: 0.7, hideSkybox: false }); * ``` */ enableSkybox(inputs: Inputs.BabylonScene.SkyboxDto): void; /** * Surrounds the scene with a skybox loaded from your own texture and uses it as the environment * lighting. * * `textureUrl` may point to an `.hdr` file, an `.env` file or the root of six cube face images; * nothing happens without it. `hideSkybox` keeps the lighting while hiding the sky itself. * @param inputs - The texture URL and size, the skybox size, blur, environment intensity and visibility * @group environment * @shortname skybox * @example * ```typescript * bitbybit.babylon.scene.enableSkyboxCustomTexture({ textureUrl: "https://example.com/env/studio.env", textureSize: 512, size: 1000, blur: 0.1, environmentIntensity: 0.7, hideSkybox: true }); * ``` */ enableSkyboxCustomTexture(inputs: Inputs.BabylonScene.SkyboxCustomTextureDto): void; /** * Surrounds the scene with a skybox built from a cube texture you loaded yourself and uses it * as the environment lighting. * * `texture` may come from an `.hdr` or `.env` file. `hideSkybox` keeps the lighting while hiding * the sky; `enableGroundProjection` flattens the lower sky into a ground the model stands on. * @param inputs - The cube texture, the skybox size, blur, environment intensity, visibility and ground projection * @group environment * @shortname skybox from texture * @example * ```typescript * const texture = new BABYLON.CubeTexture("https://example.com/env/studio", bitbybit.babylon.scene.getScene()); * bitbybit.babylon.scene.enableSkyboxFromTexture({ texture, size: 1000, blur: 0.1, environmentIntensity: 0.7, hideSkybox: false, enableGroundProjection: true, projectedGroundRadius: 20, projectedGroundHeight: 3 }); * ``` */ enableSkyboxFromTexture(inputs: Inputs.BabylonScene.SkyboxFromTextureDto): void; /** * Sets the function that runs when a pointer button is pressed on the canvas, replacing any * function set before. * @param inputs - The function to run * @ignore true * @example * ```typescript * bitbybit.babylon.scene.onPointerDown({ statement_update: () => { console.log("pressed"); } }); * ``` */ onPointerDown(inputs: Inputs.BabylonScene.PointerDto): void; /** * Sets the function that runs when a pointer button is released on the canvas, replacing any * function set before. * @param inputs - The function to run * @ignore true * @example * ```typescript * bitbybit.babylon.scene.onPointerUp({ statement_update: () => { console.log("released"); } }); * ``` */ onPointerUp(inputs: Inputs.BabylonScene.PointerDto): void; /** * Sets the function that runs whenever the pointer moves over the canvas, replacing any * function set before; it runs often, so keep it light. * @param inputs - The function to run * @ignore true * @example * ```typescript * bitbybit.babylon.scene.onPointerMove({ statement_update: () => { console.log("moved"); } }); * ``` */ onPointerMove(inputs: Inputs.BabylonScene.PointerDto): void; /** * Fades distant geometry into a color, the way haze does. * * `linear` fades from `start` to `end` in scene units; `exponential` and `exponentialSquared` * fade by `density` instead, ignoring the distances; `none` turns fog off. * @param inputs - The fog mode, color, density and the start and end distances * @group environment * @shortname fog * @example * ```typescript * bitbybit.babylon.scene.fog({ mode: Bit.Inputs.Base.fogModeEnum.linear, color: "#ffffff", density: 0.1, start: 50, end: 300 }); * ``` */ fog(inputs: Inputs.BabylonScene.FogDto): void; /** * Turns on the physics engine for the scene with the given gravity, so bodies given physics * fall and collide; the physics plugin must be set up on the context. * @param inputs - The gravity vector * @returns Nothing; the scene is changed in place * @ignore true * @group physics * @shortname enable * @example * ```typescript * bitbybit.babylon.scene.enablePhysics({ vector: [0, -9.81, 0] }); * ``` */ enablePhysics(inputs: Inputs.BabylonScene.EnablePhysicsDto): void; /** * Paints any CSS `background-image` value behind the scene, a gradient or an image, by making * the scene's clear color transparent and styling the canvas. * @param inputs - The CSS background image value * @returns The style that was applied * @group background * @shortname css background image * @example * ```typescript * bitbybit.babylon.scene.canvasCSSBackgroundImage({ cssBackgroundImage: "linear-gradient(to top, #1a1c1f 0%, #93aacd 100%)" }); * ``` */ canvasCSSBackgroundImage(inputs: Inputs.BabylonScene.SceneCanvasCSSBackgroundImageDto): { backgroundImage: string; }; /** * Paints a straight gradient between two colors behind the scene, in the given direction, with * the stops as percentages along it. * @param inputs - The two colors, the direction and the two stops * @returns The style that was applied * @group background * @shortname two color linear gradient * @example * ```typescript * bitbybit.babylon.scene.twoColorLinearGradientBackground({ colorFrom: "#1a1c1f", colorTo: "#93aacd", direction: Bit.Inputs.Base.gradientDirectionEnum.toBottom, stopFrom: 0, stopTo: 100 }); * ``` */ twoColorLinearGradientBackground(inputs: Inputs.BabylonScene.SceneTwoColorLinearGradientDto): { backgroundImage: string; }; /** * Paints a round gradient between two colors behind the scene, spreading out from `position` in * the given `shape`, with the stops as percentages from the center. * @param inputs - The two colors, the center position, the two stops and the shape * @returns The style that was applied * @group background * @shortname two color radial gradient * @example * ```typescript * bitbybit.babylon.scene.twoColorRadialGradientBackground({ colorFrom: "#1a1c1f", colorTo: "#93aacd", position: Bit.Inputs.Base.gradientPositionEnum.center, stopFrom: 0, stopTo: 100, shape: Bit.Inputs.Base.gradientShapeEnum.circle }); * ``` */ twoColorRadialGradientBackground(inputs: Inputs.BabylonScene.SceneTwoColorRadialGradientDto): { backgroundImage: string; }; /** * Paints a straight gradient through several colors behind the scene, each at its own stop * percentage; `colors` and `stops` must be the same length, or an error object comes back * instead. * @param inputs - The colors, their stops and the direction * @returns The style that was applied, or an error message when the lists differ in length * @group background * @shortname multi color linear gradient * @example * ```typescript * bitbybit.babylon.scene.multiColorLinearGradientBackground({ colors: ["#1a1c1f", "#4a5a7a", "#93aacd"], stops: [0, 50, 100], direction: Bit.Inputs.Base.gradientDirectionEnum.toTop }); * ``` */ multiColorLinearGradientBackground(inputs: Inputs.BabylonScene.SceneMultiColorLinearGradientDto): { backgroundImage: string; } | { error: string; }; /** * Paints a round gradient through several colors behind the scene, each at its own stop * percentage; `colors` and `stops` must be the same length, or an error object comes back * instead. * @param inputs - The colors, their stops, the center position and the shape * @returns The style that was applied, or an error message when the lists differ in length * @group background * @shortname multi color radial gradient * @example * ```typescript * bitbybit.babylon.scene.multiColorRadialGradientBackground({ colors: ["#1a1c1f", "#93aacd"], stops: [0, 100], position: Bit.Inputs.Base.gradientPositionEnum.center, shape: Bit.Inputs.Base.gradientShapeEnum.circle }); * ``` */ multiColorRadialGradientBackground(inputs: Inputs.BabylonScene.SceneMultiColorRadialGradientDto): { backgroundImage: string; } | { error: string; }; /** * Shows an image behind the scene with the CSS background options for how it repeats, scales, * sits and scrolls; the scene's clear color becomes transparent so the image shows through. * @param inputs - The image URL and the repeat, size, position, attachment, origin and clip options * @returns The style that was applied * @group background * @shortname background image * @example * ```typescript * bitbybit.babylon.scene.canvasBackgroundImage({ imageUrl: "https://example.com/backdrop.jpg", repeat: Bit.Inputs.Base.backgroundRepeatEnum.noRepeat, size: Bit.Inputs.Base.backgroundSizeEnum.cover, position: Bit.Inputs.Base.gradientPositionEnum.center, attachment: Bit.Inputs.Base.backgroundAttachmentEnum.scroll, origin: Bit.Inputs.Base.backgroundOriginClipEnum.paddingBox, clip: Bit.Inputs.Base.backgroundOriginClipEnum.borderBox }); * ``` */ canvasBackgroundImage(inputs: Inputs.BabylonScene.SceneCanvasBackgroundImageDto): { backgroundImage: string; backgroundRepeat: string; backgroundSize: string; backgroundPosition: string; backgroundAttachment: string; backgroundOrigin: string; backgroundClip: string; }; /** * Fills the background of the scene with one plain color and removes any canvas background * image or gradient set before. * @param inputs - The hex color * @group background * @shortname color * @example * ```typescript * bitbybit.babylon.scene.backgroundColour({ colour: "#1a1c1f" }); * ``` */ backgroundColour(inputs: Inputs.BabylonScene.SceneBackgroundColourDto): void; private getRadians; private createSkyboxMesh; private createGroundProjectedSkybox; } /** * Textures, the images a material spreads over a surface: a tiled texture from a URL with scale and * offset for material slots, and an image texture with transparency kept for decals and * projections. */ declare class BabylonTexture { private readonly context; /** * Creates texture from URL from a few basic options. If you loaded the asset via the file, create object url and pass it here. * @param inputs required to set up basic texture * @returns Babylon texture that can be used with materials * @group create * @shortname simple texture * @disposableOutput true */ createSimple(inputs: Inputs.BabylonTexture.TextureSimpleDto): BABYLON.Texture; /** * Creates an image texture intended for decals and projections. Wrap modes are clamped so the image is not tiled, * and the alpha channel is respected by default. Feed the result into decal creation or decal map projection. * @param inputs required to set up the image texture * @returns Babylon texture that can be projected onto meshes * @group create * @shortname image texture * @disposableOutput true */ createImage(inputs: Inputs.BabylonTexture.TextureImageDto): BABYLON.Texture; } /** * Utilities around the rendered image: taking a screenshot of the scene at a chosen size through * any camera, as an image data URL to use or as a download. */ declare class BabylonTools { private readonly context; /** * Renders the scene through `camera`, or the active camera when none is given, at the given * size and gives the image back as a data URL. * * `mimeType` picks the format and `quality` from 0 to 1 the compression of lossy formats such * as JPEG. * @param inputs - The camera, the size, the image type and the quality * @returns The image as a data URL * @group screenshots * @shortname create screenshot * @example * ```typescript * const image = await bitbybit.babylon.tools.createScreenshot({ camera: bitbybit.babylon.scene.getActiveCamera(), width: 1920, height: 1080, mimeType: "image/png", quality: 1 }); * ``` */ createScreenshot(inputs: Inputs.BabylonTools.ScreenshotDto): Promise; /** * Renders the scene through `camera`, or the active camera when none is given, at the given * size and downloads the image in the browser. * @param inputs - The camera, the size, the image type and the quality * @returns The text `done` once the download has started * @group screenshots * @shortname create screenshot and download * @example * ```typescript * await bitbybit.babylon.tools.createScreenshotAndDownload({ camera: bitbybit.babylon.scene.getActiveCamera(), width: 1920, height: 1080, mimeType: "image/png", quality: 1 }); * ``` */ createScreenshotAndDownload(inputs: Inputs.BabylonTools.ScreenshotDto): Promise; } /** * Builds transformation matrices for moving, rotating and scaling geometry, using the BabylonJS * math. A transformation is a 4x4 matrix as 16 numbers in column-major order; most methods return a * short list of them that is applied in order, so a rotation about a point is a move to the origin, * the rotation, and the move back. Angles are in degrees. The `transforms` service on the base * package builds the same matrices without the engine. */ declare class BabylonTransforms { /** * Builds a rotation about an axis that passes through a center point, as three matrices applied * in order: move the center to the origin, rotate, move back. The angle is in degrees. * @param inputs - The angle in degrees, the axis direction and the center it passes through * @returns The list of matrices to apply in order * @group rotation * @shortname center axis * @drawable false * @example * ```typescript * const turn = bitbybit.babylon.transforms.rotationCenterAxis({ angle: 90, axis: [0, 1, 0], center: [5, 0, 0] }); * ``` */ rotationCenterAxis(inputs: Inputs.BabylonTransforms.RotationCenterAxisDto): Base.TransformMatrixes; /** * Builds a rotation about a line parallel to the X axis through a center point, as three * matrices applied in order: move the center to the origin, rotate, move back. The angle is in * degrees. * @param inputs - The angle in degrees and the center * @returns The list of matrices to apply in order * @group rotation * @shortname center x * @drawable false * @example * ```typescript * const turn = bitbybit.babylon.transforms.rotationCenterX({ angle: 90, center: [0, 0, 0] }); * ``` */ rotationCenterX(inputs: Inputs.BabylonTransforms.RotationCenterDto): Base.TransformMatrixes; /** * Builds a rotation about a line parallel to the Y axis through a center point, as three * matrices applied in order: move the center to the origin, rotate, move back. The angle is in * degrees. * @param inputs - The angle in degrees and the center * @returns The list of matrices to apply in order * @group rotation * @shortname center y * @drawable false * @example * ```typescript * const turn = bitbybit.babylon.transforms.rotationCenterY({ angle: 90, center: [0, 0, 0] }); * ``` */ rotationCenterY(inputs: Inputs.BabylonTransforms.RotationCenterDto): Base.TransformMatrixes; /** * Builds a rotation about a line parallel to the Z axis through a center point, as three * matrices applied in order: move the center to the origin, rotate, move back. The angle is in * degrees. * @param inputs - The angle in degrees and the center * @returns The list of matrices to apply in order * @group rotation * @shortname center z * @drawable false * @example * ```typescript * const turn = bitbybit.babylon.transforms.rotationCenterZ({ angle: 90, center: [0, 0, 0] }); * ``` */ rotationCenterZ(inputs: Inputs.BabylonTransforms.RotationCenterDto): Base.TransformMatrixes; /** * Builds a rotation from three angles about a center point: yaw turns about Y, pitch about X * and roll about Z, in degrees. The result is three matrices applied in order: move the center * to the origin, rotate, move back. * @param inputs - The yaw, pitch and roll in degrees and the center * @returns The list of matrices to apply in order * @group rotation * @shortname yaw pitch roll * @drawable false * @example * ```typescript * const turn = bitbybit.babylon.transforms.rotationCenterYawPitchRoll({ yaw: 90, pitch: 0, roll: 0, center: [0, 0, 0] }); * ``` */ rotationCenterYawPitchRoll(inputs: Inputs.BabylonTransforms.RotationCenterYawPitchRollDto): Base.TransformMatrixes; /** * Builds a scale with its own factor per axis, measured from a center point that stays in * place, as three matrices applied in order: move the center to the origin, scale, move back. * @param inputs - The center and the factor for each axis * @returns The list of matrices to apply in order * @group rotation * @shortname center xyz * @drawable false * @example * ```typescript * const stretch = bitbybit.babylon.transforms.scaleCenterXYZ({ center: [5, 5, 5], scaleXyz: [2, 1, 0.5] }); * ``` */ scaleCenterXYZ(inputs: Inputs.BabylonTransforms.ScaleCenterXYZDto): Base.TransformMatrixes; /** * Builds a scale with its own factor per axis, measured from the origin; `[2, 3, 1]` doubles X, * triples Y and keeps Z. * @param inputs - The factor for each axis * @returns A list with the one scale matrix * @group scale * @shortname xyz * @drawable false * @example * ```typescript * const stretch = bitbybit.babylon.transforms.scaleXYZ({ scaleXyz: [2, 3, 1] }); * ``` */ scaleXYZ(inputs: Inputs.BabylonTransforms.ScaleXYZDto): Base.TransformMatrixes; /** * Builds a scale by the same factor on every axis, measured from the origin, so 2 makes * everything twice as big and twice as far from the origin. * @param inputs - The factor * @returns A list with the one scale matrix * @group scale * @shortname uniform * @drawable false * @example * ```typescript * const double = bitbybit.babylon.transforms.uniformScale({ scale: 2 }); * ``` */ uniformScale(inputs: Inputs.BabylonTransforms.UniformScaleDto): Base.TransformMatrixes; /** * Builds a scale by the same factor on every axis, measured from a center point that stays in * place, as three matrices applied in order: move the center to the origin, scale, move back. * @param inputs - The factor and the center * @returns The list of matrices to apply in order * @group scale * @shortname uniform from center * @drawable false * @example * ```typescript * const half = bitbybit.babylon.transforms.uniformScaleFromCenter({ scale: 0.5, center: [5, 5, 5] }); * ``` */ uniformScaleFromCenter(inputs: Inputs.BabylonTransforms.UniformScaleFromCenterDto): Base.TransformMatrixes; /** * Builds a move by a vector; `[10, 5, 0]` moves 10 along X, 5 along Y and nothing along Z. * @param inputs - The vector to move by * @returns A list with the one translation matrix * @group translation * @shortname xyz * @drawable false * @example * ```typescript * const move = bitbybit.babylon.transforms.translationXYZ({ translation: [10, 5, 0] }); * ``` */ translationXYZ(inputs: Inputs.BabylonTransforms.TranslationXYZDto): Base.TransformMatrixes; /** * Builds one move per vector, for transforming many objects each by its own vector, in the same * order. * @param inputs - The vectors to move by * @returns One transformation per vector, in the same order * @group translations * @shortname xyz * @drawable false * @example * ```typescript * const moves = bitbybit.babylon.transforms.translationsXYZ({ translations: [[1, 0, 0], [0, 2, 0]] }); * ``` */ translationsXYZ(inputs: Inputs.BabylonTransforms.TranslationsXYZDto): Base.TransformMatrixes[]; } /** * The building blocks the `webXr.simple` entry points are made of, for applications that hold the * class directly: creating the default XR experience from the full set of options, or with none, * and reading its base experience and feature manager to add features such as hand tracking or hit * testing yourself. */ declare class BabylonWebXRBase { private readonly context; /** * Starts the default WebXR experience with the given options, which choose the session features * to enable, the floor meshes for teleporting and the per-feature settings. * @param inputs - The XR experience options * @returns The default XR experience * @group scene * @shortname default xr experience async * @disposableOutput true */ createDefaultXRExperienceAsync(inputs: Inputs.BabylonWebXR.WebXRDefaultExperienceOptions): Promise; /** * Starts the default WebXR experience with the engine's defaults: the enter-XR button, pointer * selection and teleportation with no floor meshes. * @returns The default XR experience * @group scene * @shortname default xr experience no opt. async * @disposableOutput true */ createDefaultXRExperienceNoOptionsAsync(): Promise; /** * Reads the base experience helper of a default XR experience, which manages the session itself * and is what the feature manager hangs off. * @param inputs - The default XR experience * @returns The base experience helper * @group get * @shortname get base experience */ getBaseExperience(inputs: Inputs.BabylonWebXR.WebXRDefaultExperienceDto): BABYLON.WebXRExperienceHelper; /** * Reads the feature manager of a base experience, through which XR features such as hand * tracking, hit testing or anchors are enabled and configured. * @param inputs - The base experience helper * @returns The feature manager * @group get * @shortname get feature manager */ getFeatureManager(inputs: Inputs.BabylonWebXR.WebXRExperienceHelperDto): BABYLON.WebXRFeaturesManager; } /** * One-call entry points into virtual and augmented reality on a WebXR-capable browser and headset: * an immersive AR session, or a VR session with teleportation over the ground meshes you name. For * finer control, `webXr.base` creates the experience from full options. */ declare class BabylonWebXRSimple { private readonly context; /** * Starts a default WebXR experience in immersive AR mode, showing the scene over the camera * view of the room on a device that supports it. * @returns The default XR experience * @group scene * @shortname simple immersive ar experience * @disposableOutput true * @example * ```typescript * const xr = await bitbybit.babylon.webXr.simple.createImmersiveARExperience(); * ``` */ createImmersiveARExperience(): Promise; /** * Starts a default WebXR experience in VR with teleportation over the given ground meshes, * enough for simple walkthroughs; nothing is given back. * @param inputs - The meshes the user can teleport onto * @group scene * @shortname simple xr with teleportation * @example * ```typescript * await bitbybit.babylon.webXr.simple.createDefaultXRExperienceWithTeleportation({ groundMeshes: [ground] }); * ``` */ createDefaultXRExperienceWithTeleportation(inputs: Inputs.BabylonWebXR.DefaultWebXRWithTeleportationDto): Promise; /** * Starts a default WebXR experience in VR with teleportation over the given ground meshes, as * `createDefaultXRExperienceWithTeleportation` does, and gives back the experience with the * near menu, button and text it created plus a `dispose` function to end it. * @param inputs - The meshes the user can teleport onto * @returns The experience, its menu parts and a dispose function * @group scene * @shortname simple xr with teleportation return * @disposableOutput true * @example * ```typescript * const session = await bitbybit.babylon.webXr.simple.createDefaultXRExperienceWithTeleportationReturn({ groundMeshes: [ground] }); * session.dispose(); * ``` */ createDefaultXRExperienceWithTeleportationReturn(inputs: Inputs.BabylonWebXR.DefaultWebXRWithTeleportationDto): Promise<{ xr: BABYLON.WebXRDefaultExperience; torusMat: BABYLON.PBRMetallicRoughnessMaterial; manager: GUI3DManager; near: NearMenu; button: TouchHolographicButton; text: TextBlock; dispose: () => void; }>; } /** * WebXR: entering virtual or augmented reality from the browser, with controller input, * teleportation and hit testing against the real world. The route to viewing a configured product * at full size in the room it is destined for. */ declare class BabylonWebXR { simple: BabylonWebXRSimple; } /** * Drawing anything into the scene: kernel shapes, points, lines, polylines, curves, meshes and tags * all go through `drawAnyAsync`, which picks the right renderer for the entity and returns the * drawn object. The `options` methods build the drawing options with defaults for each kind of * entity, `createPBRMaterial` and `createTexture` make materials for the face slots, and a drawn * object can be redrawn in place by passing it back. */ declare class Draw extends DrawCore { /** * @ignore true */ readonly drawHelper: DrawHelper; /** * @ignore true */ readonly node: BabylonNode; /** * @ignore true */ readonly tag: Tag; /** * @ignore true */ readonly context: Context; private defaultBasicOptions; private defaultPolylineOptions; private defaultNodeOptions; /** * Draws any entity into the scene, as `drawAnyAsync` does, without giving the drawn object * back; for the last step of a script that only needs the result to appear. * @param inputs - The entity to draw and the optional drawing options * @group draw async * @shortname draw async void * @disposableOutput true * @drawable true * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 0, 0] }); * await bitbybit.draw.drawAnyAsyncNoReturn({ entity: box }); * ``` */ drawAnyAsyncNoReturn(inputs: Inputs.Draw.DrawAny): Promise; /** * Draws any entity the library produces into the scene and gives back the drawn object: kernel * shapes from OCCT, JSCAD and Manifold, points, lines, polylines, curves, meshes, tags and * nodes. * * The options are matched to the entity, with defaults when none are given; pass the previous * result back in the update slot to redraw in place. * @param inputs - The entity to draw, the optional drawing options and the previous result when updating * @returns What drawing the entity produces: a scene object for geometry, the tag or tags for a tag, an axis triad for a node; undefined for an empty list * @group draw async * @shortname draw async * @drawable true * @disposableOutput true * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 0, 0] }); * const options = bitbybit.draw.optionsOcctShapeSimple({ precision: 0.01, drawFaces: true, faceColour: "#ff0000", drawEdges: true, edgeColour: "#ffffff", edgeWidth: 2, drawTwoSided: true, backFaceColour: "#0000ff", backFaceOpacity: 1 }); * const drawn = await bitbybit.draw.drawAnyAsync({ entity: box, options }); * ``` */ drawAnyAsync(inputs: Inputs.Draw.DrawAny): Promise>; /** * Every branch of the asynchronous dispatch, typed as what it can actually produce. * * A package that adds entity kinds overrides this rather than the public signature: two * unresolved conditional types over the same `E` have no provable relation to each other, so a * narrower override of `drawAnyAsync` cannot typecheck however correct it is. * @ignore true */ protected drawResolvedAsync(inputs: Inputs.Draw.DrawAny): Promise>; private mergedOcctShapeOptions; private handleDecomposedMeshShape; private handleDecomposedMeshes; private decomposedMeshesContainerCounter; private updateAny; /** * Draws an entity that needs no kernel work, as `drawAny` does, without giving the drawn object * back; points, lines, polylines and tags qualify, kernel shapes do not. * @param inputs - The entity to draw and the optional drawing options * @group draw sync * @shortname draw sync void * @example * ```typescript * bitbybit.draw.drawAnyNoReturn({ entity: [[0, 0, 0], [5, 5, 5], [10, 0, 0]] }); * ``` */ drawAnyNoReturn(inputs: Inputs.Draw.DrawAny): void; /** * Draws an entity that needs no kernel work into the scene right away and gives back the drawn * object: points, lines, polylines, tags and nodes. * * Kernel shapes from OCCT, JSCAD and Manifold must go through `drawAnyAsync`, which waits for * the kernel to mesh them. * @param inputs - The entity to draw, the optional drawing options and the previous result when updating * @returns What drawing the entity produces: a scene object for geometry, the tag or tags for a tag, an axis triad for a node; undefined for an empty list * @group draw sync * @shortname draw sync * @example * ```typescript * const options = bitbybit.draw.optionsSimple({ colours: "#00ff00", size: 0.5, opacity: 1, updatable: false, hidden: false, drawTwoSided: true, backFaceColour: "#0000ff", backFaceOpacity: 1, colorMapStrategy: Bit.Inputs.Base.colorMapStrategyEnum.lastColorRemainder, arrowSize: 0, arrowAngle: 15 }); * const drawn = bitbybit.draw.drawAny({ entity: [[0, 0, 0], [5, 5, 5], [10, 0, 0]], options }); * ``` */ drawAny(inputs: Inputs.Draw.DrawAny): Inputs.Draw.Drawn; private cachedSyncHandlers; /** * What this renderer draws each synchronous kind with, keyed by the kind's name in the ordered * table. A kind absent from here is one this renderer does not draw, and the walk skips it. * @ignore true */ private syncHandlers; private cachedAsyncHandlers; /** * The same for the kinds that have to cross to a worker and back. * * The two JSCAD entries ask their own check again rather than asserting: a handler that takes the * narrowed entity can only be given one honestly, and re-running a check the table just ran is * cheaper than a cast that could be wrong. * @ignore true */ private asyncHandlers; /** * Whether the entity is a node this renderer can draw an axis triad for. * * The engine-agnostic check this replaces asks whether `id` is a string containing "node", which * any object can satisfy and most real nodes do not: it matched only the ones this library named * itself, so a node from a loaded model, or one a script constructed, typechecked as drawable * and then silently drew nothing. A node is a renderer's own concept, so the honest check lives * beside the renderer that has the type to ask about. * @ignore true */ detectNode(entity: unknown): entity is BABYLON.TransformNode; /** * @ignore true */ detectNodes(entity: unknown): entity is BABYLON.TransformNode[]; /** * Every branch of the synchronous dispatch, typed as what it can actually produce. Overridden * instead of the public signature, for the reason given on its asynchronous twin. * @ignore true */ protected drawResolved(inputs: Inputs.Draw.DrawAny): Inputs.Draw.DrawnAny; /** * Draws a grid on the ground plane, as `drawGridMesh` does, without giving the mesh back. * @param inputs - The size, line spacing, colors and opacity of the grid * @group grid * @shortname draw grid no return * @disposableOutput true * @example * ```typescript * bitbybit.draw.drawGridMeshNoReturn({ width: 400, height: 400, subdivisions: 10, majorUnitFrequency: 10, minorUnitVisibility: 0.45, gridRatio: 0.5, opacity: 0.5, backFaceCulling: false, mainColor: "#ffffff", secondaryColor: "#ffffff" }); * ``` */ drawGridMeshNoReturn(inputs: Inputs.Draw.SceneDrawGridMeshDto): void; /** * Draws a grid on the ground plane, the XZ plane through the origin, to give a sense of scale * and orientation; every tenth line is drawn thicker by default. * @param inputs - The size, line spacing, colors and opacity of the grid * @returns The grid mesh * @group grid * @shortname draw grid * @disposableOutput true * @example * ```typescript * const grid = bitbybit.draw.drawGridMesh({ width: 400, height: 400, subdivisions: 10, majorUnitFrequency: 10, minorUnitVisibility: 0.45, gridRatio: 0.5, opacity: 0.5, backFaceCulling: false, mainColor: "#ffffff", secondaryColor: "#ffffff" }); * ``` */ drawGridMesh(inputs: Inputs.Draw.SceneDrawGridMeshDto): BABYLON.Mesh; /** * Builds drawing options for points, lines, polylines, curves, surfaces and JSCAD meshes: * colors, size, opacity, two-sided rendering and arrow heads on lines, with defaults for what * is left out. * @param inputs - The options to start from * @returns The drawing options * @group options * @shortname simple * @example * ```typescript * const options = bitbybit.draw.optionsSimple({ colours: "#ff0000", size: 2, opacity: 1, updatable: false, hidden: false, drawTwoSided: true, backFaceColour: "#0000ff", backFaceOpacity: 1, colorMapStrategy: Bit.Inputs.Base.colorMapStrategyEnum.lastColorRemainder, arrowSize: 0, arrowAngle: 15 }); * ``` */ optionsSimple(inputs: Inputs.Draw.DrawBasicGeometryOptions): Inputs.Draw.DrawBasicGeometryOptions; /** * Builds the full drawing options for OCCT shapes: meshing precision, face, edge and vertex * colors and sizes, index labels, arrows on edges, two-sided rendering and the triangulation * cache, with defaults for what is left out. * @param inputs - The options to start from * @returns The drawing options * @group options * @shortname occt shape * @example * ```typescript * const options = bitbybit.draw.optionsOcctShape({ faceOpacity: 1, edgeOpacity: 1, edgeColour: "#ffffff", faceColour: "#ff0000", edgeWidth: 2, drawEdges: true, drawFaces: true, drawVertices: false, vertexColour: "#ff00ff", vertexSize: 0.03, precision: 0.01, drawEdgeIndexes: false, edgeIndexHeight: 0.06, edgeIndexColour: "#ff00ff", drawFaceIndexes: false, faceIndexHeight: 0.06, faceIndexColour: "#0000ff", drawTwoSided: true, backFaceColour: "#0000ff", backFaceOpacity: 1, edgeArrowSize: 0, edgeArrowAngle: 15, keepMeshData: false, allowQualityDecrease: true, forceFaceDeflection: false }); * ``` */ optionsOcctShape(inputs: Inputs.Draw.DrawOcctShapeOptions): Inputs.Draw.DrawOcctShapeOptions; /** * Builds the most used drawing options for OCCT shapes, precision, face and edge colors and * two-sided rendering, with defaults for what is left out. * @param inputs - The options to start from * @returns The drawing options * @group options * @shortname occt shape simple * @example * ```typescript * const options = bitbybit.draw.optionsOcctShapeSimple({ precision: 0.01, drawFaces: true, faceColour: "#ff0000", drawEdges: true, edgeColour: "#ffffff", edgeWidth: 2, drawTwoSided: true, backFaceColour: "#0000ff", backFaceOpacity: 1 }); * ``` */ optionsOcctShapeSimple(inputs: Inputs.Draw.DrawOcctShapeSimpleOptions): Inputs.Draw.DrawOcctShapeSimpleOptions; /** * Builds drawing options for OCCT shapes whose faces use a full engine material, as * `createPBRMaterial` makes one, plus the precision and edge style. * @param inputs - The options to start from * @returns The drawing options * @group options * @shortname occt shape with material * @example * ```typescript * const material = bitbybit.draw.createPBRMaterial({ name: "steel", baseColor: "#c0c0c0", metallic: 1, roughness: 0.4, alpha: 1, emissiveColor: "#000000", emissiveIntensity: 1, zOffset: 0, zOffsetUnits: 0, alphaMode: Bit.Inputs.Draw.alphaModeEnum.opaque, alphaCutoff: 0.5, doubleSided: false, wireframe: false, unlit: false }); * const options = bitbybit.draw.optionsOcctShapeMaterial({ precision: 0.01, faceMaterial: material, drawEdges: true, edgeColour: "#ffffff", edgeWidth: 2 }); * ``` */ optionsOcctShapeMaterial(inputs: Inputs.Draw.DrawOcctShapeMaterialOptions): Inputs.Draw.DrawOcctShapeMaterialOptions; /** * Builds drawing options for Manifold solids and cross-sections: face color or a full engine * material, the line style of cross-sections, normals and the two-sided rendering. * @param inputs - The options to start from * @returns The drawing options * @group options * @shortname manifold shape draw options * @example * ```typescript * const options = bitbybit.draw.optionsManifoldShapeMaterial({ faceOpacity: 1, faceColour: "#ff0000", faceMaterial: material, crossSectionColour: "#ff00ff", crossSectionWidth: 2, crossSectionOpacity: 1, computeNormals: false, drawTwoSided: true, backFaceColour: "#0000ff", backFaceOpacity: 1 }); * const drawn = await bitbybit.draw.drawAnyAsync({ entity: solid, options }); * ``` */ optionsManifoldShapeMaterial(inputs: Inputs.Draw.DrawManifoldOrCrossSectionOptions): Inputs.Draw.DrawManifoldOrCrossSectionOptions; /** * Builds drawing options for transform nodes, which are drawn as a triad of colored axis lines * of a given length. * @param inputs - The options to start from * @returns The drawing options * @group options * @shortname babylon node * @example * ```typescript * const options = bitbybit.draw.optionsBabylonNode({ colorX: "#ff0000", colorY: "#00ff00", colorZ: "#0000ff", size: 2 }); * const drawn = await bitbybit.draw.drawAnyAsync({ entity: node, options }); * ``` */ optionsBabylonNode(inputs: Inputs.Draw.DrawNodeOptions): Inputs.Draw.DrawNodeOptions; /** * Creates an image texture from a URL for the texture slots of `createPBRMaterial`, with * tiling, offset, rotation and filtering that mean the same in every renderer. * @param inputs - The image URL and the tiling, offset, rotation, flip and sampling options * @returns The engine's texture * @group material * @shortname create texture * @disposableOutput true * @example * ```typescript * const texture = bitbybit.draw.createTexture({ url: "https://example.com/wood.jpg", name: "wood", uScale: 2, vScale: 2, uOffset: 0, vOffset: 0, wAng: 0, invertY: false, invertZ: false, samplingMode: Bit.Inputs.Draw.samplingModeEnum.trilinear }); * ``` */ createTexture(inputs: Inputs.Draw.GenericTextureDto): BABYLON.Texture; /** * Creates a physically based material from settings that mean the same in every renderer: base * color, metallic and roughness, opacity, emissive glow, the texture slots and the alpha and * side options; put it in the `faceMaterial` of the drawing options. * @param inputs - The name, colors, metallic and roughness values, opacity, textures and rendering options * @returns The engine's material * @group material * @shortname create pbr material * @disposableOutput true * @example * ```typescript * const material = bitbybit.draw.createPBRMaterial({ name: "steel", baseColor: "#c0c0c0", metallic: 1, roughness: 0.4, alpha: 1, emissiveColor: "#000000", emissiveIntensity: 1, zOffset: 0, zOffsetUnits: 0, alphaMode: Bit.Inputs.Draw.alphaModeEnum.opaque, alphaCutoff: 0.5, doubleSided: false, wireframe: false, unlit: false }); * const options = bitbybit.draw.optionsOcctShapeMaterial({ precision: 0.01, faceMaterial: material, drawEdges: true, edgeColour: "#ffffff", edgeWidth: 2 }); * ``` */ createPBRMaterial(inputs: Inputs.Draw.GenericPBRMaterialDto): BABYLON.PBRMetallicRoughnessMaterial; private getSamplingMode; private handleTags; private handleTag; private handleVerbSurfaces; private handleVerbCurves; private handleNodes; private handlePoints; private handleLines; private handlePolylines; private handleVerbSurface; private handleVerbCurve; private handleNode; /** * A JSCAD path drawn as the polyline it is. * * The path's points are two-dimensional and its closing segment is implied by `isClosed`, so * both are resolved before the polyline handler sees it - which then applies the same options, * metadata and update handling every other polyline gets. */ private handleJscadPath; private handleJscadPaths; private handlePolyline; private handlePoint; private handleLine; private handleJscadMeshes; private handleManifoldShape; private handleManifoldShapes; private handleOcctShape; private handleOcctShapes; private handleJscadMesh; /** * The settings a drawn node can carry, which is not the set a drawn mesh can. * * Drawing a node parents an axis triad to it: the node itself is not geometry, so pickability, * casting shadows and receiving them belong to the lines the triad is made of rather than to the * node. Sending a node through the mesh path instead writes members onto an object that has none * and registers a non-mesh as a shadow caster, which the shadow map then walks as geometry. * * The settings reach the triad only, which is why the caller passes it rather than letting this * ask the node for its meshes. Any transform node can be drawn - a loaded model hangs its whole * mesh tree off one - and asking the node would take the model with it, making every mesh in it * unpickable and re-registering all of them as shadow casters, because a draw call was made * about the node they happen to be parented to. */ private applyNodeSettingsAndMetadata; private applyGlobalSettingsAndMetadataAndShadowCasting; } /** * Colors in the two forms the library uses: a hex text such as `#ff5733`, and an object `{ r, g, b * }` or `{ r, g, b, a }` whose channels run either from 0 to 255 or from 0 to 1. The methods here * build colors in each form, convert between them with an explicit channel range, read single * channels and invert a color. */ declare class Color { private readonly math; constructor(math: MathBitByBit); /** * Passes a hex color through unchanged, so a color can be given a name and reused. * * Example: '#FF5733' -> '#FF5733' * @param inputs - The hex color * @returns The same hex color * @group create * @shortname color hex * @drawable false */ hexColor(inputs: Inputs.Color.HexDto): Inputs.Base.Color; /** * Passes an `{ r, g, b }` color with channels from 0 to 255 through unchanged, so it can be * given a name and reused. * * Example: { r: 255, g: 87, b: 51 } -> the same object * @param inputs - The color object * @returns The same color object * @group create * @shortname color rgb 0-255 * @drawable false */ rgb255Color(inputs: Inputs.Color.Rgb255Dto): Inputs.Base.ColorRGB; /** * Passes an `{ r, g, b }` color with channels from 0 to 1 through unchanged, so it can be * given a name and reused. * * Example: { r: 1, g: 0.34, b: 0.2 } -> the same object * @param inputs - The color object * @returns The same color object * @group create * @shortname color rgb 0-1 * @drawable false */ rgb1Color(inputs: Inputs.Color.Rgb1Dto): Inputs.Base.ColorRGB; /** * Passes an `{ r, g, b, a }` color with color channels from 0 to 255 and opacity from 0 to 1 * through unchanged, so it can be given a name and reused. * * Example: { r: 255, g: 87, b: 51, a: 1 } -> the same object * @param inputs - The color object * @returns The same color object * @group create * @shortname color rgba 0-255 * @drawable false */ rgba255Color(inputs: Inputs.Color.Rgba255Dto): Inputs.Base.ColorRGBA; /** * Passes an `{ r, g, b, a }` color with every channel from 0 to 1 through unchanged, so it can * be given a name and reused. * * Example: { r: 1, g: 0.34, b: 0.2, a: 1 } -> the same object * @param inputs - The color object * @returns The same color object * @group create * @shortname color rgba 0-1 * @drawable false */ rgba1Color(inputs: Inputs.Color.Rgba1Dto): Inputs.Base.ColorRGBA; /** * Builds an `{ r, g, b }` color from three separate channel values from 0 to 255. * * Example: r 255, g 87, b 51 -> { r: 255, g: 87, b: 51 } * @param inputs - The red, green and blue values * @returns The color object * @group create * @shortname atomic color rgb 0-255 * @drawable false * @example * ```typescript * const orange = bitbybit.color.rgbAtomic255Color({ r: 255, g: 87, b: 51 }); * ``` */ rgbAtomic255Color(inputs: Inputs.Color.RgbAttomic255Dto): Inputs.Base.ColorRGB; /** * Builds an `{ r, g, b }` color from three separate channel values from 0 to 1. * * Example: r 1, g 0.34, b 0.2 -> { r: 1, g: 0.34, b: 0.2 } * @param inputs - The red, green and blue values * @returns The color object * @group create * @shortname atomic color rgb 0-1 * @drawable false * @example * ```typescript * const orange = bitbybit.color.rgbAtomic1Color({ r: 1, g: 0.34, b: 0.2 }); * ``` */ rgbAtomic1Color(inputs: Inputs.Color.RgbAttomic1Dto): Inputs.Base.ColorRGB; /** * Reads a hex color into an `{ r, g, b }` object with channels from 0 to 255. * * The text may start with or without `#`; anything else than six hex digits throws an error. * Example: '#FF5733' -> { r: 255, g: 87, b: 51 } * @param inputs - The hex color * @returns The color object with channels from 0 to 255 * @group convert * @shortname hex to rgb * @drawable false * @example * ```typescript * const rgb = bitbybit.color.hexToRgb({ color: "#ff5733" }); * ``` */ hexToRgb(inputs: Inputs.Color.HexDto): Inputs.Base.ColorRGB; /** * Writes three channel values as a hex color. * * `min` and `max` say which range the values use; a range other than 0 to 255 is remapped * first, so channels from 0 to 1 work as well. * Example: r 255, g 87, b 51 in [0,255] -> '#ff5733'; r 1, g 0.5, b 0.2 in [0,1] -> '#ff8033' * @param inputs - The red, green and blue values and their range * @returns The hex color * @group convert * @shortname rgb to hex * @drawable false * @example * ```typescript * const hex = bitbybit.color.rgbToHex({ r: 1, g: 0.5, b: 0.2, min: 0, max: 1 }); * ``` */ rgbToHex(inputs: Inputs.Color.RGBMinMaxDto): Inputs.Base.Color; /** * Writes an `{ r, g, b }` color as a hex color. * * `min` and `max` say which range the channels use; a range other than 0 to 255 is remapped * first. * Example: { r: 1, g: 0.5, b: 0.2 } in [0,1] -> '#ff8033' * @param inputs - The color object and the range its channels use * @returns The hex color * @group convert * @shortname rgb obj to hex * @drawable false * @example * ```typescript * const hex = bitbybit.color.rgbObjToHex({ rgb: { r: 1, g: 0.5, b: 0.2 }, min: 0, max: 1 }); * ``` */ rgbObjToHex(inputs: Inputs.Color.RGBObjectMaxDto): Inputs.Base.Color; /** * Reads a hex color into an `{ r, g, b }` object with the channels remapped to a range of your * choice. * * Example: '#FF5733' mapped to [0,1] -> { r: 1, g: 0.341, b: 0.2 } * @param inputs - The hex color and the range to map the channels to * @returns The color object with channels in that range * @group convert * @shortname hex to rgb mapped * @drawable false * @example * ```typescript * const rgb = bitbybit.color.hexToRgbMapped({ color: "#ff5733", from: 0, to: 1 }); * ``` */ hexToRgbMapped(inputs: Inputs.Color.HexDtoMapped): Inputs.Base.ColorRGB; /** * Reads the red channel of a hex color, remapped to a range of your choice. * * Example: '#FF5733' in [0,1] -> 1 * @param inputs - The hex color and the range to map the channel to * @returns The red channel in that range * @group hex to * @shortname red * @drawable false * @example * ```typescript * const red = bitbybit.color.getRedParam({ color: "#ff5733", from: 0, to: 1 }); * ``` */ getRedParam(inputs: Inputs.Color.HexDtoMapped): number; /** * Reads the green channel of a hex color, remapped to a range of your choice. * * Example: '#FF5733' in [0,1] -> 0.341 * @param inputs - The hex color and the range to map the channel to * @returns The green channel in that range * @group hex to * @shortname green * @drawable false * @example * ```typescript * const green = bitbybit.color.getGreenParam({ color: "#ff5733", from: 0, to: 1 }); * ``` */ getGreenParam(inputs: Inputs.Color.HexDtoMapped): number; /** * Reads the blue channel of a hex color, remapped to a range of your choice. * * Example: '#FF5733' in [0,1] -> 0.2 * @param inputs - The hex color and the range to map the channel to * @returns The blue channel in that range * @group hex to * @shortname blue * @drawable false * @example * ```typescript * const blue = bitbybit.color.getBlueParam({ color: "#ff5733", from: 0, to: 1 }); * ``` */ getBlueParam(inputs: Inputs.Color.HexDtoMapped): number; /** * Reads the red channel of an `{ r, g, b }` color. * * Example: { r: 255, g: 87, b: 51 } -> 255 * @param inputs - The color object * @returns The red channel, in whatever range the object uses * @group rgb to * @shortname red * @drawable false */ rgbToRed(inputs: Inputs.Color.RGBObjectDto): number; /** * Reads the green channel of an `{ r, g, b }` color. * * Example: { r: 255, g: 87, b: 51 } -> 87 * @param inputs - The color object * @returns The green channel, in whatever range the object uses * @group rgb to * @shortname green * @drawable false */ rgbToGreen(inputs: Inputs.Color.RGBObjectDto): number; /** * Reads the blue channel of an `{ r, g, b }` color. * * Example: { r: 255, g: 87, b: 51 } -> 51 * @param inputs - The color object * @returns The blue channel, in whatever range the object uses * @group rgb to * @shortname blue * @drawable false */ rgbToBlue(inputs: Inputs.Color.RGBObjectDto): number; /** * Inverts a hex color, turning each channel into its opposite: 255 minus the value. * * With `blackAndWhite` on, the result is plain black for a light color or white for a dark * one, which suits text on a colored background. * Example: '#FF5733' -> '#00a8cc'; with blackAndWhite -> '#ffffff' * @param inputs - The hex color and whether to reduce the result to black or white * @returns The inverted hex color * @group hex to * @shortname invert color * @drawable false * @example * ```typescript * const textColor = bitbybit.color.invert({ color: "#ff5733", blackAndWhite: true }); * ``` */ invert(inputs: Inputs.Color.InvertHexDto): Inputs.Base.Color; } /** * Dates and times as JavaScript `Date` values: creating them, reading and setting their parts, and * formatting them as text. Months count from 0 (January is 0, December 11) and weekdays from 0 * (Sunday); days of the month count from 1. Every setter returns a new date and leaves the given * one unchanged. Local-time and UTC variants exist for most operations. */ declare class Dates { /** * Formats the date part as text, without the time, in the local time zone. * * Example: 15 January 2024 at 14:30 -> 'Mon Jan 15 2024' * @param inputs - The date * @returns The date as text such as 'Mon Jan 15 2024' * @group convert * @shortname date to string * @drawable false */ toDateString(inputs: Inputs.Dates.DateDto): string; /** * Formats the date and time in the ISO 8601 form used for data exchange, always in UTC. * * Example: 15 January 2024 at 14:30 -> '2024-01-15T14:30:45.000Z' * @param inputs - The date * @returns The date as text such as '2024-01-15T14:30:45.000Z' * @group convert * @shortname date to iso string * @drawable false */ toISOString(inputs: Inputs.Dates.DateDto): string; /** * Formats the date the way it appears inside JSON, which is the ISO 8601 form in UTC. * * Example: 15 January 2024 at 14:30 -> '2024-01-15T14:30:00.000Z' * @param inputs - The date * @returns The date as text such as '2024-01-15T14:30:00.000Z' * @group convert * @shortname date to json * @drawable false */ toJSON(inputs: Inputs.Dates.DateDto): string; /** * Formats the full date and time as text in the local time zone, with the zone offset. * * Example: 15 January 2024 at 14:30 -> 'Mon Jan 15 2024 14:30:00 GMT+0000' * @param inputs - The date * @returns The date and time as text * @group convert * @shortname date to locale string * @drawable false */ toString(inputs: Inputs.Dates.DateDto): string; /** * Formats the time part as text, without the date, in the local time zone with the zone offset. * * Example: 15 January 2024 at 14:30 -> '14:30:45 GMT+0000' * @param inputs - The date * @returns The time as text such as '14:30:45 GMT+0000' * @group convert * @shortname date to time string * @drawable false */ toTimeString(inputs: Inputs.Dates.DateDto): string; /** * Formats the date and time as text in UTC. * * Example: 15 January 2024 at 14:30 -> 'Mon, 15 Jan 2024 14:30:00 GMT' * @param inputs - The date * @returns The date and time as UTC text * @group convert * @shortname date to utc string * @drawable false */ toUTCString(inputs: Inputs.Dates.DateDto): string; /** * Gives the current date and time at the moment of the call. * @returns The current date and time * @group create * @shortname now * @drawable false */ now(): Date; /** * Builds a date from its parts, read in the local time zone. * * The month counts from 0: 0 is January, 11 December. A part outside its range rolls over, so * day 32 of January becomes the first of February. * Example: year 2024, month 0, day 15, hours 14, minutes 30 -> 15 January 2024 at 14:30 local * time * @param inputs - The year, month, day, hours, minutes, seconds and milliseconds * @returns The date * @group create * @shortname create date * @drawable false * @example * ```typescript * const date = bitbybit.dates.createDate({ year: 2024, month: 0, day: 15, hours: 14, minutes: 30, seconds: 0, milliseconds: 0 }); * ``` */ createDate(inputs: Inputs.Dates.CreateDateDto): Date; /** * Builds a date from its parts, read as UTC so the local time zone plays no part. * * The month counts from 0: 0 is January, 11 December. A part outside its range rolls over. * Example: year 2024, month 0, day 15 -> 15 January 2024 at 00:00 UTC * @param inputs - The year, month, day, hours, minutes, seconds and milliseconds * @returns The date * @group create * @shortname create utc date * @drawable false * @example * ```typescript * const date = bitbybit.dates.createDateUTC({ year: 2024, month: 0, day: 15, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 }); * ``` */ createDateUTC(inputs: Inputs.Dates.CreateDateDto): Date; /** * Builds a date from a Unix timestamp: the number of milliseconds since 1 January 1970 at 00:00 * UTC. * * Example: 1705329000000 -> 15 January 2024 at 14:30 UTC * @param inputs - The timestamp in milliseconds * @returns The date * @group create * @shortname create from unix timestamp * @drawable false * @example * ```typescript * const date = bitbybit.dates.createFromUnixTimeStamp({ unixTimeStamp: 1705329000000 }); * ``` */ createFromUnixTimeStamp(inputs: Inputs.Dates.CreateFromUnixTimeStampDto): Date; /** * Reads a date written as text and gives its Unix timestamp, the milliseconds since 1 January * 1970 at 00:00 UTC. * * ISO 8601 text such as '2024-01-15' or '2024-01-15T14:30:00Z' is read reliably; text that * cannot be read gives NaN. * Example: '2024-01-15' -> 1705276800000 * @param inputs - The date as text * @returns The timestamp in milliseconds, or NaN when the text is not a date * @group parse * @shortname parse date string * @drawable false * @example * ```typescript * const stamp = bitbybit.dates.parseDate({ dateString: "2024-01-15T14:30:00Z" }); * ``` */ parseDate(inputs: Inputs.Dates.DateStringDto): number; /** * Reads the day of the month, from 1 to 31, in the local time zone. * * Example: 15 January 2024 -> 15 * @param inputs - The date * @returns The day of the month * @group get * @shortname get date of month * @drawable false */ getDayOfMonth(inputs: Inputs.Dates.DateDto): number; /** * Reads the day of the week in the local time zone: 0 is Sunday, 6 Saturday. * * Example: 15 January 2024 -> 1, a Monday * @param inputs - The date * @returns The weekday from 0 to 6 * @group get * @shortname get weekday * @drawable false */ getWeekday(inputs: Inputs.Dates.DateDto): number; /** * Reads the full year in the local time zone. * * Example: 15 January 2024 -> 2024 * @param inputs - The date * @returns The year * @group get * @shortname get year * @drawable false */ getYear(inputs: Inputs.Dates.DateDto): number; /** * Reads the month in the local time zone, counting from 0: 0 is January, 11 December. * * Example: 15 January 2024 -> 0 * @param inputs - The date * @returns The month from 0 to 11 * @group get * @shortname get month * @drawable false */ getMonth(inputs: Inputs.Dates.DateDto): number; /** * Reads the hour, from 0 to 23, in the local time zone. * * Example: 14:30 -> 14 * @param inputs - The date * @returns The hour * @group get * @shortname get hours * @drawable false */ getHours(inputs: Inputs.Dates.DateDto): number; /** * Reads the minutes, from 0 to 59, in the local time zone. * * Example: 14:30 -> 30 * @param inputs - The date * @returns The minutes * @group get * @shortname get minutes * @drawable false */ getMinutes(inputs: Inputs.Dates.DateDto): number; /** * Reads the seconds, from 0 to 59, in the local time zone. * * Example: 14:30:45 -> 45 * @param inputs - The date * @returns The seconds * @group get * @shortname get seconds * @drawable false */ getSeconds(inputs: Inputs.Dates.DateDto): number; /** * Reads the milliseconds, from 0 to 999, in the local time zone. * * Example: 14:30:45.123 -> 123 * @param inputs - The date * @returns The milliseconds * @group get * @shortname get milliseconds * @drawable false */ getMilliseconds(inputs: Inputs.Dates.DateDto): number; /** * Gives the date as a Unix timestamp: the milliseconds since 1 January 1970 at 00:00 UTC. * * Example: 15 January 2024 at 14:30 UTC -> 1705329000000 * @param inputs - The date * @returns The timestamp in milliseconds * @group get * @shortname get time * @drawable false */ getTime(inputs: Inputs.Dates.DateDto): number; /** * Reads the full year in UTC. * * Example: 15 January 2024 -> 2024 * @param inputs - The date * @returns The year * @group get * @shortname get utc year * @drawable false */ getUTCYear(inputs: Inputs.Dates.DateDto): number; /** * Reads the month in UTC, counting from 0: 0 is January, 11 December. * * Example: 15 January 2024 -> 0 * @param inputs - The date * @returns The month from 0 to 11 * @group get * @shortname get utc month * @drawable false */ getUTCMonth(inputs: Inputs.Dates.DateDto): number; /** * Reads the day of the month, from 1 to 31, in UTC. * * Example: 15 January 2024 -> 15 * @param inputs - The date * @returns The day of the month * @group get * @shortname get utc day * @drawable false */ getUTCDay(inputs: Inputs.Dates.DateDto): number; /** * Reads the hour, from 0 to 23, in UTC. * * Example: 14:00 UTC -> 14 * @param inputs - The date * @returns The hour * @group get * @shortname get utc hours * @drawable false */ getUTCHours(inputs: Inputs.Dates.DateDto): number; /** * Reads the minutes, from 0 to 59, in UTC. * * Example: 14:30 UTC -> 30 * @param inputs - The date * @returns The minutes * @group get * @shortname get utc minutes * @drawable false */ getUTCMinutes(inputs: Inputs.Dates.DateDto): number; /** * Reads the seconds, from 0 to 59, in UTC. * * Example: 14:30:45 UTC -> 45 * @param inputs - The date * @returns The seconds * @group get * @shortname get utc seconds * @drawable false */ getUTCSeconds(inputs: Inputs.Dates.DateDto): number; /** * Reads the milliseconds, from 0 to 999, in UTC. * * Example: 14:30:45.123 UTC -> 123 * @param inputs - The date * @returns The milliseconds * @group get * @shortname get utc milliseconds * @drawable false */ getUTCMilliseconds(inputs: Inputs.Dates.DateDto): number; /** * Makes a copy of the date with another year, in the local time zone. The given date is not * changed. * * Example: 15 January 2024 with year 2025 -> 15 January 2025 * @param inputs - The date and the year * @returns A new date with the year changed * @group set * @shortname set year * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setYear({ date: bitbybit.dates.now(), year: 2025 }); * ``` */ setYear(inputs: Inputs.Dates.DateYearDto): Date; /** * Makes a copy of the date with another month, in the local time zone; months count from 0. The * given date is not changed. * * Example: 15 January 2024 with month 5 -> 15 June 2024 * @param inputs - The date and the month from 0 to 11 * @returns A new date with the month changed * @group set * @shortname set month * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setMonth({ date: bitbybit.dates.now(), month: 5 }); * ``` */ setMonth(inputs: Inputs.Dates.DateMonthDto): Date; /** * Makes a copy of the date with another day of the month, in the local time zone. The given * date is not changed. * * Example: 15 January 2024 with day 20 -> 20 January 2024 * @param inputs - The date and the day from 1 to 31 * @returns A new date with the day changed * @group set * @shortname set day of month * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setDayOfMonth({ date: bitbybit.dates.now(), day: 20 }); * ``` */ setDayOfMonth(inputs: Inputs.Dates.DateDayDto): Date; /** * Makes a copy of the date with another hour, in the local time zone. The given date is not * changed. * * Example: 14:30 with hours 9 -> 09:30 * @param inputs - The date and the hour from 0 to 23 * @returns A new date with the hour changed * @group set * @shortname set hours * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setHours({ date: bitbybit.dates.now(), hours: 9 }); * ``` */ setHours(inputs: Inputs.Dates.DateHoursDto): Date; /** * Makes a copy of the date with other minutes, in the local time zone. The given date is not * changed. * * Example: 14:30 with minutes 45 -> 14:45 * @param inputs - The date and the minutes from 0 to 59 * @returns A new date with the minutes changed * @group set * @shortname set minutes * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setMinutes({ date: bitbybit.dates.now(), minutes: 45 }); * ``` */ setMinutes(inputs: Inputs.Dates.DateMinutesDto): Date; /** * Makes a copy of the date with other seconds, in the local time zone. The given date is not * changed. * * Example: 14:30:00 with seconds 30 -> 14:30:30 * @param inputs - The date and the seconds from 0 to 59 * @returns A new date with the seconds changed * @group set * @shortname set seconds * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setSeconds({ date: bitbybit.dates.now(), seconds: 30 }); * ``` */ setSeconds(inputs: Inputs.Dates.DateSecondsDto): Date; /** * Makes a copy of the date with other milliseconds, in the local time zone. The given date is * not changed. * * Example: 14:30:00.000 with milliseconds 500 -> 14:30:00.500 * @param inputs - The date and the milliseconds from 0 to 999 * @returns A new date with the milliseconds changed * @group set * @shortname set milliseconds * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setMilliseconds({ date: bitbybit.dates.now(), milliseconds: 500 }); * ``` */ setMilliseconds(inputs: Inputs.Dates.DateMillisecondsDto): Date; /** * Makes a copy of the date moved to a Unix timestamp, the milliseconds since 1 January 1970 at * 00:00 UTC. The given date is not changed. * * Example: any date with time 0 -> 1 January 1970 at 00:00 UTC * @param inputs - The date and the timestamp in milliseconds * @returns A new date with the timestamp changed * @group set * @shortname set time * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setTime({ date: bitbybit.dates.now(), time: 1705329000000 }); * ``` */ setTime(inputs: Inputs.Dates.DateTimeDto): Date; /** * Makes a copy of the date with another year, in UTC. The given date is not changed. * * Example: 15 January 2024 with year 2025 -> 15 January 2025 * @param inputs - The date and the year * @returns A new date with the year changed * @group set * @shortname set utc year * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setUTCYear({ date: bitbybit.dates.now(), year: 2025 }); * ``` */ setUTCYear(inputs: Inputs.Dates.DateYearDto): Date; /** * Makes a copy of the date with another month, in UTC; months count from 0. The given date is * not changed. * * Example: 15 January 2024 with month 5 -> 15 June 2024 * @param inputs - The date and the month from 0 to 11 * @returns A new date with the month changed * @group set * @shortname set utc month * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setUTCMonth({ date: bitbybit.dates.now(), month: 5 }); * ``` */ setUTCMonth(inputs: Inputs.Dates.DateMonthDto): Date; /** * Makes a copy of the date with another day of the month, in UTC. The given date is not * changed. * * Example: 15 January 2024 with day 20 -> 20 January 2024 * @param inputs - The date and the day from 1 to 31 * @returns A new date with the day changed * @group set * @shortname set utc day * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setUTCDay({ date: bitbybit.dates.now(), day: 20 }); * ``` */ setUTCDay(inputs: Inputs.Dates.DateDayDto): Date; /** * Makes a copy of the date with another hour, in UTC. The given date is not changed. * * Example: 14:30 UTC with hours 9 -> 09:30 UTC * @param inputs - The date and the hour from 0 to 23 * @returns A new date with the hour changed * @group set * @shortname set utc hours * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setUTCHours({ date: bitbybit.dates.now(), hours: 9 }); * ``` */ setUTCHours(inputs: Inputs.Dates.DateHoursDto): Date; /** * Makes a copy of the date with other minutes, in UTC. The given date is not changed. * * Example: 14:30 UTC with minutes 45 -> 14:45 UTC * @param inputs - The date and the minutes from 0 to 59 * @returns A new date with the minutes changed * @group set * @shortname set utc minutes * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setUTCMinutes({ date: bitbybit.dates.now(), minutes: 45 }); * ``` */ setUTCMinutes(inputs: Inputs.Dates.DateMinutesDto): Date; /** * Makes a copy of the date with other seconds, in UTC. The given date is not changed. * * Example: 14:30:00 UTC with seconds 30 -> 14:30:30 UTC * @param inputs - The date and the seconds from 0 to 59 * @returns A new date with the seconds changed * @group set * @shortname set utc seconds * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setUTCSeconds({ date: bitbybit.dates.now(), seconds: 30 }); * ``` */ setUTCSeconds(inputs: Inputs.Dates.DateSecondsDto): Date; /** * Makes a copy of the date with other milliseconds, in UTC. The given date is not changed. * * Example: 14:30:00.000 UTC with milliseconds 500 -> 14:30:00.500 UTC * @param inputs - The date and the milliseconds from 0 to 999 * @returns A new date with the milliseconds changed * @group set * @shortname set utc milliseconds * @drawable false * @example * ```typescript * const changed = bitbybit.dates.setUTCMilliseconds({ date: bitbybit.dates.now(), milliseconds: 500 }); * ``` */ setUTCMilliseconds(inputs: Inputs.Dates.DateMillisecondsDto): Date; } declare class GeometryHelper { /** * Applies one or more 4×4 transformation matrices to a list of points sequentially. * Each transformation is applied in order (composition of transformations). * Example: points=[[0,0,0], [1,0,0]] with translation [5,0,0] → [[5,0,0], [6,0,0]] */ transformControlPoints(transformation: Inputs.Base.TransformMatrixes | Inputs.Base.TransformMatrixes[], transformedControlPoints: Inputs.Base.Point3[]): Inputs.Base.Point3[]; /** * Flattens nested transformation arrays into a single-level array of transformation matrices. * Handles both 2D arrays (single transform list) and 3D arrays (nested transform lists). * Example: [[[matrix1, matrix2]], [[matrix3]]] → [matrix1, matrix2, matrix3] */ getFlatTransformations(transformation: Inputs.Base.TransformMatrixes | Inputs.Base.TransformMatrixes[]): Inputs.Base.TransformMatrixes; /** * Calculates the nesting depth of an array recursively. * Example: [1,2,3] → 1, [[1,2],[3,4]] → 2, [[[1]]] → 3 */ getArrayDepth: (value: unknown) => number; /** * Applies a single 4×4 transformation matrix (as flat 16-element array) to multiple points. * Example: points=[[0,0,0], [1,0,0]] with translation matrix → transformed points */ transformPointsByMatrixArray(points: Inputs.Base.Point3[], transform: Inputs.Base.TransformMatrix): Inputs.Base.Point3[]; /** * Transforms multiple points using a transformation matrix (maps each point through the matrix). * Example: points=[[1,0,0], [0,1,0]] with 90° rotation → [[0,1,0], [-1,0,0]] */ transformPointsCoordinates(points: Inputs.Base.Point3[], transform: Inputs.Base.TransformMatrix): Inputs.Base.Point3[]; /** * Removes all duplicate vectors from a list (works with arbitrary-length numeric vectors). * Compares vectors using tolerance for floating-point equality. * Example: [[1,2], [3,4], [1,2], [5,6]] with tolerance=1e-7 → [[1,2], [3,4], [5,6]] */ removeAllDuplicateVectors(vectors: number[][], tolerance?: number): number[][]; /** * Removes consecutive duplicate vectors from a list (keeps only first occurrence in each sequence). * Optionally checks and removes duplicate if first and last vectors match. * Example: [[1,2], [1,2], [3,4], [3,4], [5,6]] → [[1,2], [3,4], [5,6]] */ removeConsecutiveVectorDuplicates(vectors: number[][], checkFirstAndLast?: boolean, tolerance?: number): number[][]; /** * Compares two vectors for approximate equality using tolerance (element-wise comparison). * Returns false if vectors have different lengths. * Example: [1.0000001, 2.0], [1.0, 2.0] with tolerance=1e-6 → true */ vectorsTheSame(vec1: number[], vec2: number[], tolerance: number): boolean; /** * Checks if two numbers are approximately equal within a tolerance. * Example: 1.0000001, 1.0 with tolerance=1e-6 → true, 1.001, 1.0 with tolerance=1e-6 → false */ approxEq(num1: number, num2: number, tolerance: number): boolean; /** * Removes consecutive duplicate points from a list (specialized for 3D/2D points). * Optionally checks and removes duplicate if first and last points match (for closed loops). * Example: [[0,0,0], [0,0,0], [1,0,0], [1,0,0]] → [[0,0,0], [1,0,0]] */ removeConsecutivePointDuplicates(points: Inputs.Base.Point3[], checkFirstAndLast?: boolean, tolerance?: number): Inputs.Base.Point3[]; /** * Checks if two points are approximately equal using tolerance (supports 2D and 3D points). * Example: [1.0000001, 2.0, 3.0], [1.0, 2.0, 3.0] with tolerance=1e-6 → true */ arePointsTheSame(pointA: Inputs.Base.Point3 | Inputs.Base.Point2, pointB: Inputs.Base.Point3 | Inputs.Base.Point2, tolerance: number): boolean; private transformCoordinates; } declare class DxfGenerator { private entityHandle; private colorFormat; private acadVersion; /** * Generate a complete DXF file content from path-based entities */ generateDxf(dxfInputs: Inputs.IO.DxfModelDto): string; /** * Generate DXF header section */ private generateHeader; /** * Generate DXF tables section (layers, line types, etc.) */ private generateTables; /** * Generate line type table */ private generateLineTypeTable; /** * Generate text style table */ private generateStyleTable; /** * Generate VPORT table (viewport configuration) */ private generateVportTable; /** * Generate VIEW table (empty but required for AC1009) */ private generateViewTable; /** * Generate UCS table (user coordinate system - empty but required for AC1009) */ private generateUcsTable; /** * Generate APPID table (application ID - required for AC1009) */ private generateAppidTable; /** * Generate DIMSTYLE table (dimension style - empty but required for AC1009) */ private generateDimstyleTable; /** * Generate blocks section (empty but required) */ private generateBlocks; /** * Generate layer table based on unique layers in all parts */ private generateLayerTable; /** * Generate DXF entities section with all path segments */ private generateEntities; /** * Generate entity for a single segment based on its type */ private generateSegmentEntity; /** * Type guard for line segments */ private isLineSegment; /** * Type guard for arc segments */ private isArcSegment; /** * Type guard for circle segments */ private isCircleSegment; /** * Type guard for polyline segments */ private isPolylineSegment; /** * Type guard for spline segments */ private isSplineSegment; /** * Generate a LINE entity */ private generateLineEntity; /** * Generate a CIRCLE entity */ private generateCircleEntity; /** * Generate an ARC entity */ private generateArcEntity; /** * Generate a LWPOLYLINE entity */ private generatePolylineEntity; /** * Generate a SPLINE entity */ private generateSplineEntity; /** * Check if polyline should be closed (first and last points are the same) */ private isClosedPolyline; /** * Get next entity handle as hex string */ private getNextHandle; /** * Convert color to DXF format * Accepts hex color (#RRGGBB) or ACI color index (1-255) * Returns appropriate DXF color codes based on colorFormat setting */ private convertColorToDxf; /** * Convert RGB values to nearest AutoCAD Color Index (ACI) * Uses a simplified mapping to standard ACI colors */ private rgbToAciColorIndex; } declare class Dxf { private dxfGenerator; /** * Creates a line segment definition for DXF export (pass-through for validation). * Example: start=[0,0], end=[10,5] → DXF line segment from origin to [10,5] * @param inputs Line segment definition * @returns Line segment DTO * @group dxf * @shortname line segment * @drawable false */ lineSegment(inputs: Inputs.IO.DxfLineSegmentDto): Inputs.IO.DxfLineSegmentDto; /** * Creates an arc segment definition for DXF export (curved path between two points). * Example: center=[5,5], radius=5, startAngle=0°, endAngle=90° → quarter circle arc * @param inputs Arc segment definition * @returns Arc segment DTO * @group dxf * @shortname arc segment * @drawable false */ arcSegment(inputs: Inputs.IO.DxfArcSegmentDto): Inputs.IO.DxfArcSegmentDto; /** * Creates a circle segment definition for DXF export (closed circular path). * Example: center=[10,10], radius=5 → full circle with diameter 10 centered at [10,10] * @param inputs Circle segment definition * @returns Circle segment DTO * @group dxf * @shortname circle segment * @drawable false */ circleSegment(inputs: Inputs.IO.DxfCircleSegmentDto): Inputs.IO.DxfCircleSegmentDto; /** * Creates a polyline segment definition for DXF export (connected line segments through points). * Example: points=[[0,0], [5,0], [5,5], [0,5]] → rectangular polyline path * @param inputs Polyline segment definition * @returns Polyline segment DTO * @group dxf * @shortname polyline segment * @drawable false */ polylineSegment(inputs: Inputs.IO.DxfPolylineSegmentDto): Inputs.IO.DxfPolylineSegmentDto; /** * Creates a spline segment definition for DXF export (smooth curve through control points). * Example: controlPoints=[[0,0], [5,10], [10,0]] → smooth curved path through points * @param inputs Spline segment definition * @returns Spline segment DTO * @group dxf * @shortname spline segment * @drawable false */ splineSegment(inputs: Inputs.IO.DxfSplineSegmentDto): Inputs.IO.DxfSplineSegmentDto; /** * Creates a path from multiple segments (combines lines, arcs, circles, polylines, splines). * Similar to OCCT wires - segments are connected to form a continuous or multi-part path. * Example: segments=[lineSegment, arcSegment, polylineSegment] → combined path entity * @param inputs Path definition with segments * @returns Path DTO * @group dxf * @shortname path * @drawable false */ path(inputs: Inputs.IO.DxfPathDto): Inputs.IO.DxfPathDto; /** * Creates a paths part with layer and color assignment for DXF organization. * Groups multiple paths into a single layer with consistent styling. * Example: paths=[path1, path2], layer="Outlines", color=red → grouped geometry * @param inputs Paths part definition * @returns Paths part DTO * @group dxf * @shortname paths part * @drawable false */ pathsPart(inputs: Inputs.IO.DxfPathsPartDto): Inputs.IO.DxfPathsPartDto; /** * Generates a complete DXF file from paths parts (exports 2D CAD drawing format). * Supports lines, arcs, circles, polylines, and splines organized in layered paths. * Example: model with 3 parts on different layers → valid DXF file string for CAD software * @param inputs DXF model definition * @returns DXF file content as string * @group dxf * @shortname dxf create * @drawable false */ dxfCreate(inputs: Inputs.IO.DxfModelDto): string; } /** * Compute smooth vertex normals for a mesh that arrives without them. * Accumulates each triangle's cross product onto its three vertices, then normalizes, so a vertex * shared by several triangles ends up with their average and the mesh shades smoothly. * @param positions - Flat array of vertex positions [x,y,z,x,y,z,...] * @param indices - Triangle indices * @returns Flat array of normals [nx,ny,nz,nx,ny,nz,...] */ declare function computeVertexNormals(positions: number[], indices: number[]): number[]; /** * Reading and writing files: exporting geometry to the supported formats, importing it back, and * the download and upload helpers that move files between the browser and the user's machine. */ declare class IoBitByBit { dxf: Dxf; constructor(); } /** * Straight lines between two points, held as plain objects of the form `{ start, end }`, and the * segment form `[start, end]` of the same thing. The methods here build lines, measure and * transform them, convert between the two forms, place points along them and find where two lines * cross. Lengths are in model units. */ declare class Line { private readonly vector; private readonly point; private readonly geometryHelper; constructor(vector: Vector, point: Point, geometryHelper: GeometryHelper); /** * Reads the start point of a line. * * Example: { start: [0,0,0], end: [10,5,0] } -> [0,0,0] * @param inputs - The line * @returns The start point * @group get * @shortname line start point * @drawable true */ getStartPoint(inputs: Inputs.Line.LineDto): Inputs.Base.Point3; /** * Reads the end point of a line. * * Example: { start: [0,0,0], end: [10,5,0] } -> [10,5,0] * @param inputs - The line * @returns The end point * @group get * @shortname line end point * @drawable true */ getEndPoint(inputs: Inputs.Line.LineDto): Inputs.Base.Point3; /** * Measures the straight distance from the start of a line to its end. * * Example: { start: [0,0,0], end: [3,4,0] } -> 5 * @param inputs - The line * @returns The length in model units * @group get * @shortname line length * @drawable false */ length(inputs: Inputs.Line.LineDto): number; /** * Swaps the start and end of a line, so it runs the other way. * * Example: { start: [0,0,0], end: [10,5,0] } -> { start: [10,5,0], end: [0,0,0] } * @param inputs - The line * @returns A new line running the other way * @group operations * @shortname reversed line * @drawable true */ reverse(inputs: Inputs.Line.LineDto): Inputs.Base.Line3; /** * Applies a transformation matrix, or a list of them in order, to both ends of a line. * * Example: { start: [0,0,0], end: [10,0,0] } moved by [5,5,0] -> { start: [5,5,0], end: * [15,5,0] } * @param inputs - The line and the transformation * @returns A new line with the transformed ends * @group transforms * @shortname transform line * @drawable true * @example * ```typescript * const moved = bitbybit.line.transformLine({ * line: { start: [0, 0, 0], end: [10, 0, 0] }, * transformation: bitbybit.transforms.translationXYZ({ translation: [5, 5, 0] }), * }); * ``` */ transformLine(inputs: Inputs.Line.TransformLineDto): Inputs.Base.Line3; /** * Applies a different transformation to each line: the first transformation to the first line, * and so on. * * Example: three lines with three translations -> each line moved by its own translation * @param inputs - The lines and one transformation per line * @returns The transformed lines, in the same order * @group transforms * @shortname transform lines * @drawable true * @example * ```typescript * const placed = bitbybit.line.transformsForLines({ * lines: [{ start: [0, 0, 0], end: [1, 0, 0] }, { start: [0, 0, 0], end: [0, 1, 0] }], * transformation: bitbybit.transforms.translationsXYZ({ translations: [[0, 1, 0], [0, 2, 0]] }), * }); * ``` */ transformsForLines(inputs: Inputs.Line.TransformsLinesDto): Inputs.Base.Line3[]; /** * Builds a line object from a start and an end point. * * Example: start [0,0,0], end [10,5,0] -> { start: [0,0,0], end: [10,5,0] } * @param inputs - The start and end points * @returns The line object * @group create * @shortname line * @drawable true * @example * ```typescript * const line = bitbybit.line.create({ start: [0, 0, 0], end: [10, 5, 0] }); * ``` */ create(inputs: Inputs.Line.LinePointsDto): Inputs.Base.Line3; /** * Builds a segment, the pair-of-points form of a line, from a start and an end point. * * Example: start [0,0,0], end [10,5,0] -> [[0,0,0], [10,5,0]] * @param inputs - The start and end points * @returns The segment as `[start, end]` * @group create * @shortname segment * @drawable true * @example * ```typescript * const segment = bitbybit.line.createSegment({ start: [0, 0, 0], end: [10, 5, 0] }); * ``` */ createSegment(inputs: Inputs.Line.LinePointsDto): Inputs.Base.Segment3; /** * Finds the point a fraction of the way along a line: 0 gives the start, 1 the end, 0.5 the * middle. * * A fraction outside 0 to 1 continues past the ends. * Example: { start: [0,0,0], end: [10,0,0] } at 0.5 -> [5,0,0] * @param inputs - The line and the fraction along it * @returns The point on the line * @group get * @shortname point on line * @drawable true * @example * ```typescript * const middle = bitbybit.line.getPointOnLine({ line: { start: [0, 0, 0], end: [10, 0, 0] }, param: 0.5 }); * ``` */ getPointOnLine(inputs: Inputs.Line.PointOnLineDto): Inputs.Base.Point3; /** * Joins each point to the next with a line, so a list of points becomes a chain of lines. * * Example: [[0,0,0], [5,0,0], [5,5,0]] -> two lines, [0,0,0] to [5,0,0] and [5,0,0] to [5,5,0] * @param inputs - The points, in order * @returns One line per pair of neighboring points * @group create * @shortname lines between points * @drawable true * @example * ```typescript * const chain = bitbybit.line.linesBetweenPoints({ points: [[0, 0, 0], [5, 0, 0], [5, 5, 0]] }); * ``` */ linesBetweenPoints(inputs: Inputs.Line.PointsLinesDto): Inputs.Base.Line3[]; /** * Pairs each start point with the end point at the same position and joins them with a line. * * A pair whose two points coincide makes no line and is left out. * Example: starts [[0,0,0], [5,0,0]] and ends [[0,5,0], [5,5,0]] -> two lines * @param inputs - The start points and the end points, in matching order * @returns One line per pair, skipping pairs of length 0 * @group create * @shortname start and end points to lines * @drawable true * @example * ```typescript * const rungs = bitbybit.line.linesBetweenStartAndEndPoints({ * startPoints: [[0, 0, 0], [5, 0, 0]], * endPoints: [[0, 5, 0], [5, 5, 0]], * }); * ``` */ linesBetweenStartAndEndPoints(inputs: Inputs.Line.LineStartEndPointsDto): Inputs.Base.Line3[]; /** * Turns a line object into its segment form, the pair `[start, end]`. * * Example: { start: [0,0,0], end: [10,5,0] } -> [[0,0,0], [10,5,0]] * @param inputs - The line * @returns The segment * @group convert * @shortname line to segment * @drawable false */ lineToSegment(inputs: Inputs.Line.LineDto): Inputs.Base.Segment3; /** * Turns each line object into its segment form, the pair `[start, end]`. * * Example: three lines -> three segments, in the same order * @param inputs - The lines * @returns One segment per line * @group convert * @shortname lines to segments * @drawable false */ linesToSegments(inputs: Inputs.Line.LinesDto): Inputs.Base.Segment3[]; /** * Turns a segment, the pair `[start, end]`, into a line object. * * Example: [[0,0,0], [10,5,0]] -> { start: [0,0,0], end: [10,5,0] } * @param inputs - The segment * @returns The line * @group convert * @shortname segment to line * @drawable true */ segmentToLine(inputs: Inputs.Line.SegmentDto): Inputs.Base.Line3; /** * Turns each segment, a pair `[start, end]`, into a line object. * * Example: three segments -> three lines, in the same order * @param inputs - The segments * @returns One line per segment * @group convert * @shortname segments to lines * @drawable true */ segmentsToLines(inputs: Inputs.Line.SegmentsDto): Inputs.Base.Line3[]; /** * Finds the point where two lines cross. * * With `checkSegmentsOnly` on, the crossing must lie within both segments; off, the lines * extend without end. Parallel lines, lines that pass each other without meeting, and segments * that do not reach each other give undefined. The tolerance says how close counts as meeting. * Example: [0,0,0] to [10,0,0] and [5,-5,0] to [5,5,0] -> [5,0,0] * @param inputs - The two lines, whether to stay within the segments, and the tolerance * @returns The crossing point, or undefined when there is none * @group intersection * @shortname line-line int * @drawable true * @example * ```typescript * const crossing = bitbybit.line.lineLineIntersection({ * line1: { start: [0, 0, 0], end: [10, 0, 0] }, * line2: { start: [5, -5, 0], end: [5, 5, 0] }, * checkSegmentsOnly: true, * tolerance: 1e-6, * }); * ``` */ lineLineIntersection(inputs: Inputs.Line.LineLineIntersectionDto): Inputs.Base.Point3 | undefined; } /** * Reading, building and reshaping plain arrays of any kind of item. Positions are 0-based: index 0 * is the first item. Most methods take a `clone` option, on by default, that deep-copies the list * first so the input is never changed; switched off, the modifying methods work on the list in * place, which is faster for large data. `removeAllItems` always empties the list it is given. */ declare class Lists { /** * Reads the item at a position in the list, counting from 0. * * An index outside the list throws an error. * Example: [10, 20, 30, 40] at index 2 -> 30 * @param inputs - The list, the index and whether to copy the item * @returns The item at that index * @group get * @shortname item by index * @drawable false * @example * ```typescript * const third = bitbybit.lists.getItem({ list: [10, 20, 30, 40], index: 2, clone: true }); * ``` */ getItem(inputs: Inputs.Lists.ListItemDto): T; /** * Reads the first item of the list. * * Example: [10, 20, 30, 40] -> 10 * @param inputs - The list and whether to copy the item * @returns The first item * @group get * @shortname first item * @drawable false */ getFirstItem(inputs: Inputs.Lists.ListCloneDto): T; /** * Reads the last item of the list. * * Example: [10, 20, 30, 40] -> 40 * @param inputs - The list and whether to copy the item * @returns The last item * @group get * @shortname last item * @drawable false */ getLastItem(inputs: Inputs.Lists.ListCloneDto): T; /** * Keeps each item of the list with a given probability and drops the rest, so the result * differs on every call. * * Example: [1, 2, 3, 4, 5] with threshold 0.5 -> perhaps [1, 3, 5] * @param inputs - The list, the probability of keeping an item from 0 to 1, and whether to copy * @returns The items that were kept, in their original order * @group get * @shortname random get threshold * @drawable false * @example * ```typescript * const some = bitbybit.lists.randomGetThreshold({ list: [1, 2, 3, 4, 5], threshold: 0.5, clone: true }); * ``` */ randomGetThreshold(inputs: Inputs.Lists.RandomThresholdDto): T[]; /** * Cuts out the items from a start index up to, but not including, an end index. * * Example: [10, 20, 30, 40, 50] from 1 to 4 -> [20, 30, 40] * @param inputs - The list, the start and end indexes, and whether to copy * @returns The items in that range * @group get * @shortname sublist * @drawable false * @example * ```typescript * const middle = bitbybit.lists.getSubList({ list: [10, 20, 30, 40, 50], indexStart: 1, indexEnd: 4, clone: true }); * ``` */ getSubList(inputs: Inputs.Lists.SubListDto): T[]; /** * Keeps every nth item, starting from an offset. * * Example: [0, 1, 2, 3, 4, 5, 6, 7, 8] with nth 3 and offset 0 -> [0, 3, 6]; with nth 2 and * offset 1 -> [1, 3, 5, 7] * @param inputs - The list, the step, the offset to start from, and whether to copy * @returns Every nth item, in order * @group get * @shortname every n-th * @drawable false * @example * ```typescript * const everyThird = bitbybit.lists.getNthItem({ list: [0, 1, 2, 3, 4, 5, 6, 7, 8], nth: 3, offset: 0, clone: true }); * ``` */ getNthItem(inputs: Inputs.Lists.GetNthItemDto): T[]; /** * Keeps the items where a repeating true/false pattern says true and drops the others. * * The pattern starts over when it runs out. * Example: [0, 1, 2, 3, 4, 5] with pattern [true, true, false] -> [0, 1, 3, 4] * @param inputs - The list and the pattern * @returns The items the pattern kept, in order * @group get * @shortname by pattern * @drawable false * @example * ```typescript * const kept = bitbybit.lists.getByPattern({ list: [0, 1, 2, 3, 4, 5], pattern: [true, true, false] }); * ``` */ getByPattern(inputs: Inputs.Lists.GetByPatternDto): T[]; /** * Regroups nested lists by position: the first items of every list go together, then the second * items, and so on. * * `level` says how many levels of nesting to flatten inside each list first; 0 regroups them as * they are. * Example: [[0, 1, 2], [3, 4, 5]] at level 0 -> [[0, 3], [1, 4], [2, 5]] * @param inputs - The lists and the depth at which to regroup * @returns The regrouped lists * @group get * @shortname merge levels * @drawable false * @example * ```typescript * const columns = bitbybit.lists.mergeElementsOfLists({ lists: [[0, 1, 2], [3, 4, 5]], level: 0 }); * ``` */ mergeElementsOfLists(inputs: Inputs.Lists.MergeElementsOfLists): T[]; /** * Measures the longest list among several. * * Example: [[1, 2], [3, 4, 5, 6], [7]] -> 4 * @param inputs - The lists to measure * @returns The length of the longest one * @group get * @shortname longest list length * @drawable false * @example * ```typescript * const longest = bitbybit.lists.getLongestListLength({ lists: [[1, 2], [3, 4, 5, 6], [7]] }); * ``` */ getLongestListLength(inputs: Inputs.Lists.GetLongestListLength): number; /** * Reverses the order of the items. * * Example: [1, 2, 3, 4, 5] -> [5, 4, 3, 2, 1] * @param inputs - The list and whether to copy it first * @returns The reversed list * @group edit * @shortname reverse * @drawable false */ reverse(inputs: Inputs.Lists.ListCloneDto): T[]; /** * Puts the items in a random order, different on every call. * * Example: [1, 2, 3, 4, 5] -> perhaps [3, 1, 5, 2, 4] * @param inputs - The list and whether to copy it first * @returns The shuffled list * @group edit * @shortname shuffle * @drawable false */ shuffle(inputs: Inputs.Lists.ListCloneDto): T[]; /** * Turns a list of lists on its side: rows become columns and columns become rows. * * All the inner lists must have the same length. * Example: [[0, 1, 2], [3, 4, 5]] -> [[0, 3], [1, 4], [2, 5]] * @param inputs - The list of lists and whether to copy it first * @returns The transposed list of lists * @group edit * @shortname flip lists * @drawable false * @example * ```typescript * const columns = bitbybit.lists.flipLists({ list: [[0, 1, 2], [3, 4, 5]], clone: true }); * ``` */ flipLists(inputs: Inputs.Lists.ListCloneDto): T[][]; /** * Splits the list into groups of n items. * * Items left over at the end are dropped unless `keepRemainder` is on, which adds them as a * shorter last group. * Example: [0, 1, 2, 3, 4, 5, 6, 7, 8] in groups of 3 -> [[0, 1, 2], [3, 4, 5], [6, 7, 8]] * @param inputs - The list, the group size and whether to keep a partial last group * @returns The groups, in order * @group edit * @shortname group elements * @drawable false * @example * ```typescript * const pairs = bitbybit.lists.groupNth({ list: [0, 1, 2, 3, 4], nrElements: 2, keepRemainder: true }); * ``` */ groupNth(inputs: Inputs.Lists.GroupListDto): T[][]; /** * Tells whether an item is in the list. * * Items are compared by identity, so an object is found only if the very same object is in the * list. * Example: [10, 20, 30, 40] includes 30 -> true, includes 50 -> false * @param inputs - The list and the item to look for * @returns True when the item is in the list * @group get * @shortname contains item * @drawable false * @example * ```typescript * const found = bitbybit.lists.includes({ list: [10, 20, 30, 40], item: 30 }); * ``` */ includes(inputs: Inputs.Lists.IncludesDto): boolean; /** * Finds the position of the first occurrence of an item, or -1 when it is not in the list. * * Example: [10, 20, 30, 20, 40] finding 20 -> 1, finding 50 -> -1 * @param inputs - The list and the item to look for * @returns The 0-based index, or -1 * @group get * @shortname find index * @drawable false * @example * ```typescript * const where = bitbybit.lists.findIndex({ list: [10, 20, 30, 20, 40], item: 20 }); * ``` */ findIndex(inputs: Inputs.Lists.IncludesDto): number; /** * Measures how deeply lists are nested inside the list. * * Example: [1, 2, 3] -> 1, [[1, 2], [3, 4]] -> 2, [[[1]]] -> 3 * @param inputs - The list * @returns The number of nesting levels * @group get * @shortname max list depth * @drawable false */ getListDepth(inputs: Inputs.Lists.ListCloneDto<[ ]>): number; /** * Counts the items in the list. * * Example: [10, 20, 30, 40, 50] -> 5, [] -> 0 * @param inputs - The list * @returns The number of items * @group get * @shortname list length * @drawable false */ listLength(inputs: Inputs.Lists.ListCloneDto): number; /** * Inserts an item at a position; the items from that position on shift up by one. * * Example: [10, 20, 30, 40] with 99 at index 2 -> [10, 20, 99, 30, 40] * @param inputs - The list, the item, the index and whether to copy * @returns The list with the item inserted * @group add * @shortname add item * @drawable false * @example * ```typescript * const longer = bitbybit.lists.addItemAtIndex({ list: [10, 20, 30, 40], item: 99, index: 2, clone: true }); * ``` */ addItemAtIndex(inputs: Inputs.Lists.AddItemAtIndexDto): T[]; /** * Inserts the same item at several positions of the original list. * * Example: [10, 20, 30] with 99 at indexes [0, 2] -> [99, 10, 20, 99, 30] * @param inputs - The list, the item, the indexes and whether to copy * @returns The list with the item inserted at each index * @group add * @shortname add item at indexes * @drawable false * @example * ```typescript * const marked = bitbybit.lists.addItemAtIndexes({ list: [10, 20, 30], item: 99, indexes: [0, 2], clone: true }); * ``` */ addItemAtIndexes(inputs: Inputs.Lists.AddItemAtIndexesDto): T[]; /** * Inserts several items, the first at the first index, the second at the second, and so on, all * counted on the original list. * * The indexes must be in ascending order and there must be one per item, or an error is thrown. * Example: [10, 20, 30] with items [88, 99] at indexes [1, 2] -> [10, 88, 20, 99, 30] * @param inputs - The list, the items, one index per item and whether to copy * @returns The list with the items inserted * @group add * @shortname add items * @drawable false * @example * ```typescript * const merged = bitbybit.lists.addItemsAtIndexes({ list: [10, 20, 30], items: [88, 99], indexes: [1, 2], clone: true }); * ``` */ addItemsAtIndexes(inputs: Inputs.Lists.AddItemsAtIndexesDto): T[]; /** * Removes the item at a position. * * Example: [10, 20, 30, 40, 50] removing index 2 -> [10, 20, 40, 50] * @param inputs - The list, the index and whether to copy * @returns The list without that item * @group remove * @shortname remove item * @drawable false * @example * ```typescript * const shorter = bitbybit.lists.removeItemAtIndex({ list: [10, 20, 30, 40, 50], index: 2, clone: true }); * ``` */ removeItemAtIndex(inputs: Inputs.Lists.RemoveItemAtIndexDto): T[]; /** * Removes the first item. * * Example: [10, 20, 30, 40] -> [20, 30, 40] * @param inputs - The list and whether to copy it first * @returns The list without its first item * @group remove * @shortname remove first item * @drawable false */ removeFirstItem(inputs: Inputs.Lists.ListCloneDto): T[]; /** * Removes the last item. * * Example: [10, 20, 30, 40] -> [10, 20, 30] * @param inputs - The list and whether to copy it first * @returns The list without its last item * @group remove * @shortname remove last item * @drawable false */ removeLastItem(inputs: Inputs.Lists.ListCloneDto): T[]; /** * Removes an item counted from the end: index 0 is the last item, 1 the one before it. * * Example: [10, 20, 30, 40, 50] removing index 1 from the end -> [10, 20, 30, 50] * @param inputs - The list, the index from the end and whether to copy * @returns The list without that item * @group remove * @shortname remove item from end * @drawable false * @example * ```typescript * const shorter = bitbybit.lists.removeItemAtIndexFromEnd({ list: [10, 20, 30, 40, 50], index: 1, clone: true }); * ``` */ removeItemAtIndexFromEnd(inputs: Inputs.Lists.RemoveItemAtIndexDto): T[]; /** * Removes the items at several positions, all counted on the original list. * * Example: [10, 20, 30, 40, 50] removing indexes [1, 3] -> [10, 30, 50] * @param inputs - The list, the indexes and whether to copy * @returns The list without those items * @group remove * @shortname remove items * @drawable false * @example * ```typescript * const kept = bitbybit.lists.removeItemsAtIndexes({ list: [10, 20, 30, 40, 50], indexes: [1, 3], clone: true }); * ``` */ removeItemsAtIndexes(inputs: Inputs.Lists.RemoveItemsAtIndexesDto): T[]; /** * Empties the list it is given, in place: the same array comes back with no items in it. * * Example: [10, 20, 30, 40] -> [] * @param inputs - The list to empty * @returns The same list, now empty * @group remove * @shortname remove all items * @drawable false */ removeAllItems(inputs: Inputs.Lists.ListDto): T[]; /** * Removes every nth item, starting from an offset. * * Example: [0, 1, 2, 3, 4, 5, 6, 7, 8] with nth 3 and offset 0 -> [1, 2, 4, 5, 7, 8] * @param inputs - The list, the step, the offset to start from and whether to copy * @returns The list without every nth item * @group remove * @shortname every n-th * @drawable false * @example * ```typescript * const thinned = bitbybit.lists.removeNthItem({ list: [0, 1, 2, 3, 4, 5, 6, 7, 8], nth: 3, offset: 0, clone: true }); * ``` */ removeNthItem(inputs: Inputs.Lists.RemoveNthItemDto): T[]; /** * Drops each item of the list with a given probability and keeps the rest, so the result * differs on every call. * * Example: [1, 2, 3, 4, 5] with threshold 0.5 -> perhaps [2, 4] * @param inputs - The list, the probability of dropping an item from 0 to 1, and whether to copy * @returns The items that survived, in their original order * @group remove * @shortname random remove threshold * @drawable false * @example * ```typescript * const some = bitbybit.lists.randomRemoveThreshold({ list: [1, 2, 3, 4, 5], threshold: 0.5, clone: true }); * ``` */ randomRemoveThreshold(inputs: Inputs.Lists.RandomThresholdDto): T[]; /** * Removes repeated numbers, keeping the first occurrence of each. * * Example: [1, 2, 3, 2, 4, 3, 5] -> [1, 2, 3, 4, 5] * @param inputs - The numbers and whether to copy * @returns The numbers without repeats, in their original order * @group remove * @shortname remove duplicate numbers * @drawable false */ removeDuplicateNumbers(inputs: Inputs.Lists.RemoveDuplicatesDto): number[]; /** * Removes numbers that are within a tolerance of one already kept, so values that differ only * by floating-point noise count as the same. * * Example: [1.0, 1.001, 2.0, 2.002, 3.0] with tolerance 0.01 -> [1.0, 2.0, 3.0] * @param inputs - The numbers, the tolerance and whether to copy * @returns The numbers without near-repeats, in their original order * @group remove * @shortname remove duplicates tol * @drawable false * @example * ```typescript * const distinct = bitbybit.lists.removeDuplicateNumbersTolerance({ list: [1.0, 1.001, 2.0], tolerance: 0.01, clone: true }); * ``` */ removeDuplicateNumbersTolerance(inputs: Inputs.Lists.RemoveDuplicatesToleranceDto): number[]; /** * Removes repeated items of any kind, keeping the first occurrence of each. * * Items are compared by identity, so two equal-looking objects both stay. * Example: ['a', 'b', 'c', 'a', 'd', 'b'] -> ['a', 'b', 'c', 'd'] * @param inputs - The list and whether to copy * @returns The list without repeats, in its original order * @group remove * @shortname remove duplicates * @drawable false */ removeDuplicates(inputs: Inputs.Lists.RemoveDuplicatesDto): T[]; /** * Adds an item at the end of the list. * * Example: [10, 20, 30] adding 40 -> [10, 20, 30, 40] * @param inputs - The list, the item and whether to copy * @returns The list with the item at its end * @group add * @shortname add item to list * @drawable false * @example * ```typescript * const longer = bitbybit.lists.addItem({ list: [10, 20, 30], item: 40, clone: true }); * ``` */ addItem(inputs: Inputs.Lists.AddItemDto): T[]; /** * Adds an item at the start of the list. * * Example: [10, 20, 30] prepending 5 -> [5, 10, 20, 30] * @param inputs - The list, the item and whether to copy * @returns The list with the item at its start * @group add * @shortname prepend item to list * @drawable false * @example * ```typescript * const longer = bitbybit.lists.prependItem({ list: [10, 20, 30], item: 5, clone: true }); * ``` */ prependItem(inputs: Inputs.Lists.AddItemDto): T[]; /** * Adds an item at the start or at the end of the list, as chosen. * * Example: [10, 20, 30] adding 5 first -> [5, 10, 20, 30]; last -> [10, 20, 30, 5] * @param inputs - The list, the item, the position and whether to copy * @returns The list with the item added * @group add * @shortname item at first or last * @drawable false * @example * ```typescript * const longer = bitbybit.lists.addItemFirstLast({ list: [10, 20, 30], item: 5, position: Bit.Inputs.Lists.firstLastEnum.first, clone: true }); * ``` */ addItemFirstLast(inputs: Inputs.Lists.AddItemFirstLastDto): T[]; /** * Joins several lists into one, end to end. * * Example: [[1, 2], [3, 4], [5, 6]] -> [1, 2, 3, 4, 5, 6] * @param inputs - The lists to join and whether to copy * @returns One list with all the items * @group add * @shortname concatenate lists * @drawable false * @example * ```typescript * const all = bitbybit.lists.concatenate({ lists: [[1, 2], [3, 4], [5, 6]], clone: true }); * ``` */ concatenate(inputs: Inputs.Lists.ConcatenateDto): T[]; /** * Makes a new list with nothing in it. * * Example: -> [] * @returns An empty list * @group create * @shortname empty list * @drawable false */ createEmptyList(): [ ]; /** * Makes a list that holds the same item a number of times. * * Example: 5 three times -> [5, 5, 5] * @param inputs - The item and how many times to repeat it * @returns The list of repeats * @group create * @shortname repeat * @drawable false * @example * ```typescript * const fives = bitbybit.lists.repeat({ item: 5, times: 3 }); * ``` */ repeat(inputs: Inputs.Lists.MultiplyItemDto): T[]; /** * Repeats a pattern of items over and over until the list reaches a given length. * * Example: [1, 2, 3] to length 7 -> [1, 2, 3, 1, 2, 3, 1] * @param inputs - The pattern, the length to reach and whether to copy * @returns The repeated pattern, cut to the length * @group create * @shortname repeat in pattern * @drawable false * @example * ```typescript * const cycle = bitbybit.lists.repeatInPattern({ list: [1, 2, 3], lengthLimit: 7, clone: true }); * ``` */ repeatInPattern(inputs: Inputs.Lists.RepeatInPatternDto): T[]; /** * Sorts numbers from lowest to highest, or from highest to lowest. * * Example: [5, 2, 8, 1, 9] ascending -> [1, 2, 5, 8, 9]; descending -> [9, 8, 5, 2, 1] * @param inputs - The numbers, the direction and whether to copy * @returns The sorted numbers * @group sorting * @shortname sort numbers * @drawable false * @example * ```typescript * const sorted = bitbybit.lists.sortNumber({ list: [5, 2, 8, 1, 9], orderAsc: true, clone: true }); * ``` */ sortNumber(inputs: Inputs.Lists.SortDto): number[]; /** * Sorts texts alphabetically, from A to Z or from Z to A. * * Example: ['dog', 'apple', 'cat'] ascending -> ['apple', 'cat', 'dog'] * @param inputs - The texts, the direction and whether to copy * @returns The sorted texts * @group sorting * @shortname sort texts * @drawable false * @example * ```typescript * const sorted = bitbybit.lists.sortTexts({ list: ["dog", "apple", "cat"], orderAsc: true, clone: true }); * ``` */ sortTexts(inputs: Inputs.Lists.SortDto): string[]; /** * Sorts objects by the number held in one of their properties. * * Example: [{age: 30}, {age: 20}, {age: 25}] by 'age' ascending -> [{age: 20}, {age: 25}, {age: * 30}] * @param inputs - The objects, the property to sort by, the direction and whether to copy * @returns The sorted objects * @group sorting * @shortname sort json objects * @drawable false * @example * ```typescript * const byAge = bitbybit.lists.sortByPropValue({ list: [{ age: 30 }, { age: 20 }], property: "age", orderAsc: true, clone: true }); * ``` */ sortByPropValue(inputs: Inputs.Lists.SortJsonDto): any[]; /** * Weaves several lists into one by taking the first item of each in turn, then the second of * each, and so on. * * A shorter list simply drops out once it runs dry. An empty list of lists throws an error. * Example: [[0, 1, 2], [3, 4, 5]] -> [0, 3, 1, 4, 2, 5] * @param inputs - The lists to weave together and whether to copy * @returns One list with the items alternating * @group transform * @shortname interleave lists * @drawable false * @example * ```typescript * const woven = bitbybit.lists.interleave({ lists: [[0, 1, 2], [3, 4, 5]], clone: true }); * ``` */ interleave(inputs: Inputs.Lists.InterleaveDto): T[]; } /** * Booleans and decisions: comparing values, flipping booleans, turning lists of numbers into lists * of booleans by thresholds, drawing random booleans, and gating a value so it passes only when a * condition holds. The threshold methods are the usual way to decide which items of a pattern get a * feature and which do not. */ declare class Logic { /** * Passes a boolean through unchanged, so a value can be given a name and reused. * * Example: true -> true * @param inputs - The boolean * @returns The same boolean * @group create * @shortname boolean * @drawable false */ boolean(inputs: Inputs.Logic.BooleanDto): boolean; /** * Draws a list of random booleans, each true with a given probability. * * Example: length 5 with trueThreshold 0.7 -> perhaps [true, true, false, true, true] * @param inputs - How many booleans to draw and the probability of true * @returns The random booleans * @group create * @shortname random booleans * @drawable false * @example * ```typescript * const flags = bitbybit.logic.randomBooleans({ length: 5, trueThreshold: 0.7 }); * ``` */ randomBooleans(inputs: Inputs.Logic.RandomBooleansDto): boolean[]; /** * Turns numbers into booleans with a random blend between two thresholds. * * Below the first threshold a number is always true, above the second always false; in between, * the chance of true falls in steps from one to the other, so a pattern fades out instead of * switching sharply. * Example: [0.1, 0.9] with thresholds 0.3 and 0.7 -> [true, false] * @param inputs - The numbers, the two thresholds and how many steps the fade has * @returns One boolean per number * @group create * @shortname 2 threshold random gradient * @drawable false * @example * ```typescript * const fade = bitbybit.logic.twoThresholdRandomGradient({ * numbers: [0.1, 0.4, 0.6, 0.9], * thresholdTotalTrue: 0.3, * thresholdTotalFalse: 0.7, * nrLevels: 10, * }); * ``` */ twoThresholdRandomGradient(inputs: Inputs.Logic.TwoThresholdRandomGradientDto): boolean[]; /** * Turns numbers into booleans: true below the threshold, false at or above it. * * `inverse` flips every result. * Example: [0.3, 0.7, 0.5] with threshold 0.6 -> [true, false, true] * @param inputs - The numbers, the threshold and whether to flip the result * @returns One boolean per number * @group create * @shortname threshold boolean list * @drawable false * @example * ```typescript * const below = bitbybit.logic.thresholdBooleanList({ numbers: [0.3, 0.7, 0.5], threshold: 0.6, inverse: false }); * ``` */ thresholdBooleanList(inputs: Inputs.Logic.ThresholdBooleanListDto): boolean[]; /** * Turns numbers into booleans: true when the number falls inside any of the given ranges, false * otherwise. * * Each range is `[min, max]` with both ends included; `inverse` flips every result. * Example: [0.2, 0.5, 0.8] with ranges [[0.3, 0.6], [0.7, 0.9]] -> [false, true, true] * @param inputs - The numbers, the ranges and whether to flip the result * @returns One boolean per number * @group create * @shortname threshold gaps boolean list * @drawable false * @example * ```typescript * const inside = bitbybit.logic.thresholdGapsBooleanList({ * numbers: [0.2, 0.5, 0.8], * gapThresholds: [[0.3, 0.6], [0.7, 0.9]], * inverse: false, * }); * ``` */ thresholdGapsBooleanList(inputs: Inputs.Logic.ThresholdGapsBooleanListDto): boolean[]; /** * Flips a boolean: true becomes false and false becomes true. * * Example: true -> false * @param inputs - The boolean * @returns The opposite boolean * @group edit * @shortname not * @drawable false */ not(inputs: Inputs.Logic.BooleanDto): boolean; /** * Flips every boolean in a list. * * Example: [true, false, true] -> [false, true, false] * @param inputs - The booleans * @returns The flipped booleans, in the same order * @group edit * @shortname not list * @drawable false */ notList(inputs: Inputs.Logic.BooleanListDto): boolean[]; /** * Compares two values with an operator: less, less or equal, greater, greater or equal, equal * or not equal, in the loose (`==`) or strict (`===`) form. * * Example: 5 greater than 3 -> true; 'hello' strictly equal to 'world' -> false * @param inputs - The two values and the operator * @returns The result of the comparison * @group operations * @shortname compare * @drawable false * @example * ```typescript * const bigger = bitbybit.logic.compare({ first: 5, second: 3, operator: Bit.Inputs.Logic.BooleanOperatorsEnum.greater }); * ``` */ compare(inputs: Inputs.Logic.ComparisonDto): boolean; /** * Lets a value through when the boolean is true and gives undefined when it is false. * * Example: 42 with true -> 42; 42 with false -> undefined * @param inputs - The value and the boolean that opens the gate * @returns The value, or undefined when the gate is closed * @group operations * @shortname value gate * @drawable false * @example * ```typescript * const maybe = bitbybit.logic.valueGate({ value: 42, boolean: true }); * ``` */ valueGate(inputs: Inputs.Logic.ValueGateDto): T | undefined; /** * Picks the first of two values that is defined, so the second acts as a fallback. * * Example: 42 and 10 -> 42; undefined and 10 -> 10 * @param inputs - The preferred value and the fallback * @returns The first defined value, or undefined when both are missing * @group operations * @shortname first defined value gate * @drawable false * @example * ```typescript * const chosen = bitbybit.logic.firstDefinedValueGate({ value1: undefined, value2: 10 }); * ``` */ firstDefinedValueGate(inputs: Inputs.Logic.TwoValueGateDto): T | U | undefined; } /** * Arithmetic, rounding, ranges, random numbers and the trigonometric functions on plain numbers. * The trigonometric functions take and give angles in radians; `degToRad` and `radToDeg` convert at * the boundary, because almost every angle a user types is in degrees. The interpolation helpers * (`lerp`, `remap`, `ease`, `smoothstep`, `pingPong`) are the building blocks of animation and * parametric variation. */ declare class MathBitByBit { /** * Passes a number through unchanged, so a value can be given a name and reused. * * Example: 42 -> 42 * @param inputs - The number * @returns The same number * @group create * @shortname number * @drawable false */ number(inputs: Inputs.Math.NumberDto): number; /** * Applies one arithmetic operation to two numbers: add, subtract, multiply, divide, power or * modulus. * * The operation reads `first` then `second`: subtract gives first minus second, power gives * first to the power of second. * Example: 5 add 3 -> 8, 10 modulus 3 -> 1, 2 power 3 -> 8 * @param inputs - The two numbers and the operation * @returns The result of the operation * @group operations * @shortname two numbers * @drawable false * @example * ```typescript * const result = bitbybit.math.twoNrOperation({ first: 2, second: 3, operation: Bit.Inputs.Math.mathTwoNrOperatorEnum.power }); * ``` */ twoNrOperation(inputs: Inputs.Math.ActionOnTwoNumbersDto): number; /** * Finds the remainder after dividing one number by another. * * The sign follows the first number, as it does in JavaScript. * Example: 10 modulus 3 -> 1, 17 modulus 5 -> 2 * @param inputs - The number to divide and the number to divide by * @returns The remainder * @group operations * @shortname modulus * @drawable false * @example * ```typescript * const remainder = bitbybit.math.modulus({ number: 17, modulus: 5 }); * ``` */ modulus(inputs: Inputs.Math.ModulusDto): number; /** * Rounds a number to a given number of decimal places. * * Example: 1.32156 to 3 places -> 1.322 * @param inputs - The number and how many decimal places to keep * @returns The rounded number * @group operations * @shortname round to decimals * @drawable false * @example * ```typescript * const rounded = bitbybit.math.roundToDecimals({ number: 1.32156, decimalPlaces: 3 }); * ``` */ roundToDecimals(inputs: Inputs.Math.RoundToDecimalsDto): number; /** * Rounds a number to a given number of decimal places and drops the zeros at the end. * * As a number the result cannot carry trailing zeros anyway; the difference from * `roundToDecimals` is that floating-point noise such as 1.320000001 is cleaned to 1.32. * Example: 1.32156 to 3 places -> 1.322, 1.320000001 -> 1.32, 1.000 -> 1 * @param inputs - The number and how many decimal places to keep * @returns The rounded number * @group operations * @shortname round trim zeros * @drawable false * @example * ```typescript * const clean = bitbybit.math.roundAndRemoveTrailingZeros({ number: 1.320000001, decimalPlaces: 3 }); * ``` */ roundAndRemoveTrailingZeros(inputs: Inputs.Math.RoundToDecimalsDto): number; /** * Applies one operation to a single number: absolute, negate, square root, rounding, * logarithms, the trigonometric functions and their inverses, exponential, or a conversion * between radians and degrees. * * The trigonometric functions work in radians. * Example: sqrt of 5 -> 2.236, absolute of -3 -> 3 * @param inputs - The number and the operation * @returns The result of the operation * @group operations * @shortname one number * @drawable false * @example * ```typescript * const root = bitbybit.math.oneNrOperation({ number: 5, operation: Bit.Inputs.Math.mathOneNrOperatorEnum.sqrt }); * ``` */ oneNrOperation(inputs: Inputs.Math.ActionOnOneNumberDto): number; /** * Maps a number from one range onto another, keeping its relative position. * * A number outside the source range maps proportionally beyond the target range. * Example: 5 from [0,10] to [0,100] -> 50, 0.5 from [0,1] to [-10,10] -> 0 * @param inputs - The number, the range it is in and the range to map it to * @returns The number at the same relative position in the target range * @group operations * @shortname remap * @drawable false * @example * ```typescript * const percent = bitbybit.math.remap({ number: 5, fromLow: 0, fromHigh: 10, toLow: 0, toHigh: 100 }); * ``` */ remap(inputs: Inputs.Math.RemapNumberDto): number; /** * Gives a random number from 0 up to, but not including, 1. * * Example: 0.342, 0.891 or any other value in that range * @returns A random number between 0 and 1 * @group generate * @shortname random 0 - 1 * @drawable false */ random(): number; /** * Gives a random number between `low` and `high`. * * Example: low 0, high 10 -> 3.7, 8.2 or any other value between them * @param inputs - The low and high ends of the range * @returns A random number in the range * @group generate * @shortname random number * @drawable false * @example * ```typescript * const value = bitbybit.math.randomNumber({ low: 0, high: 10 }); * ``` */ randomNumber(inputs: Inputs.Math.RandomNumberDto): number; /** * Gives a list of random numbers between `low` and `high`. * * Example: low 0, high 10, count 3 -> [2.5, 7.1, 4.8] * @param inputs - The low and high ends of the range and how many numbers to make * @returns The random numbers * @group generate * @shortname random numbers * @drawable false * @example * ```typescript * const values = bitbybit.math.randomNumbers({ low: 0, high: 10, count: 3 }); * ``` */ randomNumbers(inputs: Inputs.Math.RandomNumbersDto): number[]; /** * Gives the constant pi, the ratio of a circle's circumference to its diameter. * * Example: 3.141592653589793 * @returns The number pi * @group generate * @shortname π * @drawable false */ pi(): number; /** * Formats a number as text with a fixed number of decimal places, keeping trailing zeros. * * Example: 3.14159 with 2 places -> '3.14', 5 with 3 places -> '5.000' * @param inputs - The number and how many decimal places to show * @returns The formatted text * @group operations * @shortname to fixed * @drawable false * @example * ```typescript * const label = bitbybit.math.toFixed({ number: 3.14159, decimalPlaces: 2 }); * ``` */ toFixed(inputs: Inputs.Math.ToFixedDto): string; /** * Adds two numbers. * * Example: 5 and 3 -> 8, -2 and 7 -> 5 * @param inputs - The two numbers * @returns Their sum * @group basics * @shortname add * @drawable false * @example * ```typescript * const sum = bitbybit.math.add({ first: 5, second: 3 }); * ``` */ add(inputs: Inputs.Math.TwoNumbersDto): number; /** * Subtracts the second number from the first. * * Example: 10 and 3 -> 7, 5 and 8 -> -3 * @param inputs - The number to subtract from and the number to subtract * @returns Their difference * @group basics * @shortname subtract * @drawable false * @example * ```typescript * const difference = bitbybit.math.subtract({ first: 10, second: 3 }); * ``` */ subtract(inputs: Inputs.Math.TwoNumbersDto): number; /** * Multiplies two numbers. * * Example: 5 and 3 -> 15, -2 and 4 -> -8 * @param inputs - The two numbers * @returns Their product * @group basics * @shortname multiply * @drawable false * @example * ```typescript * const product = bitbybit.math.multiply({ first: 5, second: 3 }); * ``` */ multiply(inputs: Inputs.Math.TwoNumbersDto): number; /** * Divides the first number by the second. * * Dividing by 0 gives Infinity, as in JavaScript. * Example: 10 and 2 -> 5, 7 and 2 -> 3.5 * @param inputs - The number to divide and the number to divide by * @returns Their quotient * @group basics * @shortname divide * @drawable false * @example * ```typescript * const quotient = bitbybit.math.divide({ first: 7, second: 2 }); * ``` */ divide(inputs: Inputs.Math.TwoNumbersDto): number; /** * Raises the first number to the power of the second. * * Example: 2 to the 3 -> 8, 5 to the 2 -> 25, 10 to the -1 -> 0.1 * @param inputs - The base and the exponent * @returns The power * @group basics * @shortname power * @drawable false * @example * ```typescript * const cube = bitbybit.math.power({ first: 2, second: 3 }); * ``` */ power(inputs: Inputs.Math.TwoNumbersDto): number; /** * Finds the square root of a number. * * A negative number gives NaN. * Example: 9 -> 3, 2 -> 1.414 * @param inputs - The number * @returns The square root * @group basics * @shortname sqrt * @drawable false */ sqrt(inputs: Inputs.Math.NumberDto): number; /** * Drops the sign of a number, so the result is never negative. * * Example: -5 -> 5, 3 -> 3, 0 -> 0 * @param inputs - The number * @returns The absolute value * @group basics * @shortname abs * @drawable false */ abs(inputs: Inputs.Math.NumberDto): number; /** * Rounds a number to the nearest whole number; halves round up. * * Example: 3.7 -> 4, 2.3 -> 2, 5.5 -> 6 * @param inputs - The number * @returns The nearest whole number * @group basics * @shortname round * @drawable false */ round(inputs: Inputs.Math.NumberDto): number; /** * Rounds a number down to the whole number below it. * * Example: 3.7 -> 3, -2.3 -> -3, 5 -> 5 * @param inputs - The number * @returns The whole number below * @group basics * @shortname floor * @drawable false */ floor(inputs: Inputs.Math.NumberDto): number; /** * Rounds a number up to the whole number above it. * * Example: 3.2 -> 4, -2.8 -> -2, 5 -> 5 * @param inputs - The number * @returns The whole number above * @group basics * @shortname ceil * @drawable false */ ceil(inputs: Inputs.Math.NumberDto): number; /** * Flips the sign of a number. * * Example: 5 -> -5, -3 -> 3, 0 -> 0 * @param inputs - The number * @returns The number with the opposite sign * @group basics * @shortname negate * @drawable false */ negate(inputs: Inputs.Math.NumberDto): number; /** * Finds the natural logarithm of a number: the power e must be raised to for that number. * * Example: 2.718 -> about 1, 1 -> 0 * @param inputs - The number, greater than 0 * @returns The natural logarithm * @group basics * @shortname ln * @drawable false */ ln(inputs: Inputs.Math.NumberDto): number; /** * Finds the base-10 logarithm of a number: the power 10 must be raised to for that number. * * Example: 100 -> 2, 1000 -> 3, 10 -> 1 * @param inputs - The number, greater than 0 * @returns The base-10 logarithm * @group basics * @shortname log10 * @drawable false */ log10(inputs: Inputs.Math.NumberDto): number; /** * Raises 10 to the power of a number. * * Example: 2 -> 100, 3 -> 1000, -1 -> 0.1 * @param inputs - The exponent * @returns 10 to that power * @group basics * @shortname ten pow * @drawable false */ tenPow(inputs: Inputs.Math.NumberDto): number; /** * Finds the sine of an angle given in radians. * * Example: 0 -> 0, pi/2 -> 1 * @param inputs - The angle in radians * @returns The sine, between -1 and 1 * @group basics * @shortname sin * @drawable false */ sin(inputs: Inputs.Math.NumberDto): number; /** * Finds the cosine of an angle given in radians. * * Example: 0 -> 1, pi -> -1 * @param inputs - The angle in radians * @returns The cosine, between -1 and 1 * @group basics * @shortname cos * @drawable false */ cos(inputs: Inputs.Math.NumberDto): number; /** * Finds the tangent of an angle given in radians. * * Example: 0 -> 0, pi/4 -> about 1 * @param inputs - The angle in radians * @returns The tangent * @group basics * @shortname tan * @drawable false */ tan(inputs: Inputs.Math.NumberDto): number; /** * Finds the angle, in radians, whose sine is the given number. * * Example: 0 -> 0, 1 -> pi/2 (about 1.57) * @param inputs - A number between -1 and 1 * @returns The angle in radians * @group basics * @shortname asin * @drawable false */ asin(inputs: Inputs.Math.NumberDto): number; /** * Finds the angle, in radians, whose cosine is the given number. * * Example: 1 -> 0, -1 -> pi (about 3.14) * @param inputs - A number between -1 and 1 * @returns The angle in radians * @group basics * @shortname acos * @drawable false */ acos(inputs: Inputs.Math.NumberDto): number; /** * Finds the angle, in radians, whose tangent is the given number. * * Example: 0 -> 0, 1 -> pi/4 (about 0.785) * @param inputs - The number * @returns The angle in radians, between -pi/2 and pi/2 * @group basics * @shortname atan * @drawable false */ atan(inputs: Inputs.Math.NumberDto): number; /** * Raises e, the base of the natural logarithm, to the power of a number. * * Example: 0 -> 1, 1 -> about 2.718, 2 -> about 7.389 * @param inputs - The exponent * @returns e to that power * @group basics * @shortname exp * @drawable false */ exp(inputs: Inputs.Math.NumberDto): number; /** * Converts an angle from degrees to radians. * * Example: 180 -> pi (about 3.14159), 90 -> pi/2 * @param inputs - The angle in degrees * @returns The angle in radians * @group basics * @shortname deg to rad * @drawable false */ degToRad(inputs: Inputs.Math.NumberDto): number; /** * Converts an angle from radians to degrees. * * Example: pi -> 180, pi/2 -> 90 * @param inputs - The angle in radians * @returns The angle in degrees * @group basics * @shortname rad to deg * @drawable false */ radToDeg(inputs: Inputs.Math.NumberDto): number; /** * Maps a value from 0 to 1 onto the range `min` to `max` along an easing curve, so the result * speeds up or slows down instead of changing evenly. * * An `easeIn` curve starts slowly, an `easeOut` curve ends slowly, an `easeInOut` curve does * both. * Example: 0.5 from [0,100] with easeInQuad -> 25 * @param inputs - The value between 0 and 1, the target range and the easing curve * @returns The eased value in the target range * @group operations * @shortname ease * @drawable false * @example * ```typescript * const eased = bitbybit.math.ease({ x: 0.5, min: 0, max: 100, ease: Bit.Inputs.Math.easeEnum.easeInQuad }); * ``` */ ease(inputs: Inputs.Math.EaseDto): number; /** * Keeps a number within a range: below `min` becomes `min`, above `max` becomes `max`. * * Example: 5 in [0,3] -> 3, -1 in [0,3] -> 0, 1.5 in [0,3] -> 1.5 * @param inputs - The number and the range to keep it in * @returns The number, limited to the range * @group operations * @shortname clamp * @drawable false * @example * ```typescript * const limited = bitbybit.math.clamp({ number: 5, min: 0, max: 3 }); * ``` */ clamp(inputs: Inputs.Math.ClampDto): number; /** * Blends from a start value to an end value by a fraction `t`: 0 gives the start, 1 the end, * 0.5 the midpoint. * * A `t` outside 0 to 1 extrapolates past the ends. * Example: 0 to 100 at 0.5 -> 50, 10 to 20 at 0.25 -> 12.5 * @param inputs - The start value, the end value and the fraction * @returns The blended value * @group operations * @shortname lerp * @drawable false * @example * ```typescript * const mid = bitbybit.math.lerp({ start: 10, end: 20, t: 0.25 }); * ``` */ lerp(inputs: Inputs.Math.LerpDto): number; /** * Finds where a value sits between a start and an end, as a fraction: the `t` that `lerp` would * need to produce it. * * Example: 5 in [0,10] -> 0.5, 2.5 in [0,10] -> 0.25 * @param inputs - The start value, the end value and the value to locate * @returns The fraction from start to end * @group operations * @shortname inverse lerp * @drawable false * @example * ```typescript * const fraction = bitbybit.math.inverseLerp({ start: 0, end: 10, value: 2.5 }); * ``` */ inverseLerp(inputs: Inputs.Math.InverseLerpDto): number; /** * Turns a value from 0 to 1 into a smooth S-curve that starts and ends gently; the value is * clamped to that range first. * * Example: 0 -> 0, 0.5 -> 0.5, 0.25 -> 0.156 * @param inputs - The value between 0 and 1 * @returns The smoothed value between 0 and 1 * @group operations * @shortname smoothstep * @drawable false */ smoothstep(inputs: Inputs.Math.NumberDto): number; /** * Tells the sign of a number: -1 when negative, 0 when zero, 1 when positive. * * Example: -5 -> -1, 0 -> 0, 3.14 -> 1 * @param inputs - The number * @returns -1, 0 or 1 * @group operations * @shortname sign * @drawable false */ sign(inputs: Inputs.Math.NumberDto): number; /** * Keeps the part of a number after the decimal point, measured up from the whole number below * it, so the result is always from 0 up to 1. * * Example: 3.14 -> 0.14, -2.3 -> 0.7 * @param inputs - The number * @returns The fractional part, from 0 up to 1 * @group operations * @shortname fract * @drawable false */ fract(inputs: Inputs.Math.NumberDto): number; /** * Wraps a number into a range so it cycles round: past `max` it comes back in at `min`, and * below `min` it comes back in at `max`. * * Useful for angles and repeating patterns; unlike a plain modulus it handles negative numbers. * Example: 1.5 in [0,1) -> 0.5, -0.3 in [0,1) -> 0.7, 370 in [0,360) -> 10 * @param inputs - The number and the range to wrap it into * @returns The wrapped number, from min up to max * @group operations * @shortname wrap * @drawable false * @example * ```typescript * const angle = bitbybit.math.wrap({ number: 370, min: 0, max: 360 }); * ``` */ wrap(inputs: Inputs.Math.WrapDto): number; /** * Bounces a value back and forth between 0 and `length` as `t` grows: up to `length`, back down * to 0, and again. * * Example: length 1 at t 0.5 -> 0.5, t 1 -> 1, t 1.5 -> 0.5, t 2 -> 0 * @param inputs - The running value and the length to bounce within * @returns The bounced value between 0 and length * @group operations * @shortname ping pong * @drawable false * @example * ```typescript * const bounce = bitbybit.math.pingPong({ t: 1.5, length: 1 }); * ``` */ pingPong(inputs: Inputs.Math.PingPongDto): number; /** * Moves a value toward a target by at most `maxDelta`, without overshooting it. * * Example: 0 toward 10 by 3 -> 3, 8 toward 10 by 3 -> 10 * @param inputs - The current value, the target and the largest step allowed * @returns The value after one step * @group operations * @shortname move towards * @drawable false * @example * ```typescript * const next = bitbybit.math.moveTowards({ current: 8, target: 10, maxDelta: 3 }); * ``` */ moveTowards(inputs: Inputs.Math.MoveTowardsDto): number; /** * Works out a simple arithmetic expression written as text: numbers, +, -, the multiplication * sign, /, parentheses and spaces. * * The expression is parsed and computed by the library itself, never handed to the JavaScript * engine to run, so it is safe with text a user typed. * Example: '(3+2) times 4' written with the sign -> 20, '10/3' -> 3.3333 * @param inputs - The expression text * @returns The computed value * @group operations * @shortname eval arithmetic * @drawable false * @example * ```typescript * const value = bitbybit.math.evalArithmetic({ expression: "(3 + 2) * 4" }); * ``` */ evalArithmetic(inputs: Inputs.Math.EvalArithmeticDto): number; private easeInSine; private easeOutSine; private easeInOutSine; private easeInQuad; private easeOutQuad; private easeInOutQuad; private easeInCubic; private easeOutCubic; private easeInOutCubic; private easeInQuart; private easeOutQuart; private easeInOutQuart; private easeInQuint; private easeOutQuint; private easeInOutQuint; private easeInExpo; private easeOutExpo; private easeInOutExpo; private easeInCirc; private easeOutCirc; private easeInOutCirc; private easeInBack; private easeOutBack; private easeInOutBack; private easeInElastic; private easeOutElastic; private easeInOutElastic; private easeInBounce; private easeOutBounce; private easeInOutBounce; } /** * Geometry on plain triangle meshes: a mesh is a list of triangles, each three points. The methods * here work out the plane of a triangle, the distance from a point to a plane, and where two meshes * cut through each other, as segments, as polylines or as point lists. They need no CAD kernel, so * they run on any triangulated data. */ declare class MeshBitByBit { private readonly vector; private readonly polyline; constructor(vector: Vector, polyline: Polyline); /** * Measures how far a point is from a plane, with a sign: positive on the side the normal points * to, negative on the other. * * Example: point [0,5,0] and the XZ plane with normal [0,1,0] -> 5 * @param inputs - The point and the plane * @returns The signed distance in model units * @group base * @shortname signed dist to plane * @drawable false * @example * ```typescript * const above = bitbybit.mesh.signedDistanceToPlane({ point: [0, 5, 0], plane: { normal: [0, 1, 0], d: 0 } }); * ``` */ signedDistanceToPlane(inputs: Inputs.Mesh.SignedDistanceFromPlaneToPointDto): number; /** * Finds the plane a triangle lies in: its unit normal and its distance from the origin along * that normal. * * The normal follows the right-hand rule around the triangle's points. A triangle with no area, * whose points are on one line, has no plane and gives undefined. * Example: [[0,0,0], [1,0,0], [0,1,0]] -> { normal: [0,0,1], d: 0 } * @param inputs - The triangle and the tolerance below which its area counts as zero * @returns The plane, or undefined for a flat triangle * @group traingle * @shortname triangle plane * @drawable false * @example * ```typescript * const plane = bitbybit.mesh.calculateTrianglePlane({ triangle: [[0, 0, 0], [1, 0, 0], [0, 1, 0]], tolerance: 1e-7 }); * ``` */ calculateTrianglePlane(inputs: Inputs.Mesh.TriangleToleranceDto): Inputs.Base.TrianglePlane3 | undefined; /** * Finds the segment where two triangles cut through each other. * * Triangles that do not touch, are parallel, or lie in the same plane give undefined. * Example: a triangle in the XY plane and one standing across it -> the segment where they * cross * @param inputs - The two triangles and the tolerance * @returns The crossing segment, or undefined when there is none * @group traingle * @shortname triangle-triangle int * @drawable false * @example * ```typescript * const cut = bitbybit.mesh.triangleTriangleIntersection({ * triangle1: [[0, 0, 0], [2, 0, 0], [1, 2, 0]], * triangle2: [[1, -1, 1], [1, 1, 1], [1, 1, -1]], * tolerance: 1e-7, * }); * ``` */ triangleTriangleIntersection(inputs: Inputs.Mesh.TriangleTriangleToleranceDto): Inputs.Base.Segment3 | undefined; /** * Finds every segment where the surfaces of two meshes cut through each other, testing each * triangle of one against each triangle of the other. * * Example: a cube mesh and a sphere mesh -> the segments that together trace their intersection * curve * @param inputs - The two meshes and the tolerance * @returns The crossing segments, in no particular order * @group mesh * @shortname mesh-mesh int segments * @drawable false * @example * ```typescript * const segments = bitbybit.mesh.meshMeshIntersectionSegments({ mesh1: cubeTriangles, mesh2: sphereTriangles, tolerance: 1e-7 }); * ``` */ meshMeshIntersectionSegments(inputs: Inputs.Mesh.MeshMeshToleranceDto): Inputs.Base.Segment3[]; /** * Finds where the surfaces of two meshes cut through each other and joins the pieces into * polylines, closed where the curve loops. * * Example: a cube mesh and a sphere mesh -> closed polylines where the two surfaces meet * @param inputs - The two meshes and the tolerance * @returns The intersection curves as polylines * @group mesh * @shortname mesh-mesh int polylines * @drawable true * @example * ```typescript * const curves = bitbybit.mesh.meshMeshIntersectionPolylines({ mesh1: cubeTriangles, mesh2: sphereTriangles, tolerance: 1e-7 }); * ``` */ meshMeshIntersectionPolylines(inputs: Inputs.Mesh.MeshMeshToleranceDto): Inputs.Base.Polyline3[]; /** * Finds where the surfaces of two meshes cut through each other, as one list of points per * curve. * * A closed curve repeats its first point at the end so the loop is explicit. * Example: a cube mesh and a sphere mesh -> point lists tracing where the two surfaces meet * @param inputs - The two meshes and the tolerance * @returns One point list per intersection curve * @group mesh * @shortname mesh-mesh int points * @drawable false * @example * ```typescript * const curves = bitbybit.mesh.meshMeshIntersectionPoints({ mesh1: cubeTriangles, mesh2: sphereTriangles, tolerance: 1e-7 }); * ``` */ meshMeshIntersectionPoints(inputs: Inputs.Mesh.MeshMeshToleranceDto): Inputs.Base.Point3[][]; private computeIntersectionPoint; } /** * Points as plain number arrays. A point is `[x, y, z]` with Y pointing up, the same shape as a * vector, so the two can be passed to each other's methods; a 2D point is `[x, y]`. Every method * returns new points or numbers and never changes its inputs. Angles are in degrees and lengths in * model units. */ declare class Point { private readonly geometryHelper; private readonly transforms; private readonly vector; private readonly lists; constructor(geometryHelper: GeometryHelper, transforms: Transforms, vector: Vector, lists: Lists); /** * Applies a transformation matrix, or a list of them in order, to one point. * * Example: point [0,0,0] with a translation by [5,5,0] -> [5,5,0] * @param inputs - The point and the transformation to apply * @returns The transformed point * @group transforms * @shortname transform point * @drawable true * @example * ```typescript * const moved = bitbybit.point.transformPoint({ * point: [0, 0, 0], * transformation: bitbybit.transforms.translationXYZ({ translation: [5, 5, 0] }), * }); * ``` */ transformPoint(inputs: Inputs.Point.TransformPointDto): Inputs.Base.Point3; /** * Applies the same transformation matrix, or list of them in order, to every point. * * Example: five points with a 90 degree rotation -> all five rotated together * @param inputs - The points and the transformation to apply to each * @returns The transformed points, in the same order * @group transforms * @shortname transform points * @drawable true * @example * ```typescript * const rotated = bitbybit.point.transformPoints({ * points: [[1, 0, 0], [2, 0, 0]], * transformation: bitbybit.transforms.rotationCenterAxis({ center: [0, 0, 0], axis: [0, 1, 0], angle: 90 }), * }); * ``` */ transformPoints(inputs: Inputs.Point.TransformPointsDto): Inputs.Base.Point3[]; /** * Applies a different transformation to each point: the first transformation to the first * point, and so on. * * The two lists must have the same length, or an error is thrown. * Example: three points with three translations -> each point moved by its own translation * @param inputs - The points and one transformation per point * @returns The transformed points, in the same order * @group transforms * @shortname transforms for points * @drawable true * @example * ```typescript * const placed = bitbybit.point.transformsForPoints({ * points: [[0, 0, 0], [1, 0, 0]], * transformation: bitbybit.transforms.translationsXYZ({ translations: [[0, 1, 0], [0, 2, 0]] }), * }); * ``` */ transformsForPoints(inputs: Inputs.Point.TransformsForPointsDto): Inputs.Base.Point3[]; /** * Moves every point by the same vector. * * Example: points [[0,0,0], [1,0,0]] by [5,5,0] -> [[5,5,0], [6,5,0]] * @param inputs - The points and the vector to move them by * @returns The moved points, in the same order * @group transforms * @shortname translate points * @drawable true * @example * ```typescript * const moved = bitbybit.point.translatePoints({ points: [[0, 0, 0], [1, 0, 0]], translation: [5, 5, 0] }); * ``` */ translatePoints(inputs: Inputs.Point.TranslatePointsDto): Inputs.Base.Point3[]; /** * Moves each point by its own vector: the first point by the first vector, and so on. * * The two lists must have the same length, or an error is thrown. * Example: three points with three vectors -> each point moved by its own vector * @param inputs - The points and one vector per point * @returns The moved points, in the same order * @group transforms * @shortname translate points with vectors * @drawable true * @example * ```typescript * const moved = bitbybit.point.translatePointsWithVectors({ * points: [[0, 0, 0], [1, 0, 0]], * translations: [[0, 1, 0], [0, 2, 0]], * }); * ``` */ translatePointsWithVectors(inputs: Inputs.Point.TranslatePointsWithVectorsDto): Inputs.Base.Point3[]; /** * Moves every point by the given x, y and z amounts. * * Example: point [0,0,0] with x=10, y=5, z=0 -> [10,5,0] * @param inputs - The points and the distance to move along each axis * @returns The moved points, in the same order * @group transforms * @shortname translate xyz points * @drawable true * @example * ```typescript * const lifted = bitbybit.point.translateXYZPoints({ points: [[0, 0, 0], [1, 0, 0]], x: 0, y: 5, z: 0 }); * ``` */ translateXYZPoints(inputs: Inputs.Point.TranslateXYZPointsDto): Inputs.Base.Point3[]; /** * Scales points away from or toward a center, with its own factor per axis. * * Example: point [10,0,0] about center [5,0,0] with factors [2,1,1] -> [15,0,0] * @param inputs - The points, the center to scale about and the factor per axis * @returns The scaled points, in the same order * @group transforms * @shortname scale points on center * @drawable true * @example * ```typescript * const stretched = bitbybit.point.scalePointsCenterXYZ({ * points: [[10, 0, 0], [0, 10, 0]], * center: [0, 0, 0], * scaleXyz: [2, 1, 1], * }); * ``` */ scalePointsCenterXYZ(inputs: Inputs.Point.ScalePointsCenterXYZDto): Inputs.Base.Point3[]; /** * Stretches points along one direction, measured from a center; distances across that direction * stay as they are. * * Example: point [10,0,0] from center [0,0,0] along [1,0,0] with scale 2 -> [20,0,0] * @param inputs - The points, the center, the direction to stretch along and the factor * @returns The stretched points, in the same order * @group transforms * @shortname stretch points dir from center * @drawable true * @example * ```typescript * const taller = bitbybit.point.stretchPointsDirFromCenter({ * points: [[0, 1, 0], [0, 2, 0]], * center: [0, 0, 0], * direction: [0, 1, 0], * scale: 2, * }); * ``` */ stretchPointsDirFromCenter(inputs: Inputs.Point.StretchPointsDirFromCenterDto): Inputs.Base.Point3[]; /** * Rotates points around an axis that passes through a center. * * The angle is in degrees and turns counter-clockwise when the axis points toward you. * Example: point [10,0,0] around the Y axis through [0,0,0] by 90 -> [0,0,-10] * @param inputs - The points, the axis direction, the center it passes through and the angle in degrees * @returns The rotated points, in the same order * @group transforms * @shortname rotate points center axis * @drawable true * @example * ```typescript * const turned = bitbybit.point.rotatePointsCenterAxis({ * points: [[10, 0, 0]], * center: [0, 0, 0], * axis: [0, 1, 0], * angle: 90, * }); * ``` */ rotatePointsCenterAxis(inputs: Inputs.Point.RotatePointsCenterAxisDto): Inputs.Base.Point3[]; /** * Finds the smallest axis-aligned box that holds all the points. * * The result carries the min and max corners, the center, and the width (X), height (Y) and * length (Z). * Example: points [[0,0,0], [10,5,3]] -> min [0,0,0], max [10,5,3], center [5,2.5,1.5] * @param inputs - The points to enclose * @returns The bounding box with its corners, center and sizes * @group extract * @shortname bounding box pts * @drawable true * @example * ```typescript * const box = bitbybit.point.boundingBoxOfPoints({ points: [[0, 0, 0], [10, 5, 3], [-2, 1, 1]] }); * ``` */ boundingBoxOfPoints(inputs: Inputs.Point.PointsDto): Inputs.Base.BoundingBox; /** * Measures the distance from a point to the nearest point in a list. * * Example: point [0,0,0] and points [[5,0,0], [10,0,0], [3,0,0]] -> 3 * @param inputs - The point to measure from and the points to search * @returns The distance to the nearest point, in model units * @group extract * @shortname distance to closest pt * @drawable false * @example * ```typescript * const nearest = bitbybit.point.closestPointFromPointsDistance({ point: [0, 0, 0], points: [[5, 0, 0], [3, 0, 0]] }); * ``` */ closestPointFromPointsDistance(inputs: Inputs.Point.ClosestPointFromPointsDto): number; /** * Finds the position of the nearest point in a list, counted from 1. * * Example: point [0,0,0] and points [[5,0,0], [10,0,0], [3,0,0]] -> 3 * @param inputs - The point to measure from and the points to search * @returns The 1-based index of the nearest point * @group extract * @shortname index of closest pt * @drawable false * @example * ```typescript * const index = bitbybit.point.closestPointFromPointsIndex({ point: [0, 0, 0], points: [[5, 0, 0], [3, 0, 0]] }); * ``` */ closestPointFromPointsIndex(inputs: Inputs.Point.ClosestPointFromPointsDto): number; /** * Finds the nearest point in a list to a given point. * * Example: point [0,0,0] and points [[5,0,0], [10,0,0], [3,0,0]] -> [3,0,0] * @param inputs - The point to measure from and the points to search * @returns The nearest point * @group extract * @shortname closest pt * @drawable true * @example * ```typescript * const nearest = bitbybit.point.closestPointFromPoints({ point: [0, 0, 0], points: [[5, 0, 0], [3, 0, 0]] }); * ``` */ closestPointFromPoints(inputs: Inputs.Point.ClosestPointFromPointsDto): Inputs.Base.Point3; /** * Measures the straight-line distance between two points. * * Example: [0,0,0] to [3,4,0] -> 5 * @param inputs - The two points * @returns The distance in model units * @group measure * @shortname distance * @drawable false * @example * ```typescript * const d = bitbybit.point.distance({ startPoint: [0, 0, 0], endPoint: [3, 4, 0] }); * ``` */ distance(inputs: Inputs.Point.StartEndPointsDto): number; /** * Measures the distance from one point to each point in a list. * * Example: start [0,0,0] and end points [[3,0,0], [0,4,0], [5,0,0]] -> [3, 4, 5] * @param inputs - The start point and the points to measure to * @returns One distance per end point, in the same order * @group measure * @shortname distances to points * @drawable false * @example * ```typescript * const distances = bitbybit.point.distancesToPoints({ startPoint: [0, 0, 0], endPoints: [[3, 0, 0], [0, 4, 0]] }); * ``` */ distancesToPoints(inputs: Inputs.Point.StartEndPointsListDto): number[]; /** * Repeats one point a given number of times in a list. * * Example: point [5,5,0] three times -> [[5,5,0], [5,5,0], [5,5,0]] * @param inputs - The point and how many copies to make * @returns The list of copies * @group transforms * @shortname multiply point * @drawable true * @example * ```typescript * const copies = bitbybit.point.multiplyPoint({ point: [5, 5, 0], amountOfPoints: 3 }); * ``` */ multiplyPoint(inputs: Inputs.Point.MultiplyPointDto): Inputs.Base.Point3[]; /** * Reads the X value of a point. * * Example: [5,10,3] -> 5 * @param inputs - The point * @returns The X value * @group get * @shortname x coord * @drawable false */ getX(inputs: Inputs.Point.PointDto): number; /** * Reads the Y value of a point, the one that points up. * * Example: [5,10,3] -> 10 * @param inputs - The point * @returns The Y value * @group get * @shortname y coord * @drawable false */ getY(inputs: Inputs.Point.PointDto): number; /** * Reads the Z value of a point. * * Example: [5,10,3] -> 3 * @param inputs - The point * @returns The Z value * @group get * @shortname z coord * @drawable false */ getZ(inputs: Inputs.Point.PointDto): number; /** * Finds the average of the points, which is their center of mass when they weigh the same. * * Example: [[0,0,0], [10,0,0], [10,10,0]] -> [6.67,3.33,0] * @param inputs - The points to average * @returns The average point * @group extract * @shortname average point * @drawable true * @example * ```typescript * const center = bitbybit.point.averagePoint({ points: [[0, 0, 0], [10, 0, 0], [10, 10, 0]] }); * ``` */ averagePoint(inputs: Inputs.Point.PointsDto): Inputs.Base.Point3; /** * Builds a 3D point from its x, y and z values. * * Example: x=10, y=5, z=3 -> [10,5,3] * @param inputs - The three values * @returns The point `[x, y, z]` * @group create * @shortname point xyz * @drawable true * @example * ```typescript * const point = bitbybit.point.pointXYZ({ x: 10, y: 5, z: 3 }); * ``` */ pointXYZ(inputs: Inputs.Point.PointXYZDto): Inputs.Base.Point3; /** * Builds a 2D point from its x and y values. * * Example: x=10, y=5 -> [10,5] * @param inputs - The two values * @returns The point `[x, y]` * @group create * @shortname point xy * @drawable false * @example * ```typescript * const point = bitbybit.point.pointXY({ x: 10, y: 5 }); * ``` */ pointXY(inputs: Inputs.Point.PointXYDto): Inputs.Base.Point2; /** * Lays out points along a logarithmic spiral in the XY plane, from the origin outward to * `radius`. * * `numberPoints` sets how many points are placed, `phi` and `widening` how quickly the spiral * opens, and `factor` where along the curve it starts. Every point has z = 0. * @param inputs - The point count, the radius and the shape of the spiral * @returns The points along the spiral, from the center outward * @group create * @shortname spiral * @drawable true * @example * ```typescript * const points = bitbybit.point.spiral({ phi: 0.9, numberPoints: 100, widening: 3, radius: 10, factor: 1 }); * ``` */ spiral(inputs: Inputs.Point.SpiralDto): Inputs.Base.Point3[]; /** * Lays out the centers of a honeycomb of hexagons in the XY plane. * * `radiusHexagon` is the distance from a hexagon's center to a corner; columns run along X and * rows along Y, every second row shifted by half a column. `orientOnCenter` centers the grid on * the origin, `pointsOnGround` lays it on the XZ plane. * @param inputs - The hexagon size, how many columns and rows, and where to place the grid * @returns The center points, row by row * @group create * @shortname hex grid * @drawable true * @example * ```typescript * const centers = bitbybit.point.hexGrid({ radiusHexagon: 1, nrHexagonsX: 5, nrHexagonsY: 4, orientOnCenter: true, pointsOnGround: false }); * ``` */ hexGrid(inputs: Inputs.Point.HexGridCentersDto): Inputs.Base.Point3[]; /** * Lays out a honeycomb of hexagons that fills a given width and height, sizing the hexagons * from the counts. * * The result carries the center points and the six corners of every hexagon. A corner points up * unless `flatTop` is set; the extend flags stretch the outer rows past the edges to cover the * rectangle without a jagged border. * @param inputs - The area to fill, the hexagon counts, the orientation and the placement options * @returns The centers and the corner points of every hexagon * @group create * @shortname scaled hex grid to fit * @drawable false * @example * ```typescript * const grid = bitbybit.point.hexGridScaledToFit({ * width: 10, * height: 10, * nrHexagonsInWidth: 5, * nrHexagonsInHeight: 5, * flatTop: false, * centerGrid: true, * }); * ``` */ hexGridScaledToFit(inputs: Inputs.Point.HexGridScaledToFitDto): Models.Point.HexGridData; /** * Finds the largest fillet that fits a corner: the arc touches both segments and stays inside * them. * * The corner is `end`; `start` and `center` are the far ends of the two segments that meet * there. The radius is limited by the shorter segment. A straight or folded-back corner, or a * segment shorter than `tolerance`, gives 0. * @param inputs - The far end of each segment, the corner they share, and the tolerance * @returns The largest fillet radius, in model units * @group fillet * @shortname max fillet radius * @drawable false * @example * ```typescript * const radius = bitbybit.point.maxFilletRadius({ start: [10, 0, 0], center: [0, 10, 0], end: [0, 0, 0], tolerance: 1e-7 }); * ``` */ maxFilletRadius(inputs: Inputs.Point.ThreePointsToleranceDto): number; /** * Finds the largest fillet at a corner whose arc touches each segment within its nearer half, * so neighboring corners of a polyline can each be filleted without the arcs overlapping. * * The corner is `end`; `start` and `center` are the far ends of the two segments. A straight or * folded-back corner, or a segment shorter than `tolerance`, gives 0. * @param inputs - The far end of each segment, the corner they share, and the tolerance * @returns The largest fillet radius under the half-segment rule, in model units * @group fillet * @shortname max fillet radius half line * @drawable false * @example * ```typescript * const radius = bitbybit.point.maxFilletRadiusHalfLine({ start: [10, 0, 0], center: [0, 10, 0], end: [0, 0, 0], tolerance: 1e-7 }); * ``` */ maxFilletRadiusHalfLine(inputs: Inputs.Point.ThreePointsToleranceDto): number; /** * Finds the largest fillet for every corner of a polyline, each limited to the nearer half of * its segments so the fillets never overlap. * * With `checkLastWithFirst` on, the polyline is treated as closed and the two corners at the * ends are included. Fewer than three points give an empty list. * @param inputs - The polyline points, whether it is closed, and the tolerance * @returns One radius per corner, in the order of the corners * @group fillet * @shortname max fillets half line * @drawable false * @example * ```typescript * const radii = bitbybit.point.maxFilletsHalfLine({ * points: [[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]], * checkLastWithFirst: true, * tolerance: 1e-7, * }); * ``` */ maxFilletsHalfLine(inputs: Inputs.Point.PointsMaxFilletsHalfLineDto): number[]; /** * Finds one fillet radius that fits every corner of a polyline: the smallest of the per-corner * maximums under the half-segment rule. * * With `checkLastWithFirst` on, the polyline is treated as closed. Fewer than three points, or * any corner that allows no fillet, give 0. * @param inputs - The polyline points, whether it is closed, and the tolerance * @returns The radius that fits every corner, in model units * @group fillet * @shortname safest fillet radii points * @drawable false * @example * ```typescript * const radius = bitbybit.point.safestPointsMaxFilletHalfLine({ * points: [[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]], * checkLastWithFirst: true, * tolerance: 1e-7, * }); * ``` */ safestPointsMaxFilletHalfLine(inputs: Inputs.Point.PointsMaxFilletsHalfLineDto): number; /** * Removes a point when it repeats the one right before it; the same point further away is kept. * * With `checkFirstAndLast` on, a last point that repeats the first is dropped too. Points * within `tolerance` of each other count as the same. * Example: [[0,0,0], [0,0,0], [1,0,0], [1,0,0], [2,0,0]] -> [[0,0,0], [1,0,0], [2,0,0]] * @param inputs - The points, the tolerance and whether to compare the first and last * @returns The points without consecutive repeats * @group clean * @shortname remove duplicates * @drawable true * @example * ```typescript * const cleaned = bitbybit.point.removeConsecutiveDuplicates({ * points: [[0, 0, 0], [0, 0, 0], [1, 0, 0]], * tolerance: 1e-7, * checkFirstAndLast: false, * }); * ``` */ removeConsecutiveDuplicates(inputs: Inputs.Point.RemoveConsecutiveDuplicatesDto): Inputs.Base.Point3[]; /** * Finds the direction at right angles to the plane through three points, with length 1. * * The direction follows the right-hand rule going from the first point to the second to the * third; `reverseNormal` flips it. Points on one line have no plane, so the result is * undefined. * Example: [0,0,0], [1,0,0], [0,1,0] -> [0,0,1] * @param inputs - The three points and whether to flip the result * @returns The unit normal, or undefined when the points are on one line * @group create * @shortname normal from 3 points * @drawable true * @example * ```typescript * const normal = bitbybit.point.normalFromThreePoints({ * point1: [0, 0, 0], * point2: [1, 0, 0], * point3: [0, 1, 0], * reverseNormal: false, * }); * ``` */ normalFromThreePoints(inputs: Inputs.Point.ThreePointsNormalDto): Inputs.Base.Vector3 | undefined; private closestPointFromPointData; /** * Tells whether two points are closer together than a tolerance. * * Example: [1.0000001, 2, 3] and [1, 2, 3] with tolerance 1e-6 -> true * @param inputs - The two points and the tolerance * @returns True when the distance between them is below the tolerance * @group measure * @shortname two points almost equal * @drawable false * @example * ```typescript * const same = bitbybit.point.twoPointsAlmostEqual({ point1: [1, 2, 3], point2: [1, 2, 3.0000001], tolerance: 1e-6 }); * ``` */ twoPointsAlmostEqual(inputs: Inputs.Point.TwoPointsToleranceDto): boolean; /** * Sorts points by X, then by Y for equal X, then by Z. * * Example: [[5,0,0], [1,0,0], [3,0,0]] -> [[1,0,0], [3,0,0], [5,0,0]] * @param inputs - The points to sort * @returns A sorted copy of the points * @group sort * @shortname sort points * @drawable true * @example * ```typescript * const sorted = bitbybit.point.sortPoints({ points: [[5, 0, 0], [1, 0, 0], [3, 0, 0]] }); * ``` */ sortPoints(inputs: Inputs.Point.PointsDto): Inputs.Base.Point3[]; /** * Calculates the 6 vertices of a regular flat-top hexagon. * @param center The center point [x, y, z]. * @param radius The radius (distance from center to vertex). * @returns An array of 6 Point3 vertices in counter-clockwise order. */ private getRegularHexagonVertices; } /** * Polylines: chains of straight segments through a list of points, held as plain objects of the * form `{ points, isClosed }`. A closed polyline joins its last point back to its first. The * methods here measure a polyline, convert it to segments or lines, find where polylines cross, * sort loose segments into chains and size fillets for its corners. Lengths are in model units. */ declare class Polyline { private readonly vector; private readonly point; private readonly line; private readonly geometryHelper; constructor(vector: Vector, point: Point, line: Line, geometryHelper: GeometryHelper); /** * Measures the polyline by adding up the straight distances between neighboring points. * * The closing segment of a closed polyline is not counted. * Example: [[0,0,0], [3,0,0], [3,4,0]] -> 7 * @param inputs - The polyline * @returns The length in model units * @group get * @shortname polyline length * @drawable false * @example * ```typescript * const len = bitbybit.polyline.length({ polyline: { points: [[0, 0, 0], [3, 0, 0], [3, 4, 0]] } }); * ``` */ length(inputs: Inputs.Polyline.PolylineDto): number; /** * Counts the points of the polyline. * * Example: three points -> 3 * @param inputs - The polyline * @returns The number of points * @group get * @shortname nr polyline points * @drawable false */ countPoints(inputs: Inputs.Polyline.PolylineDto): number; /** * Reads the list of points out of the polyline. * * Example: { points: [[0,0,0], [1,0,0]] } -> [[0,0,0], [1,0,0]] * @param inputs - The polyline * @returns Its points, in order * @group get * @shortname points * @drawable true */ getPoints(inputs: Inputs.Polyline.PolylineDto): Inputs.Base.Point3[]; /** * Reverses the order of the points, so the polyline runs the other way. * * The given polyline's own point list is reversed in place and handed back inside a new * polyline object. * Example: [[0,0,0], [1,0,0], [2,0,0]] -> [[2,0,0], [1,0,0], [0,0,0]] * @param inputs - The polyline * @returns A polyline with the points in reverse order * @group convert * @shortname reverse polyline * @drawable true * @example * ```typescript * const back = bitbybit.polyline.reverse({ polyline: { points: [[0, 0, 0], [1, 0, 0], [2, 0, 0]] } }); * ``` */ reverse(inputs: Inputs.Polyline.PolylineDto): Inputs.Polyline.PolylinePropertiesDto; /** * Applies a transformation matrix, or a list of them in order, to every point of the polyline. * * Example: a translation by [5,0,0] -> every point moved 5 along X * @param inputs - The polyline and the transformation * @returns A new polyline with the transformed points * @group transforms * @shortname transform polyline * @drawable true * @example * ```typescript * const moved = bitbybit.polyline.transformPolyline({ * polyline: { points: [[0, 0, 0], [1, 0, 0]] }, * transformation: bitbybit.transforms.translationXYZ({ translation: [5, 0, 0] }), * }); * ``` */ transformPolyline(inputs: Inputs.Polyline.TransformPolylineDto): Inputs.Polyline.PolylinePropertiesDto; /** * Builds a polyline object from points, open or closed. * * Example: three points with isClosed true -> a triangle * @param inputs - The points and whether the last joins back to the first * @returns The polyline object * @group create * @shortname polyline * @drawable true * @example * ```typescript * const triangle = bitbybit.polyline.create({ points: [[0, 0, 0], [1, 0, 0], [1, 1, 0]], isClosed: true }); * ``` */ create(inputs: Inputs.Polyline.PolylineCreateDto): Inputs.Polyline.PolylinePropertiesDto; /** * Splits the polyline into line objects, one per segment, each with a start and an end point. * * A closed polyline also gets the segment from its last point back to its first, unless the two * coincide. * Example: three points -> two lines, or three when closed * @param inputs - The polyline * @returns One line per segment, in order * @group convert * @shortname polyline to lines * @drawable true * @example * ```typescript * const lines = bitbybit.polyline.polylineToLines({ polyline: { points: [[0, 0, 0], [1, 0, 0], [1, 1, 0]], isClosed: true } }); * ``` */ polylineToLines(inputs: Inputs.Polyline.PolylineDto): Inputs.Base.Line3[]; /** * Splits the polyline into segments, each a pair of points. * * A closed polyline also gets the segment from its last point back to its first, unless the two * coincide. Fewer than two points give no segments. * Example: four points, closed -> four segments around the loop * @param inputs - The polyline * @returns One point pair per segment, in order * @group convert * @shortname polyline to segments * @drawable false * @example * ```typescript * const segments = bitbybit.polyline.polylineToSegments({ polyline: { points: [[0, 0, 0], [1, 0, 0], [1, 1, 0]], isClosed: false } }); * ``` */ polylineToSegments(inputs: Inputs.Polyline.PolylineDto): Inputs.Base.Segment3[]; /** * Finds the points where the polyline crosses itself. * * Neighboring segments are not tested against each other, and crossings closer together than * the tolerance are reported once. * Example: a figure-eight -> its one crossing point * @param inputs - The polyline and the tolerance * @returns The crossing points; empty when there are none * @group intersections * @shortname polyline self intersections * @drawable true * @example * ```typescript * const crossings = bitbybit.polyline.polylineSelfIntersection({ * polyline: { points: [[0, 0, 0], [2, 2, 0], [2, 0, 0], [0, 2, 0]] }, * tolerance: 1e-6, * }); * ``` */ polylineSelfIntersection(inputs: Inputs.Polyline.PolylineToleranceDto): Inputs.Base.Point3[]; /** * Finds the points where two polylines cross each other, testing every segment of one against * every segment of the other. * * Crossings closer together than the tolerance are reported once. * Example: two polylines forming an X -> the point in the middle * @param inputs - The two polylines and the tolerance * @returns The crossing points; empty when there are none * @group intersection * @shortname two polyline intersection * @drawable true * @example * ```typescript * const crossings = bitbybit.polyline.twoPolylineIntersection({ * polyline1: { points: [[0, 0, 0], [2, 2, 0]] }, * polyline2: { points: [[0, 2, 0], [2, 0, 0]] }, * tolerance: 1e-6, * }); * ``` */ twoPolylineIntersection(inputs: Inputs.Polyline.TwoPolylinesToleranceDto): Inputs.Base.Point3[]; /** * Joins loose segments into polylines by matching up ends that meet within the tolerance. * * Segments that connect end to end become one polyline each chain; segments that touch nothing * become single-segment polylines. * Example: ten scattered segments forming two chains -> two polylines * @param inputs - The segments and the tolerance for two ends to count as touching * @returns The polylines the segments form * @group sort * @shortname segments to polylines * @drawable true * @example * ```typescript * const chains = bitbybit.polyline.sortSegmentsIntoPolylines({ * segments: [[[0, 0, 0], [1, 0, 0]], [[1, 0, 0], [1, 1, 0]], [[5, 5, 0], [6, 5, 0]]], * tolerance: 1e-5, * }); * ``` */ sortSegmentsIntoPolylines(inputs: Inputs.Polyline.SegmentsToleranceDto): Inputs.Base.Polyline3[]; /** * Finds the largest fillet for every corner of the polyline, each limited to the nearer half of * its segments so the fillets never overlap. * * A closed polyline includes the two corners at its ends. Fewer than three points give an empty * list. * @param inputs - The polyline and the tolerance * @returns One radius per corner, in the order of the corners * @group fillet * @shortname polyline max fillet radii * @drawable false * @example * ```typescript * const radii = bitbybit.polyline.maxFilletsHalfLine({ * polyline: { points: [[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]], isClosed: true }, * tolerance: 1e-7, * }); * ``` */ maxFilletsHalfLine(inputs: Inputs.Polyline.PolylineToleranceDto): number[]; /** * Finds one fillet radius that fits every corner of the polyline: the smallest of the * per-corner maximums under the half-segment rule. * * Fewer than three points, or any corner that allows no fillet, give 0. * @param inputs - The polyline and the tolerance * @returns The radius that fits every corner, in model units * @group fillet * @shortname polyline safest fillet radius * @drawable false * @example * ```typescript * const radius = bitbybit.polyline.safestFilletRadius({ * polyline: { points: [[0, 0, 0], [10, 0, 0], [10, 10, 0], [0, 10, 0]], isClosed: true }, * tolerance: 1e-7, * }); * ``` */ safestFilletRadius(inputs: Inputs.Polyline.PolylineToleranceDto): number; } /** * Working with text: splitting, joining, searching, trimming, padding, changing case, regular * expressions and formatting with placeholders. `vectorChar` and `vectorText` turn text into line * paths drawn with a simple stroke font, so words can become geometry. Positions in text count from * 0. */ declare class TextBitByBit { private readonly point; constructor(point: Point); /** * Passes a text through unchanged, so a value can be given a name and reused. * * Example: 'Hello World' -> 'Hello World' * @param inputs - The text * @returns The same text * @group create * @shortname text * @drawable false */ create(inputs: Inputs.Text.TextDto): string; /** * Cuts a text into pieces wherever a separator occurs; the separator itself is dropped. * * Example: 'apple,banana,cherry' split by ',' -> ['apple', 'banana', 'cherry'] * @param inputs - The text and the separator * @returns The pieces, in order * @group transform * @shortname split * @drawable false * @example * ```typescript * const parts = bitbybit.text.split({ text: "apple,banana,cherry", separator: "," }); * ``` */ split(inputs: Inputs.Text.TextSplitDto): string[]; /** * Replaces every occurrence of a search text with another text. * * Example: 'hello hello' replacing 'hello' with 'hi' -> 'hi hi' * @param inputs - The text, what to search for and what to put in its place * @returns The text with the replacements made * @group transform * @shortname replaceAll * @drawable false * @example * ```typescript * const greeting = bitbybit.text.replaceAll({ text: "hello hello", search: "hello", replaceWith: "hi" }); * ``` */ replaceAll(inputs: Inputs.Text.TextReplaceDto): string; /** * Joins a list of texts into one, with a separator between neighbors. * * Example: ['apple', 'banana', 'cherry'] joined by ', ' -> 'apple, banana, cherry' * @param inputs - The texts and the separator * @returns The joined text * @group transform * @shortname join * @drawable false * @example * ```typescript * const line = bitbybit.text.join({ list: ["apple", "banana"], separator: ", " }); * ``` */ join(inputs: Inputs.Text.TextJoinDto): string; /** * Turns any value into text, the way JavaScript prints it. * * Example: 42 -> '42', [1, 2] -> '1,2' * @param inputs - The value * @returns The value as text * @group transform * @shortname to string * @drawable false */ toString(inputs: Inputs.Text.ToStringDto): string; /** * Turns every item of a list into text, the way JavaScript prints it. * * Example: [1, 2.5, true] -> ['1', '2.5', 'true'] * @param inputs - The list of values * @returns One text per item, in order * @group transform * @shortname to strings * @drawable false */ toStringEach(inputs: Inputs.Text.ToStringEachDto): string[]; /** * Fills numbered placeholders in a text with values: `{0}` takes the first value, `{1}` the * second, and so on. * * A placeholder without a value is left as it is. * Example: 'Point: ({0}, {1})' with [10, 5] -> 'Point: (10, 5)' * @param inputs - The text with placeholders and the values to fill in * @returns The filled-in text * @group transform * @shortname format * @drawable false * @example * ```typescript * const label = bitbybit.text.format({ text: "Point: ({0}, {1})", values: ["10", "5"] }); * ``` */ format(inputs: Inputs.Text.TextFormatDto): string; /** * Tells whether a text contains a search text. * * Example: 'hello world' includes 'world' -> true * @param inputs - The text and what to look for * @returns True when the search text occurs in it * @group query * @shortname includes * @drawable false * @example * ```typescript * const has = bitbybit.text.includes({ text: "hello world", search: "world" }); * ``` */ includes(inputs: Inputs.Text.TextSearchDto): boolean; /** * Tells whether a text begins with a search text. * * Example: 'hello world' starts with 'hello' -> true * @param inputs - The text and what to look for at its start * @returns True when the text begins with it * @group query * @shortname starts with * @drawable false * @example * ```typescript * const starts = bitbybit.text.startsWith({ text: "hello world", search: "hello" }); * ``` */ startsWith(inputs: Inputs.Text.TextSearchDto): boolean; /** * Tells whether a text ends with a search text. * * Example: 'hello world' ends with 'world' -> true * @param inputs - The text and what to look for at its end * @returns True when the text ends with it * @group query * @shortname ends with * @drawable false * @example * ```typescript * const ends = bitbybit.text.endsWith({ text: "hello world", search: "world" }); * ``` */ endsWith(inputs: Inputs.Text.TextSearchDto): boolean; /** * Finds where a search text first occurs, counting characters from 0, or -1 when it does not * occur. * * Example: 'hello world' finding 'world' -> 6 * @param inputs - The text and what to look for * @returns The position of the first occurrence, or -1 * @group query * @shortname index of * @drawable false * @example * ```typescript * const at = bitbybit.text.indexOf({ text: "hello world", search: "world" }); * ``` */ indexOf(inputs: Inputs.Text.TextSearchDto): number; /** * Finds where a search text last occurs, counting characters from 0, or -1 when it does not * occur. * * Example: 'hello world hello' finding 'hello' -> 12 * @param inputs - The text and what to look for * @returns The position of the last occurrence, or -1 * @group query * @shortname last index of * @drawable false * @example * ```typescript * const at = bitbybit.text.lastIndexOf({ text: "hello world hello", search: "hello" }); * ``` */ lastIndexOf(inputs: Inputs.Text.TextSearchDto): number; /** * Takes the characters from a start position up to, but not including, an end position. * * A start larger than the end swaps the two, and negative positions count as 0. * Example: 'hello world' from 0 to 5 -> 'hello' * @param inputs - The text and the start and end positions * @returns The characters in that range * @group transform * @shortname substring * @drawable false * @example * ```typescript * const word = bitbybit.text.substring({ text: "hello world", start: 0, end: 5 }); * ``` */ substring(inputs: Inputs.Text.TextSubstringDto): string; /** * Takes the characters from a start position up to, but not including, an end position. * * Unlike `substring`, a negative position counts from the end of the text. * Example: 'hello world' from 0 to 5 -> 'hello'; from -5 -> 'world' * @param inputs - The text and the start and end positions * @returns The characters in that range * @group transform * @shortname slice * @drawable false * @example * ```typescript * const tail = bitbybit.text.slice({ text: "hello world", start: 6, end: 11 }); * ``` */ slice(inputs: Inputs.Text.TextSubstringDto): string; /** * Reads the character at a position, counting from 0. * * Example: 'hello' at 1 -> 'e' * @param inputs - The text and the position * @returns The character, or an empty text when the position is outside the text * @group query * @shortname char at * @drawable false * @example * ```typescript * const second = bitbybit.text.charAt({ text: "hello", index: 1 }); * ``` */ charAt(inputs: Inputs.Text.TextIndexDto): string; /** * Removes spaces, tabs and line breaks from both ends of a text. * * Example: ' hello ' -> 'hello' * @param inputs - The text * @returns The trimmed text * @group transform * @shortname trim * @drawable false */ trim(inputs: Inputs.Text.TextDto): string; /** * Removes spaces, tabs and line breaks from the start of a text. * * Example: ' hello ' -> 'hello ' * @param inputs - The text * @returns The text without leading whitespace * @group transform * @shortname trim start * @drawable false */ trimStart(inputs: Inputs.Text.TextDto): string; /** * Removes spaces, tabs and line breaks from the end of a text. * * Example: ' hello ' -> ' hello' * @param inputs - The text * @returns The text without trailing whitespace * @group transform * @shortname trim end * @drawable false */ trimEnd(inputs: Inputs.Text.TextDto): string; /** * Adds a filler text in front until the text reaches a length; a text already that long is left * alone. * * Example: 'x' to length 3 with 'a' -> 'aax' * @param inputs - The text, the length to reach and the filler * @returns The padded text * @group transform * @shortname pad start * @drawable false * @example * ```typescript * const padded = bitbybit.text.padStart({ text: "7", length: 3, padString: "0" }); * ``` */ padStart(inputs: Inputs.Text.TextPadDto): string; /** * Adds a filler text behind until the text reaches a length; a text already that long is left * alone. * * Example: 'x' to length 3 with 'a' -> 'xaa' * @param inputs - The text, the length to reach and the filler * @returns The padded text * @group transform * @shortname pad end * @drawable false * @example * ```typescript * const padded = bitbybit.text.padEnd({ text: "x", length: 3, padString: "a" }); * ``` */ padEnd(inputs: Inputs.Text.TextPadDto): string; /** * Turns every letter into a capital. * * Example: 'hello' -> 'HELLO' * @param inputs - The text * @returns The text in capitals * @group transform * @shortname to upper case * @drawable false */ toUpperCase(inputs: Inputs.Text.TextDto): string; /** * Turns every letter into lower case. * * Example: 'HELLO' -> 'hello' * @param inputs - The text * @returns The text in lower case * @group transform * @shortname to lower case * @drawable false */ toLowerCase(inputs: Inputs.Text.TextDto): string; /** * Turns the first character into a capital and leaves the rest as it is. * * Example: 'hello world' -> 'Hello world' * @param inputs - The text * @returns The text with its first character capitalized * @group transform * @shortname capitalize first * @drawable false */ toUpperCaseFirst(inputs: Inputs.Text.TextDto): string; /** * Turns the first character into lower case and leaves the rest as it is. * * Example: 'Hello World' -> 'hello World' * @param inputs - The text * @returns The text with its first character in lower case * @group transform * @shortname uncapitalize first * @drawable false */ toLowerCaseFirst(inputs: Inputs.Text.TextDto): string; /** * Repeats a text a number of times, end to end. * * Example: 'ha' three times -> 'hahaha' * @param inputs - The text and how many times to repeat it * @returns The repeated text * @group transform * @shortname repeat * @drawable false * @example * ```typescript * const laugh = bitbybit.text.repeat({ text: "ha", count: 3 }); * ``` */ repeat(inputs: Inputs.Text.TextRepeatDto): string; /** * Reverses the order of the characters. * * Example: 'hello' -> 'olleh' * @param inputs - The text * @returns The reversed text * @group transform * @shortname reverse * @drawable false */ reverse(inputs: Inputs.Text.TextDto): string; /** * Counts the characters in a text. * * Example: 'hello' -> 5 * @param inputs - The text * @returns The number of characters * @group query * @shortname length * @drawable false */ length(inputs: Inputs.Text.TextDto): number; /** * Tells whether a text is empty or holds only whitespace. * * Example: ' ' -> true, 'a' -> false * @param inputs - The text * @returns True when there is nothing but whitespace * @group query * @shortname is empty * @drawable false */ isEmpty(inputs: Inputs.Text.TextDto): boolean; /** * Joins several texts into one with nothing between them. * * Example: ['hello', ' ', 'world'] -> 'hello world' * @param inputs - The texts to join * @returns The joined text * @group transform * @shortname concat * @drawable false * @example * ```typescript * const sentence = bitbybit.text.concat({ texts: ["hello", " ", "world"] }); * ``` */ concat(inputs: Inputs.Text.TextConcatDto): string; /** * Tells whether a regular expression matches somewhere in a text. * * Example: 'hello123' against '[0-9]+' -> true * @param inputs - The text, the pattern and the flags * @returns True when the pattern matches * @group regex * @shortname test regex * @drawable false * @example * ```typescript * const hasDigits = bitbybit.text.regexTest({ text: "hello123", pattern: "[0-9]+", flags: "" }); * ``` */ regexTest(inputs: Inputs.Text.TextRegexDto): boolean; /** * Finds the parts of a text that a regular expression matches. * * With the `g` flag every match is listed; without it only the first match and its capture * groups. No match gives null. * Example: 'hello123world456' against '[0-9]+' with 'g' -> ['123', '456'] * @param inputs - The text, the pattern and the flags * @returns The matches, or null when there are none * @group regex * @shortname regex match * @drawable false * @example * ```typescript * const numbers = bitbybit.text.regexMatch({ text: "hello123world456", pattern: "[0-9]+", flags: "g" }); * ``` */ regexMatch(inputs: Inputs.Text.TextRegexDto): string[] | null; /** * Replaces what a regular expression matches with another text. * * With the `g` flag every match is replaced; without it only the first. * Example: 'hello123world456' against '[0-9]+' with 'g', replaced by 'X' -> 'helloXworldX' * @param inputs - The text, the pattern, the flags and the replacement * @returns The text with the replacements made * @group regex * @shortname regex replace * @drawable false * @example * ```typescript * const clean = bitbybit.text.regexReplace({ text: "hello123world456", pattern: "[0-9]+", flags: "g", replaceWith: "X" }); * ``` */ regexReplace(inputs: Inputs.Text.TextRegexReplaceDto): string; /** * Finds where a regular expression first matches, counting characters from 0, or -1 when it * does not match. * * Example: 'hello123' against '[0-9]+' -> 5 * @param inputs - The text, the pattern and the flags * @returns The position of the first match, or -1 * @group regex * @shortname regex search * @drawable false * @example * ```typescript * const at = bitbybit.text.regexSearch({ text: "hello123", pattern: "[0-9]+", flags: "" }); * ``` */ regexSearch(inputs: Inputs.Text.TextRegexDto): number; /** * Cuts a text into pieces wherever a regular expression matches; the matches themselves are * dropped. * * Example: 'a1b2c3' split by '[0-9]+' -> ['a', 'b', 'c', ''] * @param inputs - The text, the pattern and the flags * @returns The pieces, in order * @group regex * @shortname regex split * @drawable false * @example * ```typescript * const letters = bitbybit.text.regexSplit({ text: "a1b2c3", pattern: "[0-9]+", flags: "" }); * ``` */ regexSplit(inputs: Inputs.Text.TextRegexDto): string[]; /** * Draws one character as line paths with a simple stroke font. * * The paths lie flat on the XZ plane, scaled so the character is `height` tall, and are * returned with the character's width and height. An unknown character is drawn as a question * mark. * Example: 'A' at height 10 -> the strokes of an A, 10 units tall * @param inputs - The character, its height and its offsets * @returns The character's width, height and stroke paths as lists of points * @group vector * @shortname vector char * @drawable false * @example * ```typescript * const letter = bitbybit.text.vectorChar({ char: "A", height: 10, xOffset: 0, yOffset: 0, extrudeOffset: 0 }); * ``` */ vectorChar(inputs: Inputs.Text.VectorCharDto): Models.Text.VectorCharData; /** * Draws a text, with line breaks, as line paths with a simple stroke font. * * Each line comes back as its characters with their paths, laid out flat on the XZ plane with * the given height, spacing and alignment; `centerOnOrigin` puts the middle of the block at the * origin. * Example: 'Hello' at height 10 -> five characters with their strokes * @param inputs - The text and how to lay it out * @returns One entry per line, each with its characters and their stroke paths * @group vector * @shortname vector text * @drawable false * @example * ```typescript * const lines = bitbybit.text.vectorText({ * text: "Hello\nWorld", * height: 10, * align: Bit.Inputs.Base.horizontalAlignEnum.center, * centerOnOrigin: true, * }); * ``` */ vectorText(inputs: Inputs.Text.VectorTextDto): Models.Text.VectorTextData[]; private vectorParamsChar; private translateLine; } /** * Builds transformation matrices for moving, rotating, scaling and stretching geometry. A * transformation is a 4x4 matrix as 16 numbers in column-major order; most methods return a short * list of them that is applied in order, so a rotation about a point is a move to the origin, the * rotation, and the move back. Angles are in degrees. Apply the result with the transform methods * of `point`, `polyline`, `line` and the kernels. */ declare class Transforms { private readonly vector; private readonly math; constructor(vector: Vector, math: MathBitByBit); /** * Builds a rotation about an axis that passes through a center point. * * The result is three matrices applied in order: move the center to the origin, rotate, move * back. The angle is in degrees; positive turns counter-clockwise when the axis points toward * you. * Example: center [5,0,0], axis [0,1,0], angle 90 -> a quarter turn about the vertical line * through [5,0,0] * @param inputs - The axis direction, the center it passes through and the angle in degrees * @returns The list of matrices to apply in order * @group rotation * @shortname center axis * @drawable false * @example * ```typescript * const turn = bitbybit.transforms.rotationCenterAxis({ center: [5, 0, 0], axis: [0, 1, 0], angle: 90 }); * const points = bitbybit.point.transformPoints({ points: [[10, 0, 0]], transformation: turn }); * ``` */ rotationCenterAxis(inputs: Inputs.Transforms.RotationCenterAxisDto): Base.TransformMatrixes; /** * Builds a rotation about a line parallel to the X axis through a center point. * * The result is three matrices applied in order: move the center to the origin, rotate, move * back. The angle is in degrees; positive turns counter-clockwise when the axis points toward * you. * Example: center [0,0,0], angle 90 -> a quarter turn about the X axis * @param inputs - The center and the angle in degrees * @returns The list of matrices to apply in order * @group rotation * @shortname center x * @drawable false * @example * ```typescript * const turn = bitbybit.transforms.rotationCenterX({ center: [0, 0, 0], angle: 90 }); * ``` */ rotationCenterX(inputs: Inputs.Transforms.RotationCenterDto): Base.TransformMatrixes; /** * Builds a rotation about a line parallel to the Y axis through a center point. * * The result is three matrices applied in order: move the center to the origin, rotate, move * back. The angle is in degrees; positive turns counter-clockwise when the axis points toward * you. * Example: center [0,0,0], angle 90 -> a quarter turn about the Y axis * @param inputs - The center and the angle in degrees * @returns The list of matrices to apply in order * @group rotation * @shortname center y * @drawable false * @example * ```typescript * const turn = bitbybit.transforms.rotationCenterY({ center: [0, 0, 0], angle: 90 }); * ``` */ rotationCenterY(inputs: Inputs.Transforms.RotationCenterDto): Base.TransformMatrixes; /** * Builds a rotation about a line parallel to the Z axis through a center point. * * The result is three matrices applied in order: move the center to the origin, rotate, move * back. The angle is in degrees; positive turns counter-clockwise when the axis points toward * you. * Example: center [0,0,0], angle 90 -> a quarter turn about the Z axis * @param inputs - The center and the angle in degrees * @returns The list of matrices to apply in order * @group rotation * @shortname center z * @drawable false * @example * ```typescript * const turn = bitbybit.transforms.rotationCenterZ({ center: [0, 0, 0], angle: 90 }); * ``` */ rotationCenterZ(inputs: Inputs.Transforms.RotationCenterDto): Base.TransformMatrixes; /** * Builds a rotation from three angles about a center point: yaw turns about Y, pitch about X * and roll about Z. * * The result is three matrices applied in order: move the center to the origin, rotate, move * back. Angles are in degrees. * Example: yaw 90, pitch 0, roll 0 -> a quarter turn about the vertical axis * @param inputs - The yaw, pitch and roll in degrees and the center * @returns The list of matrices to apply in order * @group rotation * @shortname yaw pitch roll * @drawable false * @example * ```typescript * const turn = bitbybit.transforms.rotationCenterYawPitchRoll({ yaw: 90, pitch: 0, roll: 0, center: [0, 0, 0] }); * ``` */ rotationCenterYawPitchRoll(inputs: Inputs.Transforms.RotationCenterYawPitchRollDto): Base.TransformMatrixes; /** * Builds a scale with its own factor per axis, measured from a center point that stays in * place. * * The result is three matrices applied in order: move the center to the origin, scale, move * back. * Example: center [5,5,5], factors [2,1,0.5] -> doubles X, keeps Y, halves Z about [5,5,5] * @param inputs - The center and the factor for each axis * @returns The list of matrices to apply in order * @group scale * @shortname center xyz * @drawable false * @example * ```typescript * const scale = bitbybit.transforms.scaleCenterXYZ({ center: [5, 5, 5], scaleXyz: [2, 1, 0.5] }); * ``` */ scaleCenterXYZ(inputs: Inputs.Transforms.ScaleCenterXYZDto): Base.TransformMatrixes; /** * Builds a scale with its own factor per axis, measured from the origin. * * Example: factors [2,3,1] -> doubles X, triples Y, keeps Z * @param inputs - The factor for each axis * @returns A list with the one scale matrix * @group scale * @shortname xyz * @drawable false * @example * ```typescript * const scale = bitbybit.transforms.scaleXYZ({ scaleXyz: [2, 3, 1] }); * ``` */ scaleXYZ(inputs: Inputs.Transforms.ScaleXYZDto): Base.TransformMatrixes; /** * Builds a stretch along one direction, measured from a center point; distances across that * direction stay as they are. * * The result is three matrices applied in order: move the center to the origin, stretch, move * back. * Example: center [0,0,0], direction [1,0,0], scale 2 -> everything twice as far from the * center along X * @param inputs - The center, the direction and the factor * @returns The list of matrices to apply in order * @group scale * @shortname stretch dir center * @drawable false * @example * ```typescript * const stretch = bitbybit.transforms.stretchDirFromCenter({ center: [0, 0, 0], direction: [1, 0, 0], scale: 2 }); * ``` */ stretchDirFromCenter(inputs: Inputs.Transforms.StretchDirCenterDto): Base.TransformMatrixes; /** * Builds a scale by the same factor on every axis, measured from the origin. * * Example: 2 -> everything twice as big and twice as far from the origin * @param inputs - The factor * @returns A list with the one scale matrix * @group scale * @shortname uniform * @drawable false * @example * ```typescript * const scale = bitbybit.transforms.uniformScale({ scale: 2 }); * ``` */ uniformScale(inputs: Inputs.Transforms.UniformScaleDto): Base.TransformMatrixes; /** * Builds a scale by the same factor on every axis, measured from a center point that stays in * place. * * The result is three matrices applied in order: move the center to the origin, scale, move * back. * Example: center [5,5,5], scale 0.5 -> everything half as big, shrinking toward [5,5,5] * @param inputs - The factor and the center * @returns The list of matrices to apply in order * @group scale * @shortname uniform from center * @drawable false * @example * ```typescript * const scale = bitbybit.transforms.uniformScaleFromCenter({ center: [5, 5, 5], scale: 0.5 }); * ``` */ uniformScaleFromCenter(inputs: Inputs.Transforms.UniformScaleFromCenterDto): Base.TransformMatrixes; /** * Builds a move by a vector. * * Example: [10,5,0] -> 10 along X, 5 along Y, nothing along Z * @param inputs - The vector to move by * @returns A list with the one translation matrix * @group translation * @shortname xyz * @drawable false * @example * ```typescript * const move = bitbybit.transforms.translationXYZ({ translation: [10, 5, 0] }); * ``` */ translationXYZ(inputs: Inputs.Transforms.TranslationXYZDto): Base.TransformMatrixes; /** * Builds one move per vector, for transforming many points each by its own vector. * * Example: [[1,0,0], [0,2,0]] -> two transformations: one along X, one along Y * @param inputs - The vectors to move by * @returns One transformation per vector, in the same order * @group translations * @shortname xyz * @drawable false * @example * ```typescript * const moves = bitbybit.transforms.translationsXYZ({ translations: [[1, 0, 0], [0, 2, 0]] }); * ``` */ translationsXYZ(inputs: Inputs.Transforms.TranslationsXYZDto): Base.TransformMatrixes[]; /** * Gives the matrix that changes nothing, as a starting point or a placeholder. * * Example: [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1] * @returns The identity matrix * @group identity * @shortname identity * @drawable false */ identity(): Base.TransformMatrix; private translation; private scaling; private rotationAxis; private rotationX; private rotationY; private rotationZ; private rotationYawPitchRoll; private rotationMatrixFromQuat; /** * Creates a 4x4 matrix that scales along a given direction vector. * @param direction The direction vector (will be normalized). * @param scale The scale factor along the direction. * @returns A 4x4 column-major transformation matrix. */ private stretchDirection; } /** * Vector maths on plain number arrays. A vector is an array of numbers; in 3D it is `[x, y, z]` * with Y pointing up, the same shape as a point, so the two can be passed to each other's methods. * Every method returns a new array or a number and never changes its inputs. Angles are in degrees. */ declare class Vector { private readonly math; private readonly geometryHelper; constructor(math: MathBitByBit, geometryHelper: GeometryHelper); /** * Removes every repeated vector from a list, keeping the first occurrence of each. * * Two vectors count as the same when every entry differs by less than `tolerance`. * Example: [[1,2,3], [4,5,6], [1,2,3], [7,8,9]] -> [[1,2,3], [4,5,6], [7,8,9]] * @param inputs - Vectors to filter and the tolerance * @returns The vectors without repeats, in their original order * @group remove * @shortname remove all duplicates * @drawable false * @example * ```typescript * const unique = bitbybit.vector.removeAllDuplicateVectors({ * vectors: [[1, 2, 3], [4, 5, 6], [1, 2, 3]], * tolerance: 1e-7, * }); * ``` */ removeAllDuplicateVectors(inputs: Inputs.Vector.RemoveAllDuplicateVectorsDto): number[][]; /** * Removes a vector when it repeats the one right before it; the same vector further away is * kept. * * With `checkFirstAndLast` on, a last vector that repeats the first is dropped too, which * closes a loop of points cleanly. Entries within `tolerance` of each other count as equal. * Example: [[1,2], [1,2], [3,4], [1,2]] -> [[1,2], [3,4], [1,2]] * @param inputs - Vectors to filter, whether to compare the first and last, and the tolerance * @returns The vectors without consecutive repeats * @group remove * @shortname remove consecutive duplicates * @drawable false * @example * ```typescript * const cleaned = bitbybit.vector.removeConsecutiveDuplicateVectors({ * vectors: [[0, 0], [0, 0], [1, 1], [0, 0]], * checkFirstAndLast: true, * tolerance: 1e-7, * }); * ``` */ removeConsecutiveDuplicateVectors(inputs: Inputs.Vector.RemoveConsecutiveDuplicateVectorsDto): number[][]; /** * Tells whether two vectors are the same within a tolerance, entry by entry. * * Vectors of different length are never the same. * Example: [1,2,3] and [1.0001,2.0001,3.0001] with tolerance 0.001 -> true * @param inputs - The two vectors and the tolerance * @returns True when every entry differs by less than the tolerance * @group validate * @shortname vectors the same * @drawable false * @example * ```typescript * const same = bitbybit.vector.vectorsTheSame({ vec1: [1, 2, 3], vec2: [1, 2, 3.0000001], tolerance: 1e-6 }); * ``` */ vectorsTheSame(inputs: Inputs.Vector.VectorsTheSameDto): boolean; /** * Measures the angle between two vectors in degrees, always between 0 and 180. * * The direction of turning is not considered; use `signedAngleBetween` for that. * Example: [1,0,0] and [0,1,0] -> 90 * @param inputs - The two vectors * @returns Angle in degrees * @group angles * @shortname angle * @drawable false * @example * ```typescript * const angle = bitbybit.vector.angleBetween({ first: [1, 0, 0], second: [0, 1, 0] }); * ``` */ angleBetween(inputs: Inputs.Vector.TwoVectorsDto): number; /** * Measures the signed angle from the first 2D vector to the second, in degrees from -180 to * 180. * * Only the first two entries of each vector are used; a positive angle turns counter-clockwise. * Example: [1,0] to [0,1] -> 90, [0,1] to [1,0] -> -90 * @param inputs - The two 2D vectors * @returns Signed angle in degrees * @group angles * @shortname angle normalized 2d * @drawable false * @example * ```typescript * const angle = bitbybit.vector.angleBetweenNormalized2d({ first: [1, 0], second: [0, 1] }); * ``` */ angleBetweenNormalized2d(inputs: Inputs.Vector.TwoVectorsDto): number; /** * Measures the angle from the first vector to the second, turning around a reference direction, * in degrees from 0 to 360. * * The turn is counter-clockwise when the reference vector points toward you. * Example: [1,0,0] to [0,0,-1] around [0,1,0] -> 90 * @param inputs - The two vectors and the reference direction to turn around * @returns Angle in degrees from 0 to 360 * @group angles * @shortname positive angle * @drawable false * @example * ```typescript * const angle = bitbybit.vector.positiveAngleBetween({ first: [1, 0, 0], second: [0, 0, -1], reference: [0, 1, 0] }); * ``` */ positiveAngleBetween(inputs: Inputs.Vector.TwoVectorsReferenceDto): number; /** * Adds a list of vectors together entry by entry into one vector. * * The result has as many entries as the first vector. * Example: [[1,2,3], [4,5,6], [7,8,9]] -> [12,15,18] * @param inputs - Vectors to add * @returns The vector of sums * @group sum * @shortname add all * @drawable false * @example * ```typescript * const total = bitbybit.vector.addAll({ vectors: [[1, 2, 3], [4, 5, 6], [7, 8, 9]] }); * ``` */ addAll(inputs: Inputs.Vector.VectorsDto): number[]; /** * Adds two vectors entry by entry. * * Example: [1,2,3] + [4,5,6] -> [5,7,9] * @param inputs - The two vectors to add * @returns The vector of sums * @group sum * @shortname add * @drawable false * @example * ```typescript * const sum = bitbybit.vector.add({ first: [1, 2, 3], second: [4, 5, 6] }); * ``` */ add(inputs: Inputs.Vector.TwoVectorsDto): number[]; /** * Tells whether every value in a list of booleans is true. * * Example: [true, true, true] -> true, [true, false, true] -> false * @param inputs - The booleans to check * @returns True when no entry is false * @group sum * @shortname all * @drawable false * @example * ```typescript * const allTrue = bitbybit.vector.all({ vector: [true, true, false] }); * ``` */ all(inputs: Inputs.Vector.VectorBoolDto): boolean; /** * Computes the cross product of two 3D vectors: a vector at right angles to both. * * Its direction follows the right-hand rule and its length is the area of the parallelogram the * two vectors span. * Example: [1,0,0] x [0,1,0] -> [0,0,1] * @param inputs - The two 3D vectors * @returns The vector perpendicular to both * @group base * @shortname cross * @drawable false * @example * ```typescript * const normal = bitbybit.vector.cross({ first: [1, 0, 0], second: [0, 1, 0] }); * ``` */ cross(inputs: Inputs.Vector.TwoVectorsDto): number[]; /** * Computes the squared distance between two vectors, which avoids the square root when only * comparing distances. * * Example: [0,0,0] to [3,4,0] -> 25 * @param inputs - The two vectors * @returns The squared distance * @group distance * @shortname dist squared * @drawable false * @example * ```typescript * const d2 = bitbybit.vector.distSquared({ first: [0, 0, 0], second: [3, 4, 0] }); * ``` */ distSquared(inputs: Inputs.Vector.TwoVectorsDto): number; /** * Computes the straight-line distance between two vectors. * * Example: [0,0,0] to [3,4,0] -> 5 * @param inputs - The two vectors * @returns The distance in model units * @group distance * @shortname dist * @drawable false * @example * ```typescript * const distance = bitbybit.vector.dist({ first: [0, 0, 0], second: [3, 4, 0] }); * ``` */ dist(inputs: Inputs.Vector.TwoVectorsDto): number; /** * Divides every entry of a vector by one number. * * Example: [10,20,30] / 2 -> [5,10,15] * @param inputs - The vector and the number to divide by * @returns The divided vector * @group base * @shortname div * @drawable false * @example * ```typescript * const half = bitbybit.vector.div({ vector: [10, 20, 30], scalar: 2 }); * ``` */ div(inputs: Inputs.Vector.VectorScalarDto): number[]; /** * Subtracts the first value of a vector from its last, which for a sorted list is its range. * * Example: [1,3,5,9] -> 8 * @param inputs - The vector * @returns Last value minus first value * @group base * @shortname domain * @drawable false * @example * ```typescript * const span = bitbybit.vector.domain({ vector: [1, 3, 5, 9] }); * ``` */ domain(inputs: Inputs.Vector.VectorDto): number; /** * Computes the dot product of two vectors: the sum of the products of matching entries. * * It is 0 for vectors at right angles and, for unit vectors, the cosine of the angle between * them. * Example: [1,2,3] and [4,5,6] -> 32 * @param inputs - The two vectors * @returns The dot product * @group base * @shortname dot * @drawable false * @example * ```typescript * const projection = bitbybit.vector.dot({ first: [1, 2, 3], second: [4, 5, 6] }); * ``` */ dot(inputs: Inputs.Vector.TwoVectorsDto): number; /** * Marks which entries of a vector are finite numbers. * * Example: [1, 2, Infinity, 3] -> [true, true, false, true] * @param inputs - The vector to check * @returns One boolean per entry, true when it is finite * @group validate * @shortname finite * @drawable false * @example * ```typescript * const flags = bitbybit.vector.finite({ vector: [1, Infinity, 3] }); * ``` */ finite(inputs: Inputs.Vector.VectorDto): boolean[]; /** * Tells whether a vector has no length, that is, every entry is exactly 0. * * Example: [0,0,0] -> true, [0,0,0.001] -> false * @param inputs - The vector to check * @returns True when the length is 0 * @group validate * @shortname isZero * @drawable false * @example * ```typescript * const zero = bitbybit.vector.isZero({ vector: [0, 0, 0] }); * ``` */ isZero(inputs: Inputs.Vector.VectorDto): boolean; /** * Blends two vectors linearly by a fraction. * * `fraction` is the share of `first`: 1 gives `first`, 0 gives `second`, 0.5 the midpoint. * Example: [0,0,0] and [10,10,10] at 0.5 -> [5,5,5] * @param inputs - The two vectors and the fraction of the first * @returns The blended vector * @group distance * @shortname lerp * @drawable false * @example * ```typescript * const mid = bitbybit.vector.lerp({ first: [0, 0, 0], second: [10, 10, 10], fraction: 0.5 }); * ``` */ lerp(inputs: Inputs.Vector.FractionTwoVectorsDto): number[]; /** * Finds the largest value in a vector. * * Example: [3, 7, 2, 9, 1] -> 9 * @param inputs - The vector * @returns The largest entry * @group extract * @shortname max * @drawable false * @example * ```typescript * const largest = bitbybit.vector.max({ vector: [3, 7, 2, 9, 1] }); * ``` */ max(inputs: Inputs.Vector.VectorDto): number; /** * Finds the smallest value in a vector. * * Example: [3, 7, 2, 9, 1] -> 1 * @param inputs - The vector * @returns The smallest entry * @group extract * @shortname min * @drawable false * @example * ```typescript * const smallest = bitbybit.vector.min({ vector: [3, 7, 2, 9, 1] }); * ``` */ min(inputs: Inputs.Vector.VectorDto): number; /** * Multiplies every entry of a vector by one number. * * Example: [2,3,4] x 5 -> [10,15,20] * @param inputs - The vector and the number to multiply by * @returns The scaled vector * @group base * @shortname mul * @drawable false * @example * ```typescript * const scaled = bitbybit.vector.mul({ vector: [2, 3, 4], scalar: 5 }); * ``` */ mul(inputs: Inputs.Vector.VectorScalarDto): number[]; /** * Flips the sign of every entry, so the vector points the opposite way. * * Example: [5,-3,2] -> [-5,3,-2] * @param inputs - The vector to flip * @returns The negated vector * @group base * @shortname neg * @drawable false * @example * ```typescript * const opposite = bitbybit.vector.neg({ vector: [5, -3, 2] }); * ``` */ neg(inputs: Inputs.Vector.VectorDto): number[]; /** * Computes the squared length of a vector, which avoids the square root when only comparing * lengths. * * Example: [3,4,0] -> 25 * @param inputs - The vector * @returns The squared length * @group base * @shortname norm squared * @drawable false * @example * ```typescript * const n2 = bitbybit.vector.normSquared({ vector: [3, 4, 0] }); * ``` */ normSquared(inputs: Inputs.Vector.VectorDto): number; /** * Computes the length of a vector. * * Example: [3,4,0] -> 5, [1,0,0] -> 1 * @param inputs - The vector * @returns The length in model units * @group base * @shortname norm * @drawable false * @example * ```typescript * const len = bitbybit.vector.norm({ vector: [3, 4, 0] }); * ``` */ norm(inputs: Inputs.Vector.VectorDto): number; /** * Scales a 3D vector to length 1 while keeping its direction. * * A vector shorter than 1e-8 has no direction to keep, so the result is undefined. * Example: [3,4,0] -> [0.6,0.8,0] * @param inputs - The 3D vector to normalize * @returns The unit vector, or undefined for a zero-length input * @group base * @shortname normalized * @drawable false * @example * ```typescript * const direction = bitbybit.vector.normalized({ vector: [3, 4, 0] }); * ``` */ normalized(inputs: Inputs.Vector.VectorDto): number[] | undefined; /** * Finds the point at a given distance from a start point along a direction. * * The direction is used as given, so a direction of length 2 travels twice the distance. * Example: start [0,0,0], direction [1,0,0], distance 5 -> [5,0,0] * @param inputs - The start point, the direction and the distance * @returns The point on the ray * @group base * @shortname on ray * @drawable false * @example * ```typescript * const ahead = bitbybit.vector.onRay({ point: [0, 0, 0], vector: [1, 0, 0], distance: 5 }); * ``` */ onRay(inputs: Inputs.Vector.RayPointDto): number[]; /** * Builds a 3D vector from its x, y and z values. * * Example: x=1, y=2, z=3 -> [1,2,3] * @param inputs - The three values * @returns The vector `[x, y, z]` * @group create * @shortname vector XYZ * @drawable true * @example * ```typescript * const up = bitbybit.vector.vectorXYZ({ x: 0, y: 1, z: 0 }); * ``` */ vectorXYZ(inputs: Inputs.Vector.VectorXYZDto): Inputs.Base.Vector3; /** * Builds a 2D vector from its x and y values. * * Example: x=3, y=4 -> [3,4] * @param inputs - The two values * @returns The vector `[x, y]` * @group create * @shortname vector XY * @drawable true * @example * ```typescript * const right = bitbybit.vector.vectorXY({ x: 1, y: 0 }); * ``` */ vectorXY(inputs: Inputs.Vector.VectorXYDto): Inputs.Base.Vector2; /** * Lists the whole numbers from 0 up to, but not including, `max`. * * Example: max=5 -> [0,1,2,3,4] * @param inputs - The end of the range, which is left out * @returns The numbers from 0 to max - 1 * @group create * @shortname range * @drawable false * @example * ```typescript * const indices = bitbybit.vector.range({ max: 5 }); * ``` */ range(inputs: Inputs.Vector.RangeMaxDto): number[]; /** * Measures the angle from the first vector to the second, turning around a reference direction, * in degrees from 0 to 360. * * The turn is counter-clockwise when the reference vector points toward you: a clockwise turn * of 30 degrees reads as 330. * Example: [1,0,0] to [0,0,-1] around [0,1,0] -> 90 * @param inputs - The two vectors and the reference direction to turn around * @returns Angle in degrees from 0 to 360 * @group angles * @shortname signed angle * @drawable false * @example * ```typescript * const angle = bitbybit.vector.signedAngleBetween({ first: [1, 0, 0], second: [0, 0, -1], reference: [0, 1, 0] }); * ``` */ signedAngleBetween(inputs: Inputs.Vector.TwoVectorsReferenceDto): number; /** * Lists the numbers from `min` to `max`, stepping by `step`; `max` is included when a step * lands on it. * * Example: min=0, max=10, step=2 -> [0,2,4,6,8,10] * @param inputs - The start, the end and the step * @returns The numbers in the span * @group create * @shortname span * @drawable false * @example * ```typescript * const values = bitbybit.vector.span({ min: 0, max: 10, step: 2.5 }); * ``` */ span(inputs: Inputs.Vector.SpanDto): number[]; /** * Lists `nrItems` numbers from `min` to `max` spaced by an easing curve, so they bunch up at * one end or both. * * With `intervals` on, the result holds the gaps between neighbors instead of the values * themselves. * Example: min=0, max=100, nrItems=5, ease='easeInQuad' -> [0, 6.25, 25, 56.25, 100] * @param inputs - The start, the end, the number of items, the easing and whether to return the gaps * @returns The eased numbers, or the gaps between them * @group create * @shortname span ease items * @drawable false * @example * ```typescript * const eased = bitbybit.vector.spanEaseItems({ min: 0, max: 100, nrItems: 5, ease: Bit.Inputs.Math.easeEnum.easeInQuad, intervals: false }); * ``` */ spanEaseItems(inputs: Inputs.Vector.SpanEaseItemsDto): number[]; /** * Lists `nrItems` evenly spaced numbers from `min` to `max`, both included. * * Example: min=0, max=10, nrItems=5 -> [0, 2.5, 5, 7.5, 10] * @param inputs - The start, the end and the number of items * @returns The evenly spaced numbers * @group create * @shortname span linear items * @drawable false * @example * ```typescript * const values = bitbybit.vector.spanLinearItems({ min: 0, max: 10, nrItems: 5 }); * ``` */ spanLinearItems(inputs: Inputs.Vector.SpanLinearItemsDto): number[]; /** * Subtracts the second vector from the first, entry by entry. * * Example: [10,20,30] - [1,2,3] -> [9,18,27] * @param inputs - The vector to subtract from and the vector to subtract * @returns The vector of differences * @group base * @shortname sub * @drawable false * @example * ```typescript * const diff = bitbybit.vector.sub({ first: [10, 20, 30], second: [1, 2, 3] }); * ``` */ sub(inputs: Inputs.Vector.TwoVectorsDto): number[]; /** * Adds up all values of a vector into one number. * * Example: [1,2,3,4] -> 10 * @param inputs - The vector to add up * @returns The total * @group base * @shortname sum * @drawable false * @example * ```typescript * const total = bitbybit.vector.sum({ vector: [1, 2, 3, 4] }); * ``` */ sum(inputs: Inputs.Vector.VectorDto): number; /** * Computes the squared length of a 3D vector, which avoids the square root when only comparing * lengths. * * Example: [3,4,0] -> 25 * @param inputs - The 3D vector * @returns The squared length * @group base * @shortname length squared * @drawable false * @example * ```typescript * const l2 = bitbybit.vector.lengthSq({ vector: [3, 4, 0] }); * ``` */ lengthSq(inputs: Inputs.Vector.Vector3Dto): number; /** * Computes the length of a 3D vector. * * Example: [3,4,0] -> 5 * @param inputs - The 3D vector * @returns The length in model units * @group base * @shortname length * @drawable false * @example * ```typescript * const len = bitbybit.vector.length({ vector: [3, 4, 0] }); * ``` */ length(inputs: Inputs.Vector.Vector3Dto): number; /** * Turns a list of number strings into numbers. * * A string that is not a number becomes NaN. * Example: ['1', '2.5', '3'] -> [1, 2.5, 3] * @param inputs - The strings to parse * @returns The numbers * @group create * @shortname parse numbers * @drawable false * @example * ```typescript * const numbers = bitbybit.vector.parseNumbers({ vector: ["1", "2.5", "-3"] }); * ``` */ parseNumbers(inputs: Inputs.Vector.VectorStringDto): number[]; } /** * Files in and out of a script: assets the running application stores under a name, files fetched * from a URL, downloads, and conversions between File, Blob, ArrayBuffer and Uint8Array. The * application supplies the lookups through `assetManager`, so what an asset name resolves to * depends on where the script runs; fetching needs an endpoint that allows cross-origin requests. */ declare class Asset { assetManager: AssetManager; constructor(); /** * Loads a named asset of the running application as a File, through the lookup the application * supplies in `assetManager.getAsset`. * * Which store the name is looked up in depends on the application; a missing asset rejects the * promise. * @param inputs - The asset's file name * @returns The asset as a File * @group get * @shortname cloud file * @example * ```typescript * const file = await bitbybit.asset.getFile({ fileName: "part.step" }); * const shape = await bitbybit.occt.io.loadSTEPorIGES({ assetFile: file, adjustZtoY: true }); * ``` */ getFile(inputs: Inputs.Asset.GetAssetDto): Promise; /** * Loads a named asset of the running application and reads it as text, for JSON, CSV or other * text files stored as assets. * @param inputs - The asset's file name * @returns The asset's content as text * @group get * @shortname text file * @example * ```typescript * const csv = await bitbybit.asset.getTextFile({ fileName: "points.csv" }); * const rows = bitbybit.csv.parseToArray({ csv, rowSeparator: "\n", columnSeparator: "," }); * ``` */ getTextFile(inputs: Inputs.Asset.GetAssetDto): Promise; /** * Loads a named local asset, one kept in the browser rather than on a server, through the * lookup the application supplies in `assetManager.getLocalAsset`. * * A name that resolves to several files gives a list. * @param inputs - The asset's file name * @returns The asset as a File, or a list of Files when the name holds several * @group get * @shortname local file * @example * ```typescript * const file = await bitbybit.asset.getLocalFile({ fileName: "part.step" }); * ``` */ getLocalFile(inputs: Inputs.Asset.GetAssetDto): Promise; /** * Loads a named local asset, one kept in the browser rather than on a server, and reads it as * text; a name that resolves to several files gives a list of texts. * @param inputs - The asset's file name * @returns The content as text, or a list of texts when the name holds several files * @group get * @shortname local text file * @example * ```typescript * const text = await bitbybit.asset.getLocalTextFile({ fileName: "settings.json" }); * ``` */ getLocalTextFile(inputs: Inputs.Asset.GetAssetDto): Promise; /** * Downloads the content at a URL as a Blob, raw bytes without a file name; the server must * allow cross-origin requests. * @param inputs - The URL to fetch * @returns The response body as a Blob * @group fetch * @shortname fetch blob * @example * ```typescript * const blob = await bitbybit.asset.fetchBlob({ url: "https://example.com/models/part.glb" }); * ``` */ fetchBlob(inputs: Inputs.Asset.FetchDto): Promise; /** * Downloads the content at a URL as a File named after the last part of the URL, without its * query string; the server must allow cross-origin requests. * @param inputs - The URL to fetch * @returns The response body as a File * @group fetch * @shortname fetch file * @example * ```typescript * const file = await bitbybit.asset.fetchFile({ url: "https://example.com/models/part.step" }); * const shape = await bitbybit.occt.io.loadSTEPorIGES({ assetFile: file, adjustZtoY: true }); * ``` */ fetchFile(inputs: Inputs.Asset.FetchDto): Promise; /** * Downloads the content at a URL and parses it as JSON; the server must allow cross-origin * requests and the body must be valid JSON. * @param inputs - The URL to fetch * @returns The parsed JSON value * @group fetch * @shortname fetch json * @example * ```typescript * const settings = await bitbybit.asset.fetchJSON({ url: "https://example.com/data/settings.json" }); * ``` */ fetchJSON(inputs: Inputs.Asset.FetchDto): Promise; /** * Downloads the content at a URL as plain text; the server must allow cross-origin requests. * @param inputs - The URL to fetch * @returns The response body as text * @group fetch * @shortname fetch text * @example * ```typescript * const csv = await bitbybit.asset.fetchText({ url: "https://example.com/data/points.csv" }); * ``` */ fetchText(inputs: Inputs.Asset.FetchDto): Promise; /** * Makes a temporary URL for a File or Blob held in memory, so it can be handed to anything that * loads from a URL, such as a texture or a model loader. * * The URL lives as long as the page does. * @param inputs - The File or Blob * @returns The temporary URL * @group create * @shortname object url * @example * ```typescript * const url = bitbybit.asset.createObjectURL({ file }); * ``` */ createObjectURL(inputs: Inputs.Asset.FileDto): string; /** * Makes a temporary URL for each File or Blob in a list, in the same order, as * `createObjectURL` does for one. * @param inputs - The Files or Blobs * @returns One temporary URL per file, in the same order * @group create * @shortname object urls * @example * ```typescript * const urls = bitbybit.asset.createObjectURLs({ files: [fileA, fileB] }); * ``` */ createObjectURLs(inputs: Inputs.Asset.FilesDto): string[]; /** * Starts a browser download of the given content as a file named `fileName` plus the * `extension`. * * Text content is wrapped in a Blob of the `contentType`; a Blob is downloaded as it is. * @param inputs - The file name, the content, the extension and the content type * @group download * @shortname download file * @example * ```typescript * bitbybit.asset.download({ fileName: "points", content: "x,y,z\n1,2,3", extension: "csv", contentType: "text/csv" }); * ``` */ download(inputs: Inputs.Asset.DownloadDto): void; /** * Reads all the bytes of a File or Blob into an ArrayBuffer, the form binary loaders and the * STEP converters take. * @param inputs - The File or Blob to read * @returns The bytes as an ArrayBuffer * @group convert * @shortname to array buffer * @example * ```typescript * const buffer = await bitbybit.asset.toArrayBuffer({ file }); * ``` */ toArrayBuffer(inputs: Inputs.Asset.FileDto): Promise; /** * Reads all the bytes of a File or Blob into a Uint8Array, a byte array that can be indexed and * sliced. * @param inputs - The File or Blob to read * @returns The bytes as a Uint8Array * @group convert * @shortname to uint8 array * @example * ```typescript * const bytes = await bitbybit.asset.toUint8Array({ file }); * ``` */ toUint8Array(inputs: Inputs.Asset.FileDto): Promise; /** * Wraps a Blob in a File with a name and a MIME type, which loaders that want a file name need; * the Blob's own type is kept when `mimeType` is left out. * @param inputs - The Blob, the file name and the optional MIME type * @returns The File * @group convert * @shortname blob to file * @example * ```typescript * const file = bitbybit.asset.blobToFile({ blob, fileName: "part.step", mimeType: "application/step" }); * ``` */ blobToFile(inputs: Inputs.Asset.BlobToFileDto): File; /** * Copies the bytes of a File into a plain Blob of the same type, dropping the name; a Blob * given in comes back as a copy. * @param inputs - The File or Blob to copy * @returns The Blob * @group convert * @shortname file to blob * @example * ```typescript * const blob = bitbybit.asset.fileToBlob({ file }); * ``` */ fileToBlob(inputs: Inputs.Asset.FileDto): Blob; /** * Views the bytes of an ArrayBuffer as a Uint8Array; no bytes are copied, both share the same * memory. * @param inputs - The ArrayBuffer to view * @returns The Uint8Array over the same bytes * @group convert * @shortname array buffer to uint8 array * @example * ```typescript * const bytes = bitbybit.asset.arrayBufferToUint8Array({ arrayBuffer }); * ``` */ arrayBufferToUint8Array(inputs: Inputs.Asset.ArrayBufferToUint8ArrayDto): Uint8Array; /** * Copies exactly the bytes a Uint8Array covers into a new ArrayBuffer, so a view over part of a * larger buffer gives only its own part. * @param inputs - The Uint8Array to copy * @returns The new ArrayBuffer * @group convert * @shortname uint8 array to array buffer * @example * ```typescript * const buffer = bitbybit.asset.uint8ArrayToArrayBuffer({ uint8Array: bytes }); * ``` */ uint8ArrayToArrayBuffer(inputs: Inputs.Asset.Uint8ArrayToArrayBufferDto): ArrayBuffer; } /** * Shared result and helper types used across the core API - the small structural types that are * neither parameters nor kernel shapes, but the plain data passed between them. */ declare namespace BaseTypes { /** * Interval represents an object that has two properties - min and max. */ class IntervalDto { /** * Minimum value of the interval */ min: number; /** * Maximum value of the interval */ max: number; } /** * UV usually represents 2D coordinates on 3D or 2D surfaces. It is similar to XY coordinates in planes. */ class UVDto { /** * U coordinate of the surface */ u: number; /** * V coordinate of the surface */ v: number; } /** * Intersection result of curve curve */ class CurveCurveIntersection { /** * Point of intersection on the first curve */ point0: number[]; /** * Point of intersection on the second curve */ point1: number[]; /** * Parameter of intersection on the first curve */ u0: number; /** * Parameter of intersection on the second curve */ u1: number; } /** * Intersection result of curve and surface */ class CurveSurfaceIntersection { /** * Parameter of intersection on the curve */ u: number; /** * UV Parameters of intersection on the surface */ uv: UVDto; /** * Point of intersection on the curve */ curvePoint: number[]; /** * Point of intersection on the surface */ surfacePoint: number[]; } /** * Intersection point between two surfaces */ class SurfaceSurfaceIntersectionPoint { /** * UV parameters of intersection on first surface */ uv0: UVDto; /** * UV parameters of intersection on second surface */ uv1: UVDto; /** * Point of intersection */ point: number[]; /** * Distance */ dist: number; } } /** * Reading and writing CSV, the plain-text table format with one row per line and a separator * between cells. The parsers split on `rowSeparator` and `columnSeparator`, honor double-quoted * cells with doubled quotes inside, skip blank lines and read `\n`, `\t` and `\r` written as two * characters as the real thing; the writers quote a cell that contains a separator, a quote or a * line break. */ declare class CSVBitByBit { /** * Splits CSV text into a list of rows, each a list of cell strings; nothing is converted to * numbers. * * Blank lines are skipped, cells are trimmed with their line, and a double-quoted cell may * contain the separator and doubled quotes. Example: `a,b,c` and `1,2,3` on two lines -> * `[["a", "b", "c"], ["1", "2", "3"]]`. * @param inputs - The CSV text and the two separators * @returns The rows as lists of cell strings * @group parse * @shortname parse to array * @drawable false * @example * ```typescript * const rows = bitbybit.csv.parseToArray({ csv: "x,y,z\n1,2,3\n4,5,6", rowSeparator: "\n", columnSeparator: "," }); * ``` */ parseToArray(inputs: Inputs.CSV.ParseToArrayDto): string[][]; /** * Turns CSV text into a list of objects, one per data row, keyed by the header names of row * `headerRow`. * * Rows start at `dataStartRow`, columns named in `numberColumns` become numbers and a missing * cell becomes an empty string. Example: `name,age` then `John,30` -> `[{ name: "John", age: * "30" }]`. * @param inputs - The CSV text, the header and data row indexes, the separators and the number columns * @returns One object per data row * @group parse * @shortname parse to json * @drawable false * @example * ```typescript * const people = bitbybit.csv.parseToJson({ csv: "name,age\nJohn,30\nJane,25", headerRow: 0, dataStartRow: 1, rowSeparator: "\n", columnSeparator: ",", numberColumns: ["age"] }); * ``` */ parseToJson>(inputs: Inputs.CSV.ParseToJsonDto): T[]; /** * Turns CSV text into a list of objects keyed by the `headers` you give, for files without a * header line; a header line the file does have is skipped by setting `dataStartRow` past it. * * Columns named in `numberColumns` become numbers. Example: `John,30` with headers `["name", * "age"]` -> `[{ name: "John", age: "30" }]`. * @param inputs - The CSV text, the header names, the data start row, the separators and the number columns * @returns One object per data row * @group parse * @shortname parse to json with headers * @drawable false * @example * ```typescript * const people = bitbybit.csv.parseToJsonWithHeaders({ csv: "John,30\nJane,25", headers: ["name", "age"], dataStartRow: 0, rowSeparator: "\n", columnSeparator: ",", numberColumns: ["age"] }); * ``` */ parseToJsonWithHeaders>(inputs: Inputs.CSV.ParseToJsonWithHeadersDto): T[]; /** * Lists every value of one column, found by its header name, in row order; a row without that * cell gives an empty string. * * With `asNumber` true the values are parsed as numbers. Example: `name,age` then `John,30` and * `Jane,25`, column `name` -> `["John", "Jane"]`. * @param inputs - The CSV text, the column name, the header and data row indexes, the separators and the number flag * @returns The column's values, top to bottom * @group query * @shortname query column * @drawable false * @example * ```typescript * const ages = bitbybit.csv.queryColumn({ csv: "name,age\nJohn,30\nJane,25", column: "age", headerRow: 0, dataStartRow: 1, rowSeparator: "\n", columnSeparator: ",", asNumber: true }); * ``` */ queryColumn(inputs: Inputs.CSV.QueryColumnDto): (string | number)[]; /** * Keeps only the rows whose cell in `column` equals `value`, giving them as objects keyed by * the headers. * * The comparison is on text unless the column is listed in `numberColumns`, in which case both * sides are compared as numbers. Example: column `age`, value `30` -> `[{ name: "John", age: * "30" }]`. * @param inputs - The CSV text, the column name, the value, the row indexes, the separators and the number columns * @returns The matching rows as objects * @group query * @shortname query rows by value * @drawable false * @example * ```typescript * const thirty = bitbybit.csv.queryRowsByValue({ csv: "name,age\nJohn,30\nJane,25", column: "age", value: "30", headerRow: 0, dataStartRow: 1, rowSeparator: "\n", columnSeparator: "," }); * ``` */ queryRowsByValue>(inputs: Inputs.CSV.QueryRowsByValueDto): T[]; /** * Writes a list of rows, each a list of cells, as CSV text; a cell holding a separator, a quote * or a line break is wrapped in double quotes. * * Example: `[["name", "age"], ["John", "30"]]` -> `name,age` and `John,30` on two lines. * @param inputs - The rows and the two separators * @returns The CSV text * @group generate * @shortname array to csv * @drawable false * @example * ```typescript * const csv = bitbybit.csv.arrayToCsv({ array: [["x", "y", "z"], [1, 2, 3]], rowSeparator: "\n", columnSeparator: "," }); * ``` */ arrayToCsv(inputs: Inputs.CSV.ArrayToCsvDto): string; /** * Writes a list of objects as CSV text with the columns you name in `headers`, in that order; a * property an object lacks becomes an empty cell. * * With `includeHeaders` true the first line holds the header names. Example: `[{ name: "John", * age: "30" }]` with headers `["name", "age"]` -> `name,age` and `John,30`. * @param inputs - The objects, the column names, the header flag and the separators * @returns The CSV text * @group generate * @shortname json to csv * @drawable false * @example * ```typescript * const csv = bitbybit.csv.jsonToCsv({ json: people, headers: ["name", "age"], includeHeaders: true, rowSeparator: "\n", columnSeparator: "," }); * ``` */ jsonToCsv>(inputs: Inputs.CSV.JsonToCsvDto): string; /** * Writes a list of objects as CSV text using the property names of the first object as the * columns, in their order; an empty list gives empty text. * * Example: `[{ name: "John", age: "30" }]` -> `name,age` and `John,30`. * @param inputs - The objects, the header flag and the separators * @returns The CSV text * @group generate * @shortname json to csv auto * @drawable false * @example * ```typescript * const csv = bitbybit.csv.jsonToCsvAuto({ json: people, includeHeaders: true, rowSeparator: "\n", columnSeparator: "," }); * ``` */ jsonToCsvAuto>(inputs: Inputs.CSV.JsonToCsvAutoDto): string; /** * Reads the cells of row `headerRow` as the header names; a row index past the end throws an * error. * * Example: `name,age` then `John,30` -> `["name", "age"]`. * @param inputs - The CSV text, the header row index and the separators * @returns The header names in column order * @group query * @shortname get headers * @drawable false * @example * ```typescript * const headers = bitbybit.csv.getHeaders({ csv: "name,age\nJohn,30", headerRow: 0, rowSeparator: "\n", columnSeparator: "," }); * ``` */ getHeaders(inputs: Inputs.CSV.GetHeadersDto): string[]; /** * Counts the data rows: all non-blank lines minus the ones before `dataStartRow`, or minus one * header line when `hasHeaders` is true and `dataStartRow` is left out. * * Example: `name,age`, `John,30`, `Jane,25` with headers -> 2. * @param inputs - The CSV text, the header flag, the optional data start row and the separators * @returns The number of data rows * @group query * @shortname row count * @drawable false * @example * ```typescript * const count = bitbybit.csv.getRowCount({ csv: "name,age\nJohn,30\nJane,25", hasHeaders: true, rowSeparator: "\n", columnSeparator: "," }); * ``` */ getRowCount(inputs: Inputs.CSV.GetRowCountDto): number; /** * Counts the cells of the first non-blank row, which is the number of columns; empty text gives * 0. * * Example: `name,age,city` then `John,30,NYC` -> 3. * @param inputs - The CSV text and the two separators * @returns The number of columns * @group query * @shortname column count * @drawable false * @example * ```typescript * const columns = bitbybit.csv.getColumnCount({ csv: "name,age,city\nJohn,30,NYC", rowSeparator: "\n", columnSeparator: "," }); * ``` */ getColumnCount(inputs: Inputs.CSV.ParseToArrayDto): number; private parseCsvLine; private escapeCsvCell; /** * Converts literal escape sequence strings to their actual characters. * For example, converts "\\n" (two characters) to "\n" (newline character). */ private convertEscapeSequences; } /** * Reading and changing values inside JSON data. A path such as `$.parts[0].name` follows the * JSONPath syntax: `$` is the root, `.name` steps into a property, `[0]` into a list entry and * `..name` searches at any depth. The methods here query, set and list by path, work on single * properties and preview data through the application; every change comes back as a changed copy, * the input stays as it is. */ declare class JSONBitByBit { private readonly context; /** * Turns any JSON-compatible value into its JSON text, on one line without indentation, as * `JSON.stringify` does. * @param inputs - The value to write as text * @returns The JSON text * @group transform * @shortname stringify * @drawable false * @example * ```typescript * const text = bitbybit.json.stringify({ json: { width: 10, points: [[0, 0, 0], [1, 1, 1]] } }); * ``` */ stringify(inputs: Inputs.JSON.StringifyDto): string; /** * Turns JSON text into the value it describes, as `JSON.parse` does; text that is not valid * JSON throws an error. * @param inputs - The JSON text * @returns The parsed value * @group transform * @shortname parse * @drawable false * @example * ```typescript * const points = bitbybit.json.parse({ text: "[[0, 0, 0], [1, 1, 1]]" }); * ``` */ parse(inputs: Inputs.JSON.ParseDto): any; /** * Finds every value in the JSON that a JSONPath expression matches and gives them as a list, * even when there is only one. * * `$.parts[*].name` lists all part names and `$..radius` every radius at any depth; JSONPath * filters in square brackets narrow the matches by a condition. * @param inputs - The JSON and the JSONPath expression * @returns The matching values as a list * @group jsonpath * @shortname query * @drawable false * @example * ```typescript * const names = bitbybit.json.query({ json: model, query: "$.parts[*].name" }); * ``` */ query(inputs: Inputs.JSON.QueryDto): any; /** * Sets one top-level property of a JSON object to a value, giving a changed copy; the input * stays as it is and a property that did not exist is added. * @param inputs - The JSON object, the property name and the value * @returns The changed copy * @group props * @shortname set value on property * @drawable false * @example * ```typescript * const updated = bitbybit.json.setValueOnProp({ json: settings, property: "width", value: 20 }); * ``` */ setValueOnProp(inputs: Inputs.JSON.SetValueOnPropDto): any; /** * Finds the first object in a list whose property equals the given value, comparing with strict * equality, and gives it back; nothing matching gives undefined. * * For anything beyond one property, use `query` with a filter. * @param inputs - The list of objects, the property name and the value to match * @returns The first matching object, or undefined * @group props * @shortname get json from array by prop match * @drawable false * @example * ```typescript * const part = bitbybit.json.getJsonFromArrayByFirstPropMatch({ jsonArray: parts, property: "name", match: "lid" }); * ``` */ getJsonFromArrayByFirstPropMatch(inputs: Inputs.JSON.GetJsonFromArrayByFirstPropMatchDto): any; /** * Reads one top-level property of a JSON object; a missing property gives undefined. * @param inputs - The JSON object and the property name * @returns The property's value * @group props * @shortname get value on property * @drawable false * @example * ```typescript * const width = bitbybit.json.getValueOnProp({ json: settings, property: "width" }); * ``` */ getValueOnProp(inputs: Inputs.JSON.GetValueOnPropDto): any; /** * Sets property `prop` to `value` on every object a JSONPath expression reaches, giving a * changed copy of the JSON. * * `path` points at the parent objects, `prop` names the property on them: `path: "$.parts[*]", * prop: "visible"` changes every part. A value that is not an object throws an error. * @param inputs - The JSON, the path to the parent objects, the property name and the value * @returns The changed copy * @group jsonpath * @shortname set value on path * @drawable false * @example * ```typescript * const hidden = bitbybit.json.setValue({ json: model, path: "$.parts[*]", prop: "visible", value: false }); * ``` */ setValue(inputs: Inputs.JSON.SetValueDto): any; /** * Applies several `setValue` changes in one go: entry `i` of `paths`, `props` and `values` is * one change, applied in order to a copy of the JSON. * @param inputs - The JSON and the matching lists of paths, property names and values * @returns The changed copy * @group jsonpath * @shortname set values on paths * @drawable false * @example * ```typescript * const updated = bitbybit.json.setValuesOnPaths({ json: model, paths: ["$", "$.parts[0]"], props: ["name", "visible"], values: ["Assembly", false] }); * ``` */ setValuesOnPaths(inputs: Inputs.JSON.SetValuesOnPathsDto): any; /** * Lists the paths of every value a JSONPath expression matches, each as a full path from the * root such as `$['parts'][0]['name']`, instead of the values themselves. * @param inputs - The JSON and the JSONPath expression * @returns The paths of the matches, as a list of strings * @group jsonpath * @shortname paths * @drawable false * @example * ```typescript * const where = bitbybit.json.paths({ json: model, query: "$..radius" }); * ``` */ paths(inputs: Inputs.JSON.PathsDto): any; /** * Gives a new empty object with no properties, a starting point for `setValueOnProp` and * `setValue`. * @returns An empty object * @group create * @shortname empty * @drawable false * @example * ```typescript * const settings = bitbybit.json.createEmpty(); * const withWidth = bitbybit.json.setValueOnProp({ json: settings, property: "width", value: 10 }); * ``` */ createEmpty(): any; /** * Hands the JSON to the running application to show it and offer to save it as a file; the * application decides how the preview looks, and nothing happens when the value is empty. * @param inputs - The JSON to show * @returns Nothing * @group preview * @shortname json preview and save * @drawable false * @example * ```typescript * bitbybit.json.previewAndSaveJson({ json: model }); * ``` */ previewAndSaveJson(inputs: Inputs.JSON.JsonDto): void; /** * Hands the JSON to the running application to show it; the application decides how the preview * looks, and nothing happens when the value is empty. * @param inputs - The JSON to show * @returns Nothing * @group preview * @shortname json preview * @drawable false * @example * ```typescript * bitbybit.json.previewJson({ json: model }); * ``` */ previewJson(inputs: Inputs.JSON.JsonDto): void; } /** * Reading and writing CAD files with OCCT: everything `io` offers on the kernel, plus loaders that * take a STEP or IGES file as a File object or as its text and give back a shape. Files are Z-up by * convention, so `adjustZtoY` turns the loaded shape to this library's Y-up unless it is set false. */ declare class OCCTWIO extends OCCTIO { readonly occWorkerManager: OCCTWorkerManager; private readonly context; /** * Reads a STEP or IGES file, given as a File, into one shape. * * The file's extension decides the kind: `.step`, `.stp` are STEP, `.iges`, `.igs` are IGES. * `adjustZtoY` turns the file's Z-up into Y-up. A file that cannot be read gives undefined. * @param inputs - The file and the axis adjustment * @returns The loaded shape * @group io * @shortname load step | iges * @example * ```typescript * const file = await bitbybit.asset.getFile({ fileName: "part.step" }); * const shape = await bitbybit.occt.io.loadSTEPorIGES({ assetFile: file, adjustZtoY: true }); * await bitbybit.draw.drawAnyAsync({ entity: shape }); * ``` */ loadSTEPorIGES(inputs: Inputs.OCCT.ImportStepIgesDto): Promise; /** * Reads a STEP or IGES file, given as its text, into one shape; `fileType` says which of the * two formats the text is in. * * `adjustZtoY` turns the file's Z-up into Y-up. Text that cannot be read gives undefined. * @param inputs - The file text, its format and the axis adjustment * @returns The loaded shape * @group io * @shortname load text step | iges * @example * ```typescript * const text = await bitbybit.asset.fetchText({ url: "https://example.com/models/part.step" }); * const shape = await bitbybit.occt.io.loadSTEPorIGESFromText({ text, fileType: Bit.Inputs.OCCT.fileTypeEnum.step, adjustZtoY: true }); * ``` */ loadSTEPorIGESFromText(inputs: Inputs.OCCT.ImportStepIgesFromTextDto): Promise; } /** * The OpenCascade (OCCT) API as reached from a script: every method of the `occt` kernel, * asynchronous, with the shapes living in the kernel and passed around as references, plus `io` * loaders that read STEP and IGES files handed in as a File or as text. The service classes are * documented on the kernel's own `OCCTService`. */ declare class OCCTW extends OCCT { readonly context: ContextBase; readonly occWorkerManager: OCCTWorkerManager; readonly io: OCCTWIO; } /** * Text labels pinned to 3D positions: a tag is an HTML text element placed over the canvas at the * screen position of a point in the scene, and it follows that point as the camera moves. Tags are * for showing names, measurements or other data next to geometry. `drawTag` and `drawTags` create * the elements and register them for updating; `create` only builds the description. */ declare class Tag { private readonly context; /** * Builds a tag description from its text, position, color, size and depth behavior, without * drawing it; `drawTag` or `drawTags` put it on screen. * @param inputs - The text, the position, the color, the size and the depth behavior * @returns The tag description, a new object * @example * ```typescript * const tag = bitbybit.tag.create({ text: "Lid", position: [0, 10, 0], colour: "#ffffff", size: 14, adaptDepth: true }); * ``` */ create(inputs: Inputs.Tag.TagDto): Inputs.Tag.TagDto; /** * Puts one tag on screen as a text element pinned to its 3D position, and keeps it following * that position. * * With `updatable` true and a `tagVariable` from an earlier draw, that tag is changed in place * instead of a new one being added. * @param inputs - The tag, whether it may be updated later and the earlier tag to update * @returns The drawn tag, carrying the id that identifies it * @ignore true * @example * ```typescript * const tag = bitbybit.tag.create({ text: "Lid", position: [0, 10, 0], colour: "#ffffff", size: 14, adaptDepth: false }); * const drawn = bitbybit.tag.drawTag({ tag, updatable: false }); * ``` */ drawTag(inputs: Inputs.Tag.DrawTagDto): Inputs.Tag.TagDto; /** * Puts several tags on screen, each a text element pinned to its 3D position. * * With `updatable` true and a `tagsVariable` from an earlier draw, the earlier tags are changed * in place: extra tags are added, and tags no longer in the list are removed. * @param inputs - The tags, whether they may be updated later and the earlier tags to update * @returns The drawn tags, each carrying the id that identifies it * @ignore true * @example * ```typescript * const tags = points.map((position, i) => bitbybit.tag.create({ text: "P" + i, position, colour: "#ffffff", size: 12, adaptDepth: false })); * const drawn = bitbybit.tag.drawTags({ tags, updatable: false }); * ``` */ drawTags(inputs: Inputs.Tag.DrawTagsDto): Inputs.Tag.TagDto[]; } /** * Hooks into the frame loop of the scene: a function registered here runs once per rendered frame * and receives the milliseconds elapsed since the previous frame, which is how animations and * interactions that change over time are driven. */ declare class Time { private context; /** * Registers a function to run on every rendered frame, for animation; it receives the * milliseconds elapsed since the previous frame, so movement can be scaled by it. * * The function stays registered until the scene is reset. * @param update - The function to call each frame with the milliseconds since the previous one * @example * ```typescript * let angle = 0; * bitbybit.time.registerRenderFunction((timePassedMs) => { * angle += timePassedMs * 0.001; * mesh.rotation.y = angle; * }); * ``` */ registerRenderFunction(update: (timePassedMs: number) => void): void; } /** * Contains various methods for nurbs circle. * These methods wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbCurveCircle { private readonly context; private readonly math; /** * Creates the circle Nurbs curve * @param inputs Circle parameters * @returns Circle Nurbs curve */ createCircle(inputs: Inputs.Verb.CircleParametersDto): any; /** * Creates the arc Nurbs curve * @param inputs Arc parameters * @returns Arc Nurbs curve */ createArc(inputs: Inputs.Verb.ArcParametersDto): any; /** * Gets the center point of the circle or an arc * @param inputs An arc or a circle Nurbs curve * @returns Point */ center(inputs: Inputs.Verb.CircleDto): number[]; /** * Gets the radius of the circle or an arc * @param inputs An arc or a circle Nurbs curve * @returns Radius */ radius(inputs: Inputs.Verb.CircleDto): number; /** * Gets the max angle of the arc in degrees * @param inputs Arc * @returns Max angle in degrees */ maxAngle(inputs: Inputs.Verb.CircleDto): number; /** * Gets the min angle of the arc in degrees * @param inputs Arc * @returns Min angle in degrees */ minAngle(inputs: Inputs.Verb.CircleDto): number; /** * Gets the x angle of the arc * @param inputs Circle * @returns X axis vector */ xAxis(inputs: Inputs.Verb.CircleDto): number[]; /** * Gets the y angle of the arc * @param inputs Circle * @returns Y axis vector */ yAxis(inputs: Inputs.Verb.CircleDto): number[]; } /** * Contains various methods for nurbs ellipse. * These methods wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbCurveEllipse { private readonly context; private readonly math; /** * Creates the ellipse Nurbs curve * @param inputs Ellipse parameters * @returns Ellipse Nurbs curve */ createEllipse(inputs: Inputs.Verb.EllipseParametersDto): any; /** * Creates the ellipse arc Nurbs curve * @param inputs Ellipse arc parameters * @returns Ellipse arc Nurbs curve */ createArc(inputs: Inputs.Verb.EllipseArcParametersDto): any; /** * Gets the center point of the ellipse or an arc * @param inputs The arc or the ellipse Nurbs curve * @returns Point */ center(inputs: Inputs.Verb.EllipseDto): number[]; /** * Gets the max angle of the arc in degrees * @param inputs Arc * @returns Max angle in degrees */ maxAngle(inputs: Inputs.Verb.EllipseDto): number; /** * Gets the min angle of the arc in degrees * @param inputs Arc * @returns Min angle in degrees */ minAngle(inputs: Inputs.Verb.EllipseDto): number; /** * Gets the x angle of the arc or an ellipse * @param inputs Ellipse or an arc * @returns X axis vector */ xAxis(inputs: Inputs.Verb.EllipseDto): number[]; /** * Gets the y angle of the arc or an ellipse * @param inputs Ellipse or an arc * @returns Y axis vector */ yAxis(inputs: Inputs.Verb.EllipseDto): number[]; } /** * Contains various methods for nurbs curves. * These methods wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbCurve { private readonly context; private readonly geometryHelper; private readonly math; readonly circle: VerbCurveCircle; readonly ellipse: VerbCurveEllipse; /** * Creates a Nurbs curve by providing knots, control points & weights * @param inputs Contains knots, control points and weights * @returns Nurbs curve */ createCurveByKnotsControlPointsWeights(inputs: Inputs.Verb.CurveNurbsDataDto): any; /** * Creates a Nurbs curve by providing control points * @param inputs Control points * @returns Nurbs curve */ createCurveByPoints(inputs: Inputs.Verb.CurvePathDataDto): any; /** * Converts lines to NURBS curves * Returns array of the verbnurbs Line objects * @param inputs Lines to be transformed to curves * @returns Verb nurbs curves */ convertLinesToNurbsCurves(inputs: Inputs.Verb.LinesDto): any[]; /** * Converts line to NURBS curve * Returns the verbnurbs Line object * @param inputs Line to be transformed to curve * @returns Verb nurbs curves */ convertLineToNurbsCurve(inputs: Inputs.Verb.LineDto): any; /** * Converts a polyline to a NURBS curve * Returns the verbnurbs NurbsCurve object * @param inputs Polyline to be transformed to curve * @returns Verb nurbs curve */ convertPolylineToNurbsCurve(inputs: Inputs.Verb.PolylineDto): any; /** * Converts a polylines to a NURBS curves * Returns the verbnurbs NurbsCurve objects * @param inputs Polylines to be transformed to curves * @returns Verb nurbs curves */ convertPolylinesToNurbsCurves(inputs: Inputs.Verb.PolylinesDto): any[]; /** * Creates a Bezier Nurbs curve by providing control points and weights * @param inputs Control points * @returns Bezier Nurbs curve */ createBezierCurve(inputs: Inputs.Verb.BezierCurveDto): any; /** * Clone the Nurbs curve * @param inputs Nurbs curve * @returns Nurbs curve */ clone(inputs: Inputs.Verb.CurveDto): any; /** * Finds the closest param on the Nurbs curve from the point * @param inputs Nurbs curve with point * @returns Param number */ closestParam(inputs: Inputs.Verb.ClosestPointDto): number; /** * Finds the closest params on the Nurbs curve from the points * @param inputs Nurbs curve with points * @returns Param numbers */ closestParams(inputs: Inputs.Verb.ClosestPointsDto): number[]; /** * Finds the closest point on the Nurbs curve from the point * @param inputs Nurbs curve with point * @returns Point */ closestPoint(inputs: Inputs.Verb.ClosestPointDto): Inputs.Base.Point3; /** * Finds the closest points on the Nurbs curve from the list of points * @param inputs Nurbs curve with points * @returns Points */ closestPoints(inputs: Inputs.Verb.ClosestPointsDto): Inputs.Base.Point3[]; /** * Finds the control points of the Nurbs curve * @param inputs Nurbs curve * @returns Points */ controlPoints(inputs: Inputs.Verb.CurveDto): Inputs.Base.Point3[]; /** * Finds the degree of the Nurbs curve * @param inputs Nurbs curve * @returns Degree number */ degree(inputs: Inputs.Verb.CurveDto): number; /** * Finds the derivatives of the Nurbs curve at parameter * @param inputs Nurbs curve with specified derivative number and parameter * @returns Derivatives */ derivatives(inputs: Inputs.Verb.CurveDerivativesDto): number[]; /** * Divides the curve by equal arc length to parameters * @param inputs Nurbs curve * @returns Parameters */ divideByEqualArcLengthToParams(inputs: Inputs.Verb.CurveSubdivisionsDto): number[]; /** * Divides the curve by equal arc length to points * @param inputs Nurbs curve * @returns Points */ divideByEqualArcLengthToPoints(inputs: Inputs.Verb.CurveSubdivisionsDto): Inputs.Base.Point3[]; /** * Divides the curve by arc length to parameters * @param inputs Nurbs curve * @returns Parameters */ divideByArcLengthToParams(inputs: Inputs.Verb.CurveDivideLengthDto): number[]; /** * Divides the curve by arc length to points * @param inputs Nurbs curve * @returns Points */ divideByArcLengthToPoints(inputs: Inputs.Verb.CurveDivideLengthDto): Inputs.Base.Point3[]; /** * Divides multiple curves by equal arc length to points * @param inputs Nurbs curves * @returns Points placed for each curve in separate arrays */ divideCurvesByEqualArcLengthToPoints(inputs: Inputs.Verb.CurvesSubdivisionsDto): Inputs.Base.Point3[][]; /** * Divides multiple curves by arc length to points * @param inputs Nurbs curves * @returns Points placed for each curve in separate arrays */ divideCurvesByArcLengthToPoints(inputs: Inputs.Verb.CurvesDivideLengthDto): Inputs.Base.Point3[][]; /** * Finds the domain interval of the curve parameters * @param inputs Nurbs curve * @returns Interval domain */ domain(inputs: Inputs.Verb.CurveDto): BaseTypes.IntervalDto; /** * Start point of the curve * @param inputs Nurbs curve * @returns Start point */ startPoint(inputs: Inputs.Verb.CurveDto): Inputs.Base.Point3; /** * End point of the curve * @param inputs Nurbs curve * @returns End point */ endPoint(inputs: Inputs.Verb.CurveDto): Inputs.Base.Point3; /** * Start points of the curves * @param inputs Nurbs curves * @returns Start points */ startPoints(inputs: Inputs.Verb.CurvesDto): Inputs.Base.Point3[]; /** * End points of the curves * @param inputs Nurbs curves * @returns End points */ endPoints(inputs: Inputs.Verb.CurvesDto): Inputs.Base.Point3[]; /** * Finds the knots of the Nurbs curve * @param inputs Nurbs curve * @returns Knots */ knots(inputs: Inputs.Verb.CurveDto): number[]; /** * Gets the length of the Nurbs curve at specific parameter * @param inputs Nurbs curve and parameter * @returns Length */ lengthAtParam(inputs: Inputs.Verb.CurveParameterDto): number; /** * Gets the length of the Nurbs curve * @param inputs Nurbs curve * @returns Length */ length(inputs: Inputs.Verb.CurveDto): number; /** * Gets the param at specified length on the Nurbs curve * @param inputs Nurbs curve, length and tolerance * @returns Parameter */ paramAtLength(inputs: Inputs.Verb.CurveLengthToleranceDto): number; /** * Gets the point at specified parameter on the Nurbs curve * @param inputs Nurbs curve and a parameter * @returns Point */ pointAtParam(inputs: Inputs.Verb.CurveParameterDto): Inputs.Base.Point3; /** * Gets the points at specified parameter on the Nurbs curves * @param inputs Nurbs curves and a parameter * @returns Points in arrays for each curve */ pointsAtParam(inputs: Inputs.Verb.CurvesParameterDto): Inputs.Base.Point3[]; /** * Reverses the Nurbs curve * @param inputs Nurbs curve * @returns Reversed Nurbs curve */ reverse(inputs: Inputs.Verb.CurveDto): any; /** * Splits the Nurbs curve in two at a given parameter * @param inputs Nurbs curve with parameter * @returns Nurbs curves */ split(inputs: Inputs.Verb.CurveParameterDto): any[]; /** * Tangent of the Nurbs curve at a given parameter * @param inputs Nurbs curve with parameter * @returns Tangent vector */ tangent(inputs: Inputs.Verb.CurveParameterDto): Inputs.Base.Vector3; /** * Tessellates the Nurbs curve into a list of points * @param inputs Nurbs curve with tolerance * @returns Points */ tessellate(inputs: Inputs.Verb.CurveToleranceDto): Inputs.Base.Point3[]; /** * Transforms the Nurbs curve * @param inputs Nurbs curve with transformation matrixes * @returns Transformed curve */ transform(inputs: Inputs.Verb.CurveTransformDto): any; /** * Transforms the Nurbs curves * @param inputs Nurbs curves with transformation matrixes * @returns Transformed curves */ transformCurves(inputs: Inputs.Verb.CurvesTransformDto): any[]; /** * Weights of the Nurbs curve * @param inputs Nurbs curve * @returns Weights */ weights(inputs: Inputs.Verb.CurveDto): number[]; } /** * Functions that allow to intersect various geometric entities and get the results * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbIntersect { private readonly context; /** * Intersects two verb Nurbs curves together and returns intersection results * @param inputs Two Nurbs curves * @returns Intersection results */ curves(inputs: Inputs.Verb.CurveCurveDto): BaseTypes.CurveCurveIntersection[]; /** * Intersects curve and surface * @param inputs Nurbs curve and a Nurbs surface * @returns Intersection results */ curveAndSurface(inputs: Inputs.Verb.CurveSurfaceDto): BaseTypes.CurveSurfaceIntersection[]; /** * Intersects two surfaces * @param inputs Nurbs curve and a Nurbs surface * @returns Nurbs curves along the intersection */ surfaces(inputs: Inputs.Verb.SurfaceSurfaceDto): any[]; /** * Gets intersection parameters on the first curve from curve-curve intersection * @param inputs Intersections data * @returns Parameters on first curve */ curveCurveFirstParams(inputs: Inputs.Verb.CurveCurveIntersectionsDto): number[]; /** * Gets intersection parameters on the second curve from curve-curve intersection * @param inputs Intersections data * @returns Parameters on second curve */ curveCurveSecondParams(inputs: Inputs.Verb.CurveCurveIntersectionsDto): number[]; /** * Gets intersection points on the first curve from curve-curve intersection * @param inputs Intersections data * @returns Points on first curve */ curveCurveFirstPoints(inputs: Inputs.Verb.CurveCurveIntersectionsDto): number[][]; /** * Gets intersection points on the second curve from curve-curve intersection * @param inputs Intersections data * @returns Points on second curve */ curveCurveSecondPoints(inputs: Inputs.Verb.CurveCurveIntersectionsDto): number[][]; /** * Gets intersection parameters on the curve from curve-surface intersection * @param inputs Intersections data * @returns Parameters on the curve */ curveSurfaceCurveParams(inputs: Inputs.Verb.CurveSurfaceIntersectionsDto): number[]; /** * Gets intersection parameters on the surface from curve-surface intersection * @param inputs Intersections data * @returns Parameters on the surface */ curveSurfaceSurfaceParams(inputs: Inputs.Verb.CurveSurfaceIntersectionsDto): BaseTypes.UVDto[]; /** * Gets intersection points on the curve from curve-surface intersection * @param inputs Intersections data * @returns Points on the curve */ curveSurfaceCurvePoints(inputs: Inputs.Verb.CurveSurfaceIntersectionsDto): number[][]; /** * Gets intersection points on the surface from curve-surface intersection * @param inputs Intersections data * @returns Points on the surface */ curveSurfaceSurfacePoints(inputs: Inputs.Verb.CurveSurfaceIntersectionsDto): number[][]; } /** * Conical surface functions. * These functions wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbSurfaceConical { private readonly context; /** * Creates the conical Nurbs surface * @param inputs Parameters for Nurbs conical surface * @returns Conical Nurbs surface */ create(inputs: Inputs.Verb.ConeAndCylinderParametersDto): any; /** * Get cone axis * @param inputs Nurbs conical surface * @returns Axis vector */ axis(inputs: Inputs.Verb.ConeDto): number[]; /** * Get cone base * @param inputs Nurbs conical surface * @returns Base point */ base(inputs: Inputs.Verb.ConeDto): number[]; /** * Get cone height * @param inputs Nurbs conical surface * @returns Height */ height(inputs: Inputs.Verb.ConeDto): number; /** * Get cone radius * @param inputs Nurbs conical surface * @returns Radius */ radius(inputs: Inputs.Verb.ConeDto): number; /** * Get cone x axis * @param inputs Nurbs conical surface * @returns X axis vector */ xAxis(inputs: Inputs.Verb.ConeDto): number[]; } /** * Cylindrical surface functions. * These functions wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbSurfaceCylindrical { private readonly context; /** * Creates the cylindrical Nurbs surface * @param inputs Parameters for cylindrical Nurbs surface * @returns Cylindrical Nurbs surface */ create(inputs: Inputs.Verb.ConeAndCylinderParametersDto): any; /** * Get cylinder axis * @param inputs Nurbs cylindrical surface * @returns Axis vector */ axis(inputs: Inputs.Verb.CylinderDto): number[]; /** * Get cylinder base * @param inputs Nurbs cylindrical surface * @returns Base point */ base(inputs: Inputs.Verb.CylinderDto): number[]; /** * Get cylinder height * @param inputs Nurbs cylindrical surface * @returns Height */ height(inputs: Inputs.Verb.CylinderDto): number; /** * Get cylinder radius * @param inputs Nurbs cylindrical surface * @returns Radius */ radius(inputs: Inputs.Verb.CylinderDto): number; /** * Get cylinder x axis * @param inputs Nurbs cylindrical surface * @returns X axis vector */ xAxis(inputs: Inputs.Verb.CylinderDto): number[]; } /** * Extrusion surface functions. * These functions wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbSurfaceExtrusion { private readonly context; /** * Creates the Nurbs surface extrusion from the curve * @param inputs Nurbs profile curve and direction vector * @returns Nurbs surface */ create(inputs: Inputs.Verb.ExtrusionParametersDto): any; /** * Gets the direction vector of the extrusion * @param inputs Extruded Nurbs surface * @returns Vector */ direction(inputs: Inputs.Verb.ExtrusionDto): number[]; /** * Gets the profile Nurbs curve of the extrusion * @param inputs Extruded Nurbs surface * @returns Profile Nurbs curve */ profile(inputs: Inputs.Verb.ExtrusionDto): number[]; } /** * Revolved surface functions. * These functions wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbSurfaceRevolved { private readonly context; private readonly math; /** * Creates the revolved Nurbs surface * @param inputs Parameters for Nurbs revolved surface * @returns Revolved Nurbs surface */ create(inputs: Inputs.Verb.RevolutionParametersDto): any; /** * Get the profile Nurbs curve of the revolved Nurbs surface * @param inputs Revolved Nurbs surface * @returns Nurbs curve */ profile(inputs: Inputs.Verb.RevolutionDto): any; /** * Get the center Nurbs curve of the revolved Nurbs surface * @param inputs Revolved Nurbs surface * @returns Center point */ center(inputs: Inputs.Verb.RevolutionDto): number[]; /** * Get the rotation axis of the revolved Nurbs surface * @param inputs Revolved Nurbs surface * @returns Axis vector of rotation */ axis(inputs: Inputs.Verb.RevolutionDto): number[]; /** * Get the angle of rotation from revolved Nurbs surface * @param inputs Revolved Nurbs surface * @returns Angle in degrees */ angle(inputs: Inputs.Verb.RevolutionDto): number; } /** * Spherical surface functions. * These functions wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbSurfaceSpherical { private readonly context; /** * Creates the spherical Nurbs surface * @param inputs Parameters for Nurbs spherical surface * @returns Spherical Nurbs surface */ create(inputs: Inputs.Verb.SphericalParametersDto): any; /** * Get the radius of the spherical Nurbs surface * @param inputs Spherical Nurbs surface * @returns Radius */ radius(inputs: Inputs.Verb.SphereDto): number; /** * Get the center of the spherical Nurbs surface * @param inputs Spherical Nurbs surface * @returns Center point */ center(inputs: Inputs.Verb.SphereDto): number[]; } /** * Sweep surface functions. * These functions wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbSurfaceSweep { private readonly context; /** * Creates the sweep Nurbs surface * @param inputs Parameters for Nurbs sweep surface * @returns Sweep Nurbs surface */ create(inputs: Inputs.Verb.SweepParametersDto): any; /** * Get the profile Nurbs curve of the swept Nurbs surface * @param inputs Sweep Nurbs surface * @returns Profile Nurbs curve */ profile(inputs: Inputs.Verb.SweepDto): any; /** * Get the rail Nurbs curve of the swept Nurbs surface * @param inputs Sweep Nurbs surface * @returns Rail Nurbs curve */ rail(inputs: Inputs.Verb.SweepDto): any; } /** * Contains various functions for Nurbs surfaces. * These functions wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class VerbSurface { private readonly context; private readonly geometryHelper; readonly cone: VerbSurfaceConical; readonly cylinder: VerbSurfaceCylindrical; readonly extrusion: VerbSurfaceExtrusion; readonly sphere: VerbSurfaceSpherical; readonly revolved: VerbSurfaceRevolved; readonly sweep: VerbSurfaceSweep; /** * Gets the boundary edge Nurbs curves of the surface in a list * @param inputs Nurbs surface * @returns Array of curves */ boundaries(inputs: Inputs.Verb.SurfaceDto): any[]; /** * Creates the surface by providing 4 points as corners * @param inputs 4 points * @returns Nurbs surface */ createSurfaceByCorners(inputs: Inputs.Verb.CornersDto): any; /** * Creates the Nurbs surface by providing uv knots, uv degrees, points and weights * @param inputs Surface creation information * @returns Nurbs surface */ createSurfaceByKnotsControlPointsWeights(inputs: Inputs.Verb.KnotsControlPointsWeightsDto): any; /** * Creates the Nurbs surface by lofting curves * @param inputs Curves to loft through * @returns Nurbs surface */ createSurfaceByLoftingCurves(inputs: Inputs.Verb.LoftCurvesDto): any; /** * Clone the Nurbs surface * @param inputs Nurbs surface * @returns Nurbs surface */ clone(inputs: Inputs.Verb.SurfaceDto): any; /** * Finds the closest parameter on the surface from the point * @param inputs Nurbs surface with a point * @returns UV parameters */ closestParam(inputs: Inputs.Verb.SurfaceParamDto): BaseTypes.UVDto; /** * Finds the closest point on the surface from the point * @param inputs Nurbs surface with a point * @returns Point */ closestPoint(inputs: Inputs.Verb.SurfaceParamDto): number[]; /** * Gets the control points on the surface * @param inputs Nurbs surface * @returns Two dimensional array of points */ controlPoints(inputs: Inputs.Verb.SurfaceDto): number[][][]; /** * Gets the U degree of the surface * @param inputs Nurbs surface * @returns U degree */ degreeU(inputs: Inputs.Verb.SurfaceDto): number; /** * Gets the V degree of the surface * @param inputs Nurbs surface * @returns V degree */ degreeV(inputs: Inputs.Verb.SurfaceDto): number; /** * Gets the derivatives of the surface at specified uv coordinate * @param inputs Nurbs surface * @returns Two dimensional array of vectors */ derivatives(inputs: Inputs.Verb.DerivativesDto): number[][][]; /** * Gets the U domain of the surface * @param inputs Nurbs surface * @returns U domain as interval */ domainU(inputs: Inputs.Verb.SurfaceDto): BaseTypes.IntervalDto; /** * Gets the V domain of the surface * @param inputs Nurbs surface * @returns V domain as interval */ domainV(inputs: Inputs.Verb.SurfaceDto): BaseTypes.IntervalDto; /** * Gets the Nurbs isocurve on the surface * @param inputs Nurbs surface * @returns Nurbs curve */ isocurve(inputs: Inputs.Verb.SurfaceParameterDto): any; /** * Subdivides surface into preferred number of isocurves * @param inputs Nurbs surface * @returns Nurbs curves */ isocurvesSubdivision(inputs: Inputs.Verb.IsocurveSubdivisionDto): any[]; /** * Subdivides surface into isocurves on specified array of parameters * @param inputs Nurbs surface * @returns Nurbs curves */ isocurvesAtParams(inputs: Inputs.Verb.IsocurvesParametersDto): any[]; /** * Gets the U knots of the surface * @param inputs Nurbs surface * @returns Knots on u direction */ knotsU(inputs: Inputs.Verb.SurfaceDto): number[]; /** * Gets the V knots of the surface * @param inputs Nurbs surface * @returns Knots on v direction */ knotsV(inputs: Inputs.Verb.SurfaceDto): number[]; /** * Gets the normal on the surface at uv coordinate * @param inputs Nurbs surface * @returns Normal vector */ normal(inputs: Inputs.Verb.SurfaceLocationDto): number[]; /** * Gets the point on the surface at uv coordinate * @param inputs Nurbs surface * @returns Point */ point(inputs: Inputs.Verb.SurfaceLocationDto): number[]; /** * Reverse the Nurbs surface. This will reverse the UV origin and isocurve directions * @param inputs Nurbs surface * @returns Nurbs surface */ reverse(inputs: Inputs.Verb.SurfaceDto): any; /** * Splits the Nurbs surface in two halfs. * @param inputs Nurbs surface * @returns Two Nurbs surfaces */ split(inputs: Inputs.Verb.SurfaceParameterDto): any[]; /** * Transforms the Nurbs surface with a given list of transformations. * @param inputs Nurbs surface with transforms * @returns Nurbs surface */ transformSurface(inputs: Inputs.Verb.SurfaceTransformDto): any; /** * Gets the weights of the surface * @param inputs Nurbs surface * @returns Two dimensional array of weights */ weights(inputs: Inputs.Verb.SurfaceDto): number[][]; } /** * Contains various functions for Nurbs curves and surfaces. * These functions wrap around Verbnurbs library that you can find here http://verbnurbs.com/. * Thanks Peter Boyer for his work. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ declare class Verb { private readonly math; readonly curve: VerbCurve; readonly surface: VerbSurface; readonly intersect: VerbIntersect; } /** * The entry point to the advanced tools: dimensions, camera navigation, surface patterns and 3D * text. Each of these composes several kernel operations into one call, so look here before * assembling the same behaviour from primitives. */ declare class AdvancedAdv { private readonly occWorkerManager; private readonly context; private readonly draw; text3d: Text3D; patterns: Patterns; navigation: Navigation; dimensions: Dimensions; } declare class Dimensions { private readonly context; constructor(context: ContextComplete); /** * Creates linear dimension - a measurement line between two points with extension lines and text label. * The dimension shows the distance between the points and can be styled with DimensionStyleDto. * @example * ```typescript * const length = bitbybit.advanced.dimensions.linearDimension({ * name: "Length", startPoint: [0, 0, 0], endPoint: [5, 0, 0], direction: [0, 1, 0], * }); * ``` * @param inputs * @returns Create linear dimension * @group dimensions * @shortname linear dimension * @drawable true */ linearDimension(inputs: Advanced.Dimensions.LinearDimensionDto): Advanced.Dimensions.LinearDimensionEntity; /** * Creates angular dimension - a measurement arc between two direction vectors with extension lines and text label. * The dimension shows the angle between the directions and can be styled with DimensionStyleDto. * @example * ```typescript * const angle = bitbybit.advanced.dimensions.angularDimension({ * name: "Angle", centerPoint: [0, 0, 0], direction1: [1, 0, 0], direction2: [0, 1, 0], radius: 2, * }); * ``` * @param inputs * @returns Create angular dimension * @group dimensions * @shortname angular dimension * @drawable true */ angularDimension(inputs: Advanced.Dimensions.AngularDimensionDto): Advanced.Dimensions.AngularDimensionEntity; /** * Creates radial dimension - a measurement line from center to perimeter showing radius or diameter. * Shows 'R' prefix for radius or '⌀' prefix for diameter with optional center mark. * @example * ```typescript * const radius = bitbybit.advanced.dimensions.radialDimension({ * centerPoint: [0, 0, 0], radiusPoint: [2, 0, 0], showDiameter: false, * }); * ``` * @param inputs * @returns Create radial dimension * @group dimensions * @shortname radial dimension * @drawable true */ radialDimension(inputs: Advanced.Dimensions.RadialDimensionDto): Advanced.Dimensions.RadialDimensionEntity; /** * Creates diametral dimension - a measurement line spanning full diameter of circular features. * Shows '⌀' prefix with optional center mark and arrows at both ends. * @example * ```typescript * const diameter = bitbybit.advanced.dimensions.diametralDimension({ * centerPoint: [0, 0, 0], direction: [1, 0, 0], diameter: 4, * }); * ``` * @param inputs * @returns Create diametral dimension * @group dimensions * @shortname diametral dimension * @drawable true */ diametralDimension(inputs: Advanced.Dimensions.DiametralDimensionDto): Advanced.Dimensions.DiametralDimensionEntity; /** * Creates ordinate dimension - shows X, Y, or Z coordinate from a reference point with leader line. * Useful for coordinate annotations and datum referencing in technical drawings. * @example * ```typescript * const ordinate = bitbybit.advanced.dimensions.ordinateDimension({ * measurementPoint: [5, 3, 2], referencePoint: [0, 0, 0], axis: Bit.Advanced.Dimensions.ordinateAxisEnum.x, * }); * ``` * @param inputs * @returns Create ordinate dimension * @group dimensions * @shortname ordinate dimension * @drawable true */ ordinateDimension(inputs: Advanced.Dimensions.OrdinateDimensionDto): Advanced.Dimensions.OrdinateDimensionEntity; /** * Create dimension style - used to style dimension lines, arrows, and text in 3D space. * You can customize line colors, thickness, text size, arrow size, and background colors. * @param inputs * @returns Create dimension style * @group style * @shortname dimension style * @drawable false */ dimensionStyle(inputs: Advanced.Dimensions.DimensionStyleDto): Advanced.Dimensions.DimensionStyleDto; /** * Draw linear dimension in 3D space * @param inputs * @returns Draw linear dimension with dispose method * @group linear dimension * @shortname draw linear dimension * @drawable false * @ignore true */ drawLinearDimension(inputs: Advanced.Dimensions.LinearDimensionEntity): { dispose: () => void; }; /** * Draw angular dimension in 3D space * @param inputs * @returns Draw angular dimension with dispose method * @group angular dimension * @shortname draw angular dimension * @drawable false * @ignore true */ drawAngularDimension(inputs: Advanced.Dimensions.AngularDimensionEntity): { dispose: () => void; }; /** * Draw radial dimension in 3D space * @param inputs * @returns Draw radial dimension with dispose method * @group radial dimension * @shortname draw radial dimension * @drawable false * @ignore true */ drawRadialDimension(inputs: Advanced.Dimensions.RadialDimensionEntity): { dispose: () => void; }; /** * Draw diametral dimension in 3D space * @param inputs * @returns Draw diametral dimension with dispose method * @group diametral dimension * @shortname draw diametral dimension * @drawable false * @ignore true */ drawDiametralDimension(inputs: Advanced.Dimensions.DiametralDimensionEntity): { dispose: () => void; }; /** * Draw ordinate dimension in 3D space * @param inputs * @returns Draw ordinate dimension with dispose method * @group ordinate dimension * @shortname draw ordinate dimension * @drawable false * @ignore true */ drawOrdinateDimension(inputs: Advanced.Dimensions.OrdinateDimensionEntity): { dispose: () => void; }; } /** * An angular dimension: the angle between two directions about a centre, drawn as an arc with a * leader and a label. Configure the arc radius, the label offset, decimal places, suffix and * whether the value reads in degrees or radians. */ declare class AngularDimension { private scene; private data; private style; private arc; private extensionLine1; private extensionLine2; private tangentExtension1; private tangentExtension2; private arrow1; private arrow2; private dimensionText3D; private static readonly DEFAULT_STYLE; constructor(options: AngularDimensionDto, scene: BABYLON.Scene); private createDimension; private createArc; private createArrowTailExtensions; private createLine; private createArrow; private createText; dispose(): void; } /** * A diametral dimension: the diameter of a circle or a cylindrical face, drawn across the full * width with a label. Use it where a radial dimension would be ambiguous - holes are conventionally * dimensioned by diameter. */ declare class DiametralDimension { private scene; private data; private style; private diameterLine; private centerMark; private arrow1; private arrow2; private dimensionText3D; constructor(options: DiametralDimensionDto, scene: BABYLON.Scene); private create; private createLine; private createCenterMark; private createArrow; private createText; dispose(): void; } /** * Service for evaluating mathematical expressions in dimension labels. * Supports basic arithmetic operations and template string replacement. */ declare class DimensionExpressionService { /** * Evaluates a mathematical expression or template string with a given value * @param expression The expression to evaluate (can contain 'val' placeholder) * @param value The numeric value to substitute for 'val' * @param decimalPlaces Number of decimal places to format the result * @param removeTrailingZeros Whether to remove trailing zeros from the result * @returns The evaluated expression as a formatted string */ static evaluate(expression: string, value: number, decimalPlaces: number, removeTrailingZeros?: boolean): string; /** * Formats dimension text with prefix, suffix, and expression evaluation * @param value The numeric value to display * @param labelOverwrite Optional expression to evaluate instead of raw value * @param decimalPlaces Number of decimal places for formatting * @param labelSuffix Suffix to append to the text * @param removeTrailingZeros Whether to remove trailing zeros from the result * @param prefix Optional prefix to prepend to the text * @returns Formatted dimension text */ static formatDimensionText(value: number, labelOverwrite: string | undefined, decimalPlaces: number, labelSuffix: string, removeTrailingZeros?: boolean, prefix?: string): string; /** * Formats linear dimension text */ static formatLinearText(distance: number, labelOverwrite: string | undefined, decimalPlaces: number, labelSuffix: string, removeTrailingZeros?: boolean): string; /** * Formats angular dimension text */ static formatAngularText(angle: number, labelOverwrite: string | undefined, decimalPlaces: number, labelSuffix: string, removeTrailingZeros?: boolean): string; /** * Formats radial dimension text */ static formatRadialText(radius: number, showDiameter: boolean, labelOverwrite: string | undefined, decimalPlaces: number, labelSuffix: string, removeTrailingZeros?: boolean): string; /** * Formats diametral dimension text */ static formatDiametralText(diameter: number, labelOverwrite: string | undefined, decimalPlaces: number, labelSuffix: string, removeTrailingZeros?: boolean): string; /** * Formats ordinate dimension text */ static formatOrdinateText(coordinate: number, axisName: string, labelOverwrite: string | undefined, decimalPlaces: number, labelSuffix: string, removeTrailingZeros?: boolean): string; } /** * Creation and lifetime of dimension annotations in a scene: adding linear, angular, radial, * diametral and ordinate dimensions, restyling them, and removing them again. Dimensions are scene * objects rather than static geometry, so they stay legible as the camera moves. */ declare class DimensionManager { private linearDimensions; private angularDimensions; private radialDimensions; private diametralDimensions; private ordinateDimensions; addLinearDimension(dimension: LinearDimension): void; removeLinearDimension(dimension: LinearDimension): void; addAngularDimension(dimension: AngularDimension): void; removeAngularDimension(dimension: AngularDimension): void; addRadialDimension(dimension: RadialDimension): void; removeRadialDimension(dimension: RadialDimension): void; addDiametralDimension(dimension: DiametralDimension): void; removeDiametralDimension(dimension: DiametralDimension): void; addOrdinateDimension(dimension: OrdinateDimension): void; removeOrdinateDimension(dimension: OrdinateDimension): void; clearAllDimensions(): void; dispose(): void; } /** * Interface for GUI text creation result */ interface GuiTextElements { textAnchor: BABYLON.TransformNode; textContainer: GUI.Rectangle; textBlock: GUI.TextBlock; } /** * Service for creating shared 3D and GUI rendering elements used across all dimension types. * Eliminates code duplication by providing common mesh and text creation functionality. */ declare class DimensionRenderingService { /** * Creates a line mesh using tube geometry with consistent styling * @param scene The Babylon scene * @param points Array of Vector3 points defining the line path * @param name Name for the mesh * @param style Dimension style containing appearance settings * @param dimensionType Type of dimension for metadata * @returns The created line mesh */ static createLine(scene: BABYLON.Scene, points: BABYLON.Vector3[], name: string, style: DimensionStyleDto, dimensionType: string): BABYLON.Mesh; /** * Creates an arrow mesh (cone) with consistent styling * @param scene The Babylon scene * @param position Position for the arrow * @param direction Direction the arrow should point * @param name Name for the mesh * @param style Dimension style containing appearance settings * @param dimensionType Type of dimension for metadata * @returns The created arrow mesh */ static createArrow(scene: BABYLON.Scene, position: BABYLON.Vector3, direction: BABYLON.Vector3, name: string, style: DimensionStyleDto, dimensionType: string): BABYLON.Mesh; /** * Creates a 3D text mesh using DimensionText3D * @param scene The Babylon scene * @param text The text content * @param position Position for the text * @param style Dimension style containing appearance settings * @returns The created DimensionText3D instance */ static create3DText(scene: BABYLON.Scene, text: string, position: BABYLON.Vector3, style: DimensionStyleDto): DimensionText3D; /** * Creates GUI text elements (anchor, container, text block) with consistent styling * @param scene The Babylon scene * @param adt Advanced Dynamic Texture for GUI * @param text The text content * @param position Position for the text anchor * @param style Dimension style containing appearance settings * @param dimensionType Type of dimension for unique IDs * @returns Object containing the created GUI elements */ static createGuiText(scene: BABYLON.Scene, adt: GUI.AdvancedDynamicTexture, text: string, position: BABYLON.Vector3, style: DimensionStyleDto): GuiTextElements; /** * Creates a center mark (crossing lines) for radial/diametral dimensions * @param scene The Babylon scene * @param center Center position for the mark * @param style Dimension style containing appearance settings * @param dimensionType Type of dimension for metadata * @returns The merged center mark mesh */ static createCenterMark(scene: BABYLON.Scene, center: BABYLON.Vector3, style: DimensionStyleDto, dimensionType: string): BABYLON.Mesh; } /** * Manages shared services and utilities for all dimension classes. * Provides singleton pattern for occlusion services and shared utilities. */ declare class DimensionServiceManager { private static idCounter; /** * Generates unique IDs for dimensions using a counter-based approach */ static generateId(type: string): string; /** * Creates Vector3 from array efficiently */ static createVector3FromArray(arr: [ number, number, number ]): BABYLON.Vector3; /** * Creates a fresh material for dimension elements * No caching to avoid issues with disposed materials and external scene cleanup */ static getDimensionMaterial(scene: BABYLON.Scene, color: string, materialType?: "line" | "arrow"): BABYLON.StandardMaterial; } /** * Options for the 3D text used inside dimension annotations: the font, size, alignment and * thickness of a label. Dimension text is real geometry rather than a screen overlay, so it needs * the same settings any other 3D text does. */ interface Text3DOptions { text: string; position: BABYLON.Vector3; size?: number; fontWeight?: number; color?: string; backgroundColor?: string; backgroundOpacity?: number; backgroundStroke?: boolean; backgroundStrokeThickness?: number; backgroundRadius?: number; stableSize?: boolean; billboardMode?: boolean; alwaysOnTop?: boolean; name?: string; } /** * Helper class for creating 3D text labels that properly participate in depth testing * and rendering within the 3D scene. */ declare class DimensionText3D { private scene; private textMesh; private material; private dynamicTexture; private options; constructor(scene: BABYLON.Scene, options: Text3DOptions); private createTextMesh; private setupDistanceScaling; private measureText; /** * Update the text content */ updateText(newText: string): void; /** * Update the position of the text mesh */ updatePosition(position: BABYLON.Vector3): void; /** * Get the text mesh for further manipulation */ getMesh(): BABYLON.Mesh | null; /** * Dispose all resources */ dispose(): void; } /** * A linear dimension: the distance between two points, drawn as a dimension line with extension * lines, arrowheads and a label. The most common annotation on any drawing. */ declare class LinearDimension { private scene; private data; private style; private dimensionLine; private extensionLine1; private extensionLine2; private arrow1; private arrow2; private arrowTail1; private arrowTail2; private dimensionText3D; private static readonly DEFAULT_STYLE; constructor(options: LinearDimensionDto, scene: BABYLON.Scene); private createDimension; private createLine; private createArrow; private createText; dispose(): void; } /** * An ordinate dimension: the distance from a single reference point along one axis, labelled with * a leader. Machining drawings prefer these to chained linear dimensions because every measurement * references the same datum, so tolerances do not accumulate. */ declare class OrdinateDimension { private scene; private data; private style; private leaderLine; private arrow; private dimensionText3D; constructor(options: OrdinateDimensionDto, scene: BABYLON.Scene); private create; private calculateOffsetDirection; private createLine; private createArrow; private createText; dispose(): void; } /** * A radial dimension: the radius of an arc or a circle, drawn from the centre outward with a * label. Fillets and rounds are conventionally dimensioned by radius. */ declare class RadialDimension { private scene; private data; private style; private radiusLine; private centerMark; private arrow; private dimensionText3D; constructor(options: RadialDimensionDto, scene: BABYLON.Scene); private create; private createLine; private createCenterMark; private createArrow; private createText; dispose(): void; } /** * How a camera flight moves: its length in seconds and the easing curve it follows. Both are optional * so callers that only know a destination get the historical two-second ease-in-out cubic flight. */ interface CameraFlightOptions { /** Flight time in seconds; zero or less jumps to the view without animating. */ animationSpeed?: number; /** Easing curve of the flight, one of the math library curves. */ ease?: Inputs.Math.easeEnum; } /** * Camera control above the level of raw position and target: framing a shape so it fills the view, * orbiting around it, and moving to named viewpoints. Use it rather than setting camera vectors by * hand - correct framing needs the shape's bounding box and the field of view together. */ declare class CameraManager { private scene; private camera; private readonly animationFrameRate; private readonly defaultAnimationSeconds; private readonly viewMatchAngleTolerance; private readonly viewMatchDistanceTolerance; constructor(scene: BABYLON.Scene); flyTo(newPosition: BABYLON.Vector3, newTarget: BABYLON.Vector3, options?: CameraFlightOptions): void; private isAlreadyAtView; } declare const DEFAULT_CAMERA_EASE = Inputs.Math.easeEnum.easeInOutCubic; /** * A Babylon easing function that follows one of the `bitbybit.math.ease` curves exactly, so a camera * animation and a parametric animation driven by the same curve name move identically. */ declare class EaseCurve extends BABYLON.EasingFunction { private readonly curve; constructor(curve: Inputs.Math.easeEnum); easeInCore(gradient: number): number; } /** * Builds the easing function for a camera animation. An unknown or missing curve name falls back to * the historical ease-in-out cubic motion instead of throwing inside the animation loop - the name * may come from a scene config authored against an older curve list. */ declare function createEaseCurve(ease: Inputs.Math.easeEnum | undefined): BABYLON.EasingFunction; declare class PointOfInterest { private scene; private data; private style; private time; private pointSphere; private pulseRing; private clickSphere; private labelText; private labelContainer; private containerNode; private pointMaterial; private pulseMaterial; private camera; private static readonly DEFAULT_STYLE; constructor(options: PointOfInterestDto, scene: BABYLON.Scene, onClick: () => void); private create3DVisual; private setupDistanceScaling; private updateLabelPosition; private createMaterials; private createLabelText; private updateLabelText; private setupInteractions; /** Animates the pulse effect using torus scaling and visibility changes for a ring effect. */ animatePulse(): void; dispose(): void; } declare class Navigation { private readonly context; constructor(context: ContextComplete); /** * Creates point of interest - clickable indicator in 3D space that can be used to fly the camera to a specific location with predefined camera position and target. * Point of interest can be styled with PointOfInterestStyleDto and animated with pulse effect. * Point of interest can also have a text label. * @example * ```typescript * const poi = bitbybit.advanced.navigation.pointOfInterest({ * name: "Entrance", position: [0, 1, 0], cameraPosition: [10, 10, 10], cameraTarget: [0, 0, 0], * }); * ``` * @param inputs * @returns Create point of interest * @group point of interest * @shortname point of interest * @drawable true */ pointOfInterest(inputs: Advanced.Navigation.PointOfInterestDto): Advanced.Navigation.PointOfInterestEntity; /** * Create point of interest style - used to style point of interest indicators in 3D space. * You can customize point size, color, hover color, pulse effect, text label color and size. * @param inputs * @returns Create point of interest style * @group point of interest * @shortname point of interest style * @drawable false */ pointOfInterestStyle(inputs: Advanced.Navigation.PointOfInterestStyleDto): Advanced.Navigation.PointOfInterestStyleDto; /** * Fly the camera to a specific position and target with a smooth animation, using the same * motion a point of interest uses when clicked: shortest-arc rotation along the chosen easing * curve, over `animationSpeed` seconds. Works only with ArcRotateCamera. Animation can be * interrupted if called multiple times. * @example * ```typescript * bitbybit.advanced.navigation.flyTo({ cameraPosition: [10, 10, 10], cameraTarget: [0, 0, 0], animationSpeed: 1.5, ease: Bit.Inputs.Math.easeEnum.easeOutQuart }); * ``` * @param inputs Configuration for the fly operation including camera position, target, flight time and easing curve * @returns void * @group camera * @shortname fly to * @drawable false */ flyTo(inputs: Advanced.Navigation.FlyToDto): void; /** * Zoom camera to fit specified meshes in the scene with smooth animation. * Works only with ArcRotateCamera. Animation can be interrupted if called multiple times. * @param inputs Configuration for zoom operation including meshes, children inclusion, animation speed and easing curve * @returns void * @group camera * @shortname zoom on * @drawable false */ zoomOn(inputs: Advanced.Navigation.ZoomOnDto): Promise; /** * Zoom camera to fit specified meshes in the scene with smooth animation, considering exact screen aspect ratio. * Unlike zoomOn, this method precisely calculates camera distance based on viewport dimensions and mesh bounding box * to ensure better fit at padding=0. Works only with ArcRotateCamera. Animation can be interrupted if called multiple times. * @param inputs Configuration for zoom operation including meshes, children inclusion, animation speed and easing curve * @returns void * @group camera * @shortname zoom on aspect * @drawable false */ zoomOnAspect(inputs: Advanced.Navigation.ZoomOnDto): Promise; /** * Focus camera on specified meshes from a specific angle with smooth animation. * Computes the center of the bounding box of all meshes and positions the camera * at the specified orientation vector to look at the center. * Works only with ArcRotateCamera. Animation can be interrupted if called multiple times. * @param inputs Configuration for focus operation including meshes, orientation, distance, animation speed and easing curve * @returns void * @group camera * @shortname focus from angle * @drawable false */ focusFromAngle(inputs: Advanced.Navigation.FocusFromAngleDto): Promise; /** * Create fly through node * @param inputs * @returns Create fly through node * @group point of interest * @shortname fly through node * @drawable false * @ignore true */ drawPointOfInterest(inputs: Advanced.Navigation.PointOfInterestEntity): { dispose: () => void; }; } /** * Patterns applied across the surface of a face, laid out in the face's own parameter space so the * cells follow its curvature rather than a flat grid projected onto it. */ declare class FacePatterns { private readonly occWorkerManager; private readonly context; private readonly draw; pyramidSimple: PyramidSimple; } declare class PyramidSimple { private readonly occWorkerManager; private readonly context; private readonly draw; /** * Creates a simple pyramid pattern on faces * @param inputs * @returns pyramid shapes along the wire * @group create * @shortname create simple pyramid * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ createPyramidSimple(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleDto): Promise>; /** * Creates a simple pyramid pattern on faces with affectors that change the height * @param inputs uv numbers, affector points and affector weights -1 to 1 * @returns pyramid shapes along the wire * @group create * @shortname create simple pyramid affector * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ createPyramidSimpleAffectors(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleAffectorsDto): Promise>; /** * Draws pyramids on the screen * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleData): Promise; /** * Gets the compound shape of all the pyramids * @param inputs pyramid model * @returns Compound shape of the pyramid * @group get shapes * @shortname get compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCompoundShape(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the compound shape on the face * @param inputs pyramid model and face index * @returns Compound shape of the pyramids on the face * @group get shapes * @shortname get compound on face * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCompoundShapeOnFace(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the compound shape of the pyramid on the face at particular index * @param inputs * @returns Compound shape of the pyramid * @group get shapes * @shortname get compound cell on face * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCompoundShapeCellOnFace(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceCellIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets all of the pyramid cells. This is usually in between action to then read particular information of the cells themselves. * @param inputs * @returns Compound shape of the pyramid * @group get cells * @shortname get all cells * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Gets pyramid cells on the face. This is usually in between action to then read particular information of the cells themselves. * @param inputs * @returns Cells of the pyramid * @group get cells * @shortname get cells on face * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidCellsOnFace(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Gets pyramid cells on the face. This is usually in between action to then read particular information of the cells themselves. * @param inputs * @returns Cells of the pyramid * @group get cells * @shortname get cells on face * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidUCellsOnFace(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Gets pyramid cells on the face at u index along v direction. This is usually in between action to then read particular information of the cells themselves. * @param inputs * @returns Cells of the pyramid * @group get cells * @shortname get cells on face at u * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidUCellsOnFaceAtU(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceCellsUIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Gets pyramid cells on the face at v index along u direction. This is usually in between action to then read particular information of the cells themselves. * @param inputs * @returns Cells of the pyramid * @group get cells * @shortname get cells on face at v * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidUCellsOnFaceAtV(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceCellsVIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Gets pyramid cell on the face at u and v index. This is usually in between action to then read particular information of the cell itself. * @param inputs * @returns Cell of the pyramid * @group get cell * @shortname get cell * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getCellOnIndex(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceCellIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart; /** * Gets the top points of cells * @param inputs cells of the pyramid * @returns Top points on the cells * @group get from cells * @shortname get top points * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getTopPointsOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.Base.Point3[]; /** * Gets the center point between cell corners * @param inputs cells of the pyramid * @returns Center points on the cells * @group get from cells * @shortname get center points * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCenterPointsOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.Base.Point3[]; /** * Gets the corner points of cells * @param inputs cells of the pyramid * @returns Corner points on cells provided * @group get from cells * @shortname get corner points of cells * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getCornerPointsOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.Base.Point3[][]; /** * Gets the corner points of cells * @param inputs cells of the pyramid * @returns Corner points on cells provided * @group get from cells * @shortname get corner point of cells * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCornerPointOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsIndexDto): Inputs.Base.Point3[]; /** * Gets the corner normal of cells * @param inputs cells of the pyramid * @returns Corner normals on cells provided * @group get from cells * @shortname get corner normal of cells * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getCornerNormalOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsIndexDto): Inputs.Base.Point3[]; /** * Gets the corner normals of cells * @param inputs cells of the pyramid * @returns Corner normals on cells provided * @group get from cells * @shortname get corner normals of cells * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getCornerNormalsOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.Base.Point3[][]; /** * Gets the compound shapes of the pyramid cells * @param inputs cells of the pyramid * @returns Compound shapes on cells provided * @group get from cells * @shortname get compound shapes * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCompoundShapesOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Gets the face shapes of the pyramid cells provided * @param inputs cells of the pyramid * @returns Face shapes on cells provided * @group get from cells * @shortname get face shapes * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getFaceShapesOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsIndexDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Gets the face shapes of the pyramid cells provided * @param inputs cells of the pyramid * @returns Wire shapes on cells provided * @group get from cells * @shortname get wire shapes * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getWireShapesOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsIndexDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Gets the polyline wire along the start edge of the face's U direction * @param inputs pyramid model and face index * @returns Wire shapes * @group get from face * @shortname get start polyline wire u * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getStartPolylineWireU(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the polyline wire along the end edge of the face's U direction * @param inputs pyramid model and face index * @returns Wire shapes * @group get from face * @shortname get end polyline wire u * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getEndPolylineWireU(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the polyline wire along the start edge of the face's V direction * @param inputs pyramid model and face index * @returns Wire shapes * @group get from face * @shortname get start polyline wire v * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getStartPolylineWireV(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the polyline wire along the end edge of the face's V direction * @param inputs pyramid model and face index * @returns Wire shapes * @group get from face * @shortname get end polyline wire v * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getEndPolylineWireV(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the polyline wires along U direction * @param inputs pyramid model and face index * @returns Wire shapes * @group get from face * @shortname get compound polyline wires u * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getPolylineWiresUCompound(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the polyline wires along V direction * @param inputs pyramid model and face index * @returns Wire shapes * @group get from face * @shortname get compound polyline wires v * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getPolylineWiresVCompound(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; } /** * Surface patterning: projecting a repeating motif across geometry and turning it into real shapes. * This is how textured, perforated and faceted surfaces are produced without modelling each cell by * hand. */ declare class Patterns { private readonly occWorkerManager; private readonly context; private readonly draw; facePatterns: FacePatterns; } declare class Text3D { private readonly occWorkerManager; private readonly context; private readonly draw; /** * Creates a 3d text * @param inputs * @returns 3d text * @group create * @shortname create 3d text * @drawable true */ create(inputs: Advanced.Text3D.Text3DDto): Promise>; /** * Creates a 3d text with a font URL * This is useful when you want to use a custom font that is not included in the library. * The font will be loaded from the provided URL and used to generate the 3d text. * Make sure that fonts do not contain self intersection and other bad characters - that is common issue with custom fonts. * Font formats supported are: ttf, otf, woff. * Please note that Woff2 is not supported by opentype.js as it is a compressed format. * @param inputs * @returns 3d text * @group create * @shortname create 3d text with url * @drawable true */ createWithUrl(inputs: Advanced.Text3D.Text3DUrlDto): Promise>; /** * Creates a 3d text on the face * @param inputs * @returns 3d text * @group create * @shortname create 3d text on face * @drawable true */ createTextOnFace(inputs: Advanced.Text3D.Text3DFaceDto): Promise>; /** * Creates a 3d text on the face using a font URL. * This is useful when you want to use a custom font that is not included in the library. * The font will be loaded from the provided URL and used to generate the 3d text. * Make sure that fonts do not contain self intersection and other bad characters - that is common issue with custom fonts. * Font formats supported are: ttf, otf, woff. * Please note that Woff2 is not supported by opentype.js as it is a compressed format. * @param inputs * @returns 3d text * @group create * @shortname create 3d text on face url * @drawable true */ createTextOnFaceUrl(inputs: Advanced.Text3D.Text3DFaceUrlDto): Promise>; /** * Creates 3d texts on the face from multiple definitions * @param inputs * @returns 3d text * @group create * @shortname create 3d texts on face * @drawable true */ createTextsOnFace(inputs: Advanced.Text3D.Texts3DFaceDto): Promise>; /** * Creates 3d texts on the face from multiple url definitions * This is useful when you want to use a custom font that is not included in the library. * The font will be loaded from the provided URL and used to generate the 3d text. * Make sure that fonts do not contain self intersection and other bad characters - that is common issue with custom fonts. * Font formats supported are: ttf, otf, woff. * Please note that Woff2 is not supported by opentype.js as it is a compressed format. * @param inputs * @returns 3d text * @group create * @shortname create 3d texts on face url * @drawable true */ createTextsOnFaceUrl(inputs: Advanced.Text3D.Texts3DFaceUrlDto): Promise>; /** * Creates 3d text that will be used on the face defintion * @param inputs * @returns definition * @group definitions * @shortname 3d text face def * @drawable false */ definition3dTextOnFace(inputs: Advanced.Text3D.Text3DFaceDefinitionDto): Advanced.Text3D.Text3DFaceDefinitionDto; /** * Creates 3d text that will be used on the face url defintion * This is useful when you want to use a custom font that is not included in the library. * The font will be loaded from the provided URL and used to generate the 3d text. * Make sure that fonts do not contain self intersection and other bad characters - that is common issue with custom fonts. * Font formats supported are: ttf, otf, woff. * Please note that Woff2 is not supported by opentype.js as it is a compressed format. * @param inputs * @returns definition * @group definitions * @shortname 3d text face url def * @drawable false */ definition3dTextOnFaceUrl(inputs: Advanced.Text3D.Text3DFaceDefinitionUrlDto): Advanced.Text3D.Text3DFaceDefinitionUrlDto; /** * Draws 3d text on the screen * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(inputs: Advanced.Text3D.Text3DData, precision?: number): Promise; /** * Gets compounded shape of the 3d text result * @param inputs * @returns compounded OCCT shape * @group get * @shortname compound shape * @drawable true */ getCompoundShape(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the character shape at particular index * @param inputs * @returns character OCCT shape of the 3d text result at index * @group get * @shortname character shape * @drawable true */ getCharacterShape(inputs: Advanced.Text3D.Text3DLetterByIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets character shapes of the 3d text result * @param inputs * @returns character OCCT shapes of the 3d text result * @group get * @shortname character shapes * @drawable true */ getCharacterShapes(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Gets the center of mass coordinates of all characters * @param inputs * @returns character coordinates as points * @group get * @shortname character coordinates * @drawable true */ getCharacterCenterCoordinates(inputs: Advanced.Text3D.Text3DModelDto): Inputs.Base.Point3[]; /** * Gets the face cutout from text 3d that was created on the face * @param inputs * @returns character coordinates as points * @group get from face * @shortname face cutout * @drawable true */ getFaceCutout(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets all of the face cutouts from text 3d that was created on the original face * @param inputs * @returns character coordinates as points * @group get from face * @shortname get all coutout faces * @drawable true */ getAllFacesOfCutout(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Gets character face cutouts from text 3d that was created on the original face * @param inputs * @returns character coordinates as points * @group get from face * @shortname get faces in characters * @drawable true */ getCutoutsInsideCharacters(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Get advance width * @param inputs * @returns width dimension * @group dimensions * @shortname get advance width * @drawable false */ getAdvanceWidth(inputs: Advanced.Text3D.Text3DModelDto): number; } /** * The shared context the API layers hold in common: the scene, the engine and the kernel handles * they each need. Created for you when the platform starts; you rarely construct one yourself. */ declare class ContextComplete extends Context { advancedDynamicTextureForFullscreenUI: GUI.AdvancedDynamicTexture; pointsOfInterestSystem: { observer: BABYLON.Observer; pois: BABYLON.Nullable[]; cameraManager: CameraManager; }; dimensionsSystem: { dimensionManager: DimensionManager; }; } declare class DrawComplete extends Draw { /** * @ignore true */ readonly drawHelper: DrawHelper; /** * @ignore true */ readonly node: BabylonNode; /** * @ignore true */ readonly tag: Tag; /** * @ignore true */ private readonly things; /** * @ignore true */ private readonly advanced; /** * @ignore true */ readonly context: Context; /** * Draws any kind of geometry after all input promises are resolved. Inputs can also be non-promise like. * @param inputs Contains options and entities to be drawn * @returns BabylonJS Mesh Promise * @group draw * @shortname draw anything * @disposableOutput true */ drawAnyAsync(inputs: Inputs.Draw.DrawAny): Promise>; /** * The kinds this layer adds are resolved asynchronously, so the synchronous entry point cannot * draw them. * * Saying so here rather than letting the base dispatch fall through is what turns a silent * `undefined` - and a TypeError on whatever the caller does with it - into a message naming the * method that does work. The public types cannot distinguish the two entry points, because both * derive their result from the entity they were given. * @ignore true */ protected drawResolved(inputs: Inputs.Draw.DrawAny): Inputs.Draw.DrawnAny; /** * The kinds this layer adds to the draw call, and then everything the renderer already knew. * * The extra kinds are added here rather than by overriding `drawAnyAsync`, because that method * says what a given entity resolves to and TypeScript cannot relate two such conditional types * to each other - so a narrower override of it cannot typecheck however correct it is. This is * the seam the renderer provides for exactly that. * @ignore true */ protected drawResolvedAsync(inputs: Inputs.Draw.DrawAny): Promise>; /** * Draws a grid mesh on the ground plane in 3D space. This helps to orient yourself in the world. * @param inputs Describes various parameters of the grid mesh like size, colour, etc. * @group draw * @shortname draw grid * @disposableOutput true */ drawGridMesh(inputs: Inputs.Draw.SceneDrawGridMeshDto): BABYLON.Mesh; /** * Creates draw options for basic geometry types like points, lines, polylines, surfaces and jscad meshes * @param inputs option definition * @returns options * @group options * @shortname simple */ optionsSimple(inputs: Inputs.Draw.DrawBasicGeometryOptions): Inputs.Draw.DrawBasicGeometryOptions; /** * Creates draw options for occt shape geometry like edges, wires, faces, shells, solids and compounds * @param inputs option definition * @returns options * @group options * @shortname occt shape */ optionsOcctShape(inputs: Inputs.Draw.DrawOcctShapeOptions): Inputs.Draw.DrawOcctShapeOptions; /** * Creates draw options for babylon js nodes * @param inputs option definition * @returns options * @group options * @shortname babylon node */ optionsBabylonNode(inputs: Inputs.Draw.DrawNodeOptions): Inputs.Draw.DrawNodeOptions; } /** * The parameters for creating a material: base colour, metallic and roughness, transparency, * backface culling and whether the material is shared. Materials are the cheapest large visual * improvement available - a correct roughness value changes a render more than extra geometry does. */ declare class CreateMaterialDto { constructor(s: CreateMaterialDto); name: string; scene: BABYLON.Scene | undefined; wAng?: number | undefined; uScale?: number | undefined; vScale?: number | undefined; color?: string; albedoTextureUrl?: string; microSurfaceTextureUrl?: string; bumpTextureUrl?: string; metallic: number; roughness: number; zOffset: number; } /** * Creation and reuse of materials across a scene. Sharing one material between many meshes is both * cheaper to render and easier to change later, and this is where that sharing is managed. */ declare class MaterialsService { static textures: { wood1: { microSurfaceTexture: string; light: { albedo: string; }; dark: { albedo: string; }; }; wood2: { microSurfaceTexture: string; light: { albedo: string; }; }; metal1: { microSurfaceTexture: string; light: { albedo: string; normalGL: string; roughness: string; metalness: string; }; }; brownPlanks: { microSurfaceTexture: string; light: { albedo: string; }; }; woodenPlanks: { microSurfaceTexture: string; light: { albedo: string; }; }; brushedConcrete: { microSurfaceTexture: string; sand: { albedo: string; }; grey: { albedo: string; }; }; rock1: { microSurfaceTexture: string; default: { albedo: string; roughness: string; }; }; }; static simpleBlackMaterial(scene: BABYLON.Scene): BABYLON.PBRMaterial; static rock1Material(scene: BABYLON.Scene, wAng: number, scale: number): BABYLON.PBRMaterial; static wood1Material(scene: BABYLON.Scene, wAng: number, scale: number): BABYLON.PBRMaterial; static wood2Material(scene: BABYLON.Scene, wAng: number, scale: number): BABYLON.PBRMaterial; static wood3Material(scene: BABYLON.Scene, wAng: number, scale: number): BABYLON.PBRMaterial; static brownPlanks(scene: BABYLON.Scene, wAng: number, scale: number): BABYLON.PBRMaterial; static woodenPlanks(scene: BABYLON.Scene, wAng: number, scale: number): BABYLON.PBRMaterial; static glass(scene: BABYLON.Scene, albedoColor: string): BABYLON.PBRMaterial; static brushedConcrete(scene: BABYLON.Scene, wAng: number, scale: number): BABYLON.PBRMaterial; static metal1(scene: BABYLON.Scene, wAng: number, scale: number): BABYLON.PBRMaterial; static roughPlastic(scene: BABYLON.Scene, color: string): BABYLON.PBRMaterial; private static createMaterial; private static createTexture; } /** * Models designed to be printed: closed, watertight solids with wall thicknesses and overhangs * chosen so they slice cleanly. */ declare class ThreeDPrinting { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; vases: Vases; medals: Medals; cups: Cups; desktop: Desktop; } /** * Parametric box and container models. */ declare class Boxes { private readonly occWorkerManager; private readonly context; private readonly draw; spicyBox: SpicyBox; } declare class SpicyBox { private readonly occWorkerManager; private readonly context; private readonly draw; /** * Creates a spicy box model for your spices * @param inputs * @returns Spicy box model * @group create * @shortname spicy box * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/cups/dragon-cup.jpeg * @drawable true */ create(inputs: Things.ThreeDPrinting.Boxes.SpicyBox.SpicyBoxDto): Promise>; /** * Gets the compound shape of the spicy box * @param inputs * @returns Compound shape of the spicy box model * @group get shapes * @shortname compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/cups/dragon-cup.jpeg * @drawable true */ getCompoundShape(inputs: Things.ThreeDPrinting.Boxes.SpicyBox.SpicyBoxModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Draws spicy box model in default settings * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/cups/dragon-cup.jpeg * @ignore true */ drawModel(inputs: Things.ThreeDPrinting.Boxes.SpicyBox.SpicyBoxData): Promise; } declare class CalmCup { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; /** * Creates a cup model for your calm moments * @param inputs * @returns Calm cup model * @group create * @shortname calm cup * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/cups/calm-cup.jpeg * @drawable true */ create(inputs: Things.ThreeDPrinting.Cups.CalmCup.CalmCupDto): Promise>; /** * Draws calm cup model in default settings * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/cups/calm-cup.jpeg * @ignore true */ drawModel(inputs: Things.ThreeDPrinting.Cups.CalmCup.CalmCupData): Promise; /** * Disposes a cup model * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose calm cup * @drawable false * @ignore true */ dispose(inputs: Things.ThreeDPrinting.Vases.SerenitySwirl.SerenitySwirlData): Promise; } /** * Parametric cup and mug models. */ declare class Cups { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; calmCup: CalmCup; dragonCup: DragonCup; } declare class DragonCup { private readonly occWorkerManager; private readonly context; private readonly draw; /** * Creates a cup model for your inner dragon * @param inputs * @returns Dragon cup model * @group create * @shortname dragon cup * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/cups/dragon-cup.jpeg * @drawable true */ create(inputs: Things.ThreeDPrinting.Cups.DragonCup.DragonCupDto): Promise>; /** * Gets the compound shape of the dragon cup * @param inputs * @returns Compound shape of the dragon cup model * @group get shapes * @shortname compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/cups/dragon-cup.jpeg * @drawable true */ getCompoundShape(inputs: Things.ThreeDPrinting.Cups.DragonCup.DragonCupModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Draws dragon cup model in default settings * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/cups/dragon-cup.jpeg * @ignore true */ drawModel(inputs: Things.ThreeDPrinting.Cups.DragonCup.DragonCupData): Promise; } /** * Parametric desk accessories. */ declare class Desktop { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; phoneNest: PhoneNest; } declare class PhoneNest { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private materials; /** * Creates a phone nest model * @param inputs * @returns phone nest model * @group create * @shortname phone nest * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/desktop/phone-nest.jpeg * @drawable true */ create(inputs: Things.ThreeDPrinting.Desktop.PhoneNest.PhoneNestDto): Promise>; /** * Gets the compound shape of the phone nest * @param inputs * @returns Compound shape of the phone nest model * @group get shapes * @shortname compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/desktop/phone-nest.jpeg * @drawable true */ getCompoundShape(inputs: Things.ThreeDPrinting.Desktop.PhoneNest.PhoneNestModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Creates draw options for model * @param inputs * @returns Draw options * @group draw * @shortname phone nest draw options * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/desktop/phone-nest.jpeg * @drawable false */ drawOptions(inputs: Things.ThreeDPrinting.Desktop.PhoneNest.PhoneNestDrawDto): Things.ThreeDPrinting.Desktop.PhoneNest.PhoneNestDrawDto; /** * Draws phone nest model in default settings * @param model Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/desktop/phone-nest.jpeg * @ignore true */ drawModel(model: Things.ThreeDPrinting.Desktop.PhoneNest.PhoneNestData, options: Things.ThreeDPrinting.Desktop.PhoneNest.PhoneNestDrawDto): Promise; /** * Disposes a model * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose phone nest * @drawable false * @ignore true */ dispose(inputs: Things.ThreeDPrinting.Desktop.PhoneNest.PhoneNestData): Promise; /** * Creates materials * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname creates default materials * @drawable false * @ignore true */ private createMaterials; } declare class EternalLove { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; /** * Creates a eternal love medal model * @param inputs * @returns Eternal love model * @group create * @shortname eternal love * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/Medals/EternalLove.jpeg * @drawable true */ create(inputs: Things.ThreeDPrinting.Medals.EternalLove.EternalLoveDto): Promise>; /** * Draws wingtip villa in default settings * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(inputs: Things.ThreeDPrinting.Medals.EternalLove.EternalLoveData, precision?: number): Promise; /** * Disposes a wingtip villa model objects * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose wingtip villa * @drawable false * @ignore true */ dispose(inputs: Things.ThreeDPrinting.Vases.SerenitySwirl.SerenitySwirlData): Promise; } /** * Parametric medal and coin models. */ declare class Medals { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; eternalLove: EternalLove; } declare class ArabicArchway { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private materials; /** * Creates a arabic archway vase * @param inputs * @returns Arabic archway mesh * @group create * @shortname arabic archway * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/Vases/ArabicArchway.jpeg * @drawable true */ create(inputs: Things.ThreeDPrinting.Vases.ArabicArchway.ArabicArchwayDto): Promise>; /** * Draws arabic archway in default settings * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(model: Things.ThreeDPrinting.Vases.ArabicArchway.ArabicArchwayData, precision?: number): Promise; /** * Disposes a arabic archway model objects * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose arabic archway * @drawable false * @ignore true */ dispose(inputs: Things.ThreeDPrinting.Vases.ArabicArchway.ArabicArchwayData): Promise; private createMaterials; private createOpaqueMaterial; private createBaseMaterial; private createGlassMaterial; } declare class SerenitySwirl { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; /** * Creates a serenity swirl * @param inputs * @returns Serenity swirl mesh * @group create * @shortname serenity swirl * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/3dprinting/Vases/SerenitySwirl.webp * @drawable true */ create(inputs: Things.ThreeDPrinting.Vases.SerenitySwirl.SerenitySwirlDto): Promise>; /** * Draws wingtip villa in default settings * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(inputs: Things.ThreeDPrinting.Vases.SerenitySwirl.SerenitySwirlData, precision?: number): Promise; /** * Disposes a wingtip villa model objects * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose wingtip villa * @drawable false * @ignore true */ dispose(inputs: Things.ThreeDPrinting.Vases.SerenitySwirl.SerenitySwirlData): Promise; } /** * Parametric vase models. */ declare class Vases { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; serenitySwirl: SerenitySwirl; arabicArchway: ArabicArchway; } /** * Architectural models - buildings and structures generated from their dimensions, along with the * building-element parts they are assembled from. */ declare class Architecture { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; houses: Houses; } /** * Parametric house models. */ declare class Houses { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; zenHideout: ZenHideout; } declare class ZenHideout { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private materials; skin: Things.Architecture.Houses.ZenHideout.ZenHideoutDrawingPartShapes; /** * Creates a zen hideout * @param inputs * @returns Zen hideout mesh * @group create * @shortname zen hideout * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/architecture/Houses/ZenHideout.jpeg * @drawable true */ create(inputs: Things.Architecture.Houses.ZenHideout.ZenHideoutDto): Promise>; /** * Draws wingtip villa in default settings * @param model Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(model: Things.Architecture.Houses.ZenHideout.ZenHideoutData, precision?: number): Promise; /** * Disposes a zen hideout model objects * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose zen hideout * @drawable false * @ignore true */ dispose(inputs: Things.Architecture.Houses.ZenHideout.ZenHideoutData): Promise; /** * Creates materials * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname creates default materials for zen hideout * @drawable false * @ignore true */ private createMaterials; private createSkin; } declare class Enums { /** * Creates a level of detail enumeration value * @param inputs * @returns level of detail * @group enums * @shortname lod * @drawable false */ lodEnum(inputs: Things.Enums.LodDto): Things.Enums.lodEnum; } /** * Parametric chair models. */ declare class Chairs { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; snakeChair: SnakeChair; } declare class SnakeChair { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private materials; /** * Creates a snake chair model * @param inputs * @returns Snake chair model * @group create * @shortname snake chair * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/chairs/snake-chair.jpeg * @drawable true */ create(inputs: Things.Furniture.Chairs.SnakeChair.SnakeChairDto): Promise>; /** * Gets the compound shape of the chair * @param inputs * @returns Compound shape of the snake chair model * @group get shapes * @shortname compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/chairs/snake-chair.jpeg * @drawable true */ getCompoundShape(inputs: Things.Furniture.Chairs.SnakeChair.SnakeChairModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the wire shape of the chair sitting area * @param inputs * @returns Wire shape of the sitting area * @group get shapes * @shortname get sitting wire * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/chairs/snake-chair.jpeg * @drawable true */ getSittingWireShape(inputs: Things.Furniture.Chairs.SnakeChair.SnakeChairModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the center point of the chair sitting area * @param inputs * @returns The point on the center of the sitting area * @group get points * @shortname get sitting area center * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/chairs/snake-chair.jpeg * @drawable true */ getSittingAreaCenterPoint(inputs: Things.Furniture.Chairs.SnakeChair.SnakeChairModelDto): Inputs.Base.Point3; /** * Creates draw options for snake chair * @param inputs * @returns Draw options * @group draw * @shortname snake chair draw options * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/chairs/snake-chair.jpeg * @drawable false */ drawOptions(inputs: Things.Furniture.Chairs.SnakeChair.SnakeChairDrawDto): Things.Furniture.Chairs.SnakeChair.SnakeChairDrawDto; /** * Draws snake chair model in default settings * @param model Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/chairs/snake-chair.jpeg * @ignore true */ drawModel(model: Things.Furniture.Chairs.SnakeChair.SnakeChairData, options: Things.Furniture.Chairs.SnakeChair.SnakeChairDrawDto): Promise; /** * Disposes a cup model * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose calm cup * @drawable false * @ignore true */ dispose(inputs: Things.Furniture.Chairs.SnakeChair.SnakeChairData): Promise; /** * Creates materials * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname creates default materials for zen hideout * @drawable false * @ignore true */ private createMaterials; } /** * Furniture models: tables and chairs whose proportions rebuild from their dimensions. The closest * of the finished-model families to what a made-to-measure configurator actually needs. */ declare class Furniture { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; chairs: Chairs; tables: Tables; } declare class ElegantTable { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private materials; /** * Creates an elegant table model * @param inputs * @returns Elegant table model * @group create * @shortname elegant table * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ create(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableDto): Promise>; /** * Gets the compound shape of the table * @param inputs * @returns Compound shape of the elegant table model * @group get shapes * @shortname compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getCompoundShape(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the leg shapes as a list * @param inputs * @returns Leg shapes of the table * @group get shapes * @shortname legs * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getLegShapes(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Gets the leg shape by index * @param inputs * @returns Leg shapes of the table * @group get shapes * @shortname leg by index * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getLegShapeByIndex(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableLegByIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table top panel shape * @param inputs * @returns Top panel shape of the table * @group get shapes * @shortname top panel * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getTopPanelShape(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table top panel wire shape * @param inputs * @returns Top panel wire shape of the table * @group get shapes * @shortname top panel wire * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getTopPanelWireShape(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table bottom panel wire shape * @param inputs * @returns Bottom panel wire shape of the table * @group get shapes * @shortname bottom panel wire * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getBottomPanelWireShape(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table bottom panel shape * @param inputs * @returns Bottom panel shape of the table * @group get shapes * @shortname bottom panel * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getBottomPanelShape(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the leg shapes as a compound shape * @param inputs * @returns Compound shape of the legs * @group get shapes * @shortname legs compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getLegsCompoundShape(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the top center point * @param inputs * @returns Top center point * @group get points * @shortname top center point * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getTableTopCenterPoint(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.Base.Point3; /** * Gets the bottom center point * @param inputs * @returns Bottom center point * @group get points * @shortname bottom center point * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getTableBottomCenterPoint(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.Base.Point3; /** * Gets the leg bottom points * @param inputs * @returns Bottom points * @group get points * @shortname leg bottom points * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getLegBottomPoints(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.Base.Point3[]; /** * Gets the leg top points * @param inputs * @returns Top points * @group get points * @shortname leg top points * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable true */ getLegTopPoints(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableModelDto): Inputs.Base.Point3[]; /** * Creates draw options for elegant table * @param inputs * @returns Draw options * @group draw * @shortname elegant table draw options * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @drawable false */ drawOptions(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableDrawDto): Things.Furniture.Tables.ElegantTable.ElegantTableDrawDto; /** * Draws elegant table model in default settings * @param model Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/elegant-table.jpeg * @ignore true */ drawModel(model: Things.Furniture.Tables.ElegantTable.ElegantTableData, options: Things.Furniture.Tables.ElegantTable.ElegantTableDrawDto): Promise; /** * Disposes a cup model * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose calm cup * @drawable false * @ignore true */ dispose(inputs: Things.Furniture.Tables.ElegantTable.ElegantTableData): Promise; /** * Creates materials * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname creates default materials for zen hideout * @drawable false * @ignore true */ private createMaterials; } declare class GoodCoffeeTable { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private materials; /** * Creates an good coffee table model * @param inputs * @returns Good coffee table model * @group create * @shortname good coffee table * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ create(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableDto): Promise>; /** * Gets the compound shape of the table * @param inputs * @returns Compound shape of the elegant table model * @group get shapes * @shortname get compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getCompoundShape(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the leg shapes as a list * @param inputs * @returns Leg shapes of the table * @group get shapes * @shortname get legs * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getLegShapes(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Gets the leg shape by index * @param inputs * @returns Leg shapes of the table * @group get shapes * @shortname get leg by index * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getLegShapeByIndex(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableLegByIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table top panel shape * @param inputs * @returns Top panel shape of the table * @group get shapes * @shortname get top panel * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getTopPanelShape(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table top panel wire shape * @param inputs * @returns Top panel wire shape of the table * @group get shapes * @shortname get top panel wire * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getTopPanelWireShape(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table glass panel shape * @param inputs * @returns Glass panel shape of the table * @group get shapes * @shortname get glass panel * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getGlassPanelShape(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table glass panel wire shape * @param inputs * @returns Glass panel wire shape of the table * @group get shapes * @shortname get glass panel wire * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getGlassPanelWireShape(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table shelf shape * @param inputs * @returns Shelf shape of the table * @group get shapes * @shortname get shelf shape * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getShelfShape(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the table shelf top wire shape * @param inputs * @returns Shelf wire shape of the table * @group get shapes * @shortname get shelf top wire * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getShelfTopWireShape(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the leg shapes as a compound shape * @param inputs * @returns Compound shape of the legs * @group get shapes * @shortname get legs compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getLegsCompoundShape(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the top center point * @param inputs * @returns Top center point * @group get points * @shortname get top center point * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getTableTopCenterPoint(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.Base.Point3; /** * Gets the top center point of the shelf * @param inputs * @returns Top center point of the shelf * @group get points * @shortname get top shelf center point * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getTableShelfTopCenterPoint(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.Base.Point3; /** * Gets the leg bottom points * @param inputs * @returns Bottom points * @group get points * @shortname get leg bottom points * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getLegBottomPoints(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.Base.Point3[]; /** * Gets the leg top points * @param inputs * @returns Top points * @group get points * @shortname get leg top points * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable true */ getLegTopPoints(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableModelDto): Inputs.Base.Point3[]; /** * Creates draw options for good coffee table * @param inputs * @returns Draw options * @group draw * @shortname good coffee table draw options * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @drawable false */ drawOptions(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableDrawDto): Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableDrawDto; /** * Draws good coffee table model in default settings * @param model Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname get draw shape * @drawable false * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/good-coffee-table.jpeg * @ignore true */ drawModel(model: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableData, options: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableDrawDto): Promise; /** * Disposes a cup model * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose calm cup * @drawable false * @ignore true */ dispose(inputs: Things.Furniture.Tables.GoodCoffeeTable.GoodCoffeeTableData): Promise; /** * Creates materials * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname creates default materials for zen hideout * @drawable false * @ignore true */ private createMaterials; } declare class SnakeTable { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private materials; /** * Creates a snake table model * @param inputs * @returns Snake table model * @group create * @shortname snake table * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/snake-table.jpeg * @drawable true */ create(inputs: Things.Furniture.Tables.SnakeTable.SnakeTableDto): Promise>; /** * Gets the compound shape of the table * @param inputs * @returns Compound shape of the snake table model * @group get shapes * @shortname get compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/snake-table.jpeg * @drawable true */ getCompoundShape(inputs: Things.Furniture.Tables.SnakeTable.SnakeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the glass shape of the table * @param inputs * @returns The glass shape solid of the table * @group get shapes * @shortname get glass * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/snake-table.jpeg * @drawable true */ getGlassShape(inputs: Things.Furniture.Tables.SnakeTable.SnakeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the main solid shape of the table * @param inputs * @returns The main shape solid of the table * @group get shapes * @shortname get main * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/snake-table.jpeg * @drawable true */ getMainShape(inputs: Things.Furniture.Tables.SnakeTable.SnakeTableModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the center point of the table top * @param inputs * @returns The point on the center of the top area * @group get points * @shortname get top center * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/snake-table.jpeg * @drawable true */ getTopCenterPoint(inputs: Things.Furniture.Tables.SnakeTable.SnakeTableModelDto): Inputs.Base.Point3; /** * Creates draw options for snake table * @param inputs * @returns Draw options * @group draw * @shortname snake table draw options * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/snake-table.jpeg * @drawable false */ drawOptions(inputs: Things.Furniture.Tables.SnakeTable.SnakeTableDrawDto): Things.Furniture.Tables.SnakeTable.SnakeTableDrawDto; /** * Draws snake table model in default settings * @param model Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/furniture/tables/snake-table.jpeg * @ignore true */ drawModel(model: Things.Furniture.Tables.SnakeTable.SnakeTableData, options: Things.Furniture.Tables.SnakeTable.SnakeTableDrawDto): Promise; /** * Disposes a cup model * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose calm cup * @drawable false * @ignore true */ dispose(inputs: Things.Furniture.Tables.SnakeTable.SnakeTableData): Promise; /** * Creates materials * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname creates default materials for zen hideout * @drawable false * @ignore true */ private createMaterials; } /** * Parametric table models. */ declare class Tables { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; elegantTable: ElegantTable; goodCoffeeTable: GoodCoffeeTable; snakeTable: SnakeTable; } /** * Parametric birdhouse models. */ declare class Birdhouses { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; wingtipVilla: WingtipVilla; chirpyChalet: ChirpyChalet; } declare class ChirpyChalet { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; /** * Disposes a chirpy chalet model objects * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose chirpy chalet * @drawable false * @ignore true */ dispose(inputs: Things.KidsCorner.BirdHouses.ChirpyChalet.ChirpyChaletData): Promise; /** * Creates a chirpy chalet birdhouse with a 45 degree roof * @param inputs Contains points and the transformations to apply * @returns Transformed points * @group birdhouse * @shortname chirpy chalet * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/kids/Birdhouses/ChirpyChaletIcon.webp * @drawable true */ create(inputs: Things.KidsCorner.BirdHouses.ChirpyChalet.ChirpyChaletDto): Promise>; /** * Draws wingtip villa in default settings * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(inputs: Things.KidsCorner.BirdHouses.ChirpyChalet.ChirpyChaletData): Promise; } declare class WingtipVilla { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; /** * Creates a wingtip villa birdhouse with a 45 degree roof * @param inputs Contains points and the transformations to apply * @returns Transformed points * @group birdhouse * @shortname wingtip villa * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/kids/Birdhouses/WingtipVillaIcon.webp * @drawable true */ create(inputs: Things.KidsCorner.BirdHouses.WingtipVilla.WingtipVillaDto): Promise>; /** * Draws wingtip villa in default settings * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(inputs: Things.KidsCorner.BirdHouses.WingtipVilla.WingtipVillaData): Promise; /** * Disposes a wingtip villa model objects * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose wingtip villa * @drawable false * @ignore true */ dispose(inputs: Things.KidsCorner.BirdHouses.WingtipVilla.WingtipVillaData): Promise; } /** * Models aimed at younger makers and at beginners: simple to understand, quick to print, and short * enough to read end to end as an example. */ declare class KidsCorner { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; birdhouses: Birdhouses; } declare class DropletsPhoneHolder { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private readonly jscad; private drawOptions; /** * Creates droplets phone holder * @param inputs * @returns Droplets phone holder data * @group create * @shortname droplets phone holder * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/laser-cutting/gadgets/DropletsPhoneHolder.jpeg * @drawable true */ create(inputs: Things.LaserCutting.Gadgets.DropletsPhoneHolder.DropletsPhoneHolderDto): Promise>; /** * Gets the compound shape of the droplets phone holder * @param inputs * @returns Compound shape of the droplets phone holder model * @group get shapes * @shortname compound * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/laser-cutting/gadgets/DropletsPhoneHolder.jpeg * @drawable true */ getCompoundShape(inputs: Things.LaserCutting.Gadgets.DropletsPhoneHolder.DropletsPhoneHolderModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the cut wires compound * @param inputs * @returns Compound of the cut wires * @group get shapes * @shortname cut wires * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/laser-cutting/gadgets/DropletsPhoneHolder.jpeg * @drawable true */ getCutWiresCompound(inputs: Things.LaserCutting.Gadgets.DropletsPhoneHolder.DropletsPhoneHolderModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Gets the engraving wires compound * @param inputs * @returns Compound of the engraving wires * @group get shapes * @shortname engraving wires * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/laser-cutting/gadgets/DropletsPhoneHolder.jpeg * @drawable true */ getEngravingWiresCompound(inputs: Things.LaserCutting.Gadgets.DropletsPhoneHolder.DropletsPhoneHolderModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Downloads DXF drawing * @param inputs * @returns DXF File * @group download * @shortname dxf drawings * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/laser-cutting/gadgets/DropletsPhoneHolder.jpeg * @drawable false */ downloadDXFDrawings(inputs: Things.LaserCutting.Gadgets.DropletsPhoneHolder.DropletsPhoneHolderModelDxfDto): Promise; /** * Downloads STEP drawing * @param inputs * @returns STEP File * @group download * @shortname step drawings * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/laser-cutting/gadgets/DropletsPhoneHolder.jpeg * @drawable false */ downloadSTEPDrawings(inputs: Things.LaserCutting.Gadgets.DropletsPhoneHolder.DropletsPhoneHolderModelStepDto): Promise; /** * Downloads STEP 3D model * @param inputs * @returns STEP File * @group download * @shortname 3d step model * @image https://ik.imagekit.io/bitbybit/app/assets/spec-cat/things/laser-cutting/gadgets/DropletsPhoneHolder.jpeg * @drawable false */ download3dSTEPModel(inputs: Things.LaserCutting.Gadgets.DropletsPhoneHolder.DropletsPhoneHolderModelStepDto): Promise; /** * Draws droplets phone holder in default settings * @param inputs Contains a model shapes to be drawn and additional information * @returns BabylonJS Mesh * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(model: Things.LaserCutting.Gadgets.DropletsPhoneHolder.DropletsPhoneHolderData, precision?: number): Promise; /** * Disposes a droplets phone holder model objects * @param inputs Contains a model shapes to be disposed and additional information * @group drawing * @shortname dispose droplets phone holder * @drawable false * @ignore true */ dispose(inputs: Things.LaserCutting.Gadgets.DropletsPhoneHolder.DropletsPhoneHolderData): Promise; private createDrawOptions; } /** * Small laser-cut gadgets. */ declare class Gadgets { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private readonly jscad; dropletsPhoneHolder: DropletsPhoneHolder; } /** * Models made from flat sheet, produced as 2D cut profiles with the slot tolerances an assembly * needs rather than as printed solids. */ declare class LaserCutting { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private readonly jscad; gadgets: Gadgets; } /** * The entry point to the finished parametric models, grouped by what they are for: 3D printing, * laser cutting, architecture, furniture and a kids' corner. Each model takes its parameters and * returns a complete shape. */ declare class ThingsAdv { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; private readonly jscad; kidsCorner: KidsCorner; threeDPrinting: ThreeDPrinting; laserCutting: LaserCutting; architecture: Architecture; furniture: Furniture; enums: Enums; } declare class BitByBitBase { readonly draw: Draw; readonly babylon: Babylon; readonly vector: Vector; readonly point: Point; readonly line: Line; readonly polyline: Polyline; readonly mesh: MeshBitByBit; readonly occt: OCCTW & OCCT; readonly advanced: AdvancedAdv; readonly things: ThingsAdv; readonly jscad: JSCAD; readonly manifold: ManifoldBitByBit; readonly logic: Logic; readonly math: MathBitByBit; readonly lists: Lists; readonly color: Color; readonly text: TextBitByBit; readonly dates: Dates; readonly json: JSONBitByBit; readonly csv: CSVBitByBit; /** * NURBS curves and surfaces. * * @deprecated Verbnurbs is not maintained upstream and this API is removed in the next major * version. Use the OpenCascade (occt) NURBS operations instead. Existing scripts keep working * until the removal. */ readonly verb: Verb; readonly tag: Tag; readonly time: Time; readonly asset: Asset; } declare const isRunnerContext: boolean; declare function mockBitbybitRunnerInputs(inputs: T): T; declare function getBitbybitRunnerInputs(): T; declare function setBitbybitRunnerResult(result: T): void; }