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 PlayCanvas materials */ type Texture = any; } /** * 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[]; } } /** * Re-export Base namespace from @bitbybit-dev/core and extend with PlayCanvas-specific types. * This includes the base types + core extensions (VerbCurve, VerbSurface, colorMapStrategyEnum, etc.) */ /** * The PlayCanvas 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 PlayCanvas scene: color, opacity, size, and the per-kind * settings that control how points, lines, polylines, meshes, surfaces and kernel shapes become * renderer entities. Passing an existing drawn entity back in updates it in place. */ declare namespace Draw { type DrawOptions = DrawOcctShapeOptions | DrawBasicGeometryOptions | DrawManifoldOrCrossSectionOptions; /** * 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; 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 | 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[]; /** * Metadata stored on drawn entities to track their type and options for updates */ interface BitByBitMeta { type: drawingTypes; options: DrawOptions; } /** * Extended pc.Entity with BitByBit metadata for type-safe access to drawing metadata */ interface BitByBitEntity extends pc.Entity { bitbybitMeta?: BitByBitMeta | undefined; } /** * A drawn tag. Drawing a tag produces the tag itself rather than a scene entity, because a tag is * rendered as an HTML overlay positioned from the scene rather than as geometry in it. It carries * the same metadata a drawn entity does, so that passing it back in updates it in place. */ interface DrawnTag extends Inputs.Tag.TagDto { bitbybitMeta?: BitByBitMeta | 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[] & { bitbybitMeta?: BitByBitMeta | undefined; }; /** * 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; } /** * 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`. */ type DrawnAny = T | DrawnTag | DrawnTags | undefined; /** * What drawing hands back: an entity for geometry, the tag or tags for tags. */ type DrawnEntity = DrawnAny; /** * 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; everything else becomes a scene entity. 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. * * 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 : T) : E extends Inputs.Tag.TagDto ? DrawnTag : T; /** * User data stored on polyline entities to track line lengths for update optimization */ interface PolylineUserData { linesForRenderLengths: string; } /** * Extended pc.Entity with user data for polyline tracking */ interface PolylineEntity extends pc.Entity { bitbybitMeta?: PolylineUserData | undefined; } /** * 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, group?: U); /** * 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; /** * Group to indicate if geometry should be updated * @optional true */ group?: U | undefined; } /** * Drawing options for Manifold solids and cross-sections: the face color or material, 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; /** * 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; } /** * 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; } /** * 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; } /** * 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 PlayCanvas cameras: position, target, field of view and clipping planes, plus the * orbit settings that decide how a user moves the view. */ declare namespace PlayCanvasCamera { /** * Feeds `playcanvas.camera.orbitCamera.create`: where the orbiting camera starts around its * pivot, how far it may zoom and tilt, how fast it reacts and how its motion is smoothed. */ class OrbitCameraDto { constructor(distance?: number, pitch?: number, yaw?: number, distanceMin?: number, distanceMax?: number, pitchAngleMin?: number, pitchAngleMax?: number, orbitSensitivity?: number, distanceSensitivity?: number, inertiaFactor?: number, autoRender?: boolean, frameOnStart?: boolean); /** * The point the camera looks at and circles around * @default [0, 0, 0] */ pivotPoint: Base.Point3; /** * How far from the pivot the camera starts, in scene units * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ distance: number; /** * How far above or below the pivot the camera starts, in degrees; 0 is level, positive is * above looking down * @default 30 * @minimum -90 * @maximum 90 * @step 1 */ pitch: number; /** * How far around the vertical axis the camera starts, in degrees * @default 45 * @minimum -360 * @maximum 360 * @step 1 */ yaw: number; /** * The closest the camera may zoom to the pivot, in scene units * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ distanceMin: number; /** * The farthest the camera may zoom from the pivot, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 1 */ distanceMax: number; /** * The lowest the camera may tilt, in degrees; -90 looks straight up from below * @default -90 * @minimum -90 * @maximum 90 * @step 1 */ pitchAngleMin: number; /** * The highest the camera may tilt, in degrees; 90 looks straight down from above * @default 90 * @minimum -90 * @maximum 90 * @step 1 */ pitchAngleMax: number; /** * How far a pointer drag turns the camera; higher turns faster * @default 0.3 * @minimum 0 * @maximum 10 * @step 0.1 */ orbitSensitivity: number; /** * How far a wheel step zooms the camera; higher zooms faster * @default 0.5 * @minimum 0 * @maximum 10 * @step 0.01 */ distanceSensitivity: number; /** * How much the camera keeps gliding after a drag, from 0 for none to 1 for most * @default 0.1 * @minimum 0 * @maximum 1 * @step 0.1 */ inertiaFactor: number; /** * When true, the scene is rendered again whenever the camera moves * @default true */ autoRender: boolean; /** * When true and a focus object is given, the camera starts framed on it * @default true */ frameOnStart: boolean; /** * An entity to frame the camera on at the start, when given * @optional true */ focusEntity?: pc.Entity | undefined; } /** * A PlayCanvas camera to work on; kept for camera methods that take just the camera. */ class CameraDto { constructor(camera?: pc.Entity); /** * The camera to work on * @default undefined */ camera: pc.Entity; } /** * A PlayCanvas camera and the point to move it to; kept for camera methods that place the * camera. */ class PositionDto { constructor(camera?: pc.Entity, position?: Base.Point3); /** * The camera to move * @default undefined */ camera: pc.Entity; /** * The point to move the camera to * @default [0, 0, 0] */ position: Base.Point3; } /** * Feeds `playcanvas.camera.orbitCamera.setPivotPoint` and `getPivotPoint` with the controller * and the point the camera circles around. */ class PivotPointDto { constructor(orbitCamera?: any, pivotPoint?: Base.Point3); /** * The orbit camera controller, as `create` gave it * @default undefined */ orbitCamera: any; /** * The point the camera looks at and circles around * @default [0, 0, 0] */ pivotPoint: Base.Point3; } /** * Feeds `playcanvas.camera.orbitCamera.focusOnEntity` with the controller and the entity to * frame. */ class FocusEntityDto { constructor(orbitCamera?: any, entity?: pc.Entity); /** * The orbit camera controller, as `create` gave it * @default undefined */ orbitCamera: any; /** * The entity the camera backs off to fit in view * @default undefined */ entity: pc.Entity; } /** * Feeds `playcanvas.camera.orbitCamera.resetCamera` with the controller and the angles and * distance to put the camera at. */ class ResetCameraDto { constructor(orbitCamera?: any, yaw?: number, pitch?: number, distance?: number); /** * The orbit camera controller, as `create` gave it * @default undefined */ orbitCamera: any; /** * How far around the vertical axis, in degrees * @default 45 * @minimum -360 * @maximum 360 * @step 1 */ yaw: number; /** * How far above or below the pivot, in degrees; positive is above looking down * @default 30 * @minimum -90 * @maximum 90 * @step 1 */ pitch: number; /** * How far from the pivot, in scene units * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ distance: number; } } /** * Interface for orbit camera internal state and methods (PlayCanvas). */ interface PlayCanvasOrbitCameraInstance { autoRender: boolean; distanceMax: number; distanceMin: number; pitchAngleMax: number; pitchAngleMin: number; inertiaFactor: number; focusEntity: pc.Entity | null; frameOnStart: boolean; distance: number; pitch: number; yaw: number; pivotPoint: pc.Vec3; focus(focusEntity: pc.Entity): void; resetAndLookAtPoint(resetPoint: pc.Vec3, lookAtPoint: pc.Vec3): void; resetAndLookAtEntity(resetPoint: pc.Vec3, entity: pc.Entity): void; reset(yaw: number, pitch: number, distance: number): void; update(dt: number): void; } /** * Interface for input handlers (mouse, touch). */ interface PlayCanvasInputHandler { destroy(): void; } /** * Orbit camera controller returned by create method. */ interface PlayCanvasOrbitCameraController { orbitCamera: PlayCanvasOrbitCameraInstance; cameraEntity: pc.Entity; mouseInput: PlayCanvasInputHandler | null; touchInput: PlayCanvasInputHandler | null; update: (dt: number) => void; destroy: () => void; } /** * Result object returned by initPlayCanvas helper function. */ interface InitPlayCanvasResult { /** The PlayCanvas application */ app: pc.Application; /** The root scene entity */ scene: pc.Entity; /** The directional light entity */ directionalLight: pc.Entity; /** The ground entity (if enabled) */ ground: pc.Entity | null; /** The orbit camera controller (if enabled) */ orbitCamera: PlayCanvasOrbitCameraController | null; /** Cleanup function to dispose resources */ dispose: () => void; } /** * Higher-level PlayCanvas scene setup: the composed configurations that build a working scene - * camera, lights, environment and ground - in one call rather than piece by piece. */ declare namespace PlayCanvasScene { /** * Feeds the `initPlayCanvas` helper that sets up a whole application in one call: the canvas, * background, ground, lights, shadows and the orbit camera, sized from `sceneSize`. */ class InitPlayCanvasDto { constructor(canvasId?: string, sceneSize?: number, backgroundColor?: string, enableShadows?: boolean, enableGround?: boolean, groundCenter?: Base.Point3, groundScaleFactor?: number, groundColor?: string, groundOpacity?: number, ambientLightColor?: string, ambientLightIntensity?: 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; /** * Ambient light color. PlayCanvas uses ambient light instead of hemisphere light. * @default "#888888" */ ambientLightColor: string; /** * Intensity factor for ambient light (applied to RGB values). * @default 1 * @minimum 0 * @maximum 10 * @step 0.1 */ ambientLightIntensity: 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 orbit camera controller. * @default true */ enableOrbitCamera: boolean; /** * Settings for the orbit camera, the same as `playcanvas.camera.orbitCamera.create` takes; * left out, defaults sized from `sceneSize` are used * @optional true */ orbitCameraOptions?: PlayCanvasCamera.OrbitCameraDto | undefined; } } /** * 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; } /** * 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 { readonly drawHelper: DrawHelper; readonly context: Context; readonly tag: Tag; private defaultBasicOptions; private defaultPolylineOptions; /** * 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 * @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 */ 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; protected drawResolvedAsync(inputs: Inputs.Draw.DrawAny): Promise; private handleDecomposedMeshShape; private handleDecomposedMeshes; /** * 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; /** * 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.DrawnEntity; /** * 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; /** * 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): pc.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): pc.StandardMaterial; /** * Applies UV transformation data from a texture to the corresponding material properties. * PlayCanvas handles UV transforms at the material level per texture slot. * @param mat - The material to apply transforms to * @param texture - The texture with potential transform metadata * @param mapType - The type of texture map (e.g., "diffuseMap", "normalMap") */ private applyTextureTransform; /** * Helper method to convert hex color string to RGB values (0-1 range) */ private hexToRgb; private handleJscadMesh; private handleJscadMeshes; private handleManifoldShape; private handleManifoldShapes; private handleOcctShape; private handleOcctShapes; private handleLine; private handlePoint; /** * 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 handleVerbCurve; private handleVerbSurface; private handlePolylines; private handleLines; private handlePoints; private handleVerbCurves; private handleVerbSurfaces; private handleTag; private handleTags; private updateAny; /** * Handle synchronous drawing operations with proper option resolution * @param inputs - Draw inputs * @param defaultOptions - Default options for this geometry type * @param action - Function that performs the actual drawing * @param type - Geometry type for metadata * @returns Drawn entity */ private handle; /** * Handle async drawing operations with proper error handling * @param inputs - Draw inputs * @param defaultOptions - Default options for this geometry type * @param action - Async function that performs the actual drawing * @param type - Geometry type for metadata * @returns Promise resolving to drawn entity */ private handleAsync; private applyGlobalSettingsAndMetadataAndShadowCasting; /** * Extract options from inputs with proper fallback chain * @param inputs - Draw inputs * @param defaultOptions - Default options to use as fallback * @returns Resolved options */ private resolveDrawOptions; /** * Attach BitByBit metadata to a drawn tag * @param tag - Tag the tag API drew * @param type - Drawing type * @param options - Draw options * @returns Tag with attached metadata */ private attachTagMetadata; } /** * Cameras for the PlayCanvas scene: the `orbitCamera` property builds a camera that circles a pivot * point, the way you would turn a product in your hands, with mouse and touch controls, and adjusts * it afterwards. */ declare class PlayCanvasCamera { private readonly context; orbitCamera: PlayCanvasOrbitCamera; } interface OrbitCameraInstance { autoRender: boolean; distanceMax: number; distanceMin: number; pitchAngleMax: number; pitchAngleMin: number; inertiaFactor: number; focusEntity: pc.Entity | null; frameOnStart: boolean; distance: number; pitch: number; yaw: number; pivotPoint: pc.Vec3; focus(focusEntity: pc.Entity): void; resetAndLookAtPoint(resetPoint: pc.Vec3, lookAtPoint: pc.Vec3): void; resetAndLookAtEntity(resetPoint: pc.Vec3, entity: pc.Entity): void; reset(yaw: number, pitch: number, distance: number): void; update(dt: number): void; } interface InputHandler { destroy(): void; } interface OrbitCameraController { orbitCamera: OrbitCameraInstance; cameraEntity: pc.Entity; mouseInput: InputHandler | null; touchInput: InputHandler | null; update: (dt: number) => void; destroy: () => void; } /** * The orbiting camera for PlayCanvas: it looks at a pivot point from a distance and turns around it * with `yaw` around the vertical axis and `pitch` up or down, both in degrees. The controller it * gives back carries the camera entity and its input handlers; the methods here move the pivot, * frame an entity and reset the view. */ declare class PlayCanvasOrbitCamera { private readonly context; /** * Creates an orbit camera that circles `pivotPoint` at `distance`, placed by `yaw` and `pitch` * in degrees, with mouse and touch controls. * * The limits fence how far it can zoom and tilt, inertia smooths its motion, and with * `focusEntity` and `frameOnStart` it starts framed on that entity. The application must be * initialized first. * @param inputs - The pivot, distance, angles, limits, sensitivities, inertia and start options * @returns The orbit camera controller holding the camera entity and its input handlers * @group create * @shortname new orbit camera * @example * ```typescript * const orbit = bitbybit.playcanvas.camera.orbitCamera.create({ pivotPoint: [0, 0, 0], distance: 20, pitch: 30, yaw: 45, distanceMin: 0.1, distanceMax: 1000, pitchAngleMin: -90, pitchAngleMax: 90, orbitSensitivity: 0.3, distanceSensitivity: 0.5, inertiaFactor: 0.1, autoRender: true, frameOnStart: true }); * ``` */ create(inputs: Inputs.PlayCanvasCamera.OrbitCameraDto): OrbitCameraController; /** * Moves the point an orbit camera looks at and circles around, keeping its distance and angles. * @param inputs - The orbit camera controller and the new pivot point * @group adjust * @shortname set pivot point * @example * ```typescript * bitbybit.playcanvas.camera.orbitCamera.setPivotPoint({ orbitCamera: orbit, pivotPoint: [0, 5, 0] }); * ``` */ setPivotPoint(inputs: Inputs.PlayCanvasCamera.PivotPointDto): void; /** * Reads the point an orbit camera looks at and circles around. * @param inputs - The orbit camera controller * @returns The pivot point * @group get * @shortname get pivot point */ getPivotPoint(inputs: Inputs.PlayCanvasCamera.PivotPointDto): Inputs.Base.Point3; /** * Turns an orbit camera toward an entity and backs off until the whole entity fits the view. * @param inputs - The orbit camera controller and the entity * @group adjust * @shortname focus on entity * @example * ```typescript * bitbybit.playcanvas.camera.orbitCamera.focusOnEntity({ orbitCamera: orbit, entity: drawn }); * ``` */ focusOnEntity(inputs: Inputs.PlayCanvasCamera.FocusEntityDto): void; /** * Puts an orbit camera at the given `yaw` and `pitch` in degrees and `distance` from its pivot, * discarding whatever the user has done with it. * @param inputs - The orbit camera controller, the two angles and the distance * @group adjust * @shortname reset camera * @example * ```typescript * bitbybit.playcanvas.camera.orbitCamera.resetCamera({ orbitCamera: orbit, yaw: 45, pitch: 30, distance: 20 }); * ``` */ resetCamera(inputs: Inputs.PlayCanvasCamera.ResetCameraDto): void; private createOrbitCameraInstance; private createMouseInput; private createTouchInput; } /** * Helper function to initialize a basic PlayCanvas 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 app, scene, lights, ground, and dispose function * * @example * ```typescript * import { initPlayCanvas, PlayCanvasScene } from "@bitbybit-dev/playcanvas"; * * // Basic usage with defaults * const { app, scene } = initPlayCanvas(); * * // Custom configuration * const options = new PlayCanvasScene.InitPlayCanvasDto(); * options.sceneSize = 500; * options.enableGround = true; * options.enableShadows = true; * const { app, scene, directionalLight } = initPlayCanvas(options); * ``` */ declare function initPlayCanvas(inputs?: PlayCanvasScene.InitPlayCanvasDto): InitPlayCanvasResult; /** * The PlayCanvas side of the library: what lives in the rendered scene rather than in a CAD kernel. * The `camera` property builds and steers the orbit camera; drawing itself goes through `draw`, and * the plain data helpers sit beside it on the base object. */ declare class PlayCanvas { private readonly context; camera: PlayCanvasCamera; } /** * 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; } declare class AdvancedAdv { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; text3d: Text3D; patterns: Patterns; } declare class FacePatterns { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; 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 PlayCanvas Entity * @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; } declare class Patterns { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; 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 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 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 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; /** * Draws 3d text on the screen * @param inputs Contains a model shapes to be drawn and additional information * @returns PlayCanvas Entity * @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; } declare class DrawComplete extends Draw { /** * @ignore true */ readonly drawHelper: DrawHelper; /** * @ignore true */ readonly tag: Tag; /** * @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 PlayCanvas Entity 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.DrawnEntity; /** * 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; /** * 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; } declare class ShapeParser { static parse(obj: unknown, partShapes: Models.OCCT.ShapeWithId[]): TResult; } declare class BitByBitBase { readonly draw: Draw; readonly playcanvas: PlayCanvas; readonly vector: Vector; readonly point: Point; readonly line: Line; readonly polyline: Polyline; 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; /** * 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; }