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[]; /** * A coordinate frame: an origin, a normal (its z axis) and a direction (its x axis, square to the * normal); its y axis is the normal crossed with the direction, so the frame is right-handed. A * frame places things: shapes land on it, profiles are drawn in its plane. */ type Frame = { origin: Base.Point3; normal: Base.Vector3; direction: Base.Vector3; }; /** * An infinite plane: an origin point, a normal vector, and a direction vector that fixes the * plane's rotation about its own normal. * @deprecated Use `Frame`, the same three fields; `Plane3` is removed in the next major version. */ type Plane3 = Frame; /** * 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: a hex text * such as `#ff0000`, or `[r, g, b]` values from 0 to 1. Closing it turns the chain into an * outline that can become a face. */ type Polyline3 = { points: Base.Point3[]; isClosed?: boolean; color?: string | number[]; }; /** * A connected chain of points in the plane, optionally closed, with an optional color: a hex * text such as `#ff0000`, or `[r, g, b]` values from 0 to 1. */ type Polyline2 = { points: Base.Point2[]; isClosed?: boolean; color?: string | 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[]; /** * A run of numbers in one of a recipe's buffers: where it starts and how many numbers it holds. * @beta */ type RecipeRange = [ number, number ]; /** * The numbers a recipe's nodes point into: coordinates in `f64`, triangle indices in `i32`. * @beta */ interface RecipeBuffers { /** * Coordinates: flat `x, y` pairs for polygons, `x, y, z` triples for triangle positions and * sixteen numbers for each frame of a loft. Every number in it is a coordinate, finite and * between minus and plus one billion. */ f64: Float64Array; /** * Triangle corners as positions counted from 0, three per triangle. */ i32: Int32Array; } /** * A flat region in the XY plane: everything its boundary encloses, less everything any of its * holes encloses. The boundary and each hole are a range of `x, y` pairs without the first point * repeated, in either winding; a boundary that crosses itself keeps every loop it makes. * @beta */ interface RecipePolygonNode { /** * Always `polygon`. */ op: "polygon"; /** * The boundary, clockwise or counterclockwise. */ points: RecipeRange; /** * The holes, clockwise or counterclockwise; they may overlap each other or reach past the * boundary, and only what lies inside the boundary is cut away. */ holes: RecipeRange[]; } /** * A flat disc in the XY plane. How many straight sides approximate it is left to the kernel that * builds the recipe. * @beta */ interface RecipeCircleNode { /** * Always `circle`. */ op: "circle"; /** * The centre, as `[x, y]`. */ center: Point2; /** * The radius, above zero. */ radius: number; } /** * A solid made by sweeping a polygon or circle node along a direction. * @beta */ interface RecipeExtrudeNode { /** * Always `extrude`. */ op: "extrude"; /** * The index of the polygon or circle node to sweep. */ profile: number; /** * The direction of the sweep, which must not lie in the XY plane. */ direction: Vector3; /** * How far to sweep along `direction`, which is normalised first, above zero. */ depth: number; } /** * Everything on one side of a plane: the side `normal` points to. Used only as a tool of a * difference node, to cut a solid by the plane. * @beta */ interface RecipeHalfSpaceNode { /** * Always `halfSpace`. */ op: "halfSpace"; /** * A point on the plane. */ origin: Point3; /** * The plane's normal, pointing into the half-space. */ normal: Vector3; } /** * A solid with other solids or half-spaces cut away. * @beta */ interface RecipeDifferenceNode { /** * Always `difference`. */ op: "difference"; /** * The index of the solid to cut. */ of: number; /** * The indices of what is cut away, all at once. */ tools: number[]; } /** * A node moved, turned or scaled by a matrix. * @beta */ interface RecipeTransformNode { /** * Always `transform`. */ op: "transform"; /** * The index of the node to transform. */ of: number; /** * Sixteen numbers in column-major order, with 0, 0, 0, 1 as the bottom row: a move, a turn, * a mirror and a scale, never a projection. */ matrix: TransformMatrix; } /** * A host solid with openings cut through it, such as a wall with its doors' and windows' holes. * The same as a difference, kept apart so an executor can cut openings through flat hosts in 2D. * @beta */ interface RecipeVoidsNode { /** * Always `voids`. */ op: "voids"; /** * The index of the host solid. */ host: number; /** * The indices of the opening solids. */ openings: number[]; } /** * A triangle mesh: positions and the triangles between them. * @beta */ interface RecipeTrianglesNode { /** * Always `triangles`. */ op: "triangles"; /** * A range of `x, y, z` triples in `f64`. */ positions: RecipeRange; /** * A range of `i32` indices into the positions, three per triangle. */ indices: RecipeRange; } /** * Several solids taken together as one, filling the space any of them fills. Parts that * overlap may come back joined into one solid, depending on the kernel that builds it. * @beta */ interface RecipeCompoundNode { /** * Always `compound`. */ op: "compound"; /** * The indices of the solids. */ of: number[]; } /** * Several solids joined into one, filling the space any of them fills, with no faces left where * they meet. * @beta */ interface RecipeUnionNode { /** * Always `union`. */ op: "union"; /** * The indices of the solids, at least one. */ of: number[]; } /** * The space every one of several solids fills. * @beta */ interface RecipeIntersectionNode { /** * Always `intersection`. */ op: "intersection"; /** * The indices of the solids, at least two. */ of: number[]; } /** * A solid made by turning a polygon or circle node about an axis in the XY plane, such as a pipe * bend or a round column's capital. The profile must lie on one side of the axis. * @beta */ interface RecipeRevolveNode { /** * Always `revolve`. */ op: "revolve"; /** * The index of the polygon or circle node to turn. */ profile: number; /** * A point on the axis, as `[x, y]`. */ origin: Point2; /** * The axis direction, as `[x, y]`; not a zero vector. */ direction: Vector2; /** * How far to turn, in radians, above zero and at most a whole turn. The turn follows the * right-hand rule about `direction`. */ angle: number; } /** * A solid made by placing polygon or circle nodes one after another by frames and joining each to * the next by straight sides, closed at both ends: a profile swept along a path when one profile * is placed by many frames, or a taper from one profile to another. * @beta */ interface RecipeLoftNode { /** * Always `loft`. */ op: "loft"; /** * The indices of the polygon or circle nodes: one, placed by every frame, or one per frame. * Profiles that differ should have as many corners in each loop, so a mesh kernel can join * them corner to corner. */ profiles: number[]; /** * A range of `f64` holding sixteen numbers per frame, at least two frames: each a column-major * matrix with 0, 0, 0, 1 as its bottom row, placing a profile's XY plane. */ frames: RecipeRange; } /** * One step of a recipe. A node refers only to nodes before it, by their position in the list. * @beta */ type RecipeNode = RecipePolygonNode | RecipeCircleNode | RecipeExtrudeNode | RecipeHalfSpaceNode | RecipeDifferenceNode | RecipeTransformNode | RecipeVoidsNode | RecipeTrianglesNode | RecipeCompoundNode | RecipeUnionNode | RecipeIntersectionNode | RecipeRevolveNode | RecipeLoftNode; /** * A value a recipe carries through to its results untouched. * @beta */ type RecipeTagValue = string | number | boolean | number[]; /** * What a recipe builds: one node, placed by a matrix, labelled by a tag. Several roots may place * the same node, so a repeated part is described once. * @beta */ interface RecipeRoot { /** * The index of the node to build. */ node: number; /** * Where the result is placed: sixteen numbers in column-major order, with 0, 0, 0, 1 as the * bottom row. */ matrix: TransformMatrix; /** * Labels handed back with the result unchanged, such as an element's `globalId`. */ tag: Record; /** * The index of the group the result belongs to, such as the storey an element stands on; * left out for a result that belongs to none. */ group?: number | undefined; } /** * A named group of a recipe's results, such as a storey or an assembly of parts, which may lie * in another group. An executor that builds a structure, such as an assembly document, nests its * results by their groups; one that only builds shapes ignores them. * * Experimental: the recipe format may still change before it is declared stable. * @beta */ interface RecipeGroup { /** * What the group is called, such as `Ground floor`. */ name: string; /** * The index of the group this one lies in, which comes earlier in the list; left out for a * group at the top. */ parent?: number | undefined; /** * Labels handed back with the group unchanged, such as a storey's `globalId`. */ tag: Record; } /** * Solids described as data rather than built: a list of steps (polygons, extrusions, turns and * lofts, cuts and unions, transforms, meshes) and the results to build from them. Every number is already resolved, so * a recipe has no variables or expressions; how finely circles are divided is left to the kernel * that builds it. * * Experimental: the recipe format may still change before it is declared stable. * @beta */ interface Recipe { /** * Always `bitbybit.recipe`. */ format: "bitbybit.recipe"; /** * The recipe format's version, 1. */ version: 1; /** * How many millimetres one unit of the recipe is, for whoever reads the results: the * coordinates are in the recipe's own units, and an executor builds in them unscaled. */ millimetresPerUnit: number; /** * The distance below which two positions count as the same, in the recipe's units, as the * recipe's source measured it. An executor may use it where it compares positions, or not. */ tolerance: number; /** * The numbers the nodes point into. */ buffers: RecipeBuffers; /** * The steps, each referring only to steps before it. */ nodes: RecipeNode[]; /** * The results to build. */ roots: RecipeRoot[]; /** * The groups the results belong to, each after the group it lies in; left out when the * results are not grouped. */ groups?: RecipeGroup[] | undefined; } /** * 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 * @default false */ 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 | undefined; /** * 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[] | undefined; /** * When true, the drawn mesh can be refreshed in place on later draws by passing it back as * `jscadMesh` * @default false */ updatable?: boolean | undefined; /** * When true, the mesh is created but not shown until it is made visible * @default false */ hidden?: boolean | undefined; /** * 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 | undefined; /** * Hex color of the back faces, the side the face normal points away from; used only when * `drawTwoSided` is true * @default #0000ff */ backFaceColour?: string | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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[] | undefined; /** * When true, the drawn meshes can be refreshed in place on later draws by passing the parent * back as `jscadMesh` * @default false */ updatable?: boolean | undefined; /** * When true, the meshes are created but not shown until they are made visible * @default false */ hidden?: boolean | undefined; /** * 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 | undefined; /** * Hex color of the back faces, the side the face normal points away from; used only when * `drawTwoSided` is true * @default #0000ff */ backFaceColour?: string | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * How opaque the line is, from 0 for invisible to 1 for solid * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity?: number | undefined; /** * Thickness of the drawn line * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ width?: number | undefined; /** * When true, the drawn line can be refreshed in place on later draws by passing it back as * `pathMesh` * @default false */ updatable?: boolean | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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.offset`: the 2D shape or path, the signed distance to build its outline at and * how the corners are shaped, kept sharp unless `corners` says otherwise. */ class ExpansionDto { constructor(geometry?: JSCADEntity, delta?: number, corners?: solidCornerTypeEnum, segments?: number); /** * The 2D shape or path to outline; 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 * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ delta?: number | undefined; /** * How a convex corner is shaped: `edge` keeps it sharp, `chamfer` cuts it flat, `round` curves * it with `segments` pieces * @default edge */ corners?: solidCornerTypeEnum | undefined; /** * 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 | undefined; } /** * Feeds `expansions.expand`: the geometry, the signed distance to move its boundary by and how the * corners are shaped, rounded unless `corners` says otherwise. */ class ExpandDto { constructor(geometry?: JSCADEntity, delta?: number, corners?: solidCornerTypeEnum, segments?: number); /** * The 2D shape, path or solid to grow; 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 or a path accepts a positive value only * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ delta?: number | undefined; /** * How a convex corner is shaped: `round` curves it with `segments` pieces, `chamfer` cuts it * flat, `edge` keeps it sharp; a solid accepts `round` only * @default round */ corners?: solidCornerTypeEnum | undefined; /** * Number of straight pieces a `round` corner is made of over a full circle; more makes it * smoother, and a solid needs at least 4 * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * Number of slices the twist is built from, at least 1; more makes a smoother twist and a * heavier mesh * @default 15 * @minimum 1 * @maximum Infinity * @step 1 */ twistSteps?: number | undefined; } /** * 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; } /** * The wall a rectangular extrusion builds, shared by `ExtrudeRectangularDto` and * `ExtrudeRectangularPointsDto`: how thick and how tall. */ abstract class ExtrudeRectangularSharedDto { /** * How tall the wall is along Z, in model units, standing on the XY plane * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * How far the wall reaches to each side of the path, in model units, so the wall is twice this * thick * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ size?: number | undefined; } /** * Feeds `extrusions.extrudeRectangular`: the outline to build a wall along, the wall's height along * Z and its half thickness. */ class ExtrudeRectangularDto extends ExtrudeRectangularSharedDto { 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; } /** * 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 extends ExtrudeRectangularSharedDto { 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[]; } /** * 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 | undefined; /** * Where the revolution starts, in degrees from the X axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ startAngle?: number | undefined; /** * Number of steps in a full turn; a partial angle uses proportionally fewer. Fewer than 3 * throws an error * @default 24 * @minimum 3 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * 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.Point2 | Base.Point3)[]); /** * The outline points in order, at least three, each 2D or 3D; only X and Y are used */ points: (Base.Point2 | 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * When true, the arc turns clockwise from the start to the end point; false turns * counter-clockwise * @default true */ clockwise?: boolean | undefined; /** * When true, the longer of the two arcs between the points is taken, more than half the ellipse * @default false */ large?: boolean | undefined; /** * Number of straight pieces for a full ellipse; the arc gets its proportional share * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; /** * 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 0 * @maximum Infinity * @step 0.1 */ radiusX?: number | undefined; /** * Half height of the ellipse along its own Y axis, in model units; equal to `radiusX` for a * circular arc * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusY?: number | undefined; } /** * 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 | undefined; /** * Distance from the center to the rim, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * Number of straight sides around the circle; more makes it rounder * @default 24 * @minimum 3 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * 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 | undefined; /** * The half width along X and the half height along Y, in model units, as `[x, y]` * @default [1, 2] */ radius?: Base.Point2 | undefined; /** * Number of straight sides around the ellipse; more makes it rounder * @default 24 * @minimum 3 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * 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 | undefined; /** * Length of each side, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; } /** * 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 | undefined; /** * Full size along X, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * Full size along Y, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length?: number | undefined; } /** * 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 | undefined; /** * 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 0 * @maximum Infinity * @step 0.1 */ roundRadius?: number | undefined; /** * 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 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; /** * Full size along X, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * Full size along Y, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length?: number | undefined; } /** * 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 | undefined; /** * Number of tips; the star has as many notches between them * @default 10 * @minimum 2 * @maximum Infinity * @step 1 */ vertices?: number | undefined; /** * 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 | undefined; /** * Distance from the center to each tip, in model units * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ outerRadius?: number | undefined; /** * 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 | undefined; /** * Direction of the first tip, in degrees counter-clockwise from the X axis * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ startAngle?: number | undefined; } /** * 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 | undefined; /** * Length of every edge, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; } /** * 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 | undefined; } /** * The size of a box, shared by `CuboidDto` and `CuboidCentersDto`. */ abstract class CuboidSharedDto { /** * Full size along X, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * Full size along Z, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length?: number | undefined; /** * Full size along Y, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; } /** * 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 extends CuboidSharedDto { 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 | undefined; } /** * Feeds `shapes.cuboidsOnCenterPoints`: one box of the same sizes on every center point, coming * back in the same order. */ class CuboidCentersDto extends CuboidSharedDto { 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[]; } /** * The size and rounding of a rounded box, shared by `RoundedCuboidDto` and * `RoundedCuboidCentersDto`. */ abstract class RoundedCuboidSharedDto { /** * 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 | undefined; /** * Full size along X, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * Full size along Z, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length?: number | undefined; /** * Full size along Y, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * Number of straight pieces a full circle of rounding is made of; more makes the edges smoother * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * 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 extends RoundedCuboidSharedDto { 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 | undefined; } /** * Feeds `shapes.roundedCuboidsOnCenterPoints`: one rounded box of the same sizes and rounding on * every center point, coming back in the same order. */ class RoundedCuboidCentersDto extends RoundedCuboidSharedDto { 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[]; } /** * 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 | undefined; /** * Full length along Z, in model units * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The X and Y radii of the bottom end, in model units, as `[x, y]` * @default [1, 2] */ startRadius?: Base.Vector2 | undefined; /** * 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 | undefined; /** * Number of flat sides around the cylinder; more makes it rounder * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The X and Y radii of every bottom end, in model units, as `[x, y]` * @default [1, 2] */ startRadius?: Base.Point2 | undefined; /** * 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 | undefined; /** * Number of flat sides around each cylinder; more makes them rounder * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * The size and smoothness of a cylinder, shared by `CylidnerDto` and `CylidnerCentersDto`. */ abstract class CylinderSharedDto { /** * Full length along Z, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * Distance from the axis to the side, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * Number of flat sides around the cylinder; more makes it rounder * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * 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 extends CylinderSharedDto { 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 | undefined; } /** * The size, rounding and smoothness of a rounded cylinder, shared by `RoundedCylidnerDto` and * `RoundedCylidnerCentersDto`. */ abstract class RoundedCylinderSharedDto { /** * 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 | undefined; /** * Full length along Z, in model units, rounding included * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * Distance from the axis to the side, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * Number of flat sides around the cylinder and pieces in the rounding; more makes it smoother * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * 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 extends RoundedCylinderSharedDto { 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 | undefined; } /** * The size and smoothness of an ellipsoid, shared by `EllipsoidDto` and `EllipsoidCentersDto`. */ abstract class EllipsoidSharedDto { /** * 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 | undefined; /** * Number of facets around the ellipsoid; more makes it smoother * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * 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 extends EllipsoidSharedDto { constructor(center?: Base.Point3, radius?: Base.Point3, segments?: number); /** * The point the ellipsoid is centered on * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * Feeds `shapes.ellipsoidsOnCenterPoints`: one ellipsoid of the same radii on every center point, * coming back in the same order. */ class EllipsoidCentersDto extends EllipsoidSharedDto { 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 size and subdivision of a geodesic sphere, shared by `GeodesicSphereDto` and * `GeodesicSphereCentersDto`. */ abstract class GeodesicSphereSharedDto { /** * Distance from the center to the surface, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * 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 6 * @maximum Infinity * @step 1 */ frequency?: number | undefined; } /** * 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 extends GeodesicSphereSharedDto { constructor(center?: Base.Point3, radius?: number, frequency?: number); /** * The point the sphere is centered on * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * Feeds `shapes.geodesicSpheresOnCenterPoints`: one geodesic sphere of the same radius on every * center point, coming back in the same order. */ class GeodesicSphereCentersDto extends GeodesicSphereSharedDto { 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[]; } /** * 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 extends CylinderSharedDto { 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[]; } /** * Feeds `shapes.roundedCylindersOnCenterPoints`: one rounded cylinder of the same size on every * center point, coming back in the same order. */ class RoundedCylidnerCentersDto extends RoundedCylinderSharedDto { 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[]; } /** * The size and smoothness of a sphere, shared by `SphereDto` and `SphereCentersDto`. */ abstract class SphereSharedDto { /** * Distance from the center to the surface, in model units * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * Number of facets around the sphere; more makes it rounder * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; } /** * Feeds `shapes.sphere`: a sphere given by its center point, its radius and how many facets * approximate it. */ class SphereDto extends SphereSharedDto { constructor(center?: Base.Point3, radius?: number, segments?: number); /** * The point the sphere is centered on * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * Feeds `shapes.spheresOnCenterPoints`: one sphere of the same radius on every center point, coming * back in the same order. */ class SphereCentersDto extends SphereSharedDto { 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[]; } /** * 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 | undefined; /** * Radius of the tube itself, in model units; it must be less than `outerRadius` * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ innerRadius?: number | undefined; /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ outerRadius?: number | undefined; /** * Number of flat pieces around the tube's cross-section; more makes the tube rounder * @default 24 * @minimum 3 * @maximum Infinity * @step 1 */ innerSegments?: number | undefined; /** * Number of flat pieces around the ring; more makes the ring rounder * @default 24 * @minimum 3 * @maximum Infinity * @step 1 */ outerSegments?: number | undefined; /** * 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 | undefined; /** * How far the tube is swept around the ring, in degrees; 360 closes the ring and less leaves it * open * @default 360 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 1 */ outerRotation?: number | undefined; /** * Where the sweep around the ring starts, in degrees from the X axis * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ startAngle?: number | undefined; } /** * 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 | undefined; /** * Number of straight pieces used for curved strokes; more makes letters rounder * @default 24 * @minimum 0 * @maximum Infinity * @step 1 */ segments?: number | undefined; /** * Where the text starts along X, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset?: number | undefined; /** * Where the baseline of the first line sits along Y, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * How the lines of a multi-line text line up: to the left, the center or the right * @default center */ align?: jscadTextAlignEnum | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * Number of flat sides around each cylinder and pieces in curved strokes; more makes the * letters rounder * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; /** * Where the text starts along X before it is centered, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset?: number | undefined; /** * Where the baseline of the first line sits along Y, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * How the lines of a multi-line text line up: to the left, the center or the right * @default center */ align?: jscadTextAlignEnum | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * Number of facets around each sphere and pieces in curved strokes; more makes the letters * rounder * @default 24 * @minimum 4 * @maximum Infinity * @step 1 */ segments?: number | undefined; /** * Where the text starts along X before it is centered, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ xOffset?: number | undefined; /** * Where the baseline of the first line sits along Y, in model units * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ yOffset?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * How the lines of a multi-line text line up: to the left, the center or the right * @default center */ align?: jscadTextAlignEnum | undefined; /** * 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 | undefined; } /** * 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, minSharpAngle?: 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 | 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 | undefined; /** * The color of a cross-section's lines as a hex string. * @default #ff00ff */ crossSectionColour?: Base.Color | undefined; /** * How thick a cross-section's lines are drawn. * @default 2 */ crossSectionWidth?: number | undefined; /** * How opaque a cross-section's lines are, from 0 to 1. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ crossSectionOpacity?: number | undefined; /** * When true, solids shade smoothly across edges flatter than `minSharpAngle` and keep sharper * ones crisp; when false, every face is shaded flat. * @default true */ computeNormals?: boolean | undefined; /** * The angle between two faces, in degrees, above which their shared edge is drawn sharp when * `computeNormals` is true. * @default 40 * @minimum 0 * @maximum 180 * @step 5 */ minSharpAngle?: number | undefined; /** * When true, the back of each face is drawn in its own color, which shows which way faces * point. * @default true */ drawTwoSided?: boolean | undefined; /** * The color of the back of the faces as a hex string; used only with `drawTwoSided`. * @default #0000ff */ backFaceColour?: Base.Color | undefined; /** * 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 | undefined; } /** * 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, minSharpAngle?: 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 | 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 | undefined; /** * The color of a cross-section's lines as a hex string. * @default #ff00ff */ crossSectionColour?: Base.Color | undefined; /** * How thick a cross-section's lines are drawn. * @default 2 */ crossSectionWidth?: number | undefined; /** * How opaque a cross-section's lines are, from 0 to 1. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ crossSectionOpacity?: number | undefined; /** * When true, solids shade smoothly across edges flatter than `minSharpAngle` and keep sharper * ones crisp; when false, every face is shaded flat. * @default true */ computeNormals?: boolean | undefined; /** * The angle between two faces, in degrees, above which their shared edge is drawn sharp when * `computeNormals` is true. * @default 40 * @minimum 0 * @maximum 180 * @step 5 */ minSharpAngle?: number | undefined; /** * When true, the back of each face is drawn in its own color, which shows which way faces * point. * @default true */ drawTwoSided?: boolean | undefined; /** * The color of the back of the faces as a hex string; used only with `drawTwoSided`. * @default #0000ff */ backFaceColour?: Base.Color | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The side length of the cube, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * How many segments go around the sphere; rounded up to a multiple of four. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments?: number | undefined; } /** * 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 | undefined; /** * The radius of the bottom circle, in model units; must be above 0. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusLow?: number | undefined; /** * 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 | undefined; /** * How many flat sides go around the cylinder; more is rounder. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments?: number | undefined; /** * When true, the cylinder is centered on the origin; when false it stands on the XY plane. * @default true */ center?: boolean | undefined; } /** * 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 | undefined; /** * How many straight sides the circle is drawn with; more is rounder. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments?: number | undefined; } /** * 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 | undefined; /** * The side along Y, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * When true, the rectangle is centered on the origin; when false its corner sits there. * @default false */ center?: boolean | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * Where the ray segment ends; nothing beyond it is hit. * @default [0,0,10] */ endpoint?: Base.Point3 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 0 * @maximum Infinity * @step 1 */ numProp?: number | undefined; /** * 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 0 * @maximum 180 * @step 1 */ minSharpAngle?: number | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * How far the top is turned against the bottom, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ twistDegrees?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * When true, the solid is centered on the XY plane; when false it stands on it. * @default true */ center?: boolean | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 1 */ revolveDegrees?: number | undefined; /** * 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 | undefined; /** * How many segments go around the turn; more is rounder. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments?: number | undefined; } /** * Cross-sections and the frames that place them for `crossSection.operations.loft`, which joins them * in order into a solid. */ class LoftDto { constructor(crossSections?: T[], frames?: Base.TransformMatrix[]); /** * One cross-section, placed by every frame, or one for each frame. Cross-sections that differ * need as many loops with as many corners each, as a moved or scaled copy has. */ crossSections: T[]; /** * Where each section stands, at least two: sixteen numbers in column-major order that place the * cross-section's XY plane, with 0, 0, 0, 1 as the bottom row. */ frames: Base.TransformMatrix[]; } /** * A cross-section, a path and the corner settings for `crossSection.operations.sweep`, which * carries the cross-section along the path into a solid. */ class SweepDto { constructor(crossSection?: T, path?: Base.Point3[], cornerRadius?: number, circularSegments?: number, xDirection?: Base.Vector3); /** * The profile to carry, drawn around the origin of its XY plane, which follows the path. */ crossSection: T; /** * The points the path runs through, at least two. */ path: Base.Point3[]; /** * How much the path's corners are rounded; 0 keeps them sharp, mitred so the solid keeps its * width. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ cornerRadius?: number | undefined; /** * How many segments a whole turn of a rounded corner is divided into; more is rounder. * @default 32 * @minimum 3 * @maximum Infinity * @step 1 */ circularSegments?: number | undefined; /** * Where the profile's X axis points at the start of the path, turned square to it; left out, * one is chosen. The profile then follows the path's turns without twisting. * @default undefined * @optional true */ xDirection?: Base.Vector3 | undefined; } /** * 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 | undefined; /** * How corners are treated: `round`, `square`, `miter` or `bevel`. * @default round */ joinType?: manifoldJoinTypeEnum | undefined; /** * 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 | undefined; /** * For `round` joins, how many segments a full circle of rounding gets. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ circularSegments?: number | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * How far to move along Y, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ y?: number | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The rotation about the Y axis in degrees, applied second. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ y?: number | undefined; /** * The rotation about the Z axis in degrees, applied last. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ z?: number | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * How far to move along Y, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ y?: number | undefined; /** * How far to move along Z, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ z?: number | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * How far each plane sits from the origin along the normal, in model units, in increasing * order. * @default [0] */ originOffsets?: number[] | undefined; } /** * 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, minSharpAngle?: 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; /** * When given, a solid's mesh carries normals after its positions, and edges sharper than this, * in degrees, keep a normal on each side; 0 shades every face flat. * @default undefined * @optional true * @minimum 0 * @maximum 180 * @step 5 */ minSharpAngle?: 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[], minSharpAngle?: 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; /** * When given, each solid's mesh carries normals after its positions, and edges sharper than * this, in degrees, keep a normal on each side; 0 shades every face flat. * @default undefined * @optional true * @minimum 0 * @maximum 180 * @step 5 */ minSharpAngle?: number | undefined; } /** * A recipe for `recipes.build`, which builds each of its roots as a solid, with how finely circles * are divided and whether Z turns into Y. Experimental: the recipe format may still change. * @beta */ class BuildRecipeDto { constructor(recipe?: Base.Recipe, circularSegments?: number, adjustZtoY?: boolean, emptyWhenFailed?: boolean); /** * The recipe: steps such as polygons, extrusions and cuts, and the roots to build from them, as * a package that describes geometry as data writes it. * @default undefined */ recipe: Base.Recipe; /** * How many flat sides each circle of the recipe is divided into; more is rounder. The recipe * leaves this to the kernel, so it is chosen here. * @default 32 * @minimum 3 * @maximum Infinity * @step 1 */ circularSegments?: number | undefined; /** * When true, each solid turns a quarter turn about X so the recipe's Z points along Y, which is * up when drawn: `(x, y, z)` becomes `(x, z, -y)`. * @default false */ adjustZtoY?: boolean | undefined; /** * When true, a root that cannot be built, such as an open mesh, comes back empty, and an * opening that cannot is left uncut; when false, both stop the build. * @default false */ emptyWhenFailed?: boolean | undefined; } /** * A recipe for `recipes.surfaceMeshes`, which gives the roots made of triangle meshes alone as * meshes, with which roots to read and whether Z turns into Y. Experimental: the recipe format may * still change. * @beta */ class RecipeSurfaceMeshesDto { constructor(recipe?: Base.Recipe, roots?: number[], adjustZtoY?: boolean); /** * The recipe: steps such as polygons, extrusions and triangle meshes, and the roots to build * from them, as a package that describes geometry as data writes it. * @default undefined */ recipe: Base.Recipe; /** * The positions of the roots to read, such as the ones `recipes.build` gave back empty; every * root when left out. * @default undefined * @optional true */ roots?: number[] | undefined; /** * When true, each mesh turns a quarter turn about X so the recipe's Z points along Y, as * `recipes.build` turns its solids: `(x, y, z)` becomes `(x, z, -y)`. * @default false */ adjustZtoY?: boolean | undefined; } /** * A recipe for `recipes.meshes`, which gives the meshes its roots draw, with how finely circles are * divided, whether Z turns into Y, whether failures are skipped and where normals split. * Experimental: the recipe format may still change. * @beta */ class BuildRecipeMeshesDto { constructor(recipe?: Base.Recipe, circularSegments?: number, adjustZtoY?: boolean, emptyWhenFailed?: boolean, minSharpAngle?: number); /** * The recipe: steps such as polygons, extrusions and cuts, and the roots to draw from them, as * a package that describes geometry as data writes it. * @default undefined */ recipe: Base.Recipe; /** * How many flat sides each circle of the recipe is divided into; more is rounder. * @default 32 * @minimum 3 * @maximum Infinity * @step 1 */ circularSegments?: number | undefined; /** * When true, every placement turns a quarter turn about X so the recipe's Z points along Y, * which is up when drawn: `(x, y, z)` becomes `(x, z, -y)`. * @default false */ adjustZtoY?: boolean | undefined; /** * When true, a root that cannot be built draws as its surface if it is triangles alone, else * draws nothing; when false, it stops the build. * @default false */ emptyWhenFailed?: boolean | undefined; /** * Edges sharper than this, in degrees, keep a normal on each side; 0 shades every face flat. * @default 40 * @minimum 0 * @maximum 180 * @step 5 */ minSharpAngle?: number | undefined; } /** * Where one recipe root draws: which mesh, placed by which matrix, with the root's tag and group. * Experimental: the recipe format may still change. * @beta */ class RecipeMeshPlacementDto { /** * The index of the root's mesh among the meshes, or -1 when the root gives nothing to draw. */ mesh: number; /** * The column-major 4 x 4 matrix taking the mesh's coordinates to where the root draws it. */ matrix: Base.TransformMatrix; /** * The root's tag, as the recipe gives it. */ tag: Record; /** * The root's group, a position in the recipe's groups. * @optional true */ group?: number | undefined; } /** * The meshes a recipe draws, each shared one once, and one placement per root, in root order. * Experimental: the recipe format may still change. * @beta */ class RecipeMeshesDto { /** * The meshes, positions and normals per vertex, each in its own coordinates. */ meshes: DecomposedManifoldMeshDto[]; /** * Where each root draws, in root order. */ placements: RecipeMeshPlacementDto[]; } } /** * Re-export Base namespace from @bitbybit-dev/base. * IFC package uses the same foundational types without additions. */ /** * Every parameter object the IFC library accepts. IFC is the open BIM exchange format: a model is a * graph of building elements, the storeys that contain them, their materials, types and properties, * with geometry kept as parametric extrusions and clippings. * * Every method that changes a model takes one and returns a new one, leaving the one it was given * as it was, so keep the result and pass it on. Lengths are in the model's length unit, millimetres * unless the model was created with another; positions on a storey are in its plan, X and Y, with Z * up from the storey's elevation. Experimental, as the IFC library is. * @beta */ declare namespace IFC { /** * A handle to an IFC model held by the library, not the model's data itself. Pass it to the next * call that reads or changes the model; a change returns a new handle and leaves this one as it was. */ type IfcModelPointer = { hash: number; type: "ifc-model"; }; /** * One attribute value as a model holds it, as `model.getAttribute` returns it: a text, a number, * true or false, `null` when the attribute is unset, `{ enum }` for an enumeration value, * `{ type, value }` for a typed value, `{ ref }` for a reference to another entity, or a list of * these. */ type IfcAttributeValue = IfcValue; /** * The length unit a new model is written in. Every length a method takes or returns is in this unit. */ enum lengthUnitEnum { /** * Lengths in millimetres, as most building models are written. */ millimetre = "millimetre", /** * Lengths in centimetres. */ centimetre = "centimetre", /** * Lengths in metres. */ metre = "metre" } /** * Which side of its axis a wall's layers lie on, looking from the wall's start to its end: centred on * the axis, to its left, or to its right. */ enum wallAlignmentEnum { /** * The layers are centred on the axis. */ center = "center", /** * The layers lie to the left of the axis. */ left = "left", /** * The layers lie to the right of the axis. */ right = "right" } /** * Where on a wall another wall meets it: at its start, at its end, or somewhere along its length. */ enum wallEndEnum { /** * At the start of its axis. */ start = "start", /** * At the end of its axis. */ end = "end", /** * Somewhere along its length, as the stem of a T meets the wall it ends against. */ along = "along" } /** * What kind of wall it is, as IFC classifies walls. */ enum wallPredefinedTypeEnum { /** * A straight wall of constant thickness, the common case. */ standard = "STANDARD", /** * A wall of solid construction, such as masonry. */ solidWall = "SOLIDWALL", /** * A wall that divides a space without carrying load. */ partitioning = "PARTITIONING", /** * A wall that resists lateral forces. */ shear = "SHEAR", /** * A low wall along the edge of a roof or balcony. */ parapet = "PARAPET", /** * A wall that can be moved, such as a folding partition. */ movable = "MOVABLE", /** * A wall that carries pipes, such as a service wall. */ plumbingWall = "PLUMBINGWALL", /** * No kind is given. */ notDefined = "NOTDEFINED" } /** * The shape of a roof over a rectangle: flat, sloping one way, two slopes meeting at a ridge, or four * slopes meeting at a ridge or a point. */ enum roofKindEnum { /** * Flat, one level slab. */ flat = "flat", /** * One slope, rising from the outline's first side to the opposite side. */ monoPitch = "monoPitch", /** * Two slopes rising from the first side and the opposite side to a ridge between them. */ gable = "gable", /** * Four slopes rising from every side, to a ridge along the longer sides or, over a square, to a * point. */ hip = "hip" } /** * What kind of member it is, as IFC classifies the linear parts of frames, roofs and facades. */ enum memberPredefinedTypeEnum { /** * A diagonal that stiffens a frame. */ brace = "BRACE", /** * The top or bottom edge of a truss. */ chord = "CHORD", /** * A horizontal tie between two rafters. */ collar = "COLLAR", /** * A member of no more particular kind. */ member = "MEMBER", /** * A vertical between panes of a window or a curtain wall. */ mullion = "MULLION", /** * A flat member, such as a gusset. */ plate = "PLATE", /** * A vertical support, such as a fence post. */ post = "POST", /** * A horizontal member that carries roof covering across rafters. */ purlin = "PURLIN", /** * A sloping member that carries a roof. */ rafter = "RAFTER", /** * A sloping member that carries the treads of a stair. */ stringer = "STRINGER", /** * A member that takes compression along its length. */ strut = "STRUT", /** * A vertical member of a framed wall. */ stud = "STUD", /** * Not said. */ notDefined = "NOTDEFINED" } /** * What kind of assembly it is, as IFC classifies elements made of other elements. */ enum elementAssemblyPredefinedTypeEnum { /** * Parts that support or connect others, such as a bracket with its fixings. */ accessoryAssembly = "ACCESSORY_ASSEMBLY", /** * An arch. */ arch = "ARCH", /** * Beams laid in a grid. */ beamGrid = "BEAM_GRID", /** * A frame stiffened by diagonal braces. */ bracedFrame = "BRACED_FRAME", /** * A girder built up of plates and members. */ girder = "GIRDER", /** * A cage of reinforcing bars placed as one. */ reinforcementUnit = "REINFORCEMENT_UNIT", /** * A frame whose joints hold it rigid without braces. */ rigidFrame = "RIGID_FRAME", /** * A field of slabs laid together. */ slabField = "SLAB_FIELD", /** * A truss. */ truss = "TRUSS", /** * A kind IFC does not name, such as a cladding of boards; `objectType` says what it is. */ userDefined = "USERDEFINED", /** * An assembly of no particular kind. */ notDefined = "NOTDEFINED" } /** * What kind of space it is, as IFC classifies spaces. */ enum spacePredefinedTypeEnum { /** * A room or an area of a storey. */ space = "SPACE", /** * A parking bay. */ parking = "PARKING", /** * The gross floor area of a storey, measured around its outside. */ gfa = "GFA", /** * An enclosed space inside the building. */ internal = "INTERNAL", /** * A space outside the building, such as a terrace. */ external = "EXTERNAL", /** * Not said. */ notDefined = "NOTDEFINED" } /** * What kind of slab it is, as IFC classifies slabs. */ enum slabPredefinedTypeEnum { /** * A floor slab. */ floor = "FLOOR", /** * A roof slab. */ roof = "ROOF", /** * A landing of a stair. */ landing = "LANDING", /** * A slab on the ground, at the base of the building. */ baseSlab = "BASESLAB", /** * No kind is given. */ notDefined = "NOTDEFINED" } /** * How a single-panel door opens, as IFC names its operation types. The door's geometry is the same * panel for each; the operation is what other tools read to draw its swing. Left and right are as IFC * defines them, seen looking along the door's Y axis, which points to its wall's left: standing on the * wall's right side, with the wall's start on your left, a left door is hinged toward the wall's start * and a right door toward its end. The handle is on the other edge. */ enum doorOperationEnum { /** * One panel swinging, hinged on the left. */ singleSwingLeft = "SINGLE_SWING_LEFT", /** * One panel swinging, hinged on the right. */ singleSwingRight = "SINGLE_SWING_RIGHT", /** * One panel swinging both ways, hinged on the left. */ doubleSwingLeft = "DOUBLE_SWING_LEFT", /** * One panel swinging both ways, hinged on the right. */ doubleSwingRight = "DOUBLE_SWING_RIGHT", /** * One panel sliding to the left. */ slidingToLeft = "SLIDING_TO_LEFT", /** * One panel sliding to the right. */ slidingToRight = "SLIDING_TO_RIGHT", /** * One panel folding to the left. */ foldingToLeft = "FOLDING_TO_LEFT", /** * One panel folding to the right. */ foldingToRight = "FOLDING_TO_RIGHT", /** * A revolving door. */ revolving = "REVOLVING", /** * A door that rolls up. */ rollingUp = "ROLLINGUP", /** * No kind is given. */ notDefined = "NOTDEFINED" } /** * The handle a door type carries on both faces of its panel, on the side away from its hinges. */ enum doorHandleEnum { /** * No handle. */ none = "none", /** * A lever handle at hand height. */ lever = "lever", /** * A long upright pull bar, as on an entrance door. */ pullBar = "pullBar" } /** * The shape of the section a column or beam is extruded from: a rectangle, a circle or an I section. */ enum profileKindEnum { /** * A rectangle of `width` by `depth`. */ rectangle = "rectangle", /** * A circle of `radius`. */ circle = "circle", /** * An I section of `width` and `depth`, with `webThickness` and `flangeThickness`. */ iShape = "iShape" } /** * A model to read, for the methods that only look at it, such as `model.summary` and * `spatial.storeys`. */ class ModelDto { constructor(model?: T); /** * The model to read, as `model.create` or `model.read` returned it. * @default undefined */ model: T; } /** * What `model.create` starts a new model with: a project, its site and one building, in the length * unit every later length is given in. */ class CreateModelDto { constructor(name?: string, siteName?: string, buildingName?: string, lengthUnit?: lengthUnitEnum, seed?: string, author?: string, organization?: string); /** * The project's name. * @default Project */ name?: string | undefined; /** * The site's name. * @default Site */ siteName?: string | undefined; /** * What the one building the model starts with is called. * @default Building */ buildingName?: string | undefined; /** * The unit every length of the model is given and written in. * @default millimetre */ lengthUnit?: lengthUnitEnum | undefined; /** * Any text the model's GlobalIds are derived from, so running the same calls again writes the * same file. Leave it out for random GlobalIds, unique to this model. * @default undefined * @optional true */ seed?: string | undefined; /** * Who the file's header names as its author. * @default undefined * @optional true */ author?: string | undefined; /** * The organization the file's header names. * @default undefined * @optional true */ organization?: string | undefined; } /** * The contents of an IFC file for `model.read`, as text or bytes. */ class ReadModelDto { constructor(data?: string | Uint8Array | ArrayBuffer); /** * The file's contents: the text of an `.ifc` file, or the bytes of an `.ifc` or `.ifczip` * file, such as what `await file.arrayBuffer()` gives for a file a user picked. * @default undefined */ data: string | Uint8Array | ArrayBuffer; } /** * A model to write for `model.write`, with the file name and time its header records. */ class WriteModelDto { constructor(model?: T, fileName?: string, timeStamp?: string); /** * The model whose entities the file holds. * @default undefined */ model: T; /** * The file name the header records. * @default model.ifc */ fileName?: string | undefined; /** * When the file was written, as ISO 8601 such as `2026-10-06T12:00:00`. Left out, the current * time; give one to write the same file every time. * @default undefined * @optional true */ timeStamp?: string | undefined; } /** * A model and a filter for `model.elements`, which lists the elements of one type, optionally on one * storey. */ class ElementsDto { constructor(model?: T, type?: string, storey?: string); /** * The model to list from. * @default undefined */ model: T; /** * The IFC type to list, its subtypes included, such as `IfcWall`, `IfcBuildingElement` for walls, * slabs, doors and the like, or `IfcElement` for every element, openings included. * @default IfcElement */ type?: string | undefined; /** * Only the elements standing in this storey or other spatial element, by GlobalId or by the id * it was added with. Leave it out for every one. * @default undefined * @optional true */ storey?: string | undefined; } /** * A model and one of its objects, by GlobalId or by the id it was added with, for `model.element`, * `model.remove`, `properties.getSets` and `quantities.get`. */ class ElementDto { constructor(model?: T, element?: string); /** * The model the object is in. * @default undefined */ model: T; /** * The object, by GlobalId or by the id it was added with. * @default undefined */ element: string; } /** * One attribute of an object to set for `model.setAttribute`, such as a wall's `Name` or `Tag`. */ class SetAttributeDto { constructor(model?: T, element?: string, attribute?: string, value?: string | number | boolean); /** * The model the object is in. * @default undefined */ model: T; /** * The object, by GlobalId or by the id it was added with. * @default undefined */ element: string; /** * The attribute's name, as the IFC schema spells it, such as `Name`, `Description` or `Tag`. * @default Name */ attribute?: string | undefined; /** * The new value: a text, a number, true or false, or the name of an enumeration value for an * attribute that takes one. * @default undefined */ value: string | number | boolean; } /** * An object's attribute to read for `model.getAttribute`. */ class GetAttributeDto { constructor(model?: T, element?: string, attribute?: string); /** * The model the object is in. * @default undefined */ model: T; /** * The object, by GlobalId or by the id it was added with. * @default undefined */ element: string; /** * The attribute's name, as the IFC schema spells it, such as `Name`, `Description` or `Tag`. * @default Name */ attribute?: string | undefined; } /** * A model and an id for `model.globalIdOf`, which says which GlobalId the id stands for. */ class GlobalIdOfDto { constructor(model?: T, id?: string); /** * The model the id belongs to; ids of different models stand for different GlobalIds. * @default undefined */ model: T; /** * Any text used as an id, or a GlobalId, which stands for itself. * @default undefined */ id: string; } /** * How far to move an element and how far to turn it, for `model.move`. */ class MoveElementDto { constructor(model?: T, element?: string, translation?: Base.Vector3, rotation?: number); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The element or space, by GlobalId or by the id it was added with. * @default undefined */ element: string; /** * How far to move it, as `[x, y, z]` in the plan of its storey: X and Y in plan, Z up. * @default [0, 0, 0] */ translation?: Base.Vector3 | undefined; /** * How far to turn it, in degrees counterclockwise seen from above, about the vertical through * its own origin; it turns before it moves. * @default 0 * @minimum -Infinity * @maximum Infinity */ rotation?: number | undefined; } /** * A storey to add to the model's building for `spatial.addStorey`, at its elevation above the * building's origin. */ class AddStoreyDto { constructor(model?: T, id?: string, name?: string, elevation?: number); /** * The model to change, which must have exactly one building; it stays as it was, and the call * returns the changed model. * @default undefined */ model: T; /** * An id of your own, such as `ground`, by which later calls refer to the storey; the model turns * it into a GlobalId. Left out, one is generated. * @default undefined * @optional true */ id?: string | undefined; /** * What the storey is called, such as `Ground floor`. * @default Storey */ name?: string | undefined; /** * How high the storey's floor is above the building's origin. * @default 0 * @minimum -Infinity * @maximum Infinity */ elevation?: number | undefined; } /** * A material to add for `materials.add`, which layer sets, columns and beams then name. */ class AddMaterialDto { constructor(model?: T, name?: string, category?: string, color?: string, transparency?: number); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The material's name, unique in the model, by which layer sets and members refer to it. * @default Material */ name?: string | undefined; /** * A broad category such as `concrete`, `steel`, `brick` or `timber`. * @default undefined * @optional true */ category?: string | undefined; /** * The colour the material is shown with, as hex such as `#b5651d`. Leave it out for none. * @default undefined * @optional true */ color?: string | undefined; /** * How see-through the material is shown, from 0 for opaque to 1 for invisible; used with * `color`. * @default 0 * @minimum 0 * @maximum 1 */ transparency?: number | undefined; } /** * One layer of a layer set: its material, by name, and its thickness. Used by `materials.addLayerSet`. */ class MaterialLayerDto { constructor(material?: string, thickness?: number, name?: string); /** * The name of the layer's material, added before with `materials.add`. Leave it out for a layer * without one. * @default undefined * @optional true */ material?: string | undefined; /** * How thick the layer is, across the wall or down through the slab. Left out, 100 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity */ thickness?: number | undefined; /** * The layer's own name, such as `Insulation`. * @default undefined * @optional true */ name?: string | undefined; } /** * A named stack of material layers for `materials.addLayerSet`, which walls, slabs and roofs are made * of; a wall's first layer is on its right face, looking from start to end, a slab's or roof's at its * top. */ class AddLayerSetDto { constructor(model?: T, name?: string, layers?: MaterialLayerDto[]); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The layer set's name, unique in the model, by which walls, wall types and slabs refer to it. * @default Layers */ name?: string | undefined; /** * The layers, in order; their thicknesses add up to the thickness of what is made of them. * @default undefined */ layers: MaterialLayerDto[]; } /** * A storey as `spatial.storeys` and `model.summary` list it: its GlobalId, name and elevation. */ class StoreyInfoDto { /** * The GlobalId that identifies the storey. * @default "" */ globalId: string; /** * What the storey is called. * @default "" */ name: string; /** * How high its floor is above the building's origin, in the model's length unit. * @default 0 */ elevation: number; } /** * A storey and its new elevation for `spatial.setElevation`. */ class SetStoreyElevationDto { constructor(model?: T, storey?: string, elevation?: number); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The storey, by GlobalId or by the id it was added with. * @default undefined */ storey: string; /** * How high its floor is now above the building's origin; everything on the storey moves with it. * @default 0 * @minimum -Infinity * @maximum Infinity */ elevation?: number | undefined; } /** * A space to add for `spaces.add`: a room or an area of a storey, an outline in the storey's plan * extruded up to its height. */ class AddSpaceDto { constructor(model?: T, storey?: string, id?: string, name?: string, longName?: string, outline?: Base.Point2[], height?: number, baseOffset?: number, predefinedType?: spacePredefinedTypeEnum); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The storey the space belongs to, by GlobalId or by the id it was added with. * @default undefined */ storey: string; /** * An id of your own for the space. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * The space's short name or number, such as `1.04`. * @default undefined * @optional true */ name?: string | undefined; /** * The space's full name, such as `Kitchen`. * @default undefined * @optional true */ longName?: string | undefined; /** * The outline, as `[x, y]` points in the storey's plan, without the first repeated at the end; * either winding works. * @default undefined */ outline: Base.Point2[]; /** * How high the space reaches, up from its base. Left out, 3 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ height?: number | undefined; /** * How far above the storey's floor the space starts. * @default 0 * @minimum -Infinity * @maximum Infinity */ baseOffset?: number | undefined; /** * What kind of space it is. * @default space */ predefinedType?: spacePredefinedTypeEnum | undefined; } /** * A model and, optionally, a storey, for `spaces.list`. */ class SpacesDto { constructor(model?: T, storey?: string); /** * The model to list the spaces of. * @default undefined */ model: T; /** * Only the spaces of this storey, by GlobalId or by the id it was added with. Leave it out for * every storey. * @default undefined * @optional true */ storey?: string | undefined; } /** * A space as `spaces.list` describes it: its number and name, its storey, and its area and height. */ class SpaceInfoDto { /** * The GlobalId that identifies the space. * @default "" */ globalId: string; /** * Its short name or number, or an empty text when it has none. * @default "" */ name: string; /** * Its full name, or an empty text when it has none. * @default "" */ longName: string; /** * The GlobalId of the storey it belongs to, or an empty text when it belongs to none. * @default "" */ storey: string; /** * The area of its outline, in the square of the model's length unit, so square millimetres in a * millimetre model; 0 when its body is not an outline extruded up. * @default 0 */ area: number; /** * How high it reaches; 0 when its body is not an outline extruded up. * @default 0 */ height: number; } /** * An element as `model.elements` and `model.element` describe it. */ class ElementInfoDto { /** * The GlobalId that identifies the element. * @default "" */ globalId: string; /** * Its IFC type, such as `IfcWall`. * @default "" */ type: string; /** * Its name, or an empty text when it has none. * @default "" */ name: string; /** * The GlobalId of the spatial element it stands in: its storey, or a space, road, bridge or * other facility part; an empty text when none contains it. * @default "" */ storey: string; } /** * Where a model sits on the Earth, as `model.georeference` reads it: its map conversion and its * site's reference latitude, longitude and elevation. */ class GeoreferenceDto { /** * Whether the model holds a map conversion; when it does not, the map fields keep their defaults. * @default false */ mapped: boolean; /** * The name of the projected coordinate reference system the map conversion targets, such as * `EPSG:3301`. * @default "" */ crs: string; /** * How far east of the map's origin the model's origin lies, in the map's unit. * @default 0 */ eastings: number; /** * How far north of the map's origin the model's origin lies, in the map's unit. * @default 0 */ northings: number; /** * The height of the model's origin above the vertical datum, in the map's unit. * @default 0 */ orthogonalHeight: number; /** * The first map coordinate of the direction the model's X axis points in. * @default 1 */ xAxisAbscissa: number; /** * The second map coordinate of the direction the model's X axis points in. * @default 0 */ xAxisOrdinate: number; /** * The scale from the model's lengths to the map's. * @default 1 */ scale: number; /** * Whether the site records a latitude and a longitude. * @default false */ located: boolean; /** * The site's reference latitude in decimal degrees, negative to the south. * @default 0 */ latitude: number; /** * The site's reference longitude in decimal degrees, negative to the west. * @default 0 */ longitude: number; /** * The site's reference elevation above sea level, in the model's length unit. * @default 0 */ elevation: number; } /** * What a model holds, as `model.summary` describes it. */ class ModelSummaryDto { /** * The schema the model's file names, such as `IFC4`. * @default "" */ schema: string; /** * Whether the model can be changed: false for an `IFC2X3` file, which is read through `IFC4` * to be shown and queried. * @default true */ editable: boolean; /** * What the project is called. * @default "" */ project: string; /** * How many millimetres one length unit of the model is. * @default 1 */ millimetresPerUnit: number; /** * How many entities the model holds, geometry and relationships included. * @default 0 */ entities: number; /** * The storeys, lowest first. * @default [] */ storeys: StoreyInfoDto[]; /** * How many elements of each IFC type the model holds, such as `{ IfcWall: 8 }`. * @default {} */ elementCounts: Record; } /** * A straight wall to add for `walls.add`: an axis from `start` to `end` on a storey, a height, and * either a `thickness` or the layer set it is made of. */ class AddWallDto { constructor(model?: T, storey?: string, id?: string, name?: string, start?: Base.Point2, end?: Base.Point2, height?: number, thickness?: number, layerSet?: string, alignment?: wallAlignmentEnum, baseOffset?: number, wallType?: string, predefinedType?: wallPredefinedTypeEnum); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The storey the wall stands on, by GlobalId or by the id it was added with. * @default undefined */ storey: string; /** * An id of your own, such as `north-wall`, by which later calls refer to the wall; the model * turns it into a GlobalId. Left out, one is generated. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the wall, which other tools show; it need not be unique. * @default undefined * @optional true */ name?: string | undefined; /** * The start of the wall's axis, as `[x, y]` in the storey's plan. * @default undefined */ start: Base.Point2; /** * The end of the wall's axis, as `[x, y]` in the storey's plan. * @default undefined */ end: Base.Point2; /** * The wall's height, up from its base. Left out, 3 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ height?: number | undefined; /** * The wall's thickness, used when no `layerSet` is given; the wall is then one layer without a * material. Left out, 200 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ thickness?: number | undefined; /** * The name of the layer set the wall is made of, added before with `materials.addLayerSet`; its * layers set the thickness. * @default undefined * @optional true */ layerSet?: string | undefined; /** * Which side of the axis the wall's layers lie on, looking from `start` to `end`. Walls drawn * counterclockwise around a plan with `right` stand outside the outline. * @default center */ alignment?: wallAlignmentEnum | undefined; /** * How far above the storey's floor the wall starts. * @default 0 * @minimum -Infinity * @maximum Infinity */ baseOffset?: number | undefined; /** * The wall type the wall is an occurrence of, by GlobalId or by the id it was added with. * @default undefined * @optional true */ wallType?: string | undefined; /** * What kind of wall it is, for a wall without a `wallType`; a wall of a type is the kind its * type says. * @default standard */ predefinedType?: wallPredefinedTypeEnum | undefined; } /** * Two walls for `walls.connect`, which works out where they meet and trims both, or for * `walls.disconnect`, which takes the join away. */ class ConnectWallsDto { constructor(model?: T, wall?: string, other?: string); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * One wall, by GlobalId or by the id it was added with. * @default undefined */ wall: string; /** * The other wall, by GlobalId or by the id it was added with. * @default undefined */ other: string; } /** * A wall and a plane to clip it with for `walls.clipByPlane`, which removes the part of the wall on * the side the plane's normal points to. */ class ClipWallDto { constructor(model?: T, wall?: string, origin?: Base.Point3, normal?: Base.Vector3); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The wall, by GlobalId or by the id it was added with. * @default undefined */ wall: string; /** * A point on the plane, as `[x, y, z]` in the wall's storey: X and Y in plan, Z up from the * storey's floor. * @default undefined */ origin: Base.Point3; /** * The plane's normal, pointing to the side that is removed; `[0, 0, 1]` cuts the top off level. * @default [0, 0, 1] */ normal?: Base.Vector3 | undefined; } /** * A wall and a roof to clip it under, for `walls.clipByRoof`. */ class ClipWallByRoofDto { constructor(model?: T, wall?: string, roof?: string); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The wall, by GlobalId or by the id it was added with. * @default undefined */ wall: string; /** * The roof, by GlobalId or by the id it was added with. * @default undefined */ roof: string; } /** * A wall type to add for `walls.addType`: a named kind of wall made of a layer set, which walls are * then occurrences of. */ class AddWallTypeDto { constructor(model?: T, id?: string, name?: string, layerSet?: string, predefinedType?: wallPredefinedTypeEnum); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * An id of your own for the type, by which walls refer to it. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * The type's name. * @default Wall type */ name?: string | undefined; /** * The name of the layer set walls of this type are made of. * @default undefined */ layerSet: string; /** * What kind of wall the type is. * @default standard */ predefinedType?: wallPredefinedTypeEnum | undefined; } /** * A wall of a model, for `walls.parameters`. */ class WallDto { constructor(model?: T, wall?: string); /** * The model to read the wall from. * @default undefined */ model: T; /** * The wall, by GlobalId or by the id it was added with. * @default undefined */ wall: string; } /** * What to change about a wall for `walls.edit`. Everything left out stays as it is. */ class EditWallDto { constructor(model?: T, wall?: string, start?: Base.Point2, end?: Base.Point2, height?: number, baseOffset?: number, thickness?: number, layerSet?: string, alignment?: wallAlignmentEnum); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The wall, by GlobalId or by the id it was added with. * @default undefined */ wall: string; /** * The new start of the wall's axis, as `[x, y]` in its storey's plan. Openings keep their offset * from the start. * @default undefined * @optional true */ start?: Base.Point2 | undefined; /** * The new end of the wall's axis, as `[x, y]` in its storey's plan. * @default undefined * @optional true */ end?: Base.Point2 | undefined; /** * The new height, up from the wall's base. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ height?: number | undefined; /** * How far above its storey's floor the wall now starts; openings keep their sill above the * wall's base. * @default undefined * @optional true * @minimum -Infinity * @maximum Infinity */ baseOffset?: number | undefined; /** * A new thickness, as one layer without a material; used when no `layerSet` is given. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ thickness?: number | undefined; /** * The name of the layer set the wall is now made of. A wall of a type keeps its type's layers. * @default undefined * @optional true */ layerSet?: string | undefined; /** * Which side of the axis the layers now lie on. Left out, a wall keeps its side as its thickness * changes: a wall aligned right stays aligned right. * @default undefined * @optional true */ alignment?: wallAlignmentEnum | undefined; } /** * One join of a wall, as `walls.parameters` lists it. */ class WallJoinInfoDto { /** * The GlobalId of the wall it is joined to. * @default "" */ other: string; /** * Where on this wall the join is. * @default start */ at: wallEndEnum; /** * Where on the other wall the join is. * @default start */ otherAt: wallEndEnum; } /** * A wall's parameters as `walls.parameters` reads them back from the model, whichever tool wrote it. * Lengths are in the model's length unit, and points in the plan of the wall's storey. */ class WallParametersDto { /** * The GlobalId that identifies the wall. * @default "" */ globalId: string; /** * The wall's name, or an empty text when it has none. * @default "" */ name: string; /** * The GlobalId of the storey that contains the wall, or an empty text when none does. * @default "" */ storey: string; /** * The start of the wall's axis, as `[x, y]`. * @default [0, 0] */ start: Base.Point2; /** * The end of the wall's axis, as `[x, y]`. * @default [0, 0] */ end: Base.Point2; /** * The wall's height, up from its base. * @default 0 */ height: number; /** * How far above its storey's floor the wall starts. * @default 0 */ baseOffset: number; /** * The wall's thickness, all its layers together. * @default 0 */ thickness: number; /** * How far the layers' first face lies left of the axis, looking from start to end: 0 aligned left, * minus the thickness aligned right. * @default 0 */ offset: number; /** * Which side of the axis the layers lie on, or an empty text when they lie at an offset none of * the alignments describe. * @default "" */ alignment: wallAlignmentEnum | ""; /** * The name of the layer set the wall is made of. * @default "" */ layerSet: string; /** * The GlobalId of the wall's type, or an empty text when it has none. * @default "" */ wallType: string; /** * Each join of the wall: the other wall, and where on each wall the join is. * @default [] */ joins: WallJoinInfoDto[]; /** * The GlobalIds of the openings cut through it, filled or not. * @default [] */ openings: string[]; /** * How many planes clip the wall. * @default 0 */ clippings: number; } /** * A rectangular opening to cut through a wall for `openings.add`, measured along the wall from * its start. */ class AddOpeningDto { constructor(model?: T, wall?: string, id?: string, name?: string, offset?: number, sill?: number, width?: number, height?: number); /** * The model the wall is in. * @default undefined */ model: T; /** * The wall to cut, by GlobalId or by the id it was added with. * @default undefined */ wall: string; /** * An id of your own for the opening. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the opening, which other tools show; it need not be unique. * @default undefined * @optional true */ name?: string | undefined; /** * How far along the wall's axis, from its start, the opening begins. Left out, 1 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity */ offset?: number | undefined; /** * How high above the wall's base the opening's bottom is. * @default 0 * @minimum -Infinity * @maximum Infinity */ sill?: number | undefined; /** * The opening's width, along the wall. Left out, 1 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ width?: number | undefined; /** * How high the opening is, from its sill up. Left out, 2 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ height?: number | undefined; } /** * Where to move an opening to, or what size to make it, for `openings.edit`. Everything left out stays * as it is. */ class EditOpeningDto { constructor(model?: T, opening?: string, offset?: number, sill?: number, width?: number, height?: number); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The opening, or the door or window in it, by GlobalId or by the id it was added with. * @default undefined */ opening: string; /** * How far along the wall's axis, from its start, the opening now begins. * @default undefined * @optional true * @minimum 0 * @maximum Infinity */ offset?: number | undefined; /** * How high above the wall's base the opening's bottom now is. * @default undefined * @optional true * @minimum -Infinity * @maximum Infinity */ sill?: number | undefined; /** * The opening's new width, along the wall; an opening with a door or window in it keeps their size. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ width?: number | undefined; /** * The opening's new height; an opening with a door or window in it keeps their size. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ height?: number | undefined; } /** * An opening to cut through a slab for `openings.addInSlab`: an outline in the plan of the slab's * storey, cut through the slab's whole thickness. */ class AddSlabOpeningDto { constructor(model?: T, slab?: string, id?: string, name?: string, outline?: Base.Point2[]); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The slab to cut, by GlobalId or by the id it was added with. * @default undefined */ slab: string; /** * An id of your own for the opening. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the opening, which other tools show; it need not be unique. * @default undefined * @optional true */ name?: string | undefined; /** * The opening's outline, as `[x, y]` points in the storey's plan, inside the slab's outline or on * it; either winding works. * @default undefined */ outline: Base.Point2[]; } /** * A door type to add for `doors.addType`: a lining around one panel, which every door of the type * shares, so the geometry is written once however many doors there are. */ class AddDoorTypeDto { constructor(model?: T, id?: string, name?: string, width?: number, height?: number, liningThickness?: number, liningDepth?: number, panelThickness?: number, operation?: doorOperationEnum, liningMaterial?: string, panelMaterial?: string, handle?: doorHandleEnum, handleMaterial?: string); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * An id of your own for the type, by which doors refer to it. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * The type's name. * @default Door */ name?: string | undefined; /** * The overall width, lining included; the opening a door of this type cuts is this wide. Left out, 900 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ width?: number | undefined; /** * The overall height, lining included. Left out, 2.1 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ height?: number | undefined; /** * The width of the lining's sides and head; twice it must be less than `width`. Left out, 50 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ liningThickness?: number | undefined; /** * How deep the lining is, across the wall; the door is centred in the wall's thickness. Left out, 100 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ liningDepth?: number | undefined; /** * The panel's thickness, no more than `liningDepth`. Left out, 40 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ panelThickness?: number | undefined; /** * How the door opens, recorded for other tools to draw its swing. * @default singleSwingLeft */ operation?: doorOperationEnum | undefined; /** * The material the lining is made of, added before with `materials.add`; the lining shows its * colour. * @default undefined * @optional true */ liningMaterial?: string | undefined; /** * The material the panel is made of, added before with `materials.add`, such as glass for a * sliding glass door; the panel shows its colour. * @default undefined * @optional true */ panelMaterial?: string | undefined; /** * The handle on both faces of the panel, near the edge away from the hinges that `operation` * names. * @default none */ handle?: doorHandleEnum | undefined; /** * The material the handle is made of, added before with `materials.add`; the handle shows its * colour. * @default undefined * @optional true */ handleMaterial?: string | undefined; } /** * A window type to add for `windows.addType`: a frame around one pane of glass, which every window * of the type shares. */ class AddWindowTypeDto { constructor(model?: T, id?: string, name?: string, width?: number, height?: number, frameThickness?: number, frameDepth?: number, glassThickness?: number, frameMaterial?: string, glassMaterial?: string); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * An id of your own for the type, by which windows refer to it. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * The type's name. * @default Window */ name?: string | undefined; /** * The overall width, frame included; the opening a window of this type cuts is this wide. Left out, 1.2 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ width?: number | undefined; /** * The overall height, frame included. Left out, 1.2 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ height?: number | undefined; /** * The width of the frame's members; twice it must be less than both `width` and `height`. Left out, 60 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ frameThickness?: number | undefined; /** * How deep the frame is, across the wall; the window is centred in the wall's thickness. Left out, 80 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ frameDepth?: number | undefined; /** * The thickness of the glass, no more than `frameDepth`. Left out, 24 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ glassThickness?: number | undefined; /** * The material the frame is made of, added before with `materials.add`; the frame shows its * colour. * @default undefined * @optional true */ frameMaterial?: string | undefined; /** * The material of the glass, added before with `materials.add`, usually with a `transparency`; * the glass shows its colour. * @default undefined * @optional true */ glassMaterial?: string | undefined; } /** * A door to place in a wall for `doors.add`: a door type and where along the wall it goes. The door * cuts its own opening, as wide and high as its type. */ class AddDoorDto { constructor(model?: T, wall?: string, doorType?: string, id?: string, name?: string, offset?: number, sill?: number); /** * The model the wall is in. * @default undefined */ model: T; /** * The wall the door goes into, by GlobalId or by the id it was added with. * @default undefined */ wall: string; /** * The door type, added before with `doors.addType`, by GlobalId or by its id. * @default undefined */ doorType: string; /** * An id of your own for the door. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the door, which other tools show; it need not be unique. * @default undefined * @optional true */ name?: string | undefined; /** * How far along the wall's axis, from its start, the door begins. Left out, 1 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity */ offset?: number | undefined; /** * How high above the wall's base the door's bottom is. * @default 0 * @minimum -Infinity * @maximum Infinity */ sill?: number | undefined; } /** * A window to place in a wall for `windows.add`: a window type and where along the wall it goes. * The window cuts its own opening, as wide and high as its type. */ class AddWindowDto { constructor(model?: T, wall?: string, windowType?: string, id?: string, name?: string, offset?: number, sill?: number); /** * The model the wall is in. * @default undefined */ model: T; /** * The wall the window goes into, by GlobalId or by the id it was added with. * @default undefined */ wall: string; /** * The window type, added before with `windows.addType`, by GlobalId or by its id. * @default undefined */ windowType: string; /** * An id of your own for the window. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the window, which other tools show; it need not be unique. * @default undefined * @optional true */ name?: string | undefined; /** * How far along the wall's axis, from its start, the window begins. Left out, 1 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity */ offset?: number | undefined; /** * How high above the wall's base the window's bottom is. Left out, 900 mm, in the model's length unit. * @default undefined * @optional true * @minimum -Infinity * @maximum Infinity */ sill?: number | undefined; } /** * A slab to add for `slabs.add`: an outline in a storey's plan, with optional holes, extruded down * from its top by its thickness. */ class AddSlabDto { constructor(model?: T, storey?: string, id?: string, name?: string, outline?: Base.Point2[], holes?: Base.Point2[][], thickness?: number, layerSet?: string, topOffset?: number, predefinedType?: slabPredefinedTypeEnum); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The storey the slab belongs to, by GlobalId or by the id it was added with. * @default undefined */ storey: string; /** * An id of your own for the slab. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the slab, which other tools show; it need not be unique. * @default undefined * @optional true */ name?: string | undefined; /** * The outline, as `[x, y]` points in the storey's plan, without the first repeated at the end; * either winding works. * @default undefined */ outline: Base.Point2[]; /** * Holes through the slab, each an outline like `outline`, inside it. * @default undefined * @optional true */ holes?: Base.Point2[][] | undefined; /** * The slab's thickness, used when no `layerSet` is given. Left out, 200 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ thickness?: number | undefined; /** * The name of the layer set the slab is made of, its first layer at the top; its layers set the * thickness. * @default undefined * @optional true */ layerSet?: string | undefined; /** * How high the slab's top is above the storey's floor. * @default 0 * @minimum -Infinity * @maximum Infinity */ topOffset?: number | undefined; /** * What kind of slab it is. * @default floor */ predefinedType?: slabPredefinedTypeEnum | undefined; } /** * The section shared by `columns.add`, `beams.add` and `members.add`: its kind and the sizes that kind reads, a * rectangle's `width` and `depth`, a circle's `radius`, or an I section's `width`, `depth`, * `webThickness` and `flangeThickness`. */ abstract class MemberSharedDto { /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The storey the member belongs to, by GlobalId or by the id it was added with. * @default undefined */ storey: string; /** * An id of your own for the member. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the column, beam or member, which other tools show; it need not be unique. * @default undefined * @optional true */ name?: string | undefined; /** * The section's shape. * @default rectangle */ profile?: profileKindEnum | undefined; /** * The section's size along its X: a rectangle's width, or an I section's flange width. Left out, 300 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ width?: number | undefined; /** * The section's size along its Y: a rectangle's depth, or an I section's overall depth. Left out, 300 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ depth?: number | undefined; /** * A circular section's radius. Left out, 150 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ radius?: number | undefined; /** * An I section's web thickness. Left out, 10 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ webThickness?: number | undefined; /** * An I section's flange thickness. Left out, 15 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ flangeThickness?: number | undefined; /** * How far the section turns about the member's own axis, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity */ rotation?: number | undefined; /** * The name of the member's material, added before with `materials.add`. * @default undefined * @optional true */ material?: string | undefined; } /** * A column to add for `columns.add`: a section standing upright on a point of a storey's plan. */ class AddColumnDto extends MemberSharedDto { constructor(model?: T, storey?: string, position?: Base.Point2, height?: number, baseOffset?: number, id?: string, name?: string, profile?: profileKindEnum, width?: number, depth?: number, radius?: number, webThickness?: number, flangeThickness?: number, rotation?: number, material?: string); /** * Where the column stands, as `[x, y]` in the storey's plan; the section is centred on it. * @default [0, 0] */ position?: Base.Point2 | undefined; /** * How tall the column is, from its base up. Left out, 3 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ height?: number | undefined; /** * How far above the storey's floor the column starts. * @default 0 * @minimum -Infinity * @maximum Infinity */ baseOffset?: number | undefined; } /** * A beam to add for `beams.add`: a section swept straight from `start` to `end`, centred on that * line, with its Y up when the beam is not vertical. */ class AddBeamDto extends MemberSharedDto { constructor(model?: T, storey?: string, start?: Base.Point3, end?: Base.Point3, id?: string, name?: string, profile?: profileKindEnum, width?: number, depth?: number, radius?: number, webThickness?: number, flangeThickness?: number, rotation?: number, material?: string); /** * Where the beam's axis starts, as `[x, y, z]` in the storey: X and Y in plan, Z up from the * storey's floor. * @default undefined */ start: Base.Point3; /** * Where the beam's axis ends. * @default undefined */ end: Base.Point3; } /** * A member to add for `members.add`: a section swept straight from `start` to `end`, such as a brace, * a rafter, a stud or a mullion. */ class AddMemberDto extends MemberSharedDto { constructor(model?: T, storey?: string, start?: Base.Point3, end?: Base.Point3, id?: string, name?: string, profile?: profileKindEnum, width?: number, depth?: number, radius?: number, webThickness?: number, flangeThickness?: number, rotation?: number, material?: string, predefinedType?: memberPredefinedTypeEnum); /** * Where the member's axis starts, as `[x, y, z]` in the storey: X and Y in plan, Z up from the * storey's floor. * @default undefined */ start: Base.Point3; /** * Where the member's axis ends. * @default undefined */ end: Base.Point3; /** * What kind of member it is. * @default member */ predefinedType?: memberPredefinedTypeEnum | undefined; } /** * A roof to add for `roofs.add`: a flat, mono-pitch, gable or hip roof over a rectangle in a storey's * plan, written as an `IfcRoof` whose parts are sloping slabs. */ class AddRoofDto { constructor(model?: T, storey?: string, id?: string, name?: string, outline?: Base.Point2[], kind?: roofKindEnum, pitch?: number, thickness?: number, layerSet?: string, overhang?: number, baseOffset?: number); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The storey the roof stands on, by GlobalId or by the id it was added with. * @default undefined */ storey: string; /** * An id of your own for the roof. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the roof, which other tools show; it need not be unique. * @default undefined * @optional true */ name?: string | undefined; /** * The rectangle's four corners in the storey's plan, such as the walls' outer faces. A mono-pitch * roof rises from the first side; a gable's ridge runs along it. * @default undefined */ outline: Base.Point2[]; /** * The roof's shape. * @default gable */ kind?: roofKindEnum | undefined; /** * The slope of a sloping roof, in degrees from level, more than 0 and at most 89. * @default 30 * @minimum 0 * @maximum 89 */ pitch?: number | undefined; /** * The roof's thickness, used when no `layerSet` is given. Left out, 200 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ thickness?: number | undefined; /** * The name of the layer set the roof is made of, its first layer at the top, as a slab's is; its * layers set the thickness. * @default undefined * @optional true */ layerSet?: string | undefined; /** * How far the roof reaches past the outline on every side, measured level. * @default 0 * @minimum 0 * @maximum Infinity */ overhang?: number | undefined; /** * How high above the storey's floor the roof's underside meets the outline, such as the height of * the walls under it. * @default 0 * @minimum -Infinity * @maximum Infinity */ baseOffset?: number | undefined; } /** * An assembly to make for `assemblies.add`: an element made of other elements of the model, such as * a facade's cladding boards or a truss's members, which then stand in the model through it. */ class AddAssemblyDto { constructor(model?: T, parts?: string[], id?: string, name?: string, predefinedType?: elementAssemblyPredefinedTypeEnum, objectType?: string); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The elements the assembly is made of, by GlobalId or id. They must stand in one storey, or * other part of the structure, and belong to no other assembly. * @default undefined */ parts: string[]; /** * An id of your own for the assembly. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the assembly, which other tools show; it need not be unique. * @default undefined * @optional true */ name?: string | undefined; /** * The kind of assembly, as IFC classifies them; `userDefined` for a kind it does not name, which * `objectType` then says. * @default notDefined */ predefinedType?: elementAssemblyPredefinedTypeEnum | undefined; /** * What kind of assembly it is, in words, such as `Cladding`. Required when `predefinedType` is * `userDefined`. * @default undefined * @optional true */ objectType?: string | undefined; } /** * Terrain to add for `site.addTerrain`: the ground of the site as an outline in the site's plan, with * holes where a building or paving meets it, its top at `elevation` and reaching `depth` down. */ class AddTerrainDto { constructor(model?: T, id?: string, name?: string, outline?: Base.Point2[], holes?: Base.Point2[][], depth?: number, elevation?: number, material?: string); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * An id of your own for the terrain. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the terrain, which other tools show. * @default Terrain */ name?: string | undefined; /** * The outline, as `[x, y]` points in the site's plan, without the first repeated at the end; * either winding works. * @default undefined */ outline: Base.Point2[]; /** * Holes in the ground, each an outline like `outline`, inside it, such as a building's footprint * or paving that lies flush with the ground. * @default undefined * @optional true */ holes?: Base.Point2[][] | undefined; /** * How far the ground reaches down from its top. Left out, 1 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ depth?: number | undefined; /** * How high the ground's top is above the site's origin. * @default 0 */ elevation?: number | undefined; /** * The material of the ground, added before with `materials.add`, such as lawn or soil. * @default undefined * @optional true */ material?: string | undefined; } /** * A tree to add for `site.addTree`: a trunk and a rounded crown standing on the site at `position`, * `height` tall overall, written as a geographic element of the site. */ class AddTreeDto { constructor(model?: T, id?: string, name?: string, species?: string, position?: Base.Point2, elevation?: number, height?: number, crownRadius?: number, trunkRadius?: number, crownMaterial?: string, trunkMaterial?: string); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * An id of your own for the tree. Leave it out for a generated one. * @default undefined * @optional true */ id?: string | undefined; /** * A name for the tree, which other tools show. * @default Tree */ name?: string | undefined; /** * What kind of tree it is, such as `Silver birch`, written as the element's object type. * @default Tree */ species?: string | undefined; /** * Where the trunk stands, as `[x, y]` in the site's plan. * @default [0, 0] */ position?: Base.Point2 | undefined; /** * How high above the site's origin the trunk stands. * @default 0 */ elevation?: number | undefined; /** * The tree's height from the ground to the top of its crown. Left out, 8 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ height?: number | undefined; /** * How far the crown spreads from the trunk. Left out, 2.5 m, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ crownRadius?: number | undefined; /** * The trunk's radius at the ground; it narrows towards the crown. Left out, 150 mm, in the model's length unit. * @default undefined * @optional true * @minimum 0 * @maximum Infinity * @exclusiveMinimum true */ trunkRadius?: number | undefined; /** * The material of the crown, added before with `materials.add`. * @default undefined * @optional true */ crownMaterial?: string | undefined; /** * The material of the trunk, added before with `materials.add`. * @default undefined * @optional true */ trunkMaterial?: string | undefined; } /** * One property of a property set: its name, its value and, when the value needs one, its IFC type. * Used by `properties.addSet` and `properties.setValues`. A type outside `IfcValue`, or a value it * cannot hold, is refused. */ class PropertyDto { constructor(name?: string, value?: string | number | boolean, type?: string); /** * The property's name, such as `IsExternal` or `FireRating`. * @default Property */ name?: string | undefined; /** * The property's value: a text, a number, or true or false. * @default undefined */ value: string | number | boolean; /** * The IFC type of the value, any in IFC4's `IfcValue` select, such as `IfcText` or * `IfcThermalTransmittanceMeasure`. Left out, a label, boolean, integer or real, as the value is. * @default undefined * @optional true */ type?: string | undefined; } /** * A property set to attach to elements for `properties.addSet`, such as `Pset_WallCommon` with its * `IsExternal` and `LoadBearing`. */ class AddPropertySetDto { constructor(model?: T, elements?: string[], name?: string, properties?: PropertyDto[]); /** * The model the elements are in. * @default undefined */ model: T; /** * The elements, types or other objects the set describes, each by GlobalId or by the id it was * added with; one set is shared by all of them. * @default undefined */ elements: string[]; /** * The set's name. Names starting with `Pset_` are reserved for the sets the IFC standard defines. * @default Properties */ name?: string | undefined; /** * The properties, each name once. * @default undefined */ properties: PropertyDto[]; } /** * Values to set in one property set of one object for `properties.setValues`; the set is made when * the object has none of that name. */ class SetPropertyValuesDto { constructor(model?: T, element?: string, name?: string, properties?: PropertyDto[]); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The element, type or other object, by GlobalId or by the id it was added with. * @default undefined */ element: string; /** * The name of the property set, such as `Pset_WallCommon`. * @default Properties */ name?: string | undefined; /** * The properties to set, each name once; a property the set already holds takes the new value. * @default undefined */ properties: PropertyDto[]; } /** * Properties to take out of one property set of one object for `properties.removeValues`. */ class RemovePropertyValuesDto { constructor(model?: T, element?: string, name?: string, names?: string[]); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The element, type or other object, by GlobalId or by the id it was added with. * @default undefined */ element: string; /** * The name of the property set, such as `Pset_WallCommon`. * @default Properties */ name?: string | undefined; /** * The names of the properties to take out; the set goes when none are left. * @default undefined */ names: string[]; } /** * One property set of one object to take away, for `properties.removeSet`. */ class RemovePropertySetDto { constructor(model?: T, element?: string, name?: string); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The element, type or other object, by GlobalId or by the id it was added with. * @default undefined */ element: string; /** * The name of the property set, such as `Pset_WallCommon`. * @default Properties */ name?: string | undefined; } /** * A property set as `properties.getSets` reads it back. */ class PropertySetInfoDto { /** * What the set is called, such as `Pset_WallCommon`. * @default "" */ name: string; /** * Its single values by property name, such as `{ IsExternal: true }`. * @default {} */ properties: Record; } /** * The model and the elements to measure for `quantities.compute`, every one it can when left out. */ class ComputeQuantitiesDto { constructor(model?: T, elements?: string[]); /** * The model to change; it stays as it was, and the call returns the changed model. * @default undefined */ model: T; /** * The elements to measure, each by GlobalId or by the id it was added with. Left out, every element * of a kind this library measures. * @default undefined * @optional true */ elements?: string[] | undefined; } /** * A quantity set as `quantities.get` reads it back: its name and each quantity's value by name. * Areas and volumes are in the model's area and volume units, square and cubic metres in a model * `model.create` made. */ class QuantitySetInfoDto { /** * What the set is called, such as `Qto_WallBaseQuantities`. * @default "" */ name: string; /** * Each quantity's value by its name, such as `{ NetVolume: 5.2 }`: lengths in the model's length * unit, areas and volumes in its area and volume units. * @default {} */ quantities: Record; } /** * A model, the elements to describe and how to group them for `geometry.recipe`. */ class GeometryDto { constructor(model?: T, elements?: string[], groupByClass?: boolean); /** * The model whose elements are described. * @default undefined */ model: T; /** * The elements to describe, each by GlobalId or by the id it was added with. Leave it out for * every element with a body. * @default undefined * @optional true */ elements?: string[] | undefined; /** * When true, the elements of each storey, or other part of the structure, are grouped by IFC * class, such as `Walls`; when false they lie in the structure's group. * @default true */ groupByClass?: boolean | undefined; } /** * A model and the elements to check for `geometry.unsupported`. */ class GeometryElementsDto { constructor(model?: T, elements?: string[]); /** * The model whose elements are checked. * @default undefined */ model: T; /** * The elements to check, each by GlobalId or by the id it was added with. Leave it out for * every element with a body. * @default undefined * @optional true */ elements?: string[] | undefined; } /** * A model, the elements to build, and how to build them for `geometry.toShapes`, which builds the * model's recipe as OpenCascade shapes. */ class GeometryToShapesDto { constructor(model?: T, elements?: string[], adjustZtoY?: boolean, emptyWhenFailed?: boolean, facetedMeshes?: boolean, maxTriangles?: number); /** * The model whose elements are built. * @default undefined */ model: T; /** * The elements to build, each by GlobalId or by the id it was added with. Leave it out for * every element with a body. * @default undefined * @optional true */ elements?: string[] | undefined; /** * When true, the shapes turn a quarter turn about X so the model's Z points along Y, which is up * when drawn: `(x, y, z)` becomes `(x, z, -y)`. * @default true */ adjustZtoY?: boolean | undefined; /** * When true, an element that cannot be built comes back as an empty compound and the others are * built; when false, it stops the build. * @default true */ emptyWhenFailed?: boolean | undefined; /** * When true, elements stored as triangle meshes become faceted solids that cut and fillet like * any shape; when false they keep their triangles, which draw and export faster. * @default false */ facetedMeshes?: boolean | undefined; /** * The most triangles a mesh built as a faceted solid may hold; a larger one is not built and * counts as an element that failed. * @default 100000 * @minimum 0 * @maximum Infinity * @step 10000 */ maxTriangles?: number | undefined; } /** * A model, the elements to build, and how to build them for `geometry.toDocument`, which builds the * model's recipe into an OpenCascade assembly document. */ class GeometryToDocumentDto { constructor(model?: T, elements?: string[], name?: string, emptyWhenFailed?: boolean, facetedMeshes?: boolean, maxTriangles?: number, groupByClass?: boolean); /** * The model whose elements are built. * @default undefined */ model: T; /** * The elements to build, each by GlobalId or by the id it was added with. Leave it out for * every element with a body. * @default undefined * @optional true */ elements?: string[] | undefined; /** * The name of the assembly at the top of the document, which holds every element. * @default Model */ name?: string | undefined; /** * When true, an element that cannot be built is left out of the document and the others are * built; when false, it stops the build. * @default true */ emptyWhenFailed?: boolean | undefined; /** * When true, elements stored as triangle meshes become faceted solids that cut and fillet like * any shape; when false STEP carries their triangles as tessellated geometry, smaller and faster. * @default false */ facetedMeshes?: boolean | undefined; /** * The most triangles a mesh built as a faceted solid may hold; a larger one is not built and * counts as an element that failed. * @default 100000 * @minimum 0 * @maximum Infinity * @step 10000 */ maxTriangles?: number | undefined; /** * When true, each storey's elements are gathered in assemblies by IFC class, such as `Walls` * and `Slabs`; when false they lie in the storey's assembly directly. * @default true */ groupByClass?: boolean | undefined; } /** * A model, the elements to write, and the file options for `geometry.toStep`, which writes the * model's elements as a STEP file of OpenCascade shapes. */ class GeometryToStepDto { constructor(model?: T, elements?: string[], name?: string, fileName?: string, emptyWhenFailed?: boolean, facetedMeshes?: boolean, maxTriangles?: number, compress?: boolean, tryDownload?: boolean, groupByClass?: boolean); /** * The model whose elements are written. * @default undefined */ model: T; /** * The elements to write, each by GlobalId or by the id it was added with. Leave it out for * every element with a body. * @default undefined * @optional true */ elements?: string[] | undefined; /** * The name of the assembly at the top of the file, which holds every element. * @default Model */ name?: string | undefined; /** * The file name, used for the download and written into the file's header. * @default model.step */ fileName?: string | undefined; /** * When true, an element that cannot be built is left out of the file and the others are * written; when false, it stops the export. * @default true */ emptyWhenFailed?: boolean | undefined; /** * When true, elements stored as triangle meshes are written as faceted solids; when false they * are written as tessellated geometry, which is faster and smaller. * @default false */ facetedMeshes?: boolean | undefined; /** * The most triangles a mesh built as a faceted solid may hold; a larger one is not built and * counts as an element that failed. * @default 100000 * @minimum 0 * @maximum Infinity * @step 10000 */ maxTriangles?: number | undefined; /** * When true, the file is written as gzip-compressed STEP-Z. * @default false */ compress?: boolean | undefined; /** * When true, a browser download of the file is started where that is possible; the bytes are * returned either way. * @default false */ tryDownload?: boolean | undefined; /** * When true, each storey's elements are gathered in assemblies by IFC class, such as `Walls` * and `Slabs`; when false they lie in the storey's assembly directly. * @default true */ groupByClass?: boolean | undefined; } /** * An element `geometry.recipe` had to leave out, as `geometry.unsupported` lists it. */ class GeometryProblemDto { /** * The GlobalId of the element left out. * @default "" */ globalId: string; /** * Its IFC type, such as `IfcWall`. * @default "" */ type: string; /** * What could not be described, in a sentence. * @default "" */ message: string; } } /** * 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" } /** * How a union or a difference goes through its shapes. oneAfterAnother takes one shape per step: * right for any shapes, and the edge and face numbering results have always had. inGroups puts shapes * whose boxes do not meet into one step: faster, numbered differently. allAtOnce takes every shape in * one step: fast, but wrong without an error where shapes touch each other at a single point. */ enum booleanStrategyEnum { oneAfterAnother = "oneAfterAnother", inGroups = "inGroups", allAtOnce = "allAtOnce" } /** * The kind of surface a face lies on: the analytic ones (plane, cylinder, cone, sphere, torus), Bezier * and B-spline patches, surfaces of revolution and extrusion, offsets of another surface, and other. */ enum surfaceTypeEnum { plane = "plane", cylinder = "cylinder", cone = "cone", sphere = "sphere", torus = "torus", bezier = "bezier", bspline = "bspline", revolution = "revolution", extrusion = "extrusion", offset = "offset", other = "other" } /** * The kind of curve an edge runs along: line, circle, ellipse, hyperbola, parabola, Bezier and * B-spline curves, offsets of another curve, and other. */ enum curveTypeEnum { line = "line", circle = "circle", ellipse = "ellipse", hyperbola = "hyperbola", parabola = "parabola", bezier = "bezier", bspline = "bspline", offset = "offset", other = "other" } /** * How a frame follows a curve. frenet lies in the plane the curve bends in, its direction along the * tangent, and has no normal where the curve runs straight. perpendicular stands across the curve, * level with an up vector. rotationMinimizing stands across the curve and is carried along it from * the start without twisting, the way a swept profile rides. */ enum curveFrameEnum { frenet = "frenet", perpendicular = "perpendicular", rotationMinimizing = "rotationMinimizing" } /** * What a surface analysis shows at each point of a face. none leaves the faces as they are; gaussian * and mean are the Gaussian and mean curvature, maxCurvature and minCurvature the two principal * curvatures, positive where the face bulges out; minRadius is 1 over the larger principal curvature, * infinite where the face is flat; draftAngle is the angle in degrees between the face and a pull * direction, positive where the face looks along the pull. */ enum surfaceAnalysisEnum { none = "none", gaussian = "gaussian", mean = "mean", maxCurvature = "maxCurvature", minCurvature = "minCurvature", minRadius = "minRadius", draftAngle = "draftAngle" } /** * How a filled patch meets one of its boundary edges. position only passes through the edge; tangent * also meets the face beside the edge without a crease; curvature also bends as that face does there. */ enum continuityEnum { position = "position", tangent = "tangent", curvature = "curvature" } /** * How a patch fills between its boundary edges. With three or four edges, coons blends the edges, * stretch is flatter and curved rounder. With two edges, stretch and coons join them as opposite * sides, while curved sweeps one along the other, so the two must share a corner. */ enum fillingStyleEnum { stretch = "stretch", coons = "coons", curved = "curved" } /** * How far a boss or a pocket runs from its sketch face. length stops after the given length, * untilFace stops at a chosen face of the base, and throughAll runs through the whole base. */ enum featureExtentEnum { length = "length", untilFace = "untilFace", throughAll = "throughAll" } /** * Which axis of a model points up: z, as STEP files and most CAD models have it, or y, as glTF and * the 3D engines have it. */ enum upAxisEnum { y = "y", z = "z" } /** * What a design build does when a reference that carries a hint loses its faces: `never` fails the * feature and offers the faces most like the hint as repairs, as a headless build should; `report` * takes them when they stand clear of every other face and reports the feature `rebound`, as an * editor wants. */ enum designRebindEnum { never = "never", report = "report" } /** * 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 faces' iso curves as polylines, face by face with u curves before v curves; a curve crossing * a hole comes in pieces. Present only when asked for. * @optional true */ isoCurveList?: Base.Point3[][] | undefined; } /** * An indexed triangle mesh as `shapeToManifoldMesh` returns it, in the form * `manifold.shapes.manifoldFromMesh` takes: the vertex positions and the triangles that index them. */ class DecomposedManifoldMeshDto { /** * How many numbers each vertex carries in `vertProperties`: 3, its position. */ numProp: number; /** * The x, y and z of every vertex, one vertex after another. */ vertProperties: Float32Array; /** * The triangles as vertex indexes, three per triangle, wound so that they face out of the shape. */ triVerts: Uint32Array; } /** * 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; /** * The surface analysis value at each vertex in `vertexCoord` order, such as a curvature or a draft * angle in degrees, NaN where undefined; present only with `surfaceAnalysis`. * @optional true */ analysisValues?: 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 | undefined; } /** * 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 | undefined; /** * The Y coordinate, in model units; Y is up. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ y?: number | undefined; /** * The Z coordinate, in model units. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ z?: number | undefined; } /** * 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 | undefined; /** * Which lines to keep: those on one side of the circle, the other side, or all of them. * @default all */ positionResult?: positionResultEnum | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * Which lines to keep: those on one side of the circle, the other side, or all of them. * @default all */ positionResult?: positionResultEnum | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * Which lines to keep: the outer pair, the crossing inner pair, or all of them. * @default all */ positionResult?: positionResultEnum | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The radius of the circles to draw, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; } /** * 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 | undefined; /** * The radius of the circles to draw, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; } /** * 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 | undefined; /** * The normal of the plane the edges lie in. * @default [0, 1, 0] */ planeDirection?: Base.Vector3 | undefined; /** * The radius of the rounding arc, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * Which arc to use when several fit, counted from 0; -1 takes the one nearest `planeOrigin`. * @default -1 */ solution?: number | undefined; } /** * A shape and points for `operations.closestPointsOnShapeFromPoints`, * `operations.distancesToShapeFromPoints`, `analysis.curves.closestPoints` and * `analysis.surfaces.closestPoints`. */ 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 | undefined; } /** * 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; } /** * How a shape is drawn, shared by `DrawShapeDto` and `DrawShapesDto`: colors and opacity of faces, * edges and vertices, what to show, iso curves and surface analysis, and how finely to mesh the shape. */ abstract class DrawShapeSharedDto { /** * How opaque the faces are, from 0 for invisible to 1 for solid. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity?: number | undefined; /** * How opaque the edges are, from 0 for invisible to 1 for solid. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ edgeOpacity?: number | undefined; /** * The color of the edges as a hex string such as `#ffffff`. * @default #ffffff */ edgeColour?: Base.Color | undefined; /** * 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 | undefined; /** * How thick the edge lines are drawn. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ edgeWidth?: number | undefined; /** * When false, the edges are not drawn. * @default true */ drawEdges?: boolean | undefined; /** * When false, the faces are not drawn. * @default true */ drawFaces?: boolean | undefined; /** * When true, the vertices are drawn as small markers. * @default false */ drawVertices?: boolean | undefined; /** * The color of the vertex markers as a hex string. * @default #ff00ff */ vertexColour?: string | undefined; /** * The size of the vertex markers, in model units. * @default 0.03 * @minimum 0 * @maximum Infinity * @step 0.01 */ vertexSize?: number | undefined; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * with more triangles. * @default 0.01 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ precision?: number | undefined; /** * The largest angle, in radians, a curved face may turn between neighbouring triangles; smaller * follows curvature more closely with more triangles. * @default 0.5 * @minimum 0.001 * @maximum 3.14159 * @step 0.05 */ angularDeflection?: number | undefined; /** * When true, `precision` is a fraction of each edge's and face's size instead of model units, so * small and large parts get triangles in proportion to their size. * @default false */ relativeDeflection?: boolean | undefined; /** * When true, each edge's index is written next to it, handy for picking edges to fillet. * @default false */ drawEdgeIndexes?: boolean | undefined; /** * The height of the edge index labels, in model units. * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ edgeIndexHeight?: number | undefined; /** * The color of the edge index labels as a hex string. * @default #ff00ff */ edgeIndexColour?: Base.Color | undefined; /** * When true, each face's index is written on it, handy for picking faces. * @default false */ drawFaceIndexes?: boolean | undefined; /** * The height of the face index labels, in model units. * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ faceIndexHeight?: number | undefined; /** * The color of the face index labels as a hex string. * @default #0000ff */ faceIndexColour?: Base.Color | undefined; /** * When true, the back of each face is drawn in its own color, which shows which way faces * point. * @default true */ drawTwoSided?: boolean | undefined; /** * The color of the back of the faces as a hex string; used only with `drawTwoSided`. * @default #0000ff */ backFaceColour?: Base.Color | undefined; /** * 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 | undefined; /** * 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 | 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; /** * When true, each face's iso curves are drawn with the shape, as its edges are: at `edgeWidth` * and `edgeOpacity`, in `isoCurvesColour`. * @default false */ drawIsoCurves?: boolean | undefined; /** * How many iso curves of constant u each face gets with `drawIsoCurves`, at values spread evenly * inside its u range and trimmed to the face. * @default 5 * @minimum 0 * @maximum 1000 * @step 1 */ isoCurvesU?: number | undefined; /** * How many iso curves of constant v each face gets with `drawIsoCurves`, at values spread evenly * inside its v range and trimmed to the face. * @default 5 * @minimum 0 * @maximum 1000 * @step 1 */ isoCurvesV?: number | undefined; /** * The color of the iso curves as a hex string. * @default #808080 */ isoCurvesColour?: Base.Color | undefined; /** * The surface analysis coloring the faces instead of `faceColour` and `faceMaterial`, from blue at * `analysisMin` through green to red at `analysisMax`; vertices without a value keep `faceColour`. * @default none */ surfaceAnalysis?: surfaceAnalysisEnum | undefined; /** * The pull direction the draft angles are measured against; read only by `draftAngle`. * @default [0, 1, 0] */ draftDirection?: Base.Vector3 | undefined; /** * The analysis value drawn blue, and anything below it; left out, the lowest finite value * found. * @default undefined * @optional true */ analysisMin?: number | undefined; /** * The analysis value drawn red, and anything above it; left out, the highest finite value * found. * @default undefined * @optional true */ analysisMax?: number | undefined; } /** * 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 extends DrawShapeSharedDto { /** * 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, drawIsoCurves?: boolean, isoCurvesU?: number, isoCurvesV?: number, isoCurvesColour?: Base.Color, surfaceAnalysis?: surfaceAnalysisEnum, draftDirection?: Base.Vector3, analysisMin?: number, analysisMax?: number, angularDeflection?: number, relativeDeflection?: boolean); /** * The shape to draw; it is meshed at `precision` first. * @default undefined * @optional true */ shape?: T | undefined; } /** * 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 extends DrawShapeSharedDto { /** * 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, drawIsoCurves?: boolean, isoCurvesU?: number, isoCurvesV?: number, isoCurvesColour?: Base.Color, surfaceAnalysis?: surfaceAnalysisEnum, draftDirection?: Base.Vector3, analysisMin?: number, analysisMax?: number, angularDeflection?: number, relativeDeflection?: boolean); /** * The shapes to draw with the same options. * @default undefined */ shapes: T[]; } /** * 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 | undefined; /** * How many points along each row across the V range, edge to edge. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrDivisionsV?: number | undefined; /** * 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 | undefined; /** * When true, the row at the start of the U range is left out. * @default false */ removeStartEdgeU?: boolean | undefined; /** * When true, the row at the end of the U range is left out. * @default false */ removeEndEdgeU?: boolean | undefined; /** * 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 | undefined; /** * When true, the points at the start of the V range are left out of every row. * @default false */ removeStartEdgeV?: boolean | undefined; /** * When true, the points at the end of the V range are left out of every row. * @default false */ removeEndEdgeV?: boolean | undefined; } /** * 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 | undefined; /** * When true each wire sits at a fixed U and runs across the V range; when false the roles swap. * @default true */ isU?: boolean | undefined; /** * When true, every wire moves half a step along the divided direction. * @default false */ shiftHalfStep?: boolean | undefined; /** * When true, the wire on the start boundary is left out. * @default false */ removeStart?: boolean | undefined; /** * When true, the wire on the end boundary is left out. * @default false */ removeEnd?: boolean | undefined; } /** * 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 | undefined; /** * How many cells across the V range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrRectanglesV?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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. * @default false */ flatU?: boolean | undefined; /** * 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. * @default false */ flatU?: boolean | undefined; /** * 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 | undefined; /** * How many cells across the V range. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrRectanglesV?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * How many points along each row across the V range, edge to edge. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrDivisionsV?: number | undefined; /** * 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 | undefined; /** * Which V row the counting for the U shift starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ shiftHalfStepUOffsetN?: number | undefined; /** * 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 | undefined; /** * Which point the counting for the first U row removal starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeStartEdgeUOffsetN?: number | undefined; /** * 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 | undefined; /** * Which point the counting for the last U row removal starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeEndEdgeUOffsetN?: number | undefined; /** * 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 | undefined; /** * Which U row the counting for the V shift starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ shiftHalfStepVOffsetN?: number | undefined; /** * 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 | undefined; /** * Which point the counting for the first V row removal starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeStartEdgeVOffsetN?: number | undefined; /** * 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 | undefined; /** * Which point the counting for the last V row removal starts at. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ removeEndEdgeVOffsetN?: number | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * How many points along the line, edge to edge. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrPoints?: number | undefined; /** * 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 | undefined; /** * When true, the first point is left out. * @default false */ removeStartPoint?: boolean | undefined; /** * When true, the last point is left out. * @default false */ removeEndPoint?: boolean | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 ][] | undefined; } /** * 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. * @default false */ returnCompound?: boolean | undefined; } /** * 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. * @default false */ returnCompound?: boolean | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 1 */ size?: number | undefined; /** * The point the square is centered on. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The normal of the plane the square lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 1 */ width?: number | undefined; /** * The side along Z on the ground plane, in model units, before the rectangle is turned to face * `direction`. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 1 */ length?: number | undefined; /** * The point the rectangle is centered on. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The normal of the plane the rectangle lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ widthFirst?: number | undefined; /** * The length of the first leg, in model units. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ lengthFirst?: number | undefined; /** * The thickness of the second leg, in model units. * @default 0.5 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ widthSecond?: number | undefined; /** * The length of the second leg, in model units. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ lengthSecond?: number | undefined; /** * Where the corner of the L sits relative to the legs: on their outside, their inside or their * middle. * @default outside */ align?: directionEnum | undefined; /** * How far the shape is turned in its plane, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 15 */ rotation?: number | undefined; /** * The point the shape is placed at. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The normal of the plane the shape lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * The total height of the profile, in model units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The thickness of the vertical web, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ webThickness?: number | undefined; /** * The thickness of each horizontal flange, in model units. * @default 0.3 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ flangeThickness?: number | undefined; /** * 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 | undefined; /** * How far the profile is turned in its plane, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 15 */ rotation?: number | undefined; /** * The point the profile is placed at. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The normal of the plane the profile lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 | undefined; /** * The height of the flanges, in model units. * @default 3 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The thickness of the horizontal web, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ webThickness?: number | undefined; /** * The thickness of each vertical flange, in model units. * @default 0.3 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ flangeThickness?: number | undefined; /** * 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 | undefined; /** * How far the profile is turned in its plane, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 15 */ rotation?: number | undefined; /** * The point the profile is placed at. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The normal of the plane the profile lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * The total height of the profile, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The thickness of the vertical web, in model units. * @default 0.2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ webThickness?: number | undefined; /** * The thickness of the flange, in model units. * @default 0.3 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ flangeThickness?: number | undefined; /** * 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 | undefined; /** * How far the profile is turned in its plane, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 15 */ rotation?: number | undefined; /** * The point the profile is placed at. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The normal of the plane the profile lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * The total height of the profile, in model units. * @default 3 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The thickness of the web at the back of the channel, in model units. * @default 0.2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ webThickness?: number | undefined; /** * The thickness of each flange, in model units. * @default 0.3 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ flangeThickness?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * How far the profile is turned in its plane, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 15 */ rotation?: number | undefined; /** * The point the profile is placed at. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The normal of the plane the profile lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 | undefined; /** * How far the profile grows against its normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 | undefined; /** * How far the profile grows against its normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 | undefined; /** * How far the profile grows against its normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 | undefined; /** * How far the profile grows against its normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * The side along Z, in model units. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ length?: number | undefined; /** * The side along Y, which is up, in model units. * @default 3 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The point the box is centered on, or stands on when `originOnCenter` is false. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ size?: number | undefined; /** * The point the cube is centered on, or stands on when `originOnCenter` is false. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * The side along Z, in model units. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ length?: number | undefined; /** * The side along Y, which is up, in model units. * @default 3 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * 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 | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * The point the sphere is centered on. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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 | undefined; /** * The radius at the top, in model units; 0 makes a pointed cone. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius2?: number | undefined; /** * The distance from the base to the top along `direction`, in model units. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * How much of the full round to build, in degrees; less than 360 cuts a wedge out. * @default 360 * @minimum 0 * @exclusiveMinimum true * @maximum 360 * @step 1 */ angle?: number | undefined; /** * The center of the base. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The direction from the base to the top. * @default [0, 1, 0] */ direction?: Base.Point3 | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ majorRadius?: number | undefined; /** * The radius of the tube itself, in model units; at most `majorRadius`, where the hole in the * middle closes to a point. * @default 0.5 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ minorRadius?: number | undefined; /** * The point the ring is centered on. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The axis the ring goes around; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * How much of the full ring to build, in degrees; less than 360 gives a partial ring. * @default 360 * @minimum 0 * @exclusiveMinimum true * @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 | undefined; /** * The point the line ends at. * @default [0, 1, 0] */ end?: Base.Point3 | undefined; } /** * 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 | undefined; /** * The point the line ends at, before the extension. * @default [0, 1, 0] */ end?: Base.Point3 | undefined; /** * How far the line is lengthened past its start, in model units. * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extensionStart?: number | undefined; /** * How far the line is lengthened past its end, in model units. * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ extensionEnd?: number | undefined; } /** * 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. * @default false */ returnCompound?: boolean | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * The point the arc finishes at. * @default [0, 0, 1] */ end?: Base.Point3 | undefined; } /** * 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 | undefined; /** * The point on the circle where the arc ends. * @default [0, 0, 1] */ end?: Base.Point3 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * Which way round the circle the arc runs: true follows the circle's own direction, false goes * the other way. * @default true */ sense?: boolean | undefined; } /** * 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 | undefined; /** * A point the arc passes through on its way; it fixes the plane and radius. * @default [0, 1, 0] */ middle?: Base.Point3 | undefined; /** * The point the arc finishes at. * @default [0, 0, 1] */ end?: Base.Point3 | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * How far the cylinder grows from its base along `direction`, in model units. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The center of the base, or the middle of the cylinder when `originOnCenter` is true. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * 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 * @exclusiveMinimum true * @maximum 360 * @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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * 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` gives the listed edges or corners their radii in the order the * shape holds them. */ 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * One radius per entry of `indexes`, given to the listed edges or corners in the shape's own * order, not in `indexes` order; list `indexes` ascending. 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * One radius per entry of `indexes`, given to the listed corners in their order along each * outline, not in `indexes` order; list `indexes` ascending. 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; } /** * 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[]; } /** * How the corners of a 3D wire are rounded, shared by `Fillet3DWireDto` and `Fillet3DWiresDto`: the * radius or radii, and which corners. */ abstract class Fillet3DWireSharedDto { /** * The rounding radius in model units, used for every selected corner unless `radiusList` is * given. * @default 0.1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * One radius per entry of `indexes`, in the same order; needs `indexes`. * @default undefined * @optional true */ radiusList?: number[] | undefined; /** * Corners to round, counted from 0: corner `i` joins edge `i` to the next; a closed wire's last * corner joins its last edge to its first. Omit for all. * @default undefined * @optional true */ indexes?: number[] | undefined; /** * Not used: each corner is rounded in the plane of the two edges that meet there. It is kept * so that scripts which set it keep working. * @default [0, 1, 0] * @deprecated Has no effect and will be removed in the next major version, with the constructors' * `direction` parameter; leave it out. */ direction?: Base.Vector3 | undefined; } /** * Wires, a radius and optional corner indexes for `fillets.fillet3DWires`, which rounds the corners * of wires whether or not they lie in a plane. */ class Fillet3DWiresDto extends Fillet3DWireSharedDto { constructor(shapes?: T[], radius?: number, direction?: Base.Vector3, radiusList?: number[], indexes?: number[]); /** * The wires whose corners are rounded. * @default undefined */ shapes: T[]; } /** * A wire, a radius and optional corner indexes for `fillets.fillet3DWire`, which rounds the corners * of a wire whether or not it lies in a plane. */ class Fillet3DWireDto extends Fillet3DWireSharedDto { constructor(shape?: T, radius?: number, direction?: Base.Vector3, radiusList?: number[], indexes?: number[]); /** * The wire whose corners are rounded. * @default undefined */ shape: T; } /** * A shape, a distance and optional edge indexes for `fillets.chamferEdges`; `distanceList` gives the * listed edges their distances in the order `shapes.edge.getEdges` lists them. */ 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ distance?: number | undefined; /** * One distance per entry of `indexes`, given to the listed edges in the order `shapes.edge.getEdges` * lists them, not in `indexes` order; list `indexes` ascending. 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ distance?: number | undefined; /** * The slope of the bevel away from the face, in degrees; 45 gives an even chamfer. * @default 45 * @minimum 0 * @exclusiveMinimum true * @maximum 90 * @exclusiveMaximum true * @step 1 */ angle?: number | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ distance1?: number | undefined; /** * How far the bevel reaches from the edge on the other face, in model units. * @default 0.2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ distance2?: number | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ distance1?: number | undefined; /** * How far the bevel reaches from each edge on the other face, in model units. * @default 0.2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ distance2?: number | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ distance?: number | undefined; /** * The slope of the bevels away from the paired faces, in degrees; 45 gives an even chamfer. * @default 45 * @minimum 0 * @exclusiveMinimum true * @maximum 90 * @exclusiveMaximum true * @step 1 */ angle?: number | undefined; } /** * 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 | undefined; } /** * 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. * @default false */ returnCompound?: boolean | undefined; } /** * 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 | undefined; /** * Which arc of each circle stays in the outline: both outside, both inside, or one of each. * @default outside */ circleRemainders?: fourSidesStrictEnum | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * When true, the zig-zag starts on the second wire instead of the first. * @default false */ inverse?: boolean | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * How far the curve may stray from the points, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; /** * 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, for open curves and with `endTangent` only. * Shorter than `tolerance`, such as `[0, 0, 0]`, it counts as not given. * @default undefined * @optional true */ startTangent?: Base.Vector3 | undefined; /** * A direction the curve must arrive at the last point in; only for open curves, and only together * with `startTangent`. A tangent shorter than `tolerance` counts as not given. * @default undefined * @optional true */ endTangent?: Base.Vector3 | undefined; /** * One direction per point that the curve must follow there, with undefined entries, and entries * shorter than `tolerance`, 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 | undefined; } /** * 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. * @default false */ returnCompound?: boolean | undefined; } /** * 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 | undefined; /** * 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 */ 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 | undefined; /** * 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 */ 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The degree to rebuild to in V, with the same rules as `uDegree`. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ vDegree?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * When true, U runs the other way. * @default false */ reverseU?: boolean | undefined; /** * When true, V runs the other way. * @default false */ reverseV?: boolean | undefined; } /** * 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 | undefined; /** * When true, the V parameter is evened out by distance. * @default true */ normalizeV?: boolean | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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. * @default false */ returnCompound?: boolean | undefined; } /** * How a curve is divided into points, shared by `DivideDto` and `DivideShapesDto`: the number of * steps and whether the end points are kept. */ abstract class DivideSharedDto { /** * 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 | undefined; /** * When true, the point at the start of each curve is left out. * @default false */ removeStartPoint?: boolean | undefined; /** * When true, the point at the end of each curve is left out. * @default false */ removeEndPoint?: boolean | undefined; } /** * A wire or edge and a division count for `divideWireByParamsToPoints`, * `divideEdgeByEqualDistanceToPoints` and their siblings in `shapes.wire` and `shapes.edge`. */ class DivideDto extends DivideSharedDto { constructor(shape?: T, nrOfDivisions?: number, removeStartPoint?: boolean, removeEndPoint?: boolean); /** * The wire or edge to place points along. * @default undefined */ shape: T; } /** * Where a wire is projected, shared by `ProjectWireDto` and `ProjectWiresDto`: the shape it lands * on and the direction it is cast along. */ abstract class ProjectWireSharedDto { /** * The shape each wire lands on. * @default undefined */ shape: U; /** * The direction each wire is cast along; only its direction matters. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * A wire, a shape and a direction for `shapes.wire.project`, which casts the wire onto the shape * along the direction. */ class ProjectWireDto extends ProjectWireSharedDto { constructor(wire?: T, shape?: U, direction?: Base.Vector3); /** * The wire to cast onto the shape. * @default undefined */ wire: T; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * The fewest points any edge is traced with, however straight. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ minimumOfPoints?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * The fewest points any edge is traced with, however straight. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ minimumOfPoints?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * Wires, a shape and a direction for `shapes.wire.projectWires`, which casts each wire onto the * shape along the direction. */ class ProjectWiresDto extends ProjectWireSharedDto { constructor(wires?: T[], shape?: U, direction?: Base.Vector3); /** * The wires to cast onto the shape, one result per wire. * @default undefined */ wires: T[]; } /** * Wires or edges and a division count for `divideWiresByParamsToPoints`, * `divideEdgesByEqualDistanceToPoints` and their siblings. */ class DivideShapesDto extends DivideSharedDto { 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[]; } /** * 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 -Infinity * @maximum Infinity * @step 0.1 */ param?: number | undefined; } /** * 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 | undefined; } /** * 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 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ length?: number | undefined; /** * When true, one more point is asked for a step beyond the last one that fit. * @default false */ tryNext?: boolean | undefined; /** * When true, the point at the start of the wire is kept. * @default false */ includeFirst?: boolean | undefined; /** * When true, the end point of the wire is appended whatever the spacing. * @default false */ includeLast?: boolean | undefined; } /** * 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; they must add up to more than 0. * @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 | undefined; /** * When true, the point at the start of the wire is kept. * @default false */ includeFirst?: boolean | undefined; /** * When true, the end point of the wire is appended whatever the pattern. * @default false */ includeLast?: boolean | undefined; } /** * 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 0 * @maximum Infinity * @step 0.1 */ length?: number | undefined; } /** * 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 0 * @maximum Infinity * @step 0.1 */ length?: number | undefined; } /** * A curve and several distances along it, for `shapes.wire.pointsOnWireAtLengths`, * `analysis.curves.curvaturesAtLengths`, `shapes.edge.splitEdgeAtLengths` and * `shapes.wire.splitWireAtLengths`. */ class DataOnGeometryAtLengthsDto { constructor(shape?: T, lengths?: number[]); /** * The edge or wire to evaluate; each method says which it takes. * @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 | undefined; /** * The point the circle is centered on. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The normal of the plane the circle lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * When true, the surface loops from the last section back to the first. * @default false */ closed?: boolean | undefined; /** * When true, the closed loop is made smooth across the seam by resampling the sections; needs * `closed`. * @default false */ periodic?: boolean | undefined; /** * When true, the patches between sections are ruled surfaces with straight lines instead of a * smooth blend. * @default false */ straight?: boolean | undefined; /** * How many points each section is resampled into for a periodic loft. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrPeriodicSections?: number | undefined; /** * When true, the kernel smooths the fitted surface. * @default false */ useSmoothing?: boolean | undefined; /** * The highest polynomial degree the surface may use across the sections. * @default 3 */ maxUDegree?: number | undefined; /** * 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 | undefined; /** * How the sections are parametrized before fitting: by chord length, centripetal, or * isoparametric; centripetal handles uneven sections best. * @default approxCentripetal */ parType?: approxParametrizationTypeEnum | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * When true, the internal edges the offset can leave behind are removed from the result. * @default false */ removeIntEdges?: boolean | undefined; } /** * 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; a negative angle spins the other way, 360 or more either way * gives a full turn, and 0 is not allowed. * @default 360 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle?: number | undefined; /** * The direction of the axis, which passes through the origin. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * When true, the profile's geometry is copied instead of shared with the result. * @default false */ copy?: boolean | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 1 */ radius?: number | undefined; /** * When true, the tubes are solids; when false they are open shells. * @default true */ makeSolid?: boolean | undefined; /** * 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 | undefined; /** * When true, a swept surface that came out with kinks is refitted to be smooth. * @default false */ forceApproxC1?: boolean | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 1 */ radius?: number | undefined; /** * When true, the tube is a solid; when false it is an open shell. * @default true */ makeSolid?: boolean | undefined; /** * 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 | undefined; /** * When true, a swept surface that came out with kinks is refitted to be smooth. * @default false */ forceApproxC1?: boolean | undefined; } /** * 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 * @exclusiveMinimum true * @maximum Infinity * @step 1 */ radius?: number | undefined; /** * How many corners, and so flat sides, the tube has. * @default 6 * @minimum 3 * @maximum Infinity * @step 1 */ nrCorners?: number | undefined; /** * When true, the tube is a solid; when false it is an open shell. * @default true */ makeSolid?: boolean | undefined; /** * 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 | undefined; /** * When true, a swept surface that came out with kinks is refitted to be smooth. * @default false */ forceApproxC1?: boolean | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * Shapes and an edge flag for `booleans.union`, which fuses them into one. */ class UnionDto { constructor(shapes?: T[], keepEdges?: boolean, strategy?: booleanStrategyEnum); /** * The shapes to fuse, in order; the pieces of a compound are fused as separate shapes. * @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 | undefined; /** * One shape per step suits any; in groups is faster for shapes apart but numbers faces * differently; all at once is fastest but wrong where shapes touch at a point. * @default oneAfterAnother */ strategy?: booleanStrategyEnum | undefined; } /** * A main shape and the shapes to cut away from it for `booleans.difference`. */ class DifferenceDto { constructor(shape?: T, shapes?: T[], keepEdges?: boolean, strategy?: booleanStrategyEnum); /** * The shape material is removed from. * @default undefined */ shape: T; /** * The shapes whose volume is cut away, in order; the pieces of a compound are cut away as * separate shapes. * @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 | undefined; /** * One shape per step suits any; in groups is faster for shapes apart but numbers faces * differently; all at once is fastest but wrong where shapes touch at a point. * @default oneAfterAnother */ strategy?: booleanStrategyEnum | undefined; } /** * 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 | undefined; } /** * One shape for the many methods that take nothing else, such as `shapeFix.isValid`, * `shapes.face.getFaceArea` or `analysis.measure.tightBoundingBox`. */ 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 * @exclusiveMinimum true * @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 * @exclusiveMinimum true * @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 * @exclusiveMinimum true * @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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * How far the profile turns about the Y axis over the height, in degrees. * @default 360 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle?: number | undefined; /** * When true, a face profile gives a closed solid; when false the result is a shell. * @default true */ makeSolid?: boolean | undefined; } /** * 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 -Infinity * @maximum Infinity * @step 0.1 */ offset?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * Whether the kernel should look for self-intersections in the result; not implemented by the * kernel, so leave it false. * @default false */ selfIntersection?: boolean | undefined; /** * 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 | undefined; /** * When true, the internal edges the offset can leave on the walls are removed from the result. * @default false */ removeIntEdges?: boolean | undefined; } /** * 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 | undefined; /** * The direction of the rotation axis, which passes through the origin. * @default [0,1,0] */ rotationAxis?: Base.Vector3 | undefined; /** * The rotation about the axis, in degrees, applied after the scale. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ rotationAngle?: number | undefined; /** * The uniform scale about the origin, applied first; 1 keeps the size, and a negative factor * also mirrors the shape through the origin. It must not be 0. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ scaleFactor?: number | undefined; } /** * 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[] | undefined; /** * One rotation axis direction per shape, each through the origin. * @default [[0,1,0]] */ rotationAxes?: Base.Vector3[] | undefined; /** * One rotation angle per shape, in degrees. * @default [0] */ rotationAngles?: number[] | undefined; /** * One uniform scale factor per shape, about the origin; none may be 0. * @default [1] */ scaleFactors?: number[] | undefined; } /** * 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 | undefined; } /** * 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[] | undefined; } /** * 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 | undefined; /** * The normal direction at the shape's frame, carried onto `toNorm`. * @default [1, 0, 0] */ fromNorm?: Base.Vector3 | undefined; /** * 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 | undefined; /** * The point `fromOrigin` lands on. * @default [0, 1, 0] */ toOrigin?: Base.Point3 | undefined; /** * The direction `fromNorm` lands on. * @default [0, 1, 0] */ toNorm?: Base.Vector3 | undefined; /** * The direction `fromAx` lands on. * @default [0, 0, 1] */ toAx?: Base.Vector3 | undefined; } /** * 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 | undefined; /** * The direction at the shape's frame that is carried onto `toDirection`. * @default [0, 0, 1] */ fromDirection?: Base.Vector3 | undefined; /** * The point `fromOrigin` lands on. * @default [0, 1, 0] */ toOrigin?: Base.Point3 | undefined; /** * The direction `fromDirection` lands on. * @default [0, 1, 0] */ toDirection?: Base.Vector3 | undefined; } /** * 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[] | undefined; /** * One direction per shape that is carried onto the matching `toDirections` entry. * @default [[0, 0, 1]] */ fromDirections?: Base.Vector3[] | undefined; /** * One point per shape for its `fromOrigins` entry to land on. * @default [[0, 1, 0]] */ toOrigins?: Base.Point3[] | undefined; /** * One direction per shape for its `fromDirections` entry to land on. * @default [[0, 1, 0]] */ toDirections?: Base.Vector3[] | undefined; } /** * 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 | undefined; /** * The direction of the mirror axis. * @default [0, 0, 1] */ direction?: Base.Vector3 | undefined; } /** * 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[] | undefined; /** * One mirror axis direction per shape. * @default [[0, 0, 1]] */ directions?: Base.Vector3[] | undefined; } /** * 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 | undefined; /** * The normal of the mirror plane. * @default [0, 0, 1] */ normal?: Base.Vector3 | undefined; } /** * 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[] | undefined; /** * One mirror plane normal per shape. * @default [[0, 0, 1]] */ normals?: Base.Vector3[] | undefined; } /** * 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 | undefined; /** * The point the shape's origin is moved to, in model units. * @default [0, 0, 0] */ center?: Base.Vector3 | undefined; } /** * 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 | undefined; /** * When true, faces that lie on one surface are merged into one. * @default true */ unifyFaces?: boolean | undefined; /** * When true, neighboring B-spline edges are joined into a single B-spline where possible. * @default true */ concatBSplines?: boolean | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * When true, points inside a face are kept. * @default true */ keepIn?: boolean | undefined; /** * When true, points on the boundary of a face are kept. * @default true */ keepOn?: boolean | undefined; /** * When true, points outside a face are kept. * @default false */ keepOut?: boolean | undefined; /** * When true, points the kernel cannot place inside, on or outside a face are kept. * @default false */ keepUnknown?: boolean | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * When true, points inside the face are kept. * @default true */ keepIn?: boolean | undefined; /** * When true, points on the boundary of the face are kept. * @default true */ keepOn?: boolean | undefined; /** * When true, points outside the face are kept. * @default false */ keepOut?: boolean | undefined; /** * When true, points the kernel cannot place inside, on or outside the face are kept. * @default false */ keepUnknown?: boolean | undefined; } /** * 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 | undefined; /** * When true, points inside the solid are kept. * @default true */ keepIn?: boolean | undefined; /** * When true, points on the surface of the solid are kept. * @default true */ keepOn?: boolean | undefined; /** * When true, points outside the solid are kept. * @default false */ keepOut?: boolean | undefined; /** * When true, points the kernel could not classify are kept. * @default false */ keepUnknown?: boolean | undefined; } /** * 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[] | undefined; /** * One point per shape for its origin to move to, in model units. * @default [[0, 0, 0]] */ centers?: Base.Vector3[] | undefined; } /** * 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 | undefined; /** * The rotation in degrees, following the right-hand rule about the axis. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle?: number | undefined; } /** * 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 | undefined; /** * The point the rotation axis passes through. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The direction of the rotation axis. * @default [0, 0, 1] */ axis?: Base.Vector3 | undefined; } /** * 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[] | undefined; /** * One rotation angle per shape, in degrees. * @default [0] */ angles?: number[] | undefined; } /** * 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[] | undefined; /** * One point per shape for its rotation axis to pass through. * @default [[0, 0, 0]] */ centers?: Base.Point3[] | undefined; /** * One rotation axis direction per shape. * @default [[0, 0, 1]] */ axes?: Base.Vector3[] | undefined; } /** * 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, and a negative factor also * mirrors the shape through the origin. It must not be 0. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ factor?: number | undefined; } /** * 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; none may be 0. * @default [1] */ factors?: number[] | undefined; } /** * 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, and none may be 0. * @default [1, 1, 1] */ scale?: Base.Vector3 | undefined; /** * The point that stays in place while everything else scales away from or toward it. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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, none of them 0. * @default [[1, 1, 1]] */ scales?: Base.Vector3[] | undefined; /** * One point per shape that stays in place while it scales. * @default [[0, 0, 0]] */ centers?: Base.Point3[] | undefined; } /** * 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, and a negative factor also * mirrors the shape through the center. It must not be 0. * @default 1 * @step 0.1 */ factor?: number | undefined; /** * The point that stays in place while everything else scales away from or toward it. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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 | undefined; } /** * 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 ] | undefined; } /** * 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 | 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; /** * The uniform scale about the origin, applied first; 1 keeps the size. * @default 1 * @step 0.1 */ scale?: number | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The rotation in degrees, following the right-hand rule about the axis. * @default 0 * @step 1 */ angle?: number | undefined; /** * The point the axis passes through; the origin when left at its default. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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 | undefined; /** * The point that stays in place while everything else scales; the origin when left at its * default. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The direction of the mirror axis; any length will do, but not a zero vector. * @default [1, 0, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 | undefined; /** * The normal of the mirror plane; any length will do, but not a zero vector. * @default [0, 0, 1] */ normal?: Base.Vector3 | undefined; } /** * 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 ] | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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[] | undefined; /** * The rounding radius, in model units. * @default 1 * @step 0.1 */ radius?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * `auto` rounds planar corners in place and 3D corners with a taper; `planarOnly` skips 3D * corners. * @default auto */ mode?: cornerModeEnum | undefined; } /** * 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[] | undefined; /** * How far the bevel reaches back from the corner along its edges, in model units. * @default 1 * @step 0.1 */ distance?: number | undefined; /** * The slope of the bevel in degrees, used for planar corners. * @default 45 * @step 1 */ angle?: number | undefined; /** * 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 | undefined; /** * `auto` bevels planar corners in place and 3D corners with a local plane cut; `planarOnly` * skips 3D corners. * @default auto */ mode?: cornerModeEnum | undefined; } /** * 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[] | undefined; /** * 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 | undefined; } /** * 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 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ distance?: number | undefined; /** * The angle of the bevel to that edge, in degrees; 45 gives an even chamfer. * @default 45 * @step 1 */ angle?: number | undefined; /** * 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 | undefined; /** * The draft angle, in degrees. * @default 5 * @step 1 */ angle?: number | undefined; /** * 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 | undefined; /** * The normal of the neutral plane. * @default [0, 0, 1] */ neutralPlaneDirection?: Base.Vector3 | undefined; /** * When true, the faces taper on the standard side; false tapers them the other way. * @default true */ flag?: boolean | undefined; } /** * 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 | undefined; /** * How far the skirt leans from the direction, in degrees. * @default 5 * @step 1 */ angle?: number | undefined; /** * How long the skirt may grow, in model units, measured along the corner edges between its * faces. * @default 10 * @step 0.1 */ lengthMax?: number | undefined; /** * When true, the skirt leans inward instead of outward. * @default false */ internal?: boolean | undefined; } /** * 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 | undefined; /** * How far the skirt leans from the direction, in degrees. * @default 5 * @step 1 */ angle?: number | undefined; /** * 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 | undefined; /** * When true, the skirt leans inward instead of outward. * @default false */ internal?: boolean | undefined; } /** * A shape and meshing settings for `shapeToMesh`, which triangulates the shape for drawing, and can * add each face's iso curves and a surface analysis value at every vertex. */ class ShapeToMeshDto { constructor(shape?: T, precision?: number, adjustYtoZ?: boolean, computeMetadata?: boolean, keepMeshData?: boolean, allowQualityDecrease?: boolean, forceFaceDeflection?: boolean, isoCurvesU?: number, isoCurvesV?: number, surfaceAnalysis?: surfaceAnalysisEnum, draftDirection?: Base.Vector3, angularDeflection?: number, relativeDeflection?: 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.001 */ precision?: number | undefined; /** * The largest angle, in radians, a curved face may turn between neighbouring triangles; smaller * follows curvature more closely with more triangles. * @default 0.5 * @minimum 0.001 * @maximum 3.14159 * @step 0.05 */ angularDeflection?: number | undefined; /** * When true, `precision` is a fraction of each edge's and face's size instead of model units, so * small and large parts get triangles in proportion to their size. * @default false */ relativeDeflection?: boolean | undefined; /** * 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 | undefined; /** * 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 on the shape for the next mesh with the same settings to * reuse; when false it is cleared. A mesh retention budget keeps every mesh. * @default false */ keepMeshData?: boolean | undefined; /** * When true, a face whose triangulation is not within 10% of the precision it needs is meshed * again; when false, a finer one is kept. * @default true */ allowQualityDecrease?: boolean | undefined; /** * When true, every face is meshed at exactly the requested precision; when false, a face's * precision is raised to the average of its edges' and to twice its tolerance. * @default false */ forceFaceDeflection?: boolean | undefined; /** * How many iso curves of constant u each face gets in `isoCurveList`, spread evenly inside its * u range and trimmed to the face; 0 gives none. * @default 0 * @minimum 0 * @maximum 1000 * @step 1 */ isoCurvesU?: number | undefined; /** * How many iso curves of constant v each face gets in `isoCurveList`, spread evenly inside its * v range and trimmed to the face; 0 gives none. * @default 0 * @minimum 0 * @maximum 1000 * @step 1 */ isoCurvesV?: number | undefined; /** * What each face's `analysisValues` hold, one value per vertex: a curvature, the smallest bending * radius, or the draft angle in degrees. `none` leaves them out. * @default none */ surfaceAnalysis?: surfaceAnalysisEnum | undefined; /** * The pull direction the draft angles are measured against; read only by `draftAngle`. * @default [0, 1, 0] */ draftDirection?: Base.Vector3 | 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.001 */ precision?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * A shape and a meshing precision for `shapeToManifoldMesh`, which meshes the shape into one indexed * mesh for the Manifold kernel. */ class ShapeToManifoldMeshDto { constructor(shape?: T, precision?: number); /** * The shape to mesh; a closed solid gives a closed mesh. * @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 * @exclusiveMinimum true * @maximum Infinity * @step 0.001 */ precision?: number | undefined; } /** * Shapes and meshing settings for `shapesToMeshes`, which triangulates each shape with the same * settings, iso curves and surface analysis included. */ class ShapesToMeshesDto { constructor(shapes?: T[], precision?: number, adjustYtoZ?: boolean, computeMetadata?: boolean, keepMeshData?: boolean, allowQualityDecrease?: boolean, forceFaceDeflection?: boolean, isoCurvesU?: number, isoCurvesV?: number, surfaceAnalysis?: surfaceAnalysisEnum, draftDirection?: Base.Vector3, angularDeflection?: number, relativeDeflection?: 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.001 */ precision?: number | undefined; /** * The largest angle, in radians, a curved face may turn between neighbouring triangles; smaller * follows curvature more closely with more triangles. * @default 0.5 * @minimum 0.001 * @maximum 3.14159 * @step 0.05 */ angularDeflection?: number | undefined; /** * When true, `precision` is a fraction of each edge's and face's size instead of model units, so * small and large parts get triangles in proportion to their size. * @default false */ relativeDeflection?: boolean | undefined; /** * 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 | undefined; /** * 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 triangulations stay on the shapes for the next mesh with the same settings to * reuse; when false they are cleared. A mesh retention budget keeps every mesh. * @default false */ keepMeshData?: boolean | undefined; /** * When true, a face whose triangulation is not within 10% of the precision it needs is meshed * again; when false, a finer one is kept. * @default true */ allowQualityDecrease?: boolean | undefined; /** * When true, every face is meshed at exactly the requested precision; when false, a face's * precision is raised to the average of its edges' and to twice its tolerance. * @default false */ forceFaceDeflection?: boolean | undefined; /** * How many iso curves of constant u each face gets in `isoCurveList`, spread evenly inside its * u range and trimmed to the face; 0 gives none. * @default 0 * @minimum 0 * @maximum 1000 * @step 1 */ isoCurvesU?: number | undefined; /** * How many iso curves of constant v each face gets in `isoCurveList`, spread evenly inside its * v range and trimmed to the face; 0 gives none. * @default 0 * @minimum 0 * @maximum 1000 * @step 1 */ isoCurvesV?: number | undefined; /** * What each face's `analysisValues` hold, one value per vertex: a curvature, the smallest bending * radius, or the draft angle in degrees. `none` leaves them out. * @default none */ surfaceAnalysis?: surfaceAnalysisEnum | undefined; /** * The pull direction the draft angles are measured against; read only by `draftAngle`. * @default [0, 1, 0] */ draftDirection?: Base.Vector3 | 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, angularDeflection?: number, relativeDeflection?: 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.001 */ precision?: number | undefined; /** * The largest angle, in radians, a curved face may turn between neighbouring triangles; smaller * follows curvature more closely with more triangles. * @default 0.5 * @minimum 0.001 * @maximum 3.14159 * @step 0.05 */ angularDeflection?: number | undefined; /** * When true, `precision` is a fraction of each edge's and face's size instead of model units, so * small and large parts get triangles in proportion to their size. * @default false */ relativeDeflection?: boolean | undefined; /** * 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 | undefined; /** * 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 triangulations stay on the shapes for the next mesh with the same settings to * reuse; when false they are cleared. A mesh retention budget keeps every mesh. * @default false */ keepMeshData?: boolean | undefined; /** * When true, a face whose triangulation is not within 10% of the precision it needs is meshed * again; when false, a finer one is kept. * @default true */ allowQualityDecrease?: boolean | undefined; /** * When true, every face is meshed at exactly the requested precision; when false, a face's * precision is raised to the average of its edges' and to twice its tolerance. * @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, angularDeflection?: number, relativeDeflection?: 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 * @exclusiveMinimum true * @maximum Infinity * @step 0.001 */ precision?: number | undefined; /** * The largest angle, in radians, a curved face may turn between neighbouring triangles; smaller * follows curvature more closely with more triangles. * @default 0.5 * @minimum 0.001 * @maximum 3.14159 * @step 0.05 */ angularDeflection?: number | undefined; /** * When true, `precision` is a fraction of each edge's and face's size instead of model units, so * small and large parts get triangles in proportion to their size. * @default false */ relativeDeflection?: boolean | undefined; /** * 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 | undefined; /** * 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 triangulations stay on the shapes for the next mesh with the same settings to * reuse; when false they are cleared. A mesh retention budget keeps every mesh. * @default false */ keepMeshData?: boolean | undefined; /** * When true, a face whose triangulation is not within 10% of the precision it needs is meshed * again; when false, a finer one is kept. * @default true */ allowQualityDecrease?: boolean | undefined; /** * When true, every face is meshed at exactly the requested precision; when false, a face's * precision is raised to the average of its edges' and to twice its tolerance. * @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 | undefined; /** * When true, Y and Z swap so Y-up becomes STEP's Z-up, which mirrors the shape. To keep it as * built, turn it 90 degrees about X with `transforms.rotate` instead. * @default false */ adjustYtoZ?: boolean | undefined; /** * When true, the swap of `adjustYtoZ` becomes a turn of -90 degrees about X: the shape is not * mirrored but stands upside down in a Z-up tool. * @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 | undefined; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * and makes a bigger file. * @default 0.01 */ precision?: number | undefined; /** * When true, Y and Z swap so Y-up becomes Z-up, which mirrors the shape. To keep it as built, * turn it 90 degrees about X with `transforms.rotate` instead. * @default false */ adjustYtoZ?: boolean | undefined; /** * When true, a browser download of the file is started where that is possible; the kernel * itself only returns the text or the bytes. * @default true */ tryDownload?: boolean | undefined; /** * When true, the STL is written in its binary form, which is much smaller than the text form, and * comes back as bytes; when false, as ASCII text. * @default false */ 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 | undefined; /** * 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 | undefined; /** * The fewest points any edge is traced with, however straight. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ minimumOfPoints?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The color of the paths as a hex string such as `#000000`. * @default #000000 */ color?: Base.Color | undefined; } /** * 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 | undefined; /** * The DXF version to write: `AC1009` is R12, the most widely readable, `AC1015` is 2000. * @default AC1009 */ acadVersion?: dxfAcadVersionEnum | undefined; /** * 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. * @default step */ fileType?: fileTypeEnum | undefined; /** * When true, the shape is turned so the file's Z-up becomes this library's Y-up. * @default true */ adjustZtoY?: boolean | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * When true, the shape is turned so the file's Z-up becomes this library's Y-up. * @default true */ adjustZtoY?: boolean | undefined; } /** * 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 Infinity * @step 0.001 */ meshPrecision?: number | undefined; /** * 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.141592653589793 * @step 0.05 */ meshAngle?: number | undefined; /** * 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 | undefined; /** * When true, extra vertices are added inside curved faces for a closer fit, at the cost of * speed. * @default false */ internalVerticesMode?: boolean | undefined; /** * When true, an extra pass refines triangles that bulge beyond the precision, at the cost of * speed. * @default false */ controlSurfaceDeflection?: boolean | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * When true, one quantization grid is used for every attribute instead of one per attribute. * @default false */ dracoUnifiedQuantization?: boolean | undefined; } /** * 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 | undefined; /** * When true, part names are read from the file; switch it off for faster parsing when names are * not needed. * @default true */ readNames?: boolean | undefined; /** * When true, materials are read from the file; needed for material properties in the glTF. * @default true */ readMaterials?: boolean | undefined; /** * When true, layer information is read from the file; rarely needed for glTF. * @default false */ readLayers?: boolean | undefined; /** * When true, validation properties are read from the file; rarely needed for glTF. * @default false */ readProps?: boolean | undefined; /** * 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 Infinity * @step 0.001 */ meshDeflection?: number | undefined; /** * 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.141592653589793 * @step 0.1 */ meshAngle?: number | undefined; /** * When true, faces are meshed on several threads where the build allows it. * @default true */ meshParallel?: boolean | undefined; /** * 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 Infinity * @step 10000 */ faceCountThreshold?: number | undefined; /** * 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 | undefined; /** * When true, extra vertices are added inside curved faces for a closer fit, at the cost of * speed. * @default false */ internalVerticesMode?: boolean | undefined; /** * When true, an extra pass refines triangles that bulge beyond the precision, at the cost of * speed. * @default false */ controlSurfaceDeflection?: boolean | undefined; /** * When true, the faces of a part are joined into one mesh, which makes a smaller file. * @default true */ mergeFaces?: boolean | undefined; /** * When true, merged meshes use 16-bit indexes where they fit, which makes a smaller file. * @default true */ splitIndices16?: boolean | undefined; /** * When true, the glTF is written on several threads, which helps with large files. * @default true */ parallelWrite?: boolean | undefined; /** * When true, textures are embedded in the GLB instead of referenced as separate files. * @default true */ embedTextures?: boolean | undefined; /** * When true, texture coordinates are written even for meshes without textures. * @default false */ forceUVExport?: boolean | undefined; /** * What the glTF nodes are named after: the instance, the product, a combination, or nothing. * @default instance */ nodeNameFormat?: gltfNameFormatEnum | undefined; /** * What the glTF meshes are named after: the instance, the product, a combination, or nothing. * @default instance */ meshNameFormat?: gltfNameFormatEnum | undefined; /** * 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 | undefined; /** * When true, the file's Z-up is turned into glTF's Y-up; false keeps Z up. * @default true */ adjustZtoY?: boolean | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * When true, one quantization grid is used for every attribute instead of one per attribute. * @default false */ dracoUnifiedQuantization?: boolean | undefined; } /** * 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 }` from 0 to 1; left out, the part has no color of * its own. * @default undefined * @optional true * @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[] | undefined; /** * The assembly and instance node definitions that make up the tree. * @default [] */ nodes?: Models.OCCT.AssemblyNodeDef[] | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * The green channel, from 0 to 1. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.01 */ g?: number | undefined; /** * The blue channel, from 0 to 1. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.01 */ b?: number | undefined; /** * The opacity, from 0 for transparent to 1 for opaque. * @default 1.0 * @minimum 0 * @maximum 1 * @step 0.01 */ a?: number | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The author written into the STEP header. * @default Bitbybit user */ author?: string | undefined; /** * The organization written into the STEP header. * @default Bitbybit */ organization?: string | undefined; /** * When true, the file is written as gzip-compressed STEP-Z. * @default false */ compress?: boolean | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The largest angle, in radians, between the normals of neighboring triangles; smaller gives * smoother curves. * @default 0.5 */ meshAngle?: number | undefined; /** * When true, extra vertices are added inside curved faces for a closer fit, at the cost of * speed. * @default false */ internalVerticesMode?: boolean | undefined; /** * When true, an extra pass refines triangles that bulge beyond the deflection, at the cost of * speed. * @default false */ controlSurfaceDeflection?: boolean | undefined; /** * When true, faces with the same material are joined into one mesh; false keeps every face * separate. * @default false */ mergeFaces?: boolean | undefined; /** * When true, texture coordinates are written even for meshes without textures. * @default false */ forceUVExport?: boolean | undefined; /** * Which axis points up in the document. A z-up document is turned so that z becomes glTF's y; * a y-up one is written as it is. * @default z */ up?: upAxisEnum | undefined; /** * The name the downloaded file gets; it should end in `.glb`. * @default assembly.glb */ fileName?: string | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * When true, one quantization grid is used for every attribute instead of one per attribute. * @default false */ dracoUnifiedQuantization?: boolean | undefined; } /** * 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 | undefined; } /** * A wire, an offset and a direction for `operations.offset3DWire`, which offsets a wire that does * not lie in one plane across that direction. */ 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; /** * How far every point moves, in model units. A positive offset moves a loop that runs * counterclockwise, seen from the tip of `direction`, inwards. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ offset?: number | undefined; /** * The direction the offset is taken across: every point moves at right angles to both it and the * wire. It must cross the wire everywhere, never running along it. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The direction of the major axis in the plane. * @default [1,0] */ direction?: Base.Vector2 | undefined; /** * The half-width across the ellipse's short axis; must not exceed `radiusMajor`. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusMinor?: number | undefined; /** * The half-width along the ellipse's long axis. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusMajor?: number | undefined; /** * When true, the curve runs the other way round. * @default false */ sense?: boolean | undefined; } /** * 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 | undefined; /** * The direction in the plane where the curve's parameter starts. * @default [1,0] */ direction?: Base.Vector2 | undefined; /** * The distance from the center to the curve. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * When true, the curve runs the other way round. * @default false */ sense?: boolean | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * How many layers of branches, the triangle-like skirts, the tree has. * @default 5 * @minimum 1 * @maximum Infinity * @step 1 */ nrSkirts?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * When true, only one side of the tree is built, as an open wire. * @default false */ half?: boolean | undefined; /** * How far the tree is spun about its trunk-to-tip axis, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 15 */ rotation?: number | undefined; /** * The point at the base of the trunk. * @default [0, 0, 0] */ origin?: Base.Point3 | undefined; /** * The direction from the trunk to the tip; the default stands the tree up along Y. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 | undefined; /** * The normal of the plane the star lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * How many points the star has. * @default 7 * @minimum 3 * @maximum Infinity * @step 1 */ numRays?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The normal of the plane the shape lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * When true the shape is centered on `center`; when false it starts there and extends in the * positive directions. * @default true */ aroundCenter?: boolean | undefined; /** * The width of the shape's bounding rectangle, in model units. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * The height of the shape's bounding rectangle, in model units. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The normal of the plane the heart lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * How far the heart is turned in its plane, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 15 */ rotation?: number | undefined; /** * The side of the square the heart roughly fits into, in model units. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ sizeApprox?: number | undefined; } /** * 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 | undefined; /** * The normal of the plane the polygon lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * How many corners, and so how many equal sides, the polygon has. * @default 6 * @minimum 3 * @maximum Infinity * @step 1 */ nrCorners?: number | undefined; /** * The distance from the center to each corner, in model units. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; } /** * 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 | undefined; /** * The normal of the plane the ellipse lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * 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 | undefined; /** * The half-width along the ellipse's long axis, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusMajor?: number | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * The total climb of the coil along the axis, in model units. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The point on the axis where the coil starts climbing from. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The direction of the axis the coil climbs along. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * When true, the coil winds clockwise seen from the tip of the axis. * @default false */ clockwise?: boolean | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * How many full turns the coil makes; fractions are allowed. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.5 */ numTurns?: number | undefined; /** * The point on the axis where the coil starts climbing from. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The direction of the axis the coil climbs along. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * When true, the coil winds clockwise seen from the tip of the axis. * @default false */ clockwise?: boolean | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * The total climb of the coil along the axis, in model units. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.1 */ height?: number | undefined; /** * The point on the axis where the coil starts climbing from. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The direction of the axis the coil climbs along. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * When true, the coil winds clockwise seen from the tip of the axis. * @default false */ clockwise?: boolean | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The distance from the center where the spiral ends, in model units. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.1 */ endRadius?: number | undefined; /** * 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 | undefined; /** * The point the spiral winds around. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The normal of the plane the spiral lies in; the default lays it flat on the ground. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * When true, the spiral winds clockwise seen from the tip of the normal. * @default false */ clockwise?: boolean | undefined; /** * 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 | undefined; } /** * 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 0 * @exclusiveMinimum true * @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 | undefined; } /** * 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 | undefined; /** * A point on the axis of the cylinder. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The direction of the axis of the cylinder. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 -Infinity * @maximum Infinity * @step 0.1 */ u1?: number | undefined; /** * The parameter where the piece ends. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ u2?: number | undefined; /** * 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 | undefined; /** * When true, the parameters of a periodic curve are brought into its period first. * @default true */ adjustPeriodic?: boolean | undefined; } /** * 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 | undefined; /** * The 2D point the segment ends at. * @default [1, 0] */ end?: Base.Point2 | undefined; } /** * 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 | undefined; /** * The direction the slices are stacked along; each cutting plane is perpendicular to it. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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; they must add up to more than 0. * @default [0.1, 0.2] */ steps?: number[] | undefined; /** * The direction the slices are stacked along; each cutting plane is perpendicular to it. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * 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 * @exclusiveMinimum true * @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 -Infinity * @maximum Infinity * @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 */ 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 | undefined; /** * The direction of the second leg of the angle, from the center. * @default [0, 0, 1] */ direction2?: Base.Point3 | undefined; /** * The point the angle is measured at. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The distance from the center to the dimension arc, in model units. * @default 4 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * 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 | undefined; /** * How far the extension lines stick out past the arc, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extraSize?: number | undefined; /** * How many decimals the angle is rounded to in the label. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ decimalPlaces?: number | undefined; /** * Text written after the number, such as the unit. * @default (deg) */ labelSuffix?: string | undefined; /** * The height of the label's capital letters, in model units. * @default 0.1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ labelSize?: number | undefined; /** * How far the label sits from the arc, in model units. * @default 0.3 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ labelOffset?: number | undefined; /** * When true, the angle is written in radians instead of degrees. * @default false */ radians?: boolean | undefined; /** * 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 -Infinity * @maximum Infinity * @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 */ 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 | undefined; /** * 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 * @exclusiveMinimum true * @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 -Infinity * @maximum Infinity * @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 | undefined; /** * How far the star grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 | undefined; /** * How far the polygon grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 | undefined; /** * How far the parallelogram grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 | undefined; /** * How far the heart grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 | undefined; /** * How far the tree grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 | undefined; /** * How far the L shape grows against its plane normal, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ extrusionLengthBack?: number | undefined; } /** * 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 | undefined; /** * The half-width of the ellipse along its rotated y axis. * @default 0 */ ry?: number | undefined; /** * How far the ellipse is turned in the plane, in radians, counterclockwise in path space. * @default 0 */ xAxisRotation?: number | undefined; /** * The angle on the ellipse where the arc starts, in radians. * @default 0 */ startAngle?: number | undefined; /** * How far the arc sweeps from its start, in radians; negative sweeps clockwise in path space. * @default 0 */ deltaAngle?: number | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * When true, Y is negated so a drawing made with Y pointing down, as in SVG, comes out upright. * @default true */ flipY?: boolean | undefined; /** * The point the scaled and flipped drawing is moved to. * @default [0, 0, 0] */ origin?: Base.Point3 | undefined; } /** * 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 | undefined; /** * When true, consecutive segments of a subpath are merged into a single edge where they can be. * @default true */ joinSegments?: boolean | undefined; /** * How far apart segment ends may be and still join, in model units. * @default 1e-7 */ tolerance?: number | undefined; /** * A factor applied to every path coordinate; 1 keeps the size. * @default 1 */ scale?: number | undefined; /** * When true, Y is negated so a drawing made with Y pointing down comes out upright. * @default true */ flipY?: boolean | undefined; /** * The point the scaled and flipped drawing is moved to. * @default [0, 0, 0] */ origin?: Base.Point3 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * Reserved for building ribbon faces from stroked paths; not supported yet, stroked paths stay * wires. * @default false */ makeRibbons?: boolean | undefined; /** * When true, elements hidden by `display: none` or `visibility: hidden` are imported too. * @default false */ includeInvisible?: boolean | undefined; /** * When true, consecutive segments of a subpath are merged into a single edge where they can be. * @default true */ joinSegments?: boolean | undefined; /** * How far apart segment ends may be and still join, in model units. * @default 1e-7 */ tolerance?: number | undefined; /** * A factor applied to the SVG coordinates; 1 keeps the size. * @default 1 */ scale?: number | undefined; /** * When true, Y is negated so the drawing comes out upright, since SVG has Y pointing down. * @default true */ flipY?: boolean | undefined; /** * Which point of the drawing's bounding box sits on `center`; `midMid` centers it. * @default midMid */ alignment?: Base.basicAlignmentEnum | undefined; /** * 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 | undefined; /** * The point the aligned drawing is placed at. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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[]; } /** * How `sketch.stroke` finishes the two ends of an open wire. * - `flat`: a straight cut across each end. * - `round`: a half circle around each end. * - `square`: a straight cut half the width past each end. */ enum strokeCapEnum { flat = "flat", round = "round", square = "square" } /** * A point to draw a straight segment to, for `sketch.commands.line`, which makes the command * `sketch.pen` draws; the point is a sketch point, or an offset from the pen with `relative`. */ class SketchLineDto { constructor(to?: Base.Point2, relative?: boolean, id?: string); /** * Where the segment ends, in the sketch's x and y. * @default [10, 0] */ to?: Base.Point2 | undefined; /** * When true, `to` is an offset from where the pen is rather than a point of the sketch. * @default false */ relative?: boolean | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A length to draw along the sketch's x axis, for `sketch.commands.hLine`, which makes the command * `sketch.pen` draws; a negative length draws to the left. */ class SketchHLineDto { constructor(length?: number, id?: string); /** * How far to draw along the sketch's x axis, in model units; negative draws the other way. * @default 10 * @minimum -Infinity * @maximum Infinity * @step 1 */ length?: number | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A length to draw along the sketch's y axis, for `sketch.commands.vLine`, which makes the command * `sketch.pen` draws; a negative length draws downward. */ class SketchVLineDto { constructor(length?: number, id?: string); /** * How far to draw along the sketch's y axis, in model units; negative draws the other way. * @default 10 * @minimum -Infinity * @maximum Infinity * @step 1 */ length?: number | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A length and an angle to draw at, for `sketch.commands.polarLine`, which makes the command * `sketch.pen` draws; the angle is measured from the sketch's x axis, counterclockwise. */ class SketchPolarLineDto { constructor(length?: number, angle?: number, id?: string); /** * How far to draw, in model units; negative draws the opposite way. * @default 10 * @minimum -Infinity * @maximum Infinity * @step 1 */ length?: number | undefined; /** * The direction to draw in, in degrees from the sketch's x axis, counterclockwise. * @default 45 * @minimum -Infinity * @maximum Infinity * @step 15 */ angle?: number | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A length to carry on straight for, for `sketch.commands.tangentLine`, which makes the command * `sketch.pen` draws in the direction the previous segment ended in. */ class SketchTangentLineDto { constructor(length?: number, id?: string); /** * How far to carry on, in model units. * @default 10 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 1 */ length?: number | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A point to pass through and a point to end at, for `sketch.commands.threePointArc`, which makes * the circular arc command `sketch.pen` draws from where the pen is. */ class SketchThreePointArcDto { constructor(through?: Base.Point2, to?: Base.Point2, relative?: boolean, id?: string); /** * A point the arc passes through between its ends, in the sketch's x and y. * @default [5, 5] */ through?: Base.Point2 | undefined; /** * Where the arc ends, in the sketch's x and y. * @default [10, 0] */ to?: Base.Point2 | undefined; /** * When true, `through` and `to` are offsets from where the pen is rather than points of the sketch. * @default false */ relative?: boolean | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A point to end at, for `sketch.commands.tangentArc`, which makes the command `sketch.pen` draws: a * circular arc leaving in the direction the previous segment ended in. */ class SketchTangentArcDto { constructor(to?: Base.Point2, relative?: boolean, id?: string); /** * Where the arc ends, in the sketch's x and y. * @default [10, 10] */ to?: Base.Point2 | undefined; /** * When true, `to` is an offset from where the pen is rather than a point of the sketch. * @default false */ relative?: boolean | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A point to end at and how far the arc stands off the straight line to it, for * `sketch.commands.sagittaArc`, which makes the circular arc command `sketch.pen` draws. */ class SketchSagittaArcDto { constructor(to?: Base.Point2, sagitta?: number, relative?: boolean, id?: string); /** * Where the arc ends, in the sketch's x and y. * @default [10, 0] */ to?: Base.Point2 | undefined; /** * How far the arc's middle stands off the straight line between its ends, in model units: * positive to the left of travel, negative to the right. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.5 */ sagitta?: number | undefined; /** * When true, `to` is an offset from where the pen is rather than a point of the sketch. * @default false */ relative?: boolean | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A point to end at and the arc's bulge, as DXF files write arcs, for `sketch.commands.bulgeArc`, * which makes the circular arc command `sketch.pen` draws. */ class SketchBulgeArcDto { constructor(to?: Base.Point2, bulge?: number, relative?: boolean, id?: string); /** * Where the arc ends, in the sketch's x and y. * @default [10, 0] */ to?: Base.Point2 | undefined; /** * The tangent of a quarter of the angle the arc sweeps: positive turns counterclockwise, 1 is a * half circle, and 0 would be a straight line. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ bulge?: number | undefined; /** * When true, `to` is an offset from where the pen is rather than a point of the sketch. * @default false */ relative?: boolean | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A control point and a point to end at, for `sketch.commands.quadratic`, which makes the quadratic * Bezier command `sketch.pen` draws from where the pen is. */ class SketchQuadraticDto { constructor(control?: Base.Point2, to?: Base.Point2, relative?: boolean, id?: string); /** * The point the curve is pulled toward, in the sketch's x and y. * @default [5, 5] */ control?: Base.Point2 | undefined; /** * Where the curve ends, in the sketch's x and y. * @default [10, 0] */ to?: Base.Point2 | undefined; /** * When true, `control` and `to` are offsets from where the pen is rather than points of the sketch. * @default false */ relative?: boolean | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * Two control points and a point to end at, for `sketch.commands.cubic`, which makes the cubic Bezier * command `sketch.pen` draws from where the pen is. */ class SketchCubicDto { constructor(control1?: Base.Point2, control2?: Base.Point2, to?: Base.Point2, relative?: boolean, id?: string); /** * The point the curve leaves toward, in the sketch's x and y. * @default [3, 5] */ control1?: Base.Point2 | undefined; /** * The point the curve arrives from, in the sketch's x and y. * @default [7, 5] */ control2?: Base.Point2 | undefined; /** * Where the curve ends, in the sketch's x and y. * @default [10, 0] */ to?: Base.Point2 | undefined; /** * When true, the control points and `to` are offsets from where the pen is rather than points of * the sketch. * @default false */ relative?: boolean | undefined; /** * A name for the command, reported with the edges it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * An optional name for the command `sketch.commands.close` makes, which `sketch.pen` draws as a * straight segment back to the start point, closing the outline. */ class SketchCloseDto { constructor(id?: string); /** * A name for the command, reported with the edge it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A radius for `sketch.commands.filletCorner`, which makes the command `sketch.pen` uses to round the * corner between the segments before and after it. */ class SketchFilletCornerDto { constructor(radius?: number, id?: string); /** * The radius of the rounding arc, in model units. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * A name for the command, reported with the arc it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A distance for `sketch.commands.chamferCorner`, which makes the command `sketch.pen` uses to bevel * the corner between the segments before and after it. */ class SketchChamferCornerDto { constructor(distance?: number, id?: string); /** * How much the bevel cuts off each segment, in model units, measured along the segment. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ distance?: number | undefined; /** * A name for the command, reported with the segment it draws; leave it out to be named by position. * @default undefined * @optional true */ id?: string | undefined; } /** * A start point, the pen's commands and a frame for `sketch.pen` and `sketch.penWithSegments`, which * draw one outline in the frame's plane as an exact wire, or a face when it closes. */ class SketchPenDto { constructor(commands?: Models.OCCT.SketchCommand[], start?: Base.Point2, frame?: Base.Frame, makeFace?: boolean); /** * The moves of the pen, drawn one after another from `start`. * @default undefined */ commands: Models.OCCT.SketchCommand[]; /** * Where the pen starts, in the sketch's x and y. * @default [0, 0] */ start?: Base.Point2 | undefined; /** * The frame the sketch lies in, its direction the sketch's x axis and its normal out of the face. * Left out, the ground, with the sketch's y axis along -Z. * @default undefined * @optional true */ frame?: Base.Frame | undefined; /** * When true, the closed outline becomes a face whose normal is the frame's normal. * @default false */ makeFace?: boolean | undefined; } /** * A wire, a width and how to finish its ends and corners for `sketch.stroke`, which outlines the wire * as if drawn with a pen that wide. */ class SketchStrokeDto { constructor(shape?: T, width?: number, cap?: strokeCapEnum, join?: joinTypeEnum, frame?: Base.Frame, makeFace?: boolean); /** * The wire or edge to outline, lying in the frame's plane. * @default undefined */ shape: T; /** * How wide the stroke is, in model units; it reaches half the width to each side. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ width?: number | undefined; /** * How the two ends of an open wire are finished; a closed wire has no ends. * @default round */ cap?: strokeCapEnum | undefined; /** * How the outline goes around the wire's corners: `arc` rounds them, `intersection` keeps them * sharp, `tangent` continues each side tangentially. * @default arc */ join?: joinTypeEnum | undefined; /** * The frame whose plane the wire lies in. Leave it out for the ground plane. * @default undefined * @optional true */ frame?: Base.Frame | undefined; /** * When true, the outline becomes a face; a closed wire gives a ring, a face with one hole. * @default true */ makeFace?: boolean | undefined; } /** * Vertices, edges and wires lying in a frame's plane for `sketch.hull`, which wraps them in the * tightest convex outline, exact along lines, circles and circular arcs. */ class SketchHullDto { constructor(shapes?: T[], frame?: Base.Frame, makeFace?: boolean); /** * The vertices, edges and wires to wrap; their edges must be straight or circular. * @default undefined */ shapes: T[]; /** * The frame whose plane the shapes lie in. Leave it out for the ground plane. * @default undefined * @optional true */ frame?: Base.Frame | undefined; /** * When true, the hull becomes a face whose normal is the frame's normal. * @default true */ makeFace?: boolean | undefined; } /** * A shape, a surface type and the faces to choose among for `select.faces.ofType`. */ class SelectFacesOfTypeDto { constructor(shape?: T, type?: surfaceTypeEnum, indexes?: number[]); /** * The shape whose faces are chosen from. * @default undefined */ shape: T; /** * The kind of surface the chosen faces lie on. * @default plane */ type?: surfaceTypeEnum | undefined; /** * The faces to choose among, counted from 0 as `shapes.face.getFaces` lists them; left out, all * are candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, a curve type and the edges to choose among for `select.edges.ofType`. */ class SelectEdgesOfTypeDto { constructor(shape?: T, type?: curveTypeEnum, indexes?: number[]); /** * The shape whose edges are chosen from. * @default undefined */ shape: T; /** * The kind of curve the chosen edges run along. * @default line */ type?: curveTypeEnum | undefined; /** * The edges to choose among, counted from 0 as `shapes.edge.getEdges` lists them; left out, all * are candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, a direction and an angle for `select.faces.facing` and `select.edges.along`. */ class SelectByDirectionDto { constructor(shape?: T, direction?: Base.Vector3, angle?: number, indexes?: number[]); /** * The shape whose faces or edges are chosen from. * @default undefined */ shape: T; /** * The direction a face should face, or a straight edge run along; only its direction matters. * @default [0, 0, 1] */ direction?: Base.Vector3 | undefined; /** * How far in degrees a face's normal, or an edge's line, may turn from `direction`. * @default 0 * @minimum 0 * @maximum 180 * @step 1 */ angle?: number | undefined; /** * The faces or edges to choose among, counted from 0 as the getters list them; left out, all are * candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, a direction and a tolerance for `select.faces.extreme` and `select.edges.extreme`. */ class SelectExtremeDto { constructor(shape?: T, direction?: Base.Vector3, tolerance?: number, indexes?: number[]); /** * The shape whose faces or edges are chosen from. * @default undefined */ shape: T; /** * The direction to look furthest along; `[0, 0, -1]` finds the lowest. * @default [0, 0, 1] */ direction?: Base.Vector3 | undefined; /** * How far short of the furthest centre another may lie and still be chosen, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.1 */ tolerance?: number | undefined; /** * The faces or edges to choose among, counted from 0 as the getters list them; left out, all are * candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape and two opposite corners of a box for `select.faces.inBox` and `select.edges.inBox`. */ class SelectInBoxDto { constructor(shape?: T, corner?: Base.Point3, oppositeCorner?: Base.Point3, indexes?: number[]); /** * The shape whose faces or edges are chosen from. * @default undefined */ shape: T; /** * One corner of the box, which lines up with the axes. * @default [0, 0, 0] */ corner?: Base.Point3 | undefined; /** * The corner across from `corner`; the two may be given either way round. * @default [1, 1, 1] */ oppositeCorner?: Base.Point3 | undefined; /** * The faces or edges to choose among, counted from 0 as the getters list them; left out, all are * candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, a center and a radius for `select.faces.inSphere` and `select.edges.inSphere`. */ class SelectInSphereDto { constructor(shape?: T, center?: Base.Point3, radius?: number, indexes?: number[]); /** * The shape whose faces or edges are chosen from. * @default undefined */ shape: T; /** * The point the chosen centres lie within `radius` of. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; /** * The radius of the sphere in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * The faces or edges to choose among, counted from 0 as the getters list them; left out, all are * candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, a point and a count for `select.faces.nearest` and `select.edges.nearest`. */ class SelectNearestDto { constructor(shape?: T, point?: Base.Point3, count?: number, indexes?: number[]); /** * The shape whose faces or edges are chosen from. * @default undefined */ shape: T; /** * The point the chosen faces or edges lie nearest. * @default [0, 0, 0] */ point?: Base.Point3 | undefined; /** * How many to choose, nearest first; Infinity orders them all. * @default 1 * @minimum 1 * @maximum Infinity * @step 1 */ count?: number | undefined; /** * The faces or edges to choose among, counted from 0 as the getters list them; left out, all are * candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, a plane and a tolerance for `select.faces.onPlane` and `select.edges.onPlane`. */ class SelectOnPlaneDto { constructor(shape?: T, origin?: Base.Point3, normal?: Base.Vector3, tolerance?: number, indexes?: number[]); /** * The shape whose faces or edges are chosen from. * @default undefined */ shape: T; /** * A point the plane passes through. * @default [0, 0, 0] */ origin?: Base.Point3 | undefined; /** * The direction across the plane; either way round gives the same plane. * @default [0, 0, 1] */ normal?: Base.Vector3 | undefined; /** * How far from the plane a face or an edge may lie and still be on it, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.1 */ tolerance?: number | undefined; /** * The faces or edges to choose among, counted from 0 as the getters list them; left out, all are * candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape and a range for `select.faces.bySize`, `select.faces.byRadius`, `select.edges.byLength` * and `select.edges.byRadius`. */ class SelectInRangeDto { constructor(shape?: T, min?: number, max?: number, indexes?: number[]); /** * The shape whose faces or edges are chosen from. * @default undefined */ shape: T; /** * The smallest area, length or radius chosen. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ min?: number | undefined; /** * The largest area, length or radius chosen. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ max?: number | undefined; /** * The faces or edges to choose among, counted from 0 as the getters list them; left out, all are * candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape and the faces or edges to start from, for `select.faces.adjacentTo`, * `select.faces.ofEdges` and `select.edges.ofFaces`. */ class SelectFromIndexesDto { constructor(shape?: T, indexes?: number[]); /** * The shape whose faces or edges are chosen from. * @default undefined */ shape: T; /** * The faces or edges to start from, counted from 0 as the getters list them. * @default undefined */ indexes: number[]; } /** * A shape and two sets of faces for `select.edges.between`, which finds where they meet. */ class SelectBetweenDto { constructor(shape?: T, indexes?: number[], otherIndexes?: number[]); /** * The shape whose edges are chosen from. * @default undefined */ shape: T; /** * One set of faces, counted from 0 as `shapes.face.getFaces` lists them. * @default undefined */ indexes: number[]; /** * The other set of faces, counted the same way. * @default undefined */ otherIndexes: number[]; } /** * A shape, the edges to start from and an angle for `select.edges.tangentChain`. */ class SelectTangentChainDto { constructor(shape?: T, indexes?: number[], angle?: number); /** * The shape whose edges are chosen from. * @default undefined */ shape: T; /** * The edges the chain starts from, counted from 0 as `shapes.edge.getEdges` lists them. * @default undefined */ indexes: number[]; /** * How far in degrees two edges may turn where they meet and still continue each other. * @default 1 * @minimum 0 * @maximum 180 * @step 1 */ angle?: number | undefined; } /** * A shape and an angle for `select.edges.convex` and `select.edges.concave`. */ class SelectConvexityDto { constructor(shape?: T, tangentAngle?: number, indexes?: number[]); /** * The shape whose edges are chosen from. * @default undefined */ shape: T; /** * How far in degrees, up to a right angle, two faces may turn at an edge and still count as * smooth, neither convex nor concave. * @default 1 * @minimum 0 * @maximum 90 * @step 1 */ tangentAngle?: number | undefined; /** * The edges to choose among, counted from 0 as `shapes.edge.getEdges` lists them; left out, all * are candidates, and an empty list chooses none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape and a direction for `select.faces.sortAlong` and `select.edges.sortAlong`. */ class SelectSortAlongDto { constructor(shape?: T, direction?: Base.Vector3, indexes?: number[]); /** * The shape whose faces or edges are sorted. * @default undefined */ shape: T; /** * The direction to sort along, from the lowest centre to the highest. * @default [0, 0, 1] */ direction?: Base.Vector3 | undefined; /** * The faces or edges to sort, counted from 0 as the getters list them; left out, all are sorted, * and an empty list sorts none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A shape, a direction and a tolerance for `select.faces.groupAlong` and `select.edges.groupAlong`. */ class SelectGroupAlongDto { constructor(shape?: T, direction?: Base.Vector3, tolerance?: number, indexes?: number[]); /** * The shape whose faces or edges are grouped. * @default undefined */ shape: T; /** * The direction to sort and group along. * @default [0, 0, 1] */ direction?: Base.Vector3 | undefined; /** * How far past a group's first centre another may lie and still join the group, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.1 */ tolerance?: number | undefined; /** * The faces or edges to group, counted from 0 as the getters list them; left out, all are grouped, * and an empty list groups none. * @default undefined * @optional true */ indexes?: number[] | undefined; } /** * A face and a point for `shapes.face.frameNearestPoint`. */ class FrameNearestPointDto { constructor(shape?: T, point?: Base.Point3); /** * The face the frame sits on. * @default undefined */ shape: T; /** * The point whose nearest place on the face gets the frame; beyond the face's edge it comes to the edge. * @default [0, 0, 0] */ point?: Base.Point3 | undefined; } /** * A face and the points to find frames nearest to, for `shapes.face.framesNearestPoints`. */ class FramesNearestPointsDto { constructor(shape?: T, points?: Base.Point3[]); /** * The face the frames sit on. * @default undefined */ shape: T; /** * The points whose nearest places on the face get a frame each. * @default undefined */ points: Base.Point3[]; } /** * How the frames along an edge or a wire follow it, shared by the methods that make one frame and * those that make many: the kind of frame and the up vector. */ abstract class FrameOnCurveSharedDto { /** * How the frames follow the curve. * @default rotationMinimizing */ kind?: curveFrameEnum | undefined; /** * The way perpendicular frames keep level with, and the first rotation-minimizing frame starts * from; ignored by Frenet frames. * @default [0, 0, 1] */ up?: Base.Vector3 | undefined; } /** * An edge or a wire, a parameter and the kind of frame for `shapes.edge.frameOnEdgeAtParam` and * `shapes.wire.frameOnWireAtParam`. */ class FrameOnCurveAtParamDto extends FrameOnCurveSharedDto { constructor(shape?: T, param?: number, kind?: curveFrameEnum, up?: Base.Vector3); /** * The edge or wire the frame sits on. * @default undefined */ shape: T; /** * Where the frame sits, 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 | undefined; } /** * An edge or a wire, a length and the kind of frame for `shapes.edge.frameOnEdgeAtLength` and * `shapes.wire.frameOnWireAtLength`. */ class FrameOnCurveAtLengthDto extends FrameOnCurveSharedDto { constructor(shape?: T, length?: number, kind?: curveFrameEnum, up?: Base.Vector3); /** * The edge or wire the frame sits on. * @default undefined */ shape: T; /** * How far along the curve from its start the frame sits, in model units, up to its length. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ length?: number | undefined; } /** * An edge or a wire, parameters and the kind of frame for `shapes.edge.framesOnEdgeAtParams` and * `shapes.wire.framesOnWireAtParams`. */ class FramesOnCurveAtParamsDto extends FrameOnCurveSharedDto { constructor(shape?: T, params?: number[], kind?: curveFrameEnum, up?: Base.Vector3); /** * The edge or wire the frames sit on. * @default undefined */ shape: T; /** * Where the frames sit, each a fraction from 0 at the start to 1 at the end. * @default undefined */ params: number[]; } /** * An edge or a wire, lengths and the kind of frame for `shapes.edge.framesOnEdgeAtLengths` and * `shapes.wire.framesOnWireAtLengths`. */ class FramesOnCurveAtLengthsDto extends FrameOnCurveSharedDto { constructor(shape?: T, lengths?: number[], kind?: curveFrameEnum, up?: Base.Vector3); /** * The edge or wire the frames sit on. * @default undefined */ shape: T; /** * How far along the curve from its start each frame sits, in model units, up to its length. * @default undefined */ lengths: number[]; } /** * A wire, a count and the kind of frame for `shapes.wire.framesAlongWire`, frames spread evenly * by length, and whether a closed wire repeats its first frame at the end. */ class FramesAlongWireDto extends FrameOnCurveSharedDto { constructor(shape?: T, count?: number, kind?: curveFrameEnum, up?: Base.Vector3, skipEndOnClosed?: boolean); /** * The wire the frames sit on. * @default undefined */ shape: T; /** * How many frames, the first at the start; `skipEndOnClosed` decides where the last goes on a * closed wire. * @default 10 * @minimum 2 * @maximum Infinity * @step 1 */ count?: number | undefined; /** * On a closed wire, leaves out the end frame, which would sit on the first, and spaces the * frames evenly around the loop; open wires are unaffected. * @default true */ skipEndOnClosed?: boolean | undefined; } /** * A shape and two frames for `transforms.orient`, which moves the shape from one onto the other. */ class OrientDto { constructor(shape?: T, to?: Base.Frame, from?: Base.Frame); /** * The shape to move. * @default undefined */ shape: T; /** * The frame the shape lands on. * @default undefined */ to: Base.Frame; /** * The frame the shape is moved from; leave it out for the world frame at the origin, normal * along z and direction along x. * @default undefined * @optional true */ from?: Base.Frame | undefined; } /** * A shape and frames for `transforms.placeOnFrames`, one copy on each. */ class PlaceOnFramesDto { constructor(shape?: T, frames?: Base.Frame[], from?: Base.Frame); /** * The shape a copy of which lands on every frame. * @default undefined */ shape: T; /** * The frames a copy lands on, one copy each. * @default undefined */ frames: Base.Frame[]; /** * The frame the copies are moved from; leave it out for the world frame at the origin, normal * along z and direction along x. * @default undefined * @optional true */ from?: Base.Frame | undefined; } /** * A shape and matrices for `transforms.placeByMatrices`, one copy placed by each. */ class PlaceByMatricesDto { constructor(shape?: T, matrices?: Base.TransformMatrixes[]); /** * The shape a copy of which each placement places. * @default undefined */ shape: T; /** * One placement per entry: a list of column-major 4 x 4 matrices applied first to last, as * `frame.toMatrix` gives them, or a single matrix; each a turn and a move. * @default undefined */ matrices: Base.TransformMatrixes[]; } /** * An edge or a wire and places along it as fractions, for `analysis.curves.curvaturesAtParams`, * `shapes.edge.splitEdgeAtParams` and `shapes.wire.splitWireAtParams`. */ class DataOnGeometryAtParamsDto { constructor(shape?: T, params?: number[]); /** * The edge or wire to read or cut. * @default undefined */ shape: T; /** * Places along the curve, each a fraction from 0 at the start to 1 at the end; each edge of a * wire takes an equal share, as in `shapes.wire.pointOnWireAtParam`. * @default undefined */ params: number[]; } /** * An edge or a wire, a tooth count and a scale for `analysis.curves.curvatureComb`, which draws the * curvature as teeth standing on the curve. */ class CurvatureCombDto { constructor(shape?: T, samples?: number, scale?: number); /** * The edge or wire whose curvature is drawn. * @default undefined */ shape: T; /** * How many teeth, spaced evenly by length from the start of the curve to its end. * @default 50 * @minimum 2 * @maximum Infinity * @step 1 */ samples?: number | undefined; /** * How long a tooth is per unit of curvature; 0 picks the scale that makes the longest tooth a * fifth of the curve's length. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ scale?: number | undefined; } /** * An edge or a wire and an angle for `analysis.curves.kinks`, which finds the joints where the * tangent turns sharply. */ class CurveKinksDto { constructor(shape?: T, angle?: number); /** * The edge or wire to look along. * @default undefined */ shape: T; /** * How far the tangent must turn where two edges meet for the joint to count as a kink, in * degrees; a turn of exactly this much does not count. * @default 1 * @minimum 0 * @maximum 180 * @step 1 */ angle?: number | undefined; } /** * An edge or a wire and the way up for `analysis.curves.extremesAlong`, which finds the curve's * highest and lowest points along that direction. */ class CurveExtremesAlongDto { constructor(shape?: T, direction?: Base.Vector3); /** * The edge or wire to look along. * @default undefined */ shape: T; /** * The way up: the highest points lie furthest along it; only its direction matters. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; } /** * Two edges or wires and a tolerance for `analysis.curves.intersectCurves`, which finds where the * two cross or run together. */ class IntersectCurvesDto { constructor(shapeA?: T, shapeB?: T, tolerance?: number); /** * The first edge or wire; the points come back in order along it. * @default undefined */ shapeA: T; /** * The second edge or wire, the one the first meets. * @default undefined */ shapeB: T; /** * How close the curves may pass and still count as meeting, in model units; points closer than * it to each other merge into one. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; } /** * An edge or a wire, a face and a tolerance for `analysis.curves.intersectCurveWithFace`, which * finds where the curve passes through the face or lies on it. */ class IntersectCurveWithFaceDto { constructor(shape?: T, face?: U, tolerance?: number); /** * The edge or wire that meets the face; the points come back in order along it. * @default undefined */ shape: T; /** * The face the curve meets, within its edges; the surface beyond them does not count. * @default undefined */ face: U; /** * How close the curve may pass and still count as meeting the face, in model units; points * closer than it to each other merge into one. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; } /** * An edge and the lengths to add at its ends for `shapes.edge.extendEdge`, which carries the curve * on past its start and its end. */ class ExtendEdgeDto { constructor(shape?: T, atStart?: number, atEnd?: number); /** * The edge to lengthen; it stays as it is and a longer copy comes back. * @default undefined */ shape: T; /** * How much length to add before the start, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ atStart?: number | undefined; /** * How much length to add past the end, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ atEnd?: number | undefined; } /** * Two edges and the kind of join for `shapes.edge.blendBetweenEdges`, which bridges the gap from * the end of one to the start of the other with a smooth curve. */ class BlendBetweenEdgesDto { constructor(from?: T, to?: T, matchCurvature?: boolean, bulge?: number); /** * The edge whose end the blend leaves from, along its tangent there. * @default undefined */ from: T; /** * The edge whose start the blend arrives at, along its tangent there. * @default undefined */ to: T; /** * False matches the tangents at both ends with a cubic curve; true also matches the curvature * there, with a quintic curve. * @default false */ matchCurvature?: boolean | undefined; /** * How far the blend holds each tangent before it turns; larger values swing wider. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ bulge?: number | undefined; } /** * Three edges or vertices, the plane they lie in and a tolerance for * `shapes.edge.circlesTangentToThree`, which draws every circle touching the edges and passing * through the vertices. */ class CirclesTangentToThreeDto { constructor(shapes?: T[], frame?: Base.Frame, tolerance?: number, onArgumentsOnly?: boolean); /** * Three edges or vertices lying in the plane: each circle touches every edge and passes through * every vertex. * @default undefined */ shapes: T[]; /** * A frame whose origin and normal give the plane the shapes lie in; the circles are drawn in it * too. * @default undefined */ frame: Base.Frame; /** * How close lines and circles may come to touching and still count as tangent, in model units. * @default 1e-7 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; /** * When true, keeps only the circles that touch each edge within its ends; otherwise straight * edges count as endless lines and arcs as whole circles. * @default false */ onArgumentsOnly?: boolean | undefined; } /** * Two edges or vertices, a radius and the plane they lie in for * `shapes.edge.circlesTangentToTwoWithRadius`, which draws every circle of that radius touching the * edges and passing through the vertices. */ class CirclesTangentToTwoWithRadiusDto { constructor(shapes?: T[], frame?: Base.Frame, radius?: number, tolerance?: number, onArgumentsOnly?: boolean); /** * Two edges or vertices lying in the plane: each circle touches every edge and passes through * every vertex. * @default undefined */ shapes: T[]; /** * A frame whose origin and normal give the plane the shapes lie in; the circles are drawn in it * too. * @default undefined */ frame: Base.Frame; /** * The radius of every circle drawn, in model units. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * How close lines and circles may come to touching and still count as tangent, in model units. * @default 1e-7 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; /** * When true, keeps only the circles that touch each edge within its ends; otherwise straight * edges count as endless lines and arcs as whole circles. * @default false */ onArgumentsOnly?: boolean | undefined; } /** * Two edges or vertices, the edge the centers lie on and the plane for * `shapes.edge.circlesTangentToTwoCenteredOn`, which draws every circle centered on that edge * touching the edges and passing through the vertices. */ class CirclesTangentToTwoCenteredOnDto { constructor(shapes?: T[], centerOn?: T, frame?: Base.Frame, tolerance?: number, onArgumentsOnly?: boolean); /** * Two edges or vertices lying in the plane: each circle touches every edge and passes through * every vertex. * @default undefined */ shapes: T[]; /** * The edge in the plane that the center of every circle lies on. * @default undefined */ centerOn: T; /** * A frame whose origin and normal give the plane the shapes lie in; the circles are drawn in it * too. * @default undefined */ frame: Base.Frame; /** * How close lines and circles may come to touching and still count as tangent, in model units. * @default 1e-7 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; /** * When true, keeps only the circles touching each edge within its ends and centered within * `centerOn`; otherwise straight edges count as endless lines and arcs as whole circles. * @default false */ onArgumentsOnly?: boolean | undefined; } /** * Two edges, or an edge and a vertex, and the plane they lie in for * `shapes.edge.linesTangentToTwo`, which draws every straight line touching both. */ class LinesTangentToTwoDto { constructor(shapes?: T[], frame?: Base.Frame, angularTolerance?: number, onArgumentsOnly?: boolean); /** * Two curved edges, or a curved edge and a vertex, lying in the plane; each line touches the * edges and passes through the vertex. * @default undefined */ shapes: T[]; /** * A frame whose origin and normal give the plane the shapes lie in; the lines are drawn in it * too. * @default undefined */ frame: Base.Frame; /** * How nearly a line must run along a curve where it touches to count as tangent, as the sine of * the angle between them. * @default 1e-6 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.00001 */ angularTolerance?: number | undefined; /** * When true, keeps only the lines that touch each edge within its ends; otherwise arcs count as * whole circles. * @default false */ onArgumentsOnly?: boolean | undefined; } /** * A curve, a straight reference edge, an angle and the plane for * `shapes.edge.linesTangentAtAngle`, which draws every line touching the curve at that angle to the * reference. */ class LinesTangentAtAngleDto { constructor(shape?: T, reference?: T, frame?: Base.Frame, angle?: number, angularTolerance?: number, onArgumentsOnly?: boolean); /** * The curved edge the lines touch, lying in the plane. * @default undefined */ shape: T; /** * The straight edge the angle is measured from, lying in the plane; each line runs from its touch * to where it crosses this edge's line. * @default undefined */ reference: T; /** * A frame whose origin and normal give the plane the edges lie in; the angle turns about the * normal. * @default undefined */ frame: Base.Frame; /** * The angle from the reference's direction to the lines, in degrees, turning counterclockwise * about the frame's normal. * @default 45 * @minimum -Infinity * @maximum Infinity * @step 1 */ angle?: number | undefined; /** * The tolerance of the search for touching lines, in radians; an `angle` this close to 0, a * right angle or a half turn is taken as exactly that. * @default 1e-6 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.00001 */ angularTolerance?: number | undefined; /** * When true, keeps only the lines that touch the curve within its ends and cross the reference * within its ends, which leaves out lines parallel to it. * @default false */ onArgumentsOnly?: boolean | undefined; } /** * An open wire or an edge, a distance and the corner style for `shapes.wire.offsetOpen`, which * draws the offset curve on one side of it instead of a loop around it. */ class OffsetOpenDto { constructor(shape?: T, face?: U, distance?: number, joinType?: joinTypeEnum); /** * The open wire or edge to offset, lying in a plane; a straight one needs `face` to give it one. * @default undefined */ shape: T; /** * A flat face whose plane the offset lies in, seen from the side it looks to; leave it out to use * the plane the wire lies in. * @default undefined * @optional true */ face?: U | undefined; /** * How far the offset curve lies from the wire, in model units: positive to the right of the * direction the wire runs, negative to the left. * @default 0.2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ distance?: number | undefined; /** * How the offset pieces meet where the wire has a corner: `arc` rounds them, `intersection` * extends them to a sharp corner, `tangent` keeps them tangent. * @default arc */ joinType?: joinTypeEnum | undefined; } /** * Edges or wires, a shape with faces and the fitting settings for `shapes.wire.projectNormal`, * which lays the curves onto the faces along their normals. */ class ProjectNormalDto { constructor(wires?: T[], shape?: U, tolerance?: number, maxDistance?: number); /** * The edges or wires to lay onto the shape. * @default undefined */ wires: T[]; /** * The shape whose faces the curves land on, within the faces' edges. * @default undefined */ shape: U; /** * How far the fitted curves may stray from the exact projection, in model units. * @default 1e-4 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; /** * Drops the parts of the projection lying farther than this from the curves they come from, in * model units; 0 keeps everything. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ maxDistance?: number | undefined; } /** * An edge or a wire, a shape and a point for `shapes.wire.projectConical`, which casts the curve onto * the shape along the lines from the point through it. */ class ProjectConicalDto { constructor(wire?: T, shape?: U, from?: Base.Point3); /** * The edge or wire to cast onto the shape. * @default undefined */ wire: T; /** * The shape whose faces the curve lands on. * @default undefined */ shape: U; /** * The point the curve is cast from, like a lamp throwing its shadow; it must not lie on the curve. * @default [0, 10, 0] */ from?: Base.Point3 | undefined; } /** * Flat wires or edges, a face and a tolerance for `shapes.wire.wrapWiresOnFace`, which wraps the * drawing around a plane, cylinder or cone face with its lengths kept. */ class WrapWiresOnFaceDto { constructor(wires?: T[], face?: U, tolerance?: number); /** * The wires or edges drawn flat on the ground plane, where the face's development lies with X * along its U direction and Z along V; Y is ignored. * @default undefined */ wires: T[]; /** * The plane, cylinder or cone face to wrap them around. * @default undefined */ face: U; /** * How far the wrapped curves may stray from the exact wrap, in model units. * @default 1e-4 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; } /** * Two shapes for `shapes.face.ruledBetween`, `analysis.measure.extrema` and * `analysis.measure.angleBetween`; each method says what the two may be, and results that name a * side call the first A and the second B. */ class TwoShapesDto { constructor(shapeA?: T, shapeB?: T); /** * The first shape, side A of the results. * @default undefined */ shapeA: T; /** * The second shape, side B of the results. * @default undefined */ shapeB: T; } /** * A grid of points for `shapes.face.fromPointGrid`, which makes a B-spline face through them or * near them, with the degrees and the tolerance an approximation keeps to. */ class FaceFromPointGridDto { constructor(points?: Base.Point3[][], interpolate?: boolean, periodic?: boolean, degreeMin?: number, degreeMax?: number, tolerance?: number); /** * Rows of equal length, at least two of two points each; the rows step along u and each row runs * along v. * @default undefined */ points: Base.Point3[][]; /** * True passes the face through every point at degree 3; false approximates the points within * `tolerance`, smoothing what the tolerance allows. * @default true */ interpolate?: boolean | undefined; /** * Closes the face in u, joining the last row back to the first, which is not repeated; read only * when interpolating. * @default false */ periodic?: boolean | undefined; /** * The lowest degree an approximation may use; read only when approximating. * @default 3 * @minimum 1 * @maximum 25 * @step 1 */ degreeMin?: number | undefined; /** * The highest degree an approximation may use, at least `degreeMin`; read only when * approximating. * @default 8 * @minimum 1 * @maximum 25 * @step 1 */ degreeMax?: number | undefined; /** * How far an approximation may pass from the points, in model units; read only when * approximating. * @default 1e-3 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.001 */ tolerance?: number | undefined; } /** * Two to four edges and a filling style for `shapes.face.boundaryPatch`, which makes a B-spline * face bounded by the edges, each taken along its orientation. */ class BoundaryPatchDto { constructor(edges?: T[], style?: fillingStyleEnum); /** * Two to four edges: four that close up, three of which one meets the other two, or two opposite * sides, which share a corner in the curved style. * @default undefined */ edges: T[]; /** * How the patch fills between the edges. * @default coons */ style?: fillingStyleEnum | undefined; } /** * Boundary edges, how the patch meets each, the faces beside them and points to pass near for * `shapes.face.fillPatch`, with the settings of the plate surface it fits. */ class FillPatchDto { constructor(edges?: T[], continuities?: continuityEnum[], supports?: (U | undefined)[], points?: Base.Point3[], degree?: number, pointsOnCurves?: number, iterations?: number, tolerance?: number); /** * The boundary edges, in any order and direction, that close into one loop. * @default undefined */ edges: T[]; /** * How the patch meets each edge, one entry per edge in the order of `edges`; left out, the patch * only passes through every edge. * @default undefined * @optional true */ continuities?: continuityEnum[] | undefined; /** * One face per edge, the face beside it, for tangent or curvature along an edge that stores none; * an undefined entry, or leaving it out, gives no face. * @default undefined * @optional true */ supports?: (U | undefined)[] | undefined; /** * Points inside the boundary the patch passes near; left out, none. * @default undefined * @optional true */ points?: Base.Point3[] | undefined; /** * The degree of the plate surface. * @default 3 * @minimum 2 * @maximum 9 * @step 1 */ degree?: number | undefined; /** * How many points of each boundary edge the plate is fitted to. * @default 15 * @minimum 2 * @maximum Infinity * @step 1 */ pointsOnCurves?: number | undefined; /** * How many passes the fit makes; matching curvature may need more than two. * @default 2 * @minimum 1 * @maximum Infinity * @step 1 */ iterations?: number | undefined; /** * How far the patch may pass from the boundary and the points, in model units. * @default 1e-4 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.0001 */ tolerance?: number | undefined; } /** * A face and a tolerance for `shapes.face.unroll`, which lays a plane, cylinder or cone face flat * without stretching it. */ class UnrollFaceDto { constructor(shape?: T, tolerance?: number); /** * The face to lay flat: one on a plane, a cylinder or a cone. * @default undefined */ shape: T; /** * How far the flat edges may stray from the exact development, in model units. * @default 1e-4 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.0001 */ tolerance?: number | undefined; } /** * A shape and a frame for `analysis.measure.boundingBoxInFrame`, which boxes the shape along the * frame's axes instead of the world's. */ class BoundingBoxInFrameDto { constructor(shape?: T, frame?: Base.Frame); /** * The shape the box is found around. * @default undefined */ shape: T; /** * The frame whose axes the box follows: its x along the frame's direction and its z along the * frame's normal. Only the axes matter, not the origin. * @default undefined */ frame: Base.Frame; } /** * A shape, one of its edges and a place along the edge for `analysis.measure.dihedralAngle`, which * measures the angle between the two faces that meet there. */ class DihedralAngleDto { constructor(shape?: T, index?: number, param?: number); /** * The shape the edge belongs to. * @default undefined */ shape: T; /** * The edge, counted from 0 as `shapes.edge.getEdges` lists them. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index?: number | undefined; /** * Where along the edge the angle is read, as a share of its parameter range from 0 at its start * to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ param?: number | undefined; } /** * A shape, how densely to sample it and whether to read concave bends only, for * `analysis.measure.minCurvatureRadius`. */ class MinCurvatureRadiusDto { constructor(shape?: T, samples?: number, concaveOnly?: boolean); /** * The shape whose tightest bend is found. * @default undefined */ shape: T; /** * How densely the shape is read: a grid of this many by this many places on each face, and this * many places along each edge. * @default 16 * @minimum 1 * @maximum Infinity * @step 1 */ samples?: number | undefined; /** * True reads only where faces bend concavely, the tightest radius a round tool can reach; edges * and convex bends are then skipped. * @default false */ concaveOnly?: boolean | undefined; } /** * Shapes and a clearance for `analysis.clashes.betweenShapes`, which finds the pairs of shapes that * overlap or come within the clearance of each other. */ class ClashesBetweenShapesDto { constructor(shapes?: T[], clearance?: number); /** * The shapes to check against each other; a clash names two of them by their positions here. * @default undefined */ shapes: T[]; /** * How close two shapes may come before they clash, in model units; 0 reports only shapes that * touch or overlap. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ clearance?: number | undefined; } /** * Two shapes, a clearance and a meshing precision for `analysis.clashes.facesWithin`, which finds * the faces of one that come within the clearance of faces of the other. */ class FacesWithinDto { constructor(shapeA?: T, shapeB?: T, clearance?: number, precision?: number); /** * The first shape, whose faces are side A of each clash. * @default undefined */ shapeA: T; /** * The second shape, whose faces are side B of each clash. * @default undefined */ shapeB: T; /** * How close a face of one shape may come to a face of the other before the two clash, in model * units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ clearance?: number | undefined; /** * The mesh deflection of the search for candidate pairs, in model units; every pair it finds is * then measured exactly. * @default 0.01 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ precision?: number | undefined; } /** * A shape and a meshing precision for `analysis.clashes.selfIntersections`, which finds the faces * of the shape that cross each other. */ class SelfIntersectionsDto { constructor(shape?: T, precision?: number); /** * The shape whose faces are checked against each other. * @default undefined */ shape: T; /** * The mesh deflection of the search for candidate pairs, in model units; every pair it finds is * then confirmed exactly. * @default 0.01 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.01 */ precision?: number | undefined; } /** * Two shapes and a joining tolerance for `operations.sectionWires`, which gives the curves where the * shapes meet, joined end to end into wires. */ class SectionWiresDto { constructor(shapeA?: T, shapeB?: T, tolerance?: number); /** * One of the two shapes, such as a solid to cut through. * @default undefined */ shapeA: T; /** * The shape it meets, such as a face or a solid passing through `shapeA`. * @default undefined */ shapeB: T; /** * How close the ends of two section edges must lie to be joined into one wire, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; } /** * A shape, the frames whose planes slice it and what each slice keeps for * `operations.sliceByFrames`, which gives one slice per frame. */ class SliceByFramesDto { constructor(shape?: T, frames?: Base.Frame[], makeFaces?: boolean, tolerance?: number); /** * The shape to slice: faces come from its solids, wires from its solids, shells and faces. * @default undefined */ shape: T; /** * One plane per frame, through the frame's origin and square to its normal; the frame's * direction does not matter. * @default undefined */ frames: Base.Frame[]; /** * When true, each slice holds the faces where its plane passes through the solids, holes * included; when false, it holds the section wires. * @default true */ makeFaces?: boolean | undefined; /** * How close the ends of two section edges must lie to be joined into one wire, in model units. * @default 1e-7 * @minimum 0 * @maximum Infinity * @step 0.00001 */ tolerance?: number | undefined; } /** * A shape and the frame whose plane splits it for `operations.splitByFrame`, which returns what lies * in front of the plane and what lies behind it. */ class SplitByFrameDto { constructor(shape?: T, frame?: Base.Frame); /** * The shape to split: its solids become the pieces, or its faces when it has no solids, or its * edges when it has neither. * @default undefined */ shape: T; /** * The plane to split along, through the frame's origin; `front` holds what lies on the side its * normal points to. * @default undefined */ frame: Base.Frame; } /** * A face and the edges or wires that cut it for `operations.splitFaceByWires`, which returns the * pieces of the face. */ class SplitFaceByWiresDto { constructor(shape?: T, wires?: U[]); /** * The face to cut. * @default undefined */ shape: T; /** * The edges or wires to cut along, lying on the face; a closed loop cuts out the region it * encloses. * @default undefined */ wires: U[]; } /** * A shape, a view frame and drawing options for `operations.hiddenLines`, which draws the edges seen * from the frame and the edges hidden behind faces, flat on the XZ plane. */ class HiddenLinesDto { constructor(shape?: T, frame?: Base.Frame, exact?: boolean, smoothEdges?: boolean, hiddenEdges?: boolean, focus?: number, precision?: number); /** * The shape to draw. * @default undefined */ shape: T; /** * The view: the eye sits on the side the normal points to and looks back along it, and the * drawing's x runs along the direction from the frame's origin. * @default undefined */ frame: Base.Frame; /** * When true, the drawing is made from the exact geometry; when false, from a mesh, which is * faster and draws parallel views only. * @default true */ exact?: boolean | undefined; /** * When true, the edges where faces meet without a crease, such as the borders of a fillet, are * drawn too. * @default false */ smoothEdges?: boolean | undefined; /** * When true, the edges that faces cover are collected in `hidden`; when false, `hidden` stays * empty. * @default true */ hiddenEdges?: boolean | undefined; /** * How far the eye sits from the frame's origin along its normal for a perspective, in model * units; 0 draws a parallel view. A perspective needs `exact`. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ focus?: number | undefined; /** * The meshing tolerance in model units when `exact` is false; a smaller value follows curved * faces more closely. * @default 0.01 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.001 */ precision?: number | undefined; } /** * A shape, the frames to drill at and the size of the holes for `features.holes`; * `features.counterboredHoles` and `features.countersunkHoles` add a shaped mouth to each hole. */ class HolesDto { constructor(shape?: T, frames?: Base.Frame[], diameter?: number, depth?: number, tipAngle?: number); /** * The shape to drill into. * @default undefined */ shape: T; /** * One hole per frame: the origin is where the hole enters and the normal points out of the * material, so the hole runs against it. * @default undefined */ frames: Base.Frame[]; /** * The diameter of each hole, in model units. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ diameter?: number | undefined; /** * How deep each hole goes from its entry, in model units, not counting a drill point; 0 drills * through the whole shape. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ depth?: number | undefined; /** * The full angle of the drill point at the bottom of a hole, in degrees: 0 leaves a flat * bottom, and 118 is the point of a twist drill. * @default 0 * @minimum 0 * @maximum 180 * @exclusiveMaximum true * @step 1 */ tipAngle?: number | undefined; } /** * The holes of `features.holes` with a wider, flat-bottomed counterbore at each mouth that sinks a * screw head below the surface, for `features.counterboredHoles`. */ class CounterboredHolesDto extends HolesDto { constructor(shape?: T, frames?: Base.Frame[], diameter?: number, depth?: number, tipAngle?: number, counterboreDiameter?: number, counterboreDepth?: number); /** * The diameter of the counterbore, in model units; it must be wider than `diameter`. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ counterboreDiameter?: number | undefined; /** * How deep the counterbore goes from the hole's entry, in model units; it must stay shallower * than a hole of a given `depth`. * @default 0.5 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ counterboreDepth?: number | undefined; } /** * The holes of `features.holes` with a cone-shaped countersink at each mouth that sinks a flat screw * head flush with the surface, for `features.countersunkHoles`. */ class CountersunkHolesDto extends HolesDto { constructor(shape?: T, frames?: Base.Frame[], diameter?: number, depth?: number, tipAngle?: number, countersinkDiameter?: number, countersinkAngle?: number); /** * The diameter of the countersink where it meets the surface, in model units; it must be wider * than `diameter`. * @default 2 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ countersinkDiameter?: number | undefined; /** * The full angle of the countersink cone, in degrees, such as 90 or 82 for common flat head * screws. * @default 90 * @minimum 0 * @exclusiveMinimum true * @maximum 180 * @exclusiveMaximum true * @step 1 */ countersinkAngle?: number | undefined; } /** * A solid and the faces to remove from it for `features.removeFaces`, which closes the gap by * extending the faces around them. */ class RemoveFacesDto { constructor(shape?: T, indexes?: number[]); /** * The shape to remove faces from; it must hold solids only. * @default undefined */ shape: T; /** * The faces to remove, counted from 0 as `shapes.face.getFaces` lists them. * @default undefined */ indexes: number[]; } /** * A shape, the faces to move and how far for `features.pushPullFaces`, which moves each face along * its outward normal and stretches the faces around it to follow. */ class PushPullFacesDto { constructor(shape?: T, indexes?: number[], distance?: number, distances?: number[]); /** * The shape whose faces move. * @default undefined */ shape: T; /** * The faces to move, counted from 0 as `shapes.face.getFaces` lists them, each at most once. * @default undefined */ indexes: number[]; /** * How far every chosen face moves along its outward normal, in model units; a negative * distance moves it inward. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ distance?: number | undefined; /** * One distance per entry of `indexes`, in the same order, used instead of `distance`; left out, * every chosen face moves by `distance`. * @default undefined * @optional true */ distances?: number[] | undefined; } /** * A base shape, a profile face sketched on one of its faces and how far to sweep it for * `features.boss`, which adds material, and `features.pocket`, which removes it. */ class PrismFeatureDto { constructor(shape?: T, profile?: U, sketchFaceIndex?: number, direction?: Base.Vector3, extent?: featureExtentEnum, length?: number, untilFaceIndex?: number); /** * The base shape the feature is built on. * @default undefined */ shape: T; /** * The face to sweep; it must lie on the face of the base that `sketchFaceIndex` names. * @default undefined */ profile: U; /** * The face of the base the profile lies on, counted from 0 as `shapes.face.getFaces` lists them. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ sketchFaceIndex?: number | undefined; /** * The direction the profile travels in: away from the base for a boss, into it for a pocket. * @default [0, 1, 0] */ direction?: Base.Vector3 | undefined; /** * Where the feature stops: after `length`, at the face `untilFaceIndex` names, or once it has * passed through the whole base. * @default length */ extent?: featureExtentEnum | undefined; /** * How far the profile travels when `extent` is `length`, in model units. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ length?: number | undefined; /** * The face the feature stops at when `extent` is `untilFace`: one the profile meets on its way, * such as the underside of an overhang or a void's ceiling. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ untilFaceIndex?: number | undefined; } /** * A base shape, a profile face sketched on one of its faces, a draft angle and how far to sweep the * profile for `features.taperedBoss` and `features.taperedPocket`, whose sides lean by the angle. */ class TaperedPrismFeatureDto { constructor(shape?: T, profile?: U, sketchFaceIndex?: number, angle?: number, extent?: featureExtentEnum, length?: number, untilFaceIndex?: number); /** * The base shape the feature is built on. * @default undefined */ shape: T; /** * The face to sweep; it must lie on the face of the base that `sketchFaceIndex` names. * @default undefined */ profile: U; /** * The face of the base the profile lies on, counted from 0 as `shapes.face.getFaces` lists them. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ sketchFaceIndex?: number | undefined; /** * How far the sides lean from straight, in degrees: a positive angle narrows the feature as it * goes away from the sketch face, a negative one widens it. * @default 5 * @minimum -90 * @exclusiveMinimum true * @maximum 90 * @exclusiveMaximum true * @step 1 */ angle?: number | undefined; /** * Where the feature stops: after `length`, at the face `untilFaceIndex` names, or once it has * passed through the whole base. * @default length */ extent?: featureExtentEnum | undefined; /** * How far the feature runs from the sketch face when `extent` is `length`, in model units. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ length?: number | undefined; /** * The face the feature stops at when `extent` is `untilFace`: one the profile meets on its way, * such as the underside of an overhang or a void's ceiling. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ untilFaceIndex?: number | undefined; } /** * A base shape, a profile face sketched on one of its faces and an axis for * `features.revolvedBoss` and `features.revolvedPocket`, which turn the profile about the axis to * add or remove a ring. */ class RevolvedFeatureDto { constructor(shape?: T, profile?: U, sketchFaceIndex?: number, axisOrigin?: Base.Point3, axisDirection?: Base.Vector3, angle?: number); /** * The base shape the feature is built on. * @default undefined */ shape: T; /** * The face to turn, lying in a plane through the axis; it must lie on the face of the base that * `sketchFaceIndex` names. * @default undefined */ profile: U; /** * The face of the base the profile lies on, counted from 0 as `shapes.face.getFaces` lists them. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ sketchFaceIndex?: number | undefined; /** * A point on the axis the profile turns about. * @default [0, 0, 0] */ axisOrigin?: Base.Point3 | undefined; /** * The direction of the axis the profile turns about. * @default [0, 1, 0] */ axisDirection?: Base.Vector3 | undefined; /** * How far the profile turns, in degrees, following the right-hand rule about the axis; 360 * makes a whole ring. * @default 360 * @minimum 0 * @exclusiveMinimum true * @maximum 360 * @step 1 */ angle?: number | undefined; } /** * A base shape, a wire and the plane it lies in for `features.rib`, which fills the region the wire * closes off against the base, and `features.groove`, which cuts a region away. */ class RibFeatureDto { constructor(shape?: T, wire?: U, frame?: Base.Frame, thickness?: number, otherSideThickness?: number); /** * The base shape the feature is built on. * @default undefined */ shape: T; /** * The wire outlining the rib or groove in the plane of `frame`; the feature lies on its left as * it runs, seen from the side the normal points to. * @default undefined */ wire: U; /** * The plane the wire lies in, through the frame's origin and square to its normal; the frame's * direction does not matter. * @default undefined */ frame: Base.Frame; /** * How thick the feature is on the side of the plane the frame's normal points to, in model * units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ thickness?: number | undefined; /** * How thick the feature is on the other side of the plane, in model units; it and `thickness` * are not both 0. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ otherSideThickness?: number | undefined; } /** * A flat spine and a profile for `operations.sweepEvolved`, which sweeps the profile along the spine * keeping its place beside it, the way a moulding follows a wall. */ class SweepEvolvedDto { constructor(spine?: T, profile?: U, makeSolid?: boolean); /** * The path: a wire or a face lying in one plane; a face is swept along its boundary. * @default undefined */ spine: T; /** * The edge or wire to sweep, drawn about the origin: x along the spine, y to the left of travel * and z up from the spine's plane. * @default undefined */ profile: U; /** * When true, the sweep is closed into a solid where it can be: a closed profile gives a solid * wall, and a wall round a closed spine is capped. * @default true */ makeSolid?: boolean | undefined; } /** * A spine, a profile and a scale at places along the spine for `operations.pipeWithScaling`, which * sweeps the profile along the spine while scaling it. */ class PipeWithScalingDto { constructor(spine?: T, profile?: U, params?: number[], scales?: number[], makeSolid?: boolean); /** * The path to sweep along, an edge or a wire. * @default undefined */ spine: T; /** * The edge or wire to sweep, placed across the start of the spine. * @default undefined */ profile: U; /** * Places along the spine as fractions of it, rising from 0 at its start to 1 at its end; the * first is 0 and the last is 1. * @default [0, 1] */ params?: number[] | undefined; /** * The scale of the profile at each place in `params`, in the same order, each above 0; 1 keeps * the profile's size. * @default [1, 0.5] */ scales?: number[] | undefined; /** * When true, the ends are capped into a solid, which needs a closed profile; when false, the * result is an open shell. * @default true */ makeSolid?: boolean | undefined; } /** * Shapes to join for `shapeFix.sewWithReport`, which sews their faces together along edges that lie * within `tolerance` of each other and reports what it joined and what it left open. */ class SewWithReportDto { constructor(shapes?: T[], tolerance?: number, nonManifold?: boolean); /** * The faces, shells or other shapes whose faces are sewn together. * @default undefined */ shapes: T[]; /** * How far apart two edges may lie and still be sewn into one, in model units. * @default 1e-7 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.000001 */ tolerance?: number | undefined; /** * When true, an edge may join more than two faces, as where three sheets meet along one line; * when false, an edge joins two faces at most. * @default false */ nonManifold?: boolean | undefined; } /** * An STL file for `io.loadStl`, which reads its triangles into a shape: one planar face per triangle, * or one face that carries the whole mesh. */ class LoadStlDto { constructor(stlData?: string | ArrayBuffer | Uint8Array | File | Blob, asFaces?: boolean, adjustZtoY?: boolean); /** * The STL file, ASCII or binary: the text of an ASCII file, or the file as ArrayBuffer, * Uint8Array, File or Blob. * @default undefined */ stlData: string | ArrayBuffer | Uint8Array | File | Blob; /** * When true, each triangle becomes a planar face that sewing can join into a shell; when false, * one face carries the whole mesh, light to draw but not for modelling. * @default false */ asFaces?: boolean | undefined; /** * When true, the file's Z-up is turned into this library's Y-up. * @default true */ adjustZtoY?: boolean | undefined; } /** * A BREP file for `io.loadBrep`, the text format that keeps a shape's exact geometry and topology, * as `io.saveShapeBrep` writes it. */ class LoadBrepDto { constructor(brepData?: string | File | Blob); /** * The BREP file's text, or a File or Blob that holds it. * @default undefined */ brepData: string | File | Blob; } /** * A shape and file options for `io.saveShapeBrep`, which writes the shape as a BREP file, the exact * text format `io.loadBrep` reads back. */ class SaveBrepDto { constructor(shape?: T, fileName?: string, tryDownload?: boolean, withTriangulation?: boolean); /** * The shape written to the file. * @default undefined */ shape: T; /** * The name the downloaded file gets. * @default shape.brep */ 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; /** * When true, the mesh a shape carries is written with it, so a shape read back draws without * meshing again; false writes only the exact geometry. * @default true */ withTriangulation?: boolean | undefined; } /** * A shape and file options for `io.saveShapeBrepBinary`, which writes the shape as binary BREP: the * same exact geometry and topology as the text form, in bytes `io.loadBrepBinary` reads back. */ class SaveBrepBinaryDto { constructor(shape?: T, fileName?: string, tryDownload?: boolean, withTriangulation?: boolean); /** * The shape written to the file. * @default undefined */ shape: T; /** * The name the downloaded file gets. * @default shape.bbrep */ fileName?: string | undefined; /** * When true, a browser download of the file is started where that is possible; the kernel * itself only returns the bytes. * @default true */ tryDownload?: boolean | undefined; /** * When true, the mesh a shape carries is written with it, so a shape read back draws without * meshing again; false writes only the exact geometry. * @default true */ withTriangulation?: boolean | undefined; } /** * The bytes of a binary BREP file for `io.loadBrepBinary`. */ class LoadBrepBinaryDto { constructor(brepData?: ArrayBuffer | Uint8Array | File | Blob); /** * The binary BREP file's bytes, or a File or Blob that holds them. * @default undefined */ brepData: ArrayBuffer | Uint8Array | File | Blob; } /** * A shape, a file name and meshing options for `io.saveShapeObj`, which triangulates the shape and * writes it as an OBJ file with the material library its `mtllib` line names. */ class SaveObjDto { constructor(shape?: T, fileName?: string, precision?: number, adjustYtoZ?: boolean, tryDownload?: boolean); /** * The shape written to the file. * @default undefined */ shape: T; /** * The name the downloaded file gets. Without its extension it also names the shape and the * material library, so it may hold no spaces or slashes. * @default shape.obj */ fileName?: string | undefined; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * and makes a bigger file. * @default 0.01 * @minimum 1e-7 * @maximum Infinity * @step 0.001 */ precision?: number | undefined; /** * When true, Y and Z swap so Y-up becomes Z-up, which mirrors the shape. To keep it as built, * turn it 90 degrees about X with `transforms.rotate` instead. * @default false */ adjustYtoZ?: boolean | undefined; /** * When true, a browser download of the OBJ file and of any material library is started where * that is possible; the kernel itself only returns the texts. * @default true */ tryDownload?: boolean | undefined; } /** * A shape, a file name and meshing options for `io.saveShapePly`, which triangulates the shape and * writes it as an ASCII PLY file with normals. */ class SavePlyDto { constructor(shape?: T, fileName?: string, precision?: number, adjustYtoZ?: boolean, tryDownload?: boolean); /** * The shape written to the file. * @default undefined */ shape: T; /** * The name the downloaded file gets. * @default shape.ply */ fileName?: string | undefined; /** * The meshing tolerance in model units; a smaller value follows curved surfaces more closely * and makes a bigger file. * @default 0.01 * @minimum 1e-7 * @maximum Infinity * @step 0.001 */ precision?: number | undefined; /** * When true, Y and Z swap so Y-up becomes Z-up, which mirrors the shape. To keep it as built, * turn it 90 degrees about X with `transforms.rotate` instead. * @default false */ adjustYtoZ?: 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 view and file options for `io.saveShapeSvg`, which draws the edges the view sees as an * SVG drawing, and the edges other faces cover dashed when asked. */ class SaveSvgDto { constructor(shape?: T, frame?: Base.Frame, drawHidden?: boolean, precision?: number, fileName?: string, tryDownload?: boolean); /** * The shape to draw. * @default undefined */ shape: T; /** * The view, as in `operations.hiddenLines`: the eye sits on the side the normal points to and * looks back along it, and the drawing's x runs along the direction. * @default undefined */ frame: Base.Frame; /** * When true, the edges other faces cover are drawn too, dashed. * @default false */ drawHidden?: boolean | undefined; /** * How far the straight segments that trace a curved edge may stray from it, in model units; * a smaller value follows curves more closely and makes a bigger file. * @default 0.01 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.001 */ precision?: number | undefined; /** * The name the downloaded file gets. * @default shape.svg */ 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; } /** * A glTF file for `assembly.manager.loadGltfToDoc`, which reads its meshes, names, colors and * hierarchy into an assembly document. */ class LoadGltfToDocDto { constructor(gltfData?: string | ArrayBuffer | Uint8Array | File | Blob); /** * A binary `.glb`, or a `.gltf` with its buffers embedded, as text, ArrayBuffer, Uint8Array, * File or Blob; the file's header tells which of the two it is. * @default undefined */ gltfData: string | ArrayBuffer | Uint8Array | File | Blob; } /** * An OBJ file for `assembly.manager.loadObjToDoc`, which reads its meshes and names into an * assembly document. */ class LoadObjToDocDto { constructor(objData?: string | ArrayBuffer | Uint8Array | File | Blob); /** * The OBJ file as text, ArrayBuffer, Uint8Array, File or Blob; a material library it names is * not read. * @default undefined */ objData: string | ArrayBuffer | Uint8Array | File | Blob; } /** * A document, a meshing tolerance and file options for `assembly.manager.exportDocumentToObj`, which * writes the document as an OBJ file with the material library its `mtllib` line names. */ class ExportDocumentToObjDto { constructor(document?: T, meshDeflection?: number, fileName?: string, tryDownload?: boolean); /** * The document from `buildAssemblyDocument`, `loadStepToDoc` or another loader. * @default undefined */ document: T; /** * How closely triangles follow curved surfaces, in model units; smaller gives a finer mesh. * @default 0.1 * @minimum 1e-7 * @maximum Infinity * @step 0.01 */ meshDeflection?: number | undefined; /** * The name the downloaded file gets. Without its extension it also names the material library, * so it may hold no spaces or slashes. * @default assembly.obj */ fileName?: string | undefined; /** * When true, a browser download of the OBJ file and of any material library is started where * that is possible; the kernel itself only returns the texts. * @default false */ tryDownload?: boolean | undefined; } /** * A document, a meshing tolerance and file options for `assembly.manager.exportDocumentToPly`, * which writes the document as an ASCII PLY file with normals and colors. */ class ExportDocumentToPlyDto { constructor(document?: T, meshDeflection?: number, fileName?: string, tryDownload?: boolean); /** * The document from `buildAssemblyDocument`, `loadStepToDoc` or another loader. * @default undefined */ document: T; /** * How closely triangles follow curved surfaces, in model units; smaller gives a finer mesh. * @default 0.1 * @minimum 1e-7 * @maximum Infinity * @step 0.01 */ meshDeflection?: number | undefined; /** * The name the downloaded file gets. * @default assembly.ply */ 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 false */ tryDownload?: boolean | undefined; } /** * A design document, with the documents an assembly places, for `design.validate`, which checks them * without building anything. */ class DesignDocumentDto { constructor(document?: Models.OCCT.DesignDocument, documents?: Models.OCCT.DesignDocument[]); /** * The document: a part document with its `parameters`, `features` and `parts`, or an assembly * document with its `components`. * @default undefined */ document: Models.OCCT.DesignDocument; /** * The documents an assembly's components place, each with the `id` they name it by; their * problems are listed under their position, such as `/documents/2`. * @default undefined * @optional true */ documents?: Models.OCCT.DesignDocument[] | undefined; } /** * A design document with the configuration, parameter values, asset contents and the documents an * assembly places, for `design.build`, which builds it, and `design.toTypeScript`, which writes a part * document as code. */ class DesignBuildDto { constructor(document?: Models.OCCT.DesignDocument, configuration?: string, parameters?: Record, assets?: Record, documents?: Models.OCCT.DesignDocument[], rebind?: designRebindEnum, outcomes?: Models.OCCT.DesignSuppliedOutcome[], sketches?: boolean); /** * The document: a part document with its `parameters`, `features` and `parts`, or an assembly * document with its `components`. * @default undefined */ document: Models.OCCT.DesignDocument; /** * The id of one of the document's `configurations`, whose values replace the parameters' own; * left out or empty, none is used. * @default undefined * @optional true */ configuration?: string | undefined; /** * Values that replace the parameters of the same names after the configuration's, each read as * the parameter's own value is, such as `{ width: 40 }`. * @default undefined * @optional true */ parameters?: Record | undefined; /** * The contents of the document's `assets` by asset id, as text or bytes, for the features that * import them; each is checked against the SHA-256 the document records. * @default undefined * @optional true */ assets?: Record | undefined; /** * The documents an assembly's components place, each with the `id` they name it by. * @default undefined * @optional true */ documents?: Models.OCCT.DesignDocument[] | undefined; /** * When a hinted reference loses its faces: `never` fails and offers the faces most like its hint * as repairs; `report` takes them, if they stand clear, and reports `rebound`. * @default undefined * @optional true */ rebind?: designRebindEnum | undefined; /** * Outcomes the caller made for features the build lists as `pending`, such as scripts, or kept from an * earlier build, each under the hash of the feature it is for; the build takes them instead of * making those features. * @default undefined * @optional true * @ignore true */ outcomes?: Models.OCCT.DesignSuppliedOutcome[] | undefined; /** * Whether a part document's build also lists its `sketches`: each one's outline, the frame it was * drawn in and the command that drew each edge, for editors that draw and edit sketches. * @default undefined * @optional true * @ignore true */ sketches?: boolean | undefined; } /** * A part document with the configuration, parameter values and asset contents to build it with, the * fillet or chamfer feature to probe and how many values to try, for `design.probeFillet`. */ class DesignProbeFilletDto { constructor(document?: Models.OCCT.DesignDocument, feature?: string, configuration?: string, parameters?: Record, assets?: Record, maxAttempts?: number); /** * The part document with its `parameters`, `features` and `parts`. * @default undefined */ document: Models.OCCT.DesignDocument; /** * The id of the fillet or chamfer feature to probe. * @default undefined */ feature: string; /** * The id of one of the document's `configurations`, whose values replace the parameters' own; * left out or empty, none is used. * @default undefined * @optional true */ configuration?: string | undefined; /** * Values that replace the parameters of the same names after the configuration's, each read as * the parameter's own value is, such as `{ width: 40 }`. * @default undefined * @optional true */ parameters?: Record | undefined; /** * The contents of the document's `assets` by asset id, as text or bytes, for the features that * import them. * @default undefined * @optional true */ assets?: Record | undefined; /** * How many radii or distances to try at most, from 1 to 64, starting with the document's own; * each try makes the fillet or chamfer once. * @default 16 * @minimum 1 * @maximum 64 * @step 1 */ maxAttempts?: number | undefined; } /** * A part document with the configuration, parameter values and asset contents to build it with, a * body of it and faces or edges picked on that body, for `design.referenceFor`, which names them. */ class DesignReferenceForDto { constructor(document?: Models.OCCT.DesignDocument, body?: string, faces?: number[], edges?: number[], configuration?: string, parameters?: Record, assets?: Record, nudge?: boolean); /** * The part document with its `parameters`, `features` and `parts`. * @default undefined */ document: Models.OCCT.DesignDocument; /** * The body the elements were picked on, by the id of the feature that started it, as a part's * `body` names it. * @default undefined */ body: string; /** * The picked faces of the body, as indexes from 0; give these or `edges`. * @default undefined * @optional true */ faces?: number[] | undefined; /** * The picked edges of the body, as indexes from 0; give these or `faces`. * @default undefined * @optional true */ edges?: number[] | undefined; /** * The id of one of the document's `configurations`, whose values replace the parameters' own; * left out or empty, none is used. * @default undefined * @optional true */ configuration?: string | undefined; /** * Values that replace the parameters of the same names after the configuration's, each read as * the parameter's own value is, such as `{ width: 40 }`. * @default undefined * @optional true */ parameters?: Record | undefined; /** * The contents of the document's `assets` by asset id, as text or bytes, for the features that * import them. * @default undefined * @optional true */ assets?: Record | undefined; /** * Whether to check the reference by building again with each number parameter the body depends * on moved a little, one at a time. * @default true */ nudge?: boolean | undefined; } /** * A design document with the configuration, parameter values, asset contents and the documents an * assembly places, and the clearance to keep, for `design.clashes`, which finds the placed parts that * overlap or come too close. */ class DesignClashesDto { constructor(document?: Models.OCCT.DesignDocument, documents?: Models.OCCT.DesignDocument[], configuration?: string, parameters?: Record, assets?: Record, clearance?: number); /** * The document: an assembly document with its `components`, or a part document whose parts are * checked where they were built. * @default undefined */ document: Models.OCCT.DesignDocument; /** * The documents an assembly's components place, each with the `id` they name it by. * @default undefined * @optional true */ documents?: Models.OCCT.DesignDocument[] | undefined; /** * The id of one of the document's `configurations`, whose values replace the parameters' own; * left out or empty, none is used. * @default undefined * @optional true */ configuration?: string | undefined; /** * Values that replace the parameters of the same names after the configuration's, each read as * the parameter's own value is, such as `{ width: 40 }`. * @default undefined * @optional true */ parameters?: Record | undefined; /** * The contents of the document's `assets` by asset id, as text or bytes, for the features that * import them. * @default undefined * @optional true */ assets?: Record | undefined; /** * How close two placed parts may come before they clash; 0 reports only parts that touch or * overlap. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ clearance?: number | undefined; } /** * A recipe for `recipes.build`, with whether Z turns into Y, whether a root that cannot be built * stops the build, and how large a triangle mesh is built. Experimental: the recipe format may still * change. * @beta */ class BuildRecipeDto { constructor(recipe?: Base.Recipe, adjustZtoY?: boolean, emptyWhenFailed?: boolean, facetedMeshes?: boolean, maxTriangles?: number); /** * The recipe: steps such as polygons, extrusions and cuts, and the roots to build from them, as * a package that describes geometry as data writes it. * @default undefined */ recipe: Base.Recipe; /** * When true, each shape turns a quarter turn about X so the recipe's Z points along Y, which is * up when drawn: `(x, y, z)` becomes `(x, z, -y)`. * @default false */ adjustZtoY?: boolean | undefined; /** * When true, a root that cannot be built comes back as an empty compound and an opening that * cannot is left uncut; when false, either stops the build. * @default false */ emptyWhenFailed?: boolean | undefined; /** * When true, triangle meshes become faceted solids, flat faces that cut and fillet like any * shape; when false they keep their triangles, which draw, measure and export to STEP faster. * @default false */ facetedMeshes?: boolean | undefined; /** * The most triangles a mesh built as a faceted solid may hold; a larger one is not built and * counts as a step that failed. * @default 100000 * @minimum 0 * @maximum Infinity * @step 10000 */ maxTriangles?: number | undefined; } /** * A recipe for `recipes.buildDocument`, with the name of the top assembly, the tag that groups roots * into products, whether a failed root stops the build, and how large a mesh is built. Experimental: * the recipe format may still change. * @beta */ class BuildRecipeDocumentDto { constructor(recipe?: Base.Recipe, name?: string, groupBy?: string, emptyWhenFailed?: boolean, facetedMeshes?: boolean, maxTriangles?: number); /** * The recipe: steps such as polygons, extrusions and cuts, and the roots to build from them, as * a package that describes geometry as data writes it. * @default undefined */ recipe: Base.Recipe; /** * The name of the assembly at the top of the document, which holds every product. * @default Recipe */ name?: string | undefined; /** * The tag whose value gathers roots into one product, such as the pieces of one element in * different colours. Roots without it are each a product of their own. * @default globalId */ groupBy?: string | undefined; /** * When true, a root that cannot be built is left out of the document and an opening that cannot * is left uncut; when false, either stops the build. * @default false */ emptyWhenFailed?: boolean | undefined; /** * When true, triangle meshes become faceted solids, flat faces that cut and fillet like any * shape; when false they keep their triangles, which draw, measure and export to STEP faster. * @default false */ facetedMeshes?: boolean | undefined; /** * The most triangles a mesh built as a faceted solid may hold; a larger one is not built and * counts as a step that failed. * @default 100000 * @minimum 0 * @maximum Infinity * @step 10000 */ maxTriangles?: number | undefined; } } /** * 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 | DrawFrameOptions | DrawRecipeMeshesOptions; /** * A kernel shape with the looks to draw it in: a base look for the whole shape and groups of * faces that override it, by the face indexes `shapes.face.getFaces` gives, with the colors of * its edges. A part that `occt.design.build` returns is one already; drawn, the shape becomes * one mesh. */ interface ShapeWithAppearance { /** The shape to draw, as the OCCT kernel returns it. */ shape: Inputs.OCCT.TopoDSShapePointer; /** * How the shape looks. Each `faces` entry gives its values to the faces it lists, `edgeColor` * colors the edges and each `edges` entry the edges it lists, by the indexes * `shapes.edge.getEdges` gives; left out, the shape takes the colors of the options. */ appearance?: Models.OCCT.DesignBuiltAppearance | undefined; } /** * Everything a draw call will accept: points, lines, segments and polylines; Verb curves and * surfaces; the handles the OCCT, Manifold and JSCAD kernels return; kernel shapes with their * appearance and what `occt.design.build` returns; 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. * * A design build draws every placement as a hardware instance. Drawn again into the entity it * returned, passed as `group`, with the same parts at the same component paths, it only moves * them, so animating from joint values never meshes again. * * 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.Frame | Base.VerbCurve | Base.VerbSurface | Inputs.OCCT.TopoDSShapePointer | ShapeWithAppearance | Models.OCCT.DesignBuildResult | Inputs.OCCT.DecomposedMeshDto | Inputs.Manifold.ManifoldPointer | Inputs.Manifold.CrossSectionPointer | Inputs.Manifold.DecomposedManifoldMeshDto | Inputs.Manifold.RecipeMeshesDto | Inputs.JSCAD.JSCADEntity | Inputs.Tag.TagDto | CustomGeometryDrawable | number[][] | Base.Point3[] | Base.Line3[] | Base.Segment3[] | Base.Polyline3[] | Base.Frame[] | Base.VerbCurve[] | Base.VerbSurface[] | Inputs.OCCT.TopoDSShapePointer[] | ShapeWithAppearance[] | Inputs.OCCT.DecomposedMeshDto[] | Inputs.Manifold.ManifoldPointer[] | Inputs.Manifold.CrossSectionPointer[] | Inputs.Manifold.DecomposedManifoldMeshDto[] | 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); /** * What to draw: a point, line, polyline, frame, curve, surface, kernel shape, mesh or tag, or a * list of one of these kinds. Kernel shapes need `draw.drawAnyAsync`. * @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; /** * An entity an earlier draw returned. Kinds drawn with `updatable` set change in place, a * design build only moves its parts, and without `options` its earlier options apply. * @optional true */ group?: U | undefined; } /** * Taken by `draw.drawAnyAsync` for Manifold solids, meshes and cross-sections: the face color or * engine material, the shading and back faces of solids, and the outline of cross-sections. */ 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, minSharpAngle?: number); /** * How opaque the faces are, from 0 to 1, though this renderer draws them opaque whatever the * value; a `faceMaterial` replaces it. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity?: number | undefined; /** * The color of the faces of solids and meshes, as a hex string; a `faceMaterial` replaces it. * @default #ff0000 */ faceColour?: Base.Color | undefined; /** * An engine material for the faces, such as `draw.createPBRMaterial` makes; given, it replaces * `faceColour` and `faceOpacity`. * @default undefined * @optional true */ faceMaterial?: Base.Material | undefined; /** * The color of the outline of a cross-section, as a hex string. * @default #ff00ff */ crossSectionColour?: Base.Color | undefined; /** * Not honored by this renderer, which draws the outline of a cross-section one pixel wide. * @default 2 */ crossSectionWidth?: number | undefined; /** * How opaque the outline of a cross-section is; this renderer draws it opaque whatever the * value. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ crossSectionOpacity?: number | undefined; /** * When true, the mesh shades smoothly across edges flatter than `minSharpAngle` and keeps * sharper ones crisp; when false, every face is shaded flat. * @default true */ computeNormals?: boolean | undefined; /** * The angle between two faces, in degrees, above which their shared edge is drawn sharp when * `computeNormals` is true. * @default 40 * @minimum 0 * @maximum 180 * @step 5 */ minSharpAngle?: number | undefined; /** * When true, the back of the faces of solids and meshes is drawn in `backFaceColour`, which * shows which way they face. * @default true */ drawTwoSided?: boolean | undefined; /** * The color of the back of the faces, as a hex string; used with `drawTwoSided`. * @default #0000ff */ backFaceColour?: Base.Color | undefined; /** * How opaque the back of the faces is, from 0 for invisible to 1 for opaque; used with * `drawTwoSided`. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity?: number | undefined; } /** * Built by `draw.optionsOcctShape` for OCCT shapes: meshing, which faces, edges, vertices and * labels show in what colors, iso curves, surface analysis and caching. Shapes with an appearance * and design builds skip vertices, labels, arrows, iso curves, analysis and `faceMaterial`. */ 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, drawIsoCurves?: boolean, isoCurvesU?: number, isoCurvesV?: number, isoCurvesColour?: Base.Color, surfaceAnalysis?: Inputs.OCCT.surfaceAnalysisEnum, draftDirection?: Base.Vector3, analysisMin?: number, analysisMax?: number, edgeContrast?: number, angularDeflection?: number, relativeDeflection?: boolean); /** * How opaque the faces are, from 0 to 1, multiplied into each look's own opacity. This renderer * shows it on faces drawn in looks only; plain faces stay opaque. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity?: number | undefined; /** * How opaque the edge and iso curve lines are; this renderer draws them opaque whatever the * value. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ edgeOpacity?: number | undefined; /** * The color of the edges, as a hex string, unless `edgeContrast` derives it from the faces; the * edge colors of an appearance win over both. * @default #ffffff */ edgeColour?: Base.Color | undefined; /** * Edges take their faces' color moved toward black, or toward white on dark faces, by this * amount from 0 to 1, instead of `edgeColour`. Appearance edge colors still win. * @default undefined * @optional true * @minimum 0 * @maximum 1 * @step 0.05 */ edgeContrast?: number | undefined; /** * The color of the faces, as a hex string. A `faceMaterial` or a `surfaceAnalysis` takes its * place, and the colors of an appearance win over it. * @default #ff0000 */ faceColour?: Base.Color | undefined; /** * The color of the vertex markers, as a hex string; used with `drawVertices`. * @default #ff00ff */ vertexColour?: Base.Color | undefined; /** * An engine material for the faces, such as `draw.createPBRMaterial` makes; it replaces * `faceColour` and `faceOpacity`, and a `surfaceAnalysis` replaces it in turn. * @default undefined * @optional true */ faceMaterial?: Base.Material | undefined; /** * Not honored by this renderer, which draws edge and iso curve lines one pixel wide. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ edgeWidth?: number | undefined; /** * The diameter of the vertex markers, in model units; used with `drawVertices`. * @default 0.03 * @minimum 0 * @maximum Infinity * @step 0.01 */ vertexSize?: number | undefined; /** * When false, the edges are not drawn. Drawn edges or iso curves push the faces back slightly * in depth so the lines show on top. * @default true */ drawEdges?: boolean | undefined; /** * When false, the faces and their backs are not drawn and no `surfaceAnalysis` is computed; the * face index labels still are. * @default true */ drawFaces?: boolean | undefined; /** * When true, each vertex of the shape is drawn as a small sphere in `vertexColour`, * `vertexSize` across. * @default false */ drawVertices?: boolean | undefined; /** * The largest distance, in model units, the triangles and edge lines may stray from the curved * shape; smaller is finer and heavier. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.01 */ precision?: number | undefined; /** * The largest angle, in radians, a curved face may turn between neighboring triangles; smaller * follows curvature more closely with more triangles. * @default 0.5 * @minimum 0.001 * @maximum 3.14159 * @step 0.05 */ angularDeflection?: number | undefined; /** * When true, `precision` is a fraction of each edge's and face's size instead of model units, so * small and large parts get triangles in proportion to their size. * @default false */ relativeDeflection?: boolean | undefined; /** * When true, each edge's index is written beside the middle of the edge, handy for picking * edges to fillet. * @default false */ drawEdgeIndexes?: boolean | undefined; /** * The height of the edge index labels, in model units; they are drawn as lines in a plane * parallel to XY. * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ edgeIndexHeight?: number | undefined; /** * The color of the edge index labels, as a hex string. * @default #ff00ff */ edgeIndexColour?: Base.Color | undefined; /** * When true, each face's index is written near the middle of the face, handy for picking faces. * @default false */ drawFaceIndexes?: boolean | undefined; /** * The height of the face index labels, in model units; they are drawn as lines in a plane * parallel to XY. * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ faceIndexHeight?: number | undefined; /** * The color of the face index labels, as a hex string. * @default #0000ff */ faceIndexColour?: Base.Color | undefined; /** * When true, the back of each face is drawn in `backFaceColour`, which shows which way faces * point. A design build draws no backs. * @default true */ drawTwoSided?: boolean | undefined; /** * The color of the back of the faces, as a hex string; used with `drawTwoSided`. * @default #0000ff */ backFaceColour?: Base.Color | undefined; /** * How opaque the back of the faces is, from 0 for invisible to 1 for opaque; used with * `drawTwoSided`. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity?: number | undefined; /** * The length of an arrow head at the end of each edge, showing its direction, in model units; 0 * draws none. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.01 */ edgeArrowSize?: number | undefined; /** * The angle, in degrees, between each line of an arrow head and its edge; larger spreads the * head wider. * @default 15 * @minimum 0 * @maximum 90 * @step 1 */ edgeArrowAngle?: number | undefined; /** * 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 | 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; /** * When true, each face's iso curves are drawn with the shape, as its edges are: at `edgeWidth` * and `edgeOpacity`, in `isoCurvesColour`. * @default false */ drawIsoCurves?: boolean | undefined; /** * How many iso curves of constant u each face gets with `drawIsoCurves`, at values spread evenly * inside its u range and trimmed to the face. * @default 5 * @minimum 0 * @maximum 1000 * @step 1 */ isoCurvesU?: number | undefined; /** * How many iso curves of constant v each face gets with `drawIsoCurves`, at values spread evenly * inside its v range and trimmed to the face. * @default 5 * @minimum 0 * @maximum 1000 * @step 1 */ isoCurvesV?: number | undefined; /** * The color of the iso curves as a hex string. * @default #808080 */ isoCurvesColour?: Base.Color | undefined; /** * The surface analysis coloring the faces instead of `faceColour` and `faceMaterial`, from blue at * `analysisMin` through green to red at `analysisMax`; vertices without a value keep `faceColour`. * @default none */ surfaceAnalysis?: Inputs.OCCT.surfaceAnalysisEnum | undefined; /** * The pull direction the draft angles, in degrees, are measured against; read only when * `surfaceAnalysis` is `draftAngle`. * @default [0, 1, 0] */ draftDirection?: Base.Vector3 | undefined; /** * The analysis value drawn blue, and anything below it; left out, the lowest finite value * found. * @default undefined * @optional true */ analysisMin?: number | undefined; /** * The analysis value drawn red, and anything above it; left out, the highest finite value * found. * @default undefined * @optional true */ analysisMax?: number | undefined; } /** * Built by `draw.optionsSimple` for points, lines, polylines, JSCAD paths and meshes, and Verb * curves and surfaces: colors, size, opacity, back faces and arrow heads. Drawn with no options, * lines, polylines and curves get `size` 2 in magenta. */ 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); /** * One hex color for everything drawn, or a list with one per point, line, polyline, surface or * JSCAD mesh; a polyline or JSCAD mesh with its own color keeps it. * @default #ff0000 */ colours?: string | string[] | undefined; /** * How a `colours` list shorter than what is drawn is spread: first color for all, last for the * rest, repeating, or back and forth. JSCAD meshes ignore it. * @default lastColorRemainder */ colorMapStrategy?: Base.colorMapStrategyEnum | undefined; /** * The diameter of each point in model units. This renderer draws lines one pixel wide whatever * the size. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; /** * The opacity of points, surfaces and JSCAD meshes, from 0 for invisible to 1 for opaque; this * renderer draws lines opaque. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity?: number | undefined; /** * When true, handing the drawn object back as `group` changes it in place instead of drawing a * new one. * @default false */ updatable?: boolean | undefined; /** * When true, surfaces and JSCAD meshes are drawn but not shown until made visible; points and * lines ignore it. * @default false */ hidden?: boolean | undefined; /** * When true, the back of each surface and JSCAD mesh is drawn in `backFaceColour`, which shows * which way it faces. * @default true */ drawTwoSided?: boolean | undefined; /** * The color of the back of surfaces and JSCAD meshes, as a hex string; used with * `drawTwoSided`. * @default #0000ff */ backFaceColour?: Base.Color | undefined; /** * How opaque the back of surfaces and JSCAD meshes is, from 0 for invisible to 1 for opaque; * used with `drawTwoSided`. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ backFaceOpacity?: number | undefined; /** * The length of the arrow head at the end of each line, polyline and curve, showing its * direction, in model units; 0 draws none. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.01 */ arrowSize?: number | undefined; /** * The angle, in degrees, between each line of an arrow head and the line it ends; larger * spreads the head wider. * @default 15 * @minimum 0 * @maximum 90 * @step 1 */ arrowAngle?: number | undefined; } /** * Texture filtering mode - how the texture is sampled when scaled */ enum samplingModeEnum { nearest = "nearest", bilinear = "bilinear", trilinear = "trilinear" } /** * Feeds `draw.createTexture`: the image to load and how it lies on a surface, its tiling, offset, * rotation and flip, and how it is filtered; the texture then goes into a texture slot of * `draw.createPBRMaterial`. */ class GenericTextureDto { constructor(url?: string, name?: string, uScale?: number, vScale?: number, uOffset?: number, vOffset?: number, wAng?: number, invertY?: boolean, invertZ?: boolean, samplingMode?: samplingModeEnum); /** * Where the image is loaded from, as a path relative to the page or a full web address. * @default undefined */ url: string; /** * The name the engine gives the texture. * @default Texture */ name?: string | undefined; /** * How many times the image repeats along U, the first texture direction of the surface. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ uScale?: number | undefined; /** * How many times the image repeats along V, the second texture direction of the surface. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ vScale?: number | undefined; /** * How far the image is shifted along U, in image widths. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ uOffset?: number | undefined; /** * How far the image is shifted along V, in image heights. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ vOffset?: number | undefined; /** * How far the image is turned on the surface; this renderer reads the value in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ wAng?: number | undefined; /** * When false, the default, the image is flipped vertically as it loads; true keeps its rows in * file order. * @default false */ invertY?: boolean | undefined; /** * When true, the tiling along V is negated, which mirrors the image vertically on the surface. * @default false */ invertZ?: boolean | undefined; /** * How the image is sampled when shown larger or smaller than its pixels: `nearest` keeps hard * pixels, `bilinear` blends neighbors, and `trilinear` also blends between mipmap levels. * @default nearest */ samplingMode?: samplingModeEnum | undefined; } /** * Alpha/blend modes that determine how transparent materials are rendered */ enum alphaModeEnum { opaque = "opaque", mask = "mask", blend = "blend" } /** * Feeds `draw.createPBRMaterial`: a physically based material for the `faceMaterial` of the drawing * options, from a base color, metallic and roughness values, opacity, glow, texture slots and how * the faces are rendered. */ 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); /** * The name the engine gives the material. * @default PBRMaterial */ name?: string | undefined; /** * The base color of the surface, as a hex string. * @default #0000ff */ baseColor?: Base.Color | undefined; /** * How metallic the surface is, from 0 for plastic-like to 1 for metal. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ metallic?: number | undefined; /** * How rough the surface is, from 0 for a mirror-like shine to 1 for a matte finish. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ roughness?: number | undefined; /** * How opaque the material is, from 0 for invisible to 1 for opaque; the default `opaque` mode * of `alphaMode` ignores it and `blend` shows it. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ alpha?: number | undefined; /** * The color the surface glows with whatever the scene's lights, as a hex string; black, the * default, adds no glow. * @default #000000 */ emissiveColor?: Base.Color | undefined; /** * How strongly the surface glows: the emissive color is multiplied by it. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ emissiveIntensity?: number | undefined; /** * A constant depth offset, which moves coplanar surfaces in front of or behind each other to * stop flicker. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ zOffset?: number | undefined; /** * A depth offset scaled by the slope of each face, added to `zOffset`; used only when `zOffset` * is not 0. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ zOffsetUnits?: number | undefined; /** * An image from `draw.createTexture` for the base color of the surface. * @default undefined * @optional true */ baseColorTexture?: Base.Texture | undefined; /** * An image used as both the metalness map and the gloss map of this renderer's material. * @default undefined * @optional true */ metallicRoughnessTexture?: Base.Texture | undefined; /** * A normal map, which adds surface detail by bending the lighting without changing the * geometry. * @default undefined * @optional true */ normalTexture?: Base.Texture | undefined; /** * An image giving where and in which color the surface glows. * @default undefined * @optional true */ emissiveTexture?: Base.Texture | undefined; /** * An ambient occlusion map, which darkens the creases and corners light reaches less. * @default undefined * @optional true */ occlusionTexture?: Base.Texture | undefined; /** * How opacity is applied: `opaque` ignores it, `mask` cuts away pixels below `alphaCutoff`, and * `blend` draws the faces see-through. * @default opaque */ alphaMode?: alphaModeEnum | undefined; /** * The opacity below which a pixel is cut away; used with `alphaMode` set to `mask`. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.05 */ alphaCutoff?: number | undefined; /** * When true, both sides of each face are drawn; when false, the back is culled. * @default false */ doubleSided?: boolean | undefined; /** * Not read by this renderer; the faces are drawn filled whatever the value. * @default false */ wireframe?: boolean | undefined; /** * Not read by this renderer; the surface is lit whatever the value. * @default false */ unlit?: boolean | undefined; } /** * Feeds `draw.optionsFrame`: how a frame is drawn, as its three axes in their own colors and a * small grid in its plane that marks it as a plane. */ class DrawFrameOptions { constructor(size?: number, colorX?: Base.Color, colorY?: Base.Color, colorZ?: Base.Color, drawPlane?: boolean, colorPlane?: Base.Color, lineWidth?: number, updatable?: boolean); /** * Length of each axis, in model units; the grid in the plane is as wide, centered on the origin. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ size?: number | undefined; /** * Color of the X axis, which runs along the frame's direction. * @default #ff0000 */ colorX?: Base.Color | undefined; /** * Color of the Y axis. * @default #00ff00 */ colorY?: Base.Color | undefined; /** * Color of the Z axis, which runs along the frame's normal. * @default #0000ff */ colorZ?: Base.Color | undefined; /** * Whether to draw the small grid in the frame's plane around its origin. * @default true */ drawPlane?: boolean | undefined; /** * Color of the grid in the frame's plane. * @default #808080 */ colorPlane?: Base.Color | undefined; /** * Not honored by this renderer, which draws the axis and grid lines one pixel wide. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ lineWidth?: number | undefined; /** * When true, handing the drawn frame back as `group` changes it in place instead of drawing a * new one. * @default false */ updatable?: boolean | undefined; } /** * How the meshes of a recipe, as `manifold.recipes.meshes` gives them, are drawn: the tag * naming an element, when a mesh placed many times becomes instances, the size of a merged * batch, and the look of roots without a color. */ class DrawRecipeMeshesOptions { constructor(elementKey?: string, instancing?: boolean, minInstances?: number, maxBatchVertices?: number, defaultColour?: Base.Color, defaultOpacity?: number, metallic?: number, roughness?: number); /** * The tag whose value names an element, so the roots sharing it show, hide, color and pick * as one. * @default globalId */ elementKey?: string | undefined; /** * Not read by this renderer, which merges every mesh into batches and draws no instances. * @default true */ instancing?: boolean | undefined; /** * Not read by this renderer, which merges every mesh into batches and draws no instances. * @default 2 * @minimum 2 * @maximum Infinity * @step 1 */ minInstances?: number | undefined; /** * The most vertices one merged batch holds; more start another batch. * @default 1000000 * @minimum 1 * @maximum Infinity * @step 1000 */ maxBatchVertices?: number | undefined; /** * The color of a root whose tag has no `rgba`. * @default #cccccc */ defaultColour?: Base.Color | undefined; /** * The opacity of such a root, from 0 to 1. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ defaultOpacity?: number | undefined; /** * How metallic every surface is, from 0 to 1. * @default 0 * @minimum 0 * @maximum 1 * @step 0.1 */ metallic?: number | undefined; /** * How rough every surface is, from 0 to 1. * @default 0.8 * @minimum 0 * @maximum 1 * @step 0.1 */ roughness?: number | undefined; } /** * Elements of a drawn recipe to show or hide, by the values of their element tag. */ class RecipeElementsVisibilityDto { constructor(drawn?: T, keys?: string[], visible?: boolean); /** * The drawn recipe, as drawing its meshes returned it. * @default undefined */ drawn: T; /** * The elements, by the values of their element tag, such as global ids. * @default undefined */ keys: string[]; /** * Whether they are shown. * @default true */ visible?: boolean | undefined; } /** * Elements of a drawn recipe to show in one color, or to give back their own, by the values * of their element tag. */ class RecipeElementsColourDto { constructor(drawn?: T, keys?: string[], colour?: Base.Color, opacity?: number); /** * The drawn recipe, as drawing its meshes returned it. * @default undefined */ drawn: T; /** * The elements, by the values of their element tag, such as global ids. * @default undefined */ keys: string[]; /** * The color to show them in; left out, each takes its own color back. * @default undefined * @optional true */ colour?: Base.Color | undefined; /** * The opacity that color is shown with, from 0 to 1; it shows only in an element drawn * see-through already. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity?: number | undefined; } /** * What a pick hit in a drawn recipe: the mesh, and the triangle or the instance the engine * reports for it. */ class RecipeElementPickDto { constructor(drawn?: T, mesh?: M, triangle?: number, instance?: number); /** * The drawn recipe, as drawing its meshes returned it. * @default undefined */ drawn: T; /** * The mesh the pick hit. * @default undefined */ mesh: M; /** * The triangle the pick hit, which the engine reports for a merged batch. * @default undefined * @optional true */ triangle?: number | undefined; /** * The instance the pick hit, which the engine reports for instances. * @default undefined * @optional true */ instance?: number | undefined; } /** * 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", frame = "frame", frames = "frames", verbCurve = "verbCurve", verbCurves = "verbCurves", verbSurface = "verbSurface", verbSurfaces = "verbSurfaces", jscadMesh = "jscadMesh", jscadMeshes = "jscadMeshes", jscadPath = "jscadPath", jscadPaths = "jscadPaths", occt = "occt", occtShapes = "occtShapes", manifold = "manifold", recipeMeshes = "recipeMeshes", 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 | undefined; /** * How far from the pivot the camera starts, in scene units * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ distance?: number | undefined; /** * 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 | undefined; /** * How far around the vertical axis the camera starts, in degrees * @default 45 * @minimum -Infinity * @maximum Infinity * @step 1 */ yaw?: number | undefined; /** * The closest the camera may zoom to the pivot, in scene units * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ distanceMin?: number | undefined; /** * The farthest the camera may zoom from the pivot, in scene units * @default 1000 * @minimum 0 * @maximum Infinity * @step 1 */ distanceMax?: number | undefined; /** * The lowest the camera may tilt, in degrees; -90 looks straight up from below * @default -90 * @minimum -90 * @maximum 90 * @step 1 */ pitchAngleMin?: number | undefined; /** * The highest the camera may tilt, in degrees; 90 looks straight down from above * @default 90 * @minimum -90 * @maximum 90 * @step 1 */ pitchAngleMax?: number | undefined; /** * How far a pointer drag turns the camera; higher turns faster * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ orbitSensitivity?: number | undefined; /** * How far a wheel step zooms the camera; higher zooms faster * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.01 */ distanceSensitivity?: number | undefined; /** * 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 | undefined; /** * When true, the scene is rendered again whenever the camera moves * @default true */ autoRender?: boolean | undefined; /** * When true and a focus object is given, the camera starts framed on it * @default true */ frameOnStart?: boolean | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 -Infinity * @maximum Infinity * @step 1 */ yaw?: number | undefined; /** * How far above or below the pivot, in degrees; positive is above looking down * @default 30 * @minimum -90 * @maximum 90 * @step 1 */ pitch?: number | undefined; /** * How far from the pivot, in scene units * @default 20 * @minimum 0 * @maximum Infinity * @step 1 */ distance?: number | undefined; } } /** * 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 0 * @exclusiveMinimum true * @maximum Infinity * @step 10 */ sceneSize?: number | undefined; /** * Background color of the scene in hex format. * @default "#1a1c1f" */ backgroundColor?: string | undefined; /** * Enable shadow mapping for realistic shadows. * @default true */ enableShadows?: boolean | undefined; /** * Enable the ground plane. * @default true */ enableGround?: boolean | undefined; /** * Center position of the ground plane [x, y, z]. * @default [0, 0, 0] */ groundCenter?: Base.Point3 | undefined; /** * 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 Infinity * @step 0.5 */ groundScaleFactor?: number | undefined; /** * Color of the ground plane in hex format. * @default "#333333" */ groundColor?: string | undefined; /** * Opacity of the ground plane (0 = fully transparent, 1 = fully opaque). * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ groundOpacity?: number | undefined; /** * Ambient light color. PlayCanvas uses ambient light instead of hemisphere light. * @default "#888888" */ ambientLightColor?: string | undefined; /** * Intensity factor for ambient light (applied to RGB values). * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ ambientLightIntensity?: number | undefined; /** * Color of the directional light (sun light). * @default "#ffffff" */ directionalLightColor?: string | undefined; /** * Brightness of the sun-like light that casts the shadows, 1 being full strength * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ directionalLightIntensity?: number | undefined; /** * Size of the shadow map in pixels (higher = sharper shadows but more GPU intensive). * @default 2048 * @minimum 256 * @maximum 8192 * @step 256 */ shadowMapSize?: number | undefined; /** * Enable automatic creation of an orbit camera controller. * @default true */ enableOrbitCamera?: boolean | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The green channel, from 0 to 255. * @default 0 * @minimum 0 * @maximum 255 */ g?: number | undefined; /** * The blue channel, from 0 to 255. * @default 255 * @minimum 0 * @maximum 255 */ b?: number | undefined; } /** * 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 | undefined; /** * The green channel, from 0 to 1. * @default 0 * @minimum 0 * @maximum 1 */ g?: number | undefined; /** * The blue channel, from 0 to 1. * @default 1 * @minimum 0 * @maximum 1 */ b?: number | undefined; } /** * 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 | undefined; /** * 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. * @default false */ blackAndWhite?: boolean | undefined; } /** * 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 | undefined; /** * The value a channel of 0 maps to. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ from?: number | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The green channel, within `min` to `max`. * @default 255 * @minimum 0 * @maximum 255 * @step 1 */ g?: number | undefined; /** * The blue channel, within `min` to `max`. * @default 255 * @minimum 0 * @maximum 255 * @step 1 */ b?: number | undefined; /** * The lowest value a channel can have, usually 0. * @default 0 * @minimum 0 * @maximum 255 * @step 0.1 */ min?: number | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The month counting from 0: 0 is January, 11 December. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ month?: number | undefined; /** * The day of the month, from 1 to 31. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ day?: number | undefined; /** * The hour, from 0 to 23. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ hours?: number | undefined; /** * The minutes, from 0 to 59. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ minutes?: number | undefined; /** * The seconds, from 0 to 59. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ seconds?: number | undefined; /** * The milliseconds, from 0 to 999. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ milliseconds?: number | undefined; } } /** * Parameters for frames: the origin, normal and direction a frame is built from, the frames, points * and vectors converted between a frame and the world, and the counts and spacings of frame * patterns. A frame is a point with three axes at right angles, and it places things. */ declare namespace Frame { /** * One of a frame's own axes: `x` runs along its `direction`, `z` along its `normal` and `y` * across both. Used by `frame.rotate`. */ enum frameAxisEnum { x = "x", y = "y", z = "z" } /** * Where `frame.create` puts a frame, where its Z axis points and roughly where its X axis * points; the X axis is turned square to the normal. */ class CreateFrameDto { constructor(origin?: Base.Point3, normal?: Base.Vector3, direction?: Base.Vector3); /** * Where the frame sits. * @default [0, 0, 0] */ origin?: Base.Point3 | undefined; /** * Where the Z axis points; any length but zero. * @default [0, 0, 1] */ normal?: Base.Vector3 | undefined; /** * Roughly where the X axis points. It is turned square to `normal`, so it only must not run * along it. * @default [1, 0, 0] */ direction?: Base.Vector3 | undefined; } /** * Where `frame.xy`, `frame.yz` and `frame.zx` put the frame they build; each of them fixes * the axes itself. */ class OriginDto { constructor(origin?: Base.Point3); /** * Where the frame sits. * @default [0, 0, 0] */ origin?: Base.Point3 | undefined; } /** * The three points `frame.fromThreePoints` builds a frame from: its origin, a point its X axis * runs toward and a point on the side its Y axis points to. */ class ThreePointsDto { constructor(origin?: Base.Point3, xPoint?: Base.Point3, planePoint?: Base.Point3); /** * Where the frame sits. * @default [0, 0, 0] */ origin?: Base.Point3 | undefined; /** * A point the X axis runs toward from `origin`. * @default [1, 0, 0] */ xPoint?: Base.Point3 | undefined; /** * A third point in the plane, on the side the Y axis points to; it must not lie on the line * through the other two. * @default [0, 1, 0] */ planePoint?: Base.Point3 | undefined; } /** * A point and a normal for `frame.fromPointAndNormal`, which picks the X axis by a fixed rule, * so the same normal always gives the same frame. */ class PointAndNormalDto { constructor(origin?: Base.Point3, normal?: Base.Vector3); /** * Where the frame sits. * @default [0, 0, 0] */ origin?: Base.Point3 | undefined; /** * Where the Z axis points; any length but zero. * @default [0, 0, 1] */ normal?: Base.Vector3 | undefined; } /** * The points `frame.bestFit` fits a plane through: at least three, not all on one line. */ class BestFitDto { constructor(points?: Base.Point3[]); /** * The points to fit. Their order decides which way the normal points; where it turns * neither way, as in a bow-tie, the normal's largest component is positive. * @default undefined */ points: Base.Point3[]; } /** * One frame, for the methods that read a frame or turn it over: `frame.origin`, `frame.normal`, * `frame.direction`, `frame.yDirection`, `frame.flip` and `frame.toMatrix`. */ class FrameDto { constructor(frame?: Base.Frame); /** * The frame to read or change. * @default undefined */ frame: Base.Frame; } /** * A list of frames for `frame.flipFrames`, which turns every one of them over. */ class FramesDto { constructor(frames?: Base.Frame[]); /** * The frames to change, each on its own. * @default undefined */ frames: Base.Frame[]; } /** * The vector `frame.translate` and `frame.translateFrames` move frames by; their axes keep * their directions. */ abstract class TranslateSharedDto { /** * How far to move each origin, in world coordinates and model units. * @default [0, 0, 0] */ translation?: Base.Vector3 | undefined; } /** * A frame and the vector `frame.translate` moves it by; its axes keep their directions. */ class TranslateDto extends TranslateSharedDto { constructor(frame?: Base.Frame, translation?: Base.Vector3); /** * The frame to move. * @default undefined */ frame: Base.Frame; } /** * Frames and the one vector `frame.translateFrames` moves them all by; their axes keep their * directions. */ class TranslateFramesDto extends TranslateSharedDto { constructor(frames?: Base.Frame[], translation?: Base.Vector3); /** * The frames to move. * @default undefined */ frames: Base.Frame[]; } /** * The distance `frame.offset` and `frame.offsetFrames` move frames along their own normals; * their axes keep their directions. */ abstract class OffsetSharedDto { /** * How far to move each frame along its normal, in model units; a negative distance moves * against it. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ distance?: number | undefined; } /** * A frame and the distance `frame.offset` moves it along its own normal; its axes keep their * directions. */ class OffsetDto extends OffsetSharedDto { constructor(frame?: Base.Frame, distance?: number); /** * The frame to move. * @default undefined */ frame: Base.Frame; } /** * Frames and the distance `frame.offsetFrames` moves each along its own normal; their axes keep * their directions. */ class OffsetFramesDto extends OffsetSharedDto { constructor(frames?: Base.Frame[], distance?: number); /** * The frames to move. * @default undefined */ frames: Base.Frame[]; } /** * One of a frame's own axes and the angle `frame.rotate` and `frame.rotateFrames` turn frames * by about it, through each frame's origin. */ abstract class RotateSharedDto { /** * Which of each frame's own axes to turn about. * @default z */ axis?: frameAxisEnum | undefined; /** * 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 | undefined; } /** * A frame, one of its own axes and the angle `frame.rotate` turns it by about that axis, * through its origin. */ class RotateDto extends RotateSharedDto { constructor(frame?: Base.Frame, axis?: frameAxisEnum, angle?: number); /** * The frame to turn. * @default undefined */ frame: Base.Frame; } /** * Frames, one of their own axes and the angle `frame.rotateFrames` turns each by about that * axis, through its own origin. */ class RotateFramesDto extends RotateSharedDto { constructor(frames?: Base.Frame[], axis?: frameAxisEnum, angle?: number); /** * The frames to turn. * @default undefined */ frames: Base.Frame[]; } /** * The parent frame whose coordinates `frame.frameToWorld`, `frame.frameToLocal`, * `frame.framesToWorld` and `frame.framesToLocal` read frames in. */ abstract class ChildFrameSharedDto { /** * The frame whose coordinates the frames are given in or converted to. * @default undefined */ parent: Base.Frame; } /** * Two frames for `frame.frameToWorld` and `frame.frameToLocal`: the `child` to convert, and the * `parent` whose coordinates are used. */ class ChildFrameDto extends ChildFrameSharedDto { constructor(child?: Base.Frame, parent?: Base.Frame); /** * The frame to convert: given in the coordinates of `parent` for `frameToWorld`, in world * coordinates for `frameToLocal`. * @default undefined */ child: Base.Frame; } /** * Frames and one parent frame for `frame.framesToWorld` and `frame.framesToLocal`, which convert * every frame between the parent's coordinates and world coordinates. */ class ChildFramesDto extends ChildFrameSharedDto { constructor(children?: Base.Frame[], parent?: Base.Frame); /** * The frames to convert: given in the coordinates of `parent` for `framesToWorld`, in world * coordinates for `framesToLocal`. * @default undefined */ children: Base.Frame[]; } /** * A frame and one point for `frame.pointToWorld` and `frame.pointToLocal`, which convert the * point between the frame's coordinates and world coordinates. */ class FramePointDto { constructor(frame?: Base.Frame, point?: Base.Point3); /** * The frame whose coordinates the point is converted to or from. * @default undefined */ frame: Base.Frame; /** * The point to convert: in the frame's coordinates for `pointToWorld`, in world coordinates * for `pointToLocal`. * @default undefined */ point: Base.Point3; } /** * A frame and a list of points for `frame.pointsToWorld` and `frame.pointsToLocal`, which * convert every point between the frame's coordinates and world coordinates. */ class FramePointsDto { constructor(frame?: Base.Frame, points?: Base.Point3[]); /** * The frame whose coordinates the points are converted to or from. * @default undefined */ frame: Base.Frame; /** * The points to convert: in the frame's coordinates for `pointsToWorld`, in world * coordinates for `pointsToLocal`. * @default undefined */ points: Base.Point3[]; } /** * A frame and a vector for `frame.vectorToWorld` and `frame.vectorToLocal`, which turn the * vector between the frame's axes and the world axes without moving it. */ class FrameVectorDto { constructor(frame?: Base.Frame, vector?: Base.Vector3); /** * The frame whose axes the vector is converted to or from. * @default undefined */ frame: Base.Frame; /** * The vector to convert: along the frame's axes for `vectorToWorld`, along the world axes * for `vectorToLocal`. * @default undefined */ vector: Base.Vector3; } /** * The transformation `frame.fromMatrix` reads a frame from: where it moves the world origin and * where it turns the world X and Z axes. */ class TransformationDto { constructor(transformation?: Base.TransformMatrixes); /** * A transformation matrix, or a list of them applied in order; scaling is dropped and a * perspective part is refused. * @default undefined */ transformation: Base.TransformMatrixes; } /** * Two frames for `frame.matrixFromTo`, whose transformation carries anything placed on `from` * onto `to`, turning it the same way. */ class FromToDto { constructor(to?: Base.Frame, from?: Base.Frame); /** * The frame to move onto. * @default undefined */ to: Base.Frame; /** * The frame to move from; left out, the world frame. * @default undefined * @optional true */ from?: Base.Frame | undefined; } /** * The counts and spacings of the grid of frames `frame.grid` lays out in the plane of `frame`, * each turned the same way as `frame`. */ class GridDto { constructor(frame?: Base.Frame, countX?: number, countY?: number, spacingX?: number, spacingY?: number, centered?: boolean); /** * The frame whose plane and axes the grid follows; left out, the world frame. * @default undefined * @optional true */ frame?: Base.Frame | undefined; /** * How many frames along the X axis. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ countX?: number | undefined; /** * How many frames along the Y axis. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ countY?: number | undefined; /** * The distance between neighbours along the X axis, in model units. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ spacingX?: number | undefined; /** * The distance between neighbours along the Y axis, in model units. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ spacingY?: number | undefined; /** * When true the grid is centered on the frame's origin; otherwise it starts there and runs * along the X and Y axes. * @default false */ centered?: boolean | undefined; } /** * The count, radius and sweep of the ring of frames `frame.polar` lays out around the normal of * `frame`, in its plane. */ class PolarDto { constructor(frame?: Base.Frame, count?: number, radius?: number, angle?: number, startAngle?: number, rotate?: boolean); /** * The frame the ring turns around, about its normal; left out, the world frame. * @default undefined * @optional true */ frame?: Base.Frame | undefined; /** * How many frames in the ring. * @default 6 * @minimum 1 * @maximum Infinity * @step 1 */ count?: number | undefined; /** * The distance from the center to each frame, in model units; at 0 the frames only turn * in place. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * The angle the ring covers, in degrees, from -360 to 360. A full turn spaces the frames * evenly without repeating the first; a smaller angle puts one at each end. * @default 360 * @minimum -360 * @maximum 360 * @step 1 */ angle?: number | undefined; /** * The angle of the first frame, in degrees from the X axis toward the Y axis. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ startAngle?: number | undefined; /** * When true the frames rotate with the ring, as copies around a hub do; otherwise every frame * keeps the axes of `frame`. * @default true */ rotate?: boolean | undefined; } /** * The counts and hexagon size of the honeycomb `frame.hexGrid` lays out in the plane of * `frame`: one frame at the center of each hexagon, turned the same way as `frame`. */ class HexGridDto { constructor(frame?: Base.Frame, countX?: number, countY?: number, radius?: number, centered?: boolean); /** * The frame whose plane and axes the honeycomb follows; left out, the world frame. * @default undefined * @optional true */ frame?: Base.Frame | undefined; /** * How many hexagons in each row, along the X axis. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ countX?: number | undefined; /** * How many rows, along the Y axis; every second row is shifted by half a hexagon. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ countY?: number | undefined; /** * The distance from a hexagon's center to one of its corners, in model units; two corners * lie on the frame's Y axis. * @default 1 * @minimum 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * When true the honeycomb is centered on the frame's origin; otherwise its first hexagon * sits there. * @default false */ centered?: boolean | undefined; } } /** * 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 | undefined; /** * Color for all paths in this part, as a hex string such as `#000000` * @default #000000 */ color?: Base.Color | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * Position just after the last item to take; it is not included. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ indexEnd?: number | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * Name of the property whose numeric value decides the order. * @default propName */ property?: string | undefined; } /** * 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 | undefined; /** * When true, the items left over at the end form a shorter last group; when false they are * dropped. * @default false */ keepRemainder?: boolean | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * 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[] | undefined; /** * 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[] | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * Position of the first item to remove, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ offset?: number | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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[] | undefined; } /** * 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 | undefined; /** * Position of the first item to keep, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ offset?: number | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * How many steps the fade between the thresholds has; more steps make it smoother. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ nrLevels?: number | undefined; } /** * 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 | undefined; /** * When true, every result is flipped: true becomes false and false becomes true. * @default false */ inverse?: boolean | undefined; } /** * 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 | undefined; } } /** * 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 | undefined; /** * The number to divide by; the remainder is smaller than it. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ modulus?: number | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The value at the start of the curve. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ min?: number | undefined; /** * The value at the end of the curve. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ max?: number | undefined; /** * The easing curve: `easeIn` starts slowly, `easeOut` ends slowly, `easeInOut` does both, * in sine, quadratic, cubic and other strengths. * @default easeInSine */ ease?: easeEnum | undefined; } /** * 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 | undefined; /** * How many digits to keep after the decimal point; 0 rounds to a whole number. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ decimalPlaces?: number | undefined; } /** * 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 | undefined; /** * The second operand: the number subtracted, divided by, or used as the exponent. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ second?: number | undefined; /** * The operation to apply to `first` and `second`, in that order * @default add */ operation?: mathTwoNrOperatorEnum | undefined; } /** * 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 | undefined; /** * The second operand: the number subtracted, divided by, or used as the exponent. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ second?: number | undefined; } /** * 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 | undefined; /** * The operation to apply to `number` * @default absolute */ operation?: mathOneNrOperatorEnum | undefined; } /** * 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 | undefined; /** * The low end of the range the number is in. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ fromLow?: number | undefined; /** * The high end of the range the number is in. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ fromHigh?: number | undefined; /** * The low end of the range to map to; `fromLow` lands here. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ toLow?: number | undefined; /** * The high end of the range to map to; `fromHigh` lands here. * @default 2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ toHigh?: number | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * How many random numbers to produce. * @default 10 * @minimum 0 * @maximum Infinity * @step 1 */ count?: number | undefined; } /** * 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 0 * @maximum 100 * @step 1 */ decimalPlaces?: number | undefined; } /** * 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 | undefined; /** * The lowest value allowed; anything below becomes this. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ min?: number | undefined; /** * The highest value allowed; anything above becomes this. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ max?: number | undefined; } /** * 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 | undefined; /** * The value at fraction 1. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ end?: number | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The value that counts as fraction 1. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ end?: number | undefined; /** * The value to locate between start and end. * @default 0.5 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ value?: number | undefined; } /** * 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 | undefined; /** * The start of the range, included in the result. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ min?: number | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The turning point: the result rises to it, then falls back to 0. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ length?: number | undefined; } /** * 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 | undefined; /** * The value to move toward; it is never overshot. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ target?: number | undefined; /** * The largest change allowed in one step. * @default 0.1 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ maxDelta?: number | undefined; } /** * 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 | undefined; } } /** * 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 0 * @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 0 * @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 0 * @maximum Infinity * @step 1e-7 */ tolerance?: number | undefined; } /** * A flat outline and the holes cut through it, for `mesh.triangulatePolygon`. */ class PolygonWithHolesDto { constructor(points?: Base.Point3[], holes?: Base.Point3[][]); /** * The corners of the outline in order, all in one plane; the last need not repeat the first. * @default undefined */ points: Base.Point3[]; /** * The holes, each a list of corners in the outline's plane and inside the outline. * @default undefined * @optional true */ holes?: Base.Point3[][] | undefined; } /** * A triangle mesh, for `mesh.signedVolume` and other methods that read one. */ class MeshDto { constructor(mesh?: Base.Mesh3); /** * The mesh, as a list of triangles. * @default undefined */ mesh: Base.Mesh3; } } /** * 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 | undefined; /** * The Y value, the second entry; Y is up. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ y?: number | undefined; /** * The Z value, the third entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ z?: number | undefined; } /** * 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 | undefined; /** * The Y value, the second entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ y?: number | undefined; } /** * 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 | undefined; /** * Size of the drawn point, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; /** * Color of the point as a hex string such as `#ff0000`; a list of strings is also * accepted. * @default #444444 */ colours?: string | string[] | undefined; /** * When true, the drawn mesh is built so its position can be changed later without * redrawing. * @default false */ updatable?: boolean | undefined; /** * 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 | undefined; /** * Size of each drawn point, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size?: number | undefined; /** * One hex color string for all points, or one string per point. * @default #444444 */ colours?: string | string[] | undefined; /** * When true, the drawn mesh is built so the positions can be changed later without * redrawing. * @default false */ updatable?: boolean | undefined; /** * 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 | undefined; /** * Distance to move along Y, which is up, in model units. * @default 1 */ y?: number | undefined; /** * Distance to move along Z, in model units. * @default 0 */ z?: number | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The direction of the axis to turn around. * @default [0, 1, 0] */ axis?: Base.Vector3 | undefined; /** * A point the axis passes through. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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 | undefined; } /** * 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 0 * @maximum Infinity * @step 1e-7 */ tolerance?: number | undefined; } /** * 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 0 * @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. * @default false */ checkFirstAndLast?: boolean | undefined; } /** * 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 0 * @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 | undefined; /** * How many points to place along the spiral. * @default 200 * @minimum 0 * @maximum Infinity * @step 10 */ numberPoints?: number | undefined; /** * 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 | undefined; /** * The distance from the origin the last point reaches, in model units. * @default 6 * @minimum 0 * @maximum Infinity * @step 0.1 */ radius?: number | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * How many columns of hexagons along X. * @default 21 * @minimum 0 * @maximum Infinity * @step 1 */ nrHexagonsX?: number | undefined; /** * 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 | undefined; /** * When true, the middle of the grid sits at the origin instead of its corner. * @default false */ orientOnCenter?: 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; } /** * Three points on a circular arc and how finely to divide it, for `point.arcThroughThreePoints`. */ class ArcThroughThreePointsDto { constructor(start?: Base.Point3, middle?: Base.Point3, end?: Base.Point3, segments?: number); /** * Where the arc starts. * @default undefined */ start: Base.Point3; /** * A point the arc passes through on its way, which decides the side it bulges to. * @default undefined */ middle: Base.Point3; /** * Where the arc ends. * @default undefined */ end: Base.Point3; /** * How many equal steps the arc is divided into; more steps follow the circle more closely. * @default 16 * @minimum 1 * @maximum Infinity * @step 1 */ segments?: number | undefined; } } /** * 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 undefined * @optional true */ 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 0 * @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 0 * @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 0 * @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 | undefined; } /** * 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 | undefined; /** * The text that marks a cut; it is dropped from the pieces. * @default , */ separator?: string | undefined; } /** * 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 | undefined; /** * The text to look for; every occurrence is replaced. * @default - */ search?: string | undefined; /** * The text that takes the place of each occurrence. * @default b */ replaceWith?: string | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The values, in placeholder order: the first fills `{0}`, the second `{1}`. * @default ["World"] */ values?: string[] | undefined; } /** * 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 | undefined; /** * The text to look for, matched exactly, including case. * @default world */ search?: string | undefined; } /** * 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 | undefined; /** * Position of the first character to take, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ start?: number | undefined; /** * Position just after the last character to take; leave it out to take everything to the * end. * @default undefined * @optional true * @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 | undefined; /** * Position of the character, counting from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index?: number | undefined; } /** * 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 | undefined; /** * The length to reach; a text already that long stays as it is. * @default 3 * @minimum 0 * @maximum Infinity * @step 1 */ length?: number | undefined; /** * The filler repeated until the length is reached; the last repeat is cut short if needed. * @default a */ padString?: string | undefined; } /** * 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 | undefined; /** * How many times the text appears in the result. * @default 3 * @minimum 0 * @maximum Infinity * @step 1 */ count?: number | undefined; } /** * 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[] | undefined; } /** * 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 | undefined; /** * The regular expression, written as it would be between the slashes in JavaScript, such as * `[0-9]+`. * @default [0-9]+ */ pattern?: string | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * The regular expression, written as it would be between the slashes in JavaScript, such as * `[0-9]+`. * @default [0-9]+ */ pattern?: string | undefined; /** * 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 | undefined; /** * The text that takes the place of each match; `$1` and the like refer to capture groups, * as in JavaScript. * @default X */ replaceWith?: string | undefined; } /** * 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 | undefined; /** * 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 * @default 0 */ yOffset?: number | undefined; /** * The height of a capital letter, in model units; the strokes are scaled to it. * @default 1 * @minimum 0 * @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 0 * @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 | undefined; /** * The direction of the axis to turn around. * @default [0, 1, 0] */ axis?: Base.Vector3 | undefined; /** * A point the axis passes through; it stays in place. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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 | undefined; /** * The point the axis passes through; it stays in place. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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 | undefined; /** * The turn about the X axis, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ pitch?: number | undefined; /** * The turn about the Z axis, in degrees. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ roll?: number | undefined; /** * The point the rotation turns around; it stays in place. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The point that stays in place while everything else moves away from it or toward it. * @default [0, 0, 0] */ center?: Base.Point3 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * Two vectors count as the same when every entry differs by less than this. * @default 1e-7 * @minimum 0 * @maximum Infinity */ tolerance?: number | undefined; } /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * The Y value, the second entry; Y is up. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.5 */ y?: number | undefined; /** * The Z value, the third entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.5 */ z?: number | undefined; } /** * 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 | undefined; /** * The Y value, the second entry. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.5 */ y?: number | undefined; } /** * 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 0 * @exclusiveMinimum true * @maximum Infinity * @step 0.1 */ step?: number | undefined; /** * The first number of the span. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ min?: number | undefined; /** * The end of the span; included when a step lands on it. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 1 */ max?: number | undefined; } /** * 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 | undefined; /** * The first number. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ min?: number | undefined; /** * The last number. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 1 */ max?: number | undefined; /** * 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 | undefined; /** * When true, the result holds the gaps between neighboring numbers instead of the numbers * themselves; the first entry is `min`. * @default false */ intervals?: boolean | undefined; } /** * 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 | undefined; /** * The first number. * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ min?: number | undefined; /** * The last number. * @default 1 * @minimum -Infinity * @maximum Infinity * @step 1 */ max?: number | undefined; } /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * MIME type declared for text content, such as `text/plain` or `application/json` * @default text/plain */ contentType?: string | undefined; } /** * 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 | undefined; /** * When true, the loaded model is added to the scene invisible, to be shown later * @default false */ hidden?: boolean | undefined; } /** * 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 | undefined; /** * 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; } } /** * 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 | 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.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 | undefined; /** * 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 | undefined; /** * 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[] | undefined; /** * 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 | undefined; /** * Header name of the column whose values are listed * @default name */ column?: string | undefined; /** * 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 | undefined; /** * Header name of the column that is compared with `value` * @default age */ column?: string | undefined; /** * 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 | undefined; /** * 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)[][] | 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[] | undefined; /** * The property names written as columns, in this order; properties not listed are left out * @default ["name", "age"] */ headers?: string[] | undefined; /** * 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[] | undefined; /** * 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 | undefined; /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; } /** * 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 | undefined; /** * 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 | undefined; } /** * 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 | undefined; /** * Name of the property set on every object the path reaches * @default propertyName */ prop?: string | undefined; } /** * 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 * @default false */ updatable?: boolean | undefined; /** * 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 * @default false */ updatable?: boolean | undefined; /** * 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 * @default [0, 0, 0] */ position?: Base.Point3 | undefined; /** * Hex color of the label's text * @default #444444 */ colour?: string | undefined; /** * Font size of the label, in pixels * @default 12 */ size?: number | undefined; /** * When true, a label far from the camera is drawn smaller than one nearby, as if it sat in * the scene * @default false */ adaptDepth?: boolean | undefined; /** * 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 { /** * One pair a clash query reports: the two items by index, `indexA` below `indexB` when both come * from one list or one shape, the nearest distance between them (0 where they touch, overlap or one * lies inside a solid of the other), the volume they share when both hold a solid (0 otherwise), and * the nearest points, `pointA` on the first and `pointB` on the second; where faces of one shape * cross, both are one point on their crossing. */ interface Clash { indexA: number; indexB: number; distance: number; volume: number; pointA: Base.Point3; pointB: Base.Point3; } /** * The point of a curve nearest a given point: its parameter as a fraction of the curve, its length * from the start, its distance from the given point, and the index of the edge it lies on as * `shapes.edge.getEdgesAlongWire` numbers them. */ interface CurveClosestPoint { point: Base.Point3; param: number; length: number; distance: number; edgeIndex: number; } /** * How a curve bends at one place: the point, the unit tangent, the principal normal pointing to the * center of curvature, the binormal (tangent x normal), the curvature (1 over the radius), the * radius, the center of the circle that fits the curve there, and the torsion, positive where the * curve winds as a right-handed helix does. Where the curve runs straight, `isStraight` is true, the * curvature and torsion are 0, the radius is `Infinity`, the normal and binormal are zero vectors * and the center is the point itself. */ interface CurveCurvature { point: Base.Point3; tangent: Base.Vector3; normal: Base.Vector3; binormal: Base.Vector3; curvature: number; radius: number; center: Base.Point3; torsion: number; isStraight: boolean; } /** * A corner of a curve where its tangent turns: the point, the index of the edge that ends there as * `shapes.edge.getEdgesAlongWire` numbers them, and the angle the tangent turns by, in degrees, from * 0 for a smooth join to 180 for a turn back. */ interface CurveKink { point: Base.Point3; edgeIndex: number; angle: number; } /** * A highest or lowest point of a curve along a direction: the point, its parameter as a fraction of * the curve, its length from the start, its height (how far it lies along the direction, measured * from the origin), whether it is a highest point rather than a lowest, and whether it is a global * one, with no point of the curve higher, or lower for a lowest point. */ interface CurveExtreme { point: Base.Point3; param: number; length: number; height: number; isMaximum: boolean; isGlobal: boolean; } /** * A point where two curves meet: its parameter on each as a fraction of that curve, the index of the * edge it lies on in each as `shapes.edge.getEdgesAlongWire` numbers them, and whether it is an end * of a stretch where the curves run together rather than a crossing. */ interface CurveIntersection { point: Base.Point3; paramA: number; paramB: number; edgeIndexA: number; edgeIndexB: number; isOverlap: boolean; } /** * A point where a curve meets a face: its parameter on the curve as a fraction, the index of the * edge it lies on as `shapes.edge.getEdgesAlongWire` numbers them, its `u` and `v` on the face as * fractions of the face's UV bounds, as `shapes.face.pointOnUV` takes them, and whether it is an end * of a stretch of the curve lying on the face. */ interface CurveFaceIntersection { point: Base.Point3; param: number; edgeIndex: number; u: number; v: number; isOverlap: boolean; } /** * One nearest pair of points between two shapes: `pointA` on the first and `pointB` on the second, * the distance between them, and on each side what the point lies on (a vertex, an edge or a face), * that sub-shape's index as `shapes.vertex.getVertices`, `shapes.edge.getEdges` or * `shapes.face.getFaces` numbers it, and where on it: on a face `u` and `v` as fractions of its UV * bounds, as `shapes.face.pointOnUV` takes them; on an edge `u` as a fraction of the edge from its * start to its end as it runs, and `v` 0; on a vertex both 0. When one shape lies inside a solid of * the other, the one pair is at distance 0 on a vertex of the inner shape, and the index of the side * that contains the other is -1. */ interface ShapeExtremum { pointA: Base.Point3; pointB: Base.Point3; distance: number; supportA: OCCT.shapeTypeEnum; supportB: OCCT.shapeTypeEnum; indexA: number; indexB: number; uA: number; vA: number; uB: number; vB: number; } /** * The angle between two faces or edges, in degrees from 0 to 180, read where they are nearest: at * `pointA` and `pointB`, between the directions there, which are a face's unit normal and an edge's * unit tangent along the edge's orientation. */ interface AngleBetween { angle: number; pointA: Base.Point3; pointB: Base.Point3; directionA: Base.Vector3; directionB: Base.Vector3; } /** * The angle between the two faces that meet at an edge, measured through the material, in degrees: * 90 for the edge of a box, 180 where the faces meet smoothly, 270 for the inner edge of an L, with * `isConvex` true up to 180. `point` is where on the edge it was read, `normalA` and `normalB` are * the faces' unit normals there, and `faceIndexA` and `faceIndexB` the faces as * `shapes.face.getFaces` numbers them. */ interface DihedralAngle { angle: number; isConvex: boolean; point: Base.Point3; normalA: Base.Vector3; normalB: Base.Vector3; faceIndexA: number; faceIndexB: number; } /** * The tightest bend found on a shape: its radius in model units, the point where it was found, and * the face or edge it lies on, with that face's index as `shapes.face.getFaces` numbers it or that * edge's as `shapes.edge.getEdges` does. Where nothing bends, `radius` is `Infinity`, `support` is * `unknown` and `index` is -1. */ interface MinCurvatureRadius { radius: number; point: Base.Point3; support: OCCT.shapeTypeEnum; index: number; } /** * What one face of a shape is like, read in one pass with every other face: the kind of surface it * lies on, its area, its centre of area, the unit normal at the middle of its parameter range pointing * out of the material ([0, 0, 0] where it has none), and a box holding it, which may be loose on a * curved face. `index` is its index as `shapes.face.getFaces` and the selectors number it. */ interface FaceSignature { index: number; type: OCCT.surfaceTypeEnum; area: number; centre: Base.Point3; normal: Base.Vector3; box: { min: Base.Point3; max: Base.Point3; }; } /** * What one edge of a shape is like: the kind of curve it runs along, its length, the point half way * along it and the unit tangent there, following the edge's orientation. A degenerate edge, such as * the pole of a sphere, or an edge with no curve to measure has `isDegenerate` true, type `other`, * length 0, no tangent ([0, 0, 0]) and its vertex as midpoint. `index` is its index as * `shapes.edge.getEdges` and the selectors number it. */ interface EdgeSignature { index: number; type: OCCT.curveTypeEnum; isDegenerate: boolean; length: number; midpoint: Base.Point3; tangent: Base.Vector3; } /** * A fingerprint of every face and every edge of a shape, in the selectors' numbering, so faces and * edges can be told apart, compared or found again after a rebuild without asking about each one. */ interface ShapeSignatures { faces: FaceSignature[]; edges: EdgeSignature[]; } /** * The point of a face nearest a given point: its `u` and `v` as fractions of the face's UV bounds, * as `shapes.face.pointOnUV` takes them, its distance from the given point, the face's unit normal * there, and whether it lies on the face's boundary, where a point beyond the face's edges comes to. */ interface FaceClosestPoint { point: Base.Point3; u: number; v: number; distance: number; normal: Base.Vector3; isOnBoundary: boolean; } /** * How a face bends at one place: the point, the unit normal the way the face looks, the largest and * smallest curvatures (1 over a radius, positive where the face bulges out along its normal, as the * outside of a ball does), their mean and product (the Gaussian curvature), and the unit directions * along which the face bends most and least. `isUmbilic` is true where it bends the same way in every * direction, as a plane or a ball does; where no curvature can be read, `isDefined` is false and the * curvatures and directions are 0. */ interface FaceCurvature { point: Base.Point3; normal: Base.Vector3; maxCurvature: number; minCurvature: number; meanCurvature: number; gaussianCurvature: number; maxDirection: Base.Vector3; minDirection: Base.Vector3; isUmbilic: boolean; isDefined: boolean; } /** * 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; /** Optional properties of an assembly node, such as its part number, which the STEP export writes as user-defined properties of its product; an instance's are not written */ properties?: Record | 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; /** * Optional color for the edges of the part. Exports write it on the part when the part has a * color, and on each edge otherwise, so no reader takes it for the color of the faces. */ edgeColorRgba?: Base.ColorRGBA | undefined; /** * Optional metalness of the part, from 0 to 1. With `roughness` and `emissiveRgb` it gives the * part a PBR material that glTF exports read; it needs `colorRgba`, and what it leaves out keeps * glTF's default. */ metallic?: number | undefined; /** Optional roughness of the part, from 0 to 1, for its PBR material */ roughness?: number | undefined; /** Optional light the part gives off, each channel from 0 to 1, as glTF's emissive factor */ emissiveRgb?: Base.ColorRGB | undefined; /** Optional colors of some faces, by the indexes `shapes.face.getFaces` gives; a later entry wins */ faceColors?: AssemblySubShapeColor[] | undefined; /** Optional colors of some edges, by the indexes `shapes.edge.getEdges` gives; a later entry wins */ edgeColors?: AssemblySubShapeColor[] | undefined; /** Optional properties of the part, such as its part number, which the STEP export writes as user-defined properties of its product */ properties?: Record | undefined; } /** * The color of some faces or edges of an assembly part, by their indexes. */ interface AssemblySubShapeColor { /** The indexes of the faces or edges, from 0 */ indexes: number[]; /** Their color */ colorRgba: Base.ColorRGBA; /** Optional metalness of these faces, from 0 to 1; read for faces only, as are `roughness` and `emissiveRgb` */ metallic?: number | undefined; /** Optional roughness of these faces, from 0 to 1 */ roughness?: number | undefined; /** Optional light these faces give off, each channel from 0 to 1 */ emissiveRgb?: Base.ColorRGB | 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; /** * The length unit the shapes' numbers are in, which the STEP export writes into the file. Left * out, a new document states none and the STEP export takes millimetres; an existing document * keeps its own. */ lengthUnit?: "mm" | "cm" | "m" | "in" | 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; } /** * A problem in a design document, with the JSON pointer of the value it is about, such as * `/features/2/radius`. */ interface DesignIssue { path: string; message: string; } /** * What became of one feature in a build: `ok`, `failed` with why, `suppressed`, `skipped` because a * body, profile or face it uses failed or was suppressed first, `rebound` when a reference lost its * faces and, in a build with `rebind: "report"`, took the faces most like its hint, or `pending` when * its outcome must come from the caller, as a script's does (see `pending` on the result). `ms` is the * time it took and `cached` says it was reused from an earlier build of the same inputs. A failed * feature whose lost references have hints lists, in `repairs`, the faces most like each; a rebound * one lists the faces each took. */ interface DesignFeatureReport { id: string; type: string; status: "ok" | "failed" | "skipped" | "suppressed" | "rebound" | "pending"; ms: number; cached: boolean; messages: string[]; repairs?: DesignRepair[]; } /** * The faces most like a lost reference's hint, by the reference's JSON pointer, with the score of * the least like of them: those a rebound feature took, or those a failed one could take. `clear` says * they stand clear enough of the others that a build with `rebind: "report"` takes them, as a rebound * feature's always do. */ interface DesignRepair { path: string; faces: number[]; score: number; clear: boolean; } /** * How built faces look: the faces as `shapes.face.getFaces` numbers them, with the values that * apply to them. */ interface DesignBuiltFaceAppearance { indexes: number[]; color?: string; metallic?: number; roughness?: number; opacity?: number; emissive?: string; emissiveStrength?: number; } /** * How a built part looks, with every expression evaluated and face and edge references resolved. * `edges` is there only when the part's appearance names edges. */ interface DesignBuiltAppearance { color?: string; metallic?: number; roughness?: number; opacity?: number; emissive?: string; emissiveStrength?: number; edgeColor?: string; faces: DesignBuiltFaceAppearance[]; edges?: DesignBuiltEdgeAppearance[]; } /** * The colour of built edges: the edges as `shapes.edge.getEdges` numbers them, and their colour. */ interface DesignBuiltEdgeAppearance { indexes: number[]; color?: string; } /** * The material of a built part, with its density and properties evaluated. */ interface DesignBuiltMaterial { id: string; name?: string; standard?: string; density?: number; properties: Record; } /** * A part a design built: its `id`, `name` and the `body` it is, its shape and per face the names * references find it by, its evaluated properties, material and appearance, its `volume` in the * document's length unit cubed when the body is solid, and its `mass` in kilograms when it is solid * and its material has a density. `shapeHash` is a digest of the features and values that made the * shape: the same in every build that makes the same shape and new when the shape changes, so a * viewer keeps a mesh exactly as long as the shape it shows. * * `itemKey` names the item the part is: 16 hexadecimal digits over its document's id, its part id * and `parameters`, the declared values it reads (through its features, material, appearance and * properties, and back through the parameters computed from others). A parameter the part never * reads, the configuration that set the values and the document's version are not in it, so a * revision keeps the key and identical parts share it. `buildKey` adds the document's version, for * caches and editors that must tell revisions apart. * * In an assembly build each item is one entry, from its `document`, and its `id` is the part's own * followed by its item key, such as `post-3f9a1c2e5b7d4e8f`: the same item has the same id in every * build, whatever order the components are in. When the build is given several versions of the * document, the first eight digits of the version follow, so two revisions placed together stay two * parts. Tools may show the first eight digits of the key. */ interface DesignBuiltPart { id: string; itemKey: string; buildKey: string; name: string; body: string; shape: T; shapeHash: string; faceNames: string[][]; properties: Record; material?: DesignBuiltMaterial; appearance?: DesignBuiltAppearance; volume?: number; mass?: number; connectors: DesignBuiltConnector[]; document?: string; parameters: Record; } /** * A connector of a built part: its `id` and the frame it resolved to, in the part's own coordinates. */ interface DesignBuiltConnector { id: string; frame: Base.Frame; } /** * One placed occurrence in a built assembly: its `path` of component ids from the top (`frame/bolt`), * the `parent` path it sits under, the built `part` it places or `assembly` true for a * sub-assembly, its placement `matrix` relative to its parent and `world` from the top, both * column-major 4 x 4, and its evaluated properties. */ interface DesignBuiltComponent { path: string; name: string; parent?: string; part?: string; assembly?: boolean; matrix: Base.TransformMatrix; world: Base.TransformMatrix; properties: Record; } /** * A joint as built: its `path` (the joint's id, below the sub-assembly it belongs to), its type, * the `component` path it moves and the one it is joined `to` (none for a frame), its `angle` and * `offset`, its limits, and the `frame` of its axis in world coordinates: the joint turns about the * frame's normal and slides along it. */ interface DesignBuiltJoint { path: string; type: DesignJointType; component: string; to?: string; angle: number; offset: number; limits: { angle?: [ number, number ]; offset?: [ number, number ]; }; frame: Base.Frame; } /** * A line of an assembly's bill of materials: the built `part`, how many times it is placed through * every level, and its name and evaluated properties, such as its part number. */ interface DesignBomLine { part: string; name: string; quantity: number; properties: Record; } /** * An outcome the caller made, or kept from an earlier build, for the feature whose `hash` it carries: the * `shape`, and either the `names` of its faces in `shapes.face.getFaces` order, as a build names them, * or the `roles` a script gave its faces by index. A build takes it instead of making the feature. */ interface DesignSuppliedOutcome { hash: string; shape: T; names?: string[][]; roles?: Record; } /** * A feature a build could not make itself, waiting for the caller: the script feature's `id`, its JSON * pointer, the asset that holds its code, the `inputs` its script is given (shapes, face and edge * indexes, numbers and the values written as they are) and the `hash` its outcome must be supplied * under. */ interface DesignPendingScript { id: string; path: string; script: string; hash: string; inputs: Record; } /** * What `design.build` made: the parts, a report per feature (per component for an assembly) in * document order, the problems found after the features ran (a part whose body failed, a property * that could not be evaluated), the configuration used, the value of every parameter, and the * `structure` that `assembly.manager.buildAssemblyDocument` turns into a document for STEP and glTF: * each part once under the document, or an assembly's placements. An assembly adds its * `components`, its `joints` and its bill of materials. `units` and `up` * are the built document's, filled in where it leaves them out, for the exports and views that read * them. `pending` lists the features whose outcomes the caller has still to make, such as scripts. */ interface DesignBuildResult { parts: DesignBuiltPart[]; report: DesignFeatureReport[]; issues: DesignIssue[]; configuration?: string; parameters: Record; components?: DesignBuiltComponent[]; joints?: DesignBuiltJoint[]; bom?: DesignBomLine[]; structure?: AssemblyStructureDef; properties?: Record; units: Required; up: "y" | "z"; pending?: DesignPendingScript[]; sketches?: DesignBuiltSketch[]; } /** * A sketch a build drew, listed when the build is asked for its sketches: the sketch feature's `id`, * its outline as a face (`face` true), or as a wire when it is open or its `face` is false, the `frame` it was * drawn in, and per edge of the outline, in `shapes.edge.getEdges` order, the command that drew it as * `"."`, or null for a command without an id. */ interface DesignBuiltSketch { id: string; shape: T; face: boolean; frame: Base.Frame; commands: (string | null)[]; } /** * Two placed parts of a design build that overlap, touch or come within the clearance: * `components` are their paths in the build (for a part document, the parts' ids), `distance` how far * apart they are, 0 where they touch or overlap, `volume` the volume they share, and `pointA` and * `pointB` the nearest points, on the first and on the second. `joined` says a joint holds the two * together, which a touch between them is expected to; such a touch is never listed, an overlap is. */ interface DesignClash { components: [ string, string ]; distance: number; volume: number; pointA: Base.Point3; pointB: Base.Point3; joined: boolean; } /** * A number in a design document: a number, or an expression over the document's parameters such as * `"width / 2 + 3"`, with `+ - * / ^`, parentheses, the functions `min max abs sqrt sin cos tan asin * acos atan atan2 round floor ceil` and the constant `pi`. Angles are in degrees. Comparisons * (`< <= > >= == !=`) and `&&`, `||` and `!` give 1 or 0, `if(condition, a, b)` chooses, and quoted * text such as `'steel'` compares with text and choice parameters. */ type DesignNumber = number | string; /** * An expression where text is expected, such as `{ "expr": "if(heavy, 'steel', 'aluminium')" }`: * where a value is text (a colour, a material, a text or choice parameter's value), a string is * taken as it is written, and this is how text is computed instead. */ interface DesignExpression { expr: string; } /** * Text in a design document: a string taken as it is written, or `{ "expr": "..." }` for text an * expression over the document's parameters computes. */ type DesignText = string | DesignExpression; /** * Data a document carries for other tools: `extras` is free JSON nothing reads, and `extensions` * holds objects under namespaced names such as `"acme.costing"`, which a runner ignores unless the * document lists the name in `requires`. */ interface DesignExtensible { extras?: unknown; extensions?: Record; } /** * Text shown to people: one string, or one per language by locale code, such as * `{ "en": "Width", "de": "Breite" }`. */ type DesignLabel = string | Record; /** * One option of a choice parameter: its `value`, which expressions compare with, and its `label`. */ interface DesignChoiceOption { value: string; label?: DesignLabel; } /** * A parameter with its kind and limits. `type` is `number` (the default, `value` a number or an * expression), `boolean`, `choice` (`value` one of `options`) or `text` (`value` taken as it is). A * choice or text value may be `{ "expr": "..." }`, computed from other parameters. * `min`, `max` and `options` are enforced on every value a build uses; `unit`, `step`, `label`, * `description` and `group` are for the people and tools that edit it. A number parameter's `unit` * is the document's length unit, `deg`, or `none` for a count or a ratio. */ interface DesignParameter extends DesignExtensible { value: DesignNumber | boolean | DesignExpression; type?: "number" | "boolean" | "choice" | "text"; unit?: "mm" | "cm" | "m" | "in" | "deg" | "none"; min?: number; max?: number; step?: number; options?: DesignChoiceOption[]; label?: DesignLabel; description?: DesignLabel; group?: string; } /** * A named set of parameter values, such as one size of a product: each value replaces the * parameter's own and is read the same way. A build picks one by `id`; expressions read the chosen id * as `configuration`. */ interface DesignConfiguration extends DesignExtensible { id: string; name?: DesignLabel; values: Record; } /** * What every feature may carry besides its own fields: a display `name`, and `suppressed`, which * leaves the feature out when true or when its expression is not 0. A suppressed feature that * changes a body leaves the body as it was; one that makes a body or a sketch makes none. */ interface DesignFeatureBase extends DesignExtensible { id: string; name?: string; suppressed?: boolean | DesignNumber; } /** * A point or a vector in a design document, each coordinate a number or an expression. */ type DesignPoint = [ DesignNumber, DesignNumber, DesignNumber ]; /** * A type with every number in it allowed to be an expression instead. */ type DesignExpressions = T extends number ? DesignNumber : T extends object ? { [K in keyof T]: DesignExpressions; } : T; /** * An exact circle, drawn as one closed edge around `centre`, in the sketch's coordinates, with * `radius`. It is a loop by itself, so it is the only command of its pen or loop. */ interface DesignCircleCommand { type: "circle"; id?: string; centre: [ DesignNumber, DesignNumber ]; radius: DesignNumber; } /** * A pen command of a sketch feature: a `sketch.pen` command whose numbers may be expressions, or a * `circle`. */ type DesignPenCommand = DesignExpressions | DesignCircleCommand; /** * One closed outline of a sketch that draws several: where its pen starts and its commands. */ interface DesignLoop { start?: [ DesignNumber, DesignNumber ]; pen: DesignPenCommand[]; } /** * A coordinate frame: `origin`, the `normal` it faces along and the in-plane `direction` its x axis * runs along. */ interface DesignFrame { origin: DesignPoint; normal: DesignPoint; direction: DesignPoint; } /** * A selector applied to the faces or edges a reference's lineage found: `select` names a * `select.faces` or `select.edges` method (`facing`, `extreme`, `ofType`, `nearest`, `bySize` and * the others) and the other properties are its inputs, without `shape` and `indexes`. */ interface DesignFilter { select: string; [input: string]: unknown; } /** * Which copy a pattern or a mirror made, at one level of copying: the copier's id and the copy's * `index` from 1, or `"all"` for every copy and the original. */ interface DesignCopy { of: string; index: number | "all"; } /** * Faces named by the feature that made them: `of` is that feature's id, `role` what the feature made * them as (`start`, `end`, `side`, `round`, `bevel`, `new`, `face`, `inner`, `rim`, `wall`), and * `from` the sketch command a side was swept from (`"."`), the id of a hole's * position, or an imported face's index as text, such as `"2"`. `copy` picks copies a pattern or a * mirror made: one `{ of, index }`, or a list with one per level when patterns copy copies; a level * the reference does not list means the original there. `filter` narrows what the lineage found and * `count`, when given, is how many faces it must leave. `hint`, which tools write and the version * leaves out, records what the faces were like, so a build can find them again by likeness when * their names are lost. */ interface DesignFaceReference { of: string; role: string; from?: string; copy?: DesignCopy | DesignCopy[]; filter?: DesignFilter; count?: number; hint?: DesignReferenceHint; } /** * What a reference's faces were like when a tool last resolved it (`design.withHints`): the body's * bounding `box` then, and one entry per face. A build reads it only to find the faces again by * likeness when their names are lost. */ interface DesignReferenceHint { v: 1; box: DesignHintBox; faces: DesignFaceHint[]; } /** * A body's bounding box when a hint was written, by its least and greatest corners. */ interface DesignHintBox { min: [ number, number, number ]; max: [ number, number, number ]; } /** * One face as a hint records it: its surface `type`, its `area` as a fraction of the body's, its * `centre` as fractions of the body's bounding box, its unit `normal`, and the names of the faces next * to it, sorted. Fractions keep a hint true when the body grows or shrinks with its parameters. */ interface DesignFaceHint { type: string; area: number; centre: [ number, number, number ]; normal: [ number, number, number ]; neighbours: string[]; } /** * Edges named by the two sets of faces they lie between, narrowed by `filter` and checked against * `count`. */ interface DesignEdgeReference { between: [ DesignFaceReference, DesignFaceReference ]; filter?: DesignFilter; count: number; } /** * How a feature that makes a solid joins the body it names: added to it, cut from it, or * intersected with it. */ type DesignJoin = "add" | "cut" | "intersect"; /** * Where a sketch lies: on one of the three planes through the origin, moved `offset` along its * normal; on a frame; or on a planar face of a body, placed as a connector is: at `origin`, or the * document's origin, met square on with the face's plane, with its x axis along `direction`, which a * face facing along a world axis may leave out. */ type DesignSketchPlacement = { plane: "XY" | "XZ" | "YZ"; offset?: DesignNumber; } | { frame: DesignFrame; } | { face: DesignFaceReference; origin?: DesignPoint; direction?: DesignPoint; }; /** * A sketch: pen commands on a placement, or `loops`, several closed outlines making one face, the * first its outside and each further one a hole in it, such as a washer or a plate with cut-outs. An * outline is closed when it ends with `close` or back at its start; a closed outline is made a face * unless `face` is false, and an open one stays a wire. Each command's `id`, distinct across the * sketch's loops, names the sides a later feature sweeps from it. */ interface DesignSketchFeature extends DesignFeatureBase { type: "sketch"; on: DesignSketchPlacement; start?: [ DesignNumber, DesignNumber ]; pen?: DesignPenCommand[]; loops?: DesignLoop[]; face?: boolean; } /** * Sweeps a sketch's face `distance` along its normal, or along `direction`. Without `body` it starts * a body named by its id; with `body` it joins that body as `join` says, adding by default. Its * faces are named `start`, `end` and `side` (from each sketch command). */ interface DesignExtrudeFeature extends DesignFeatureBase { type: "extrude"; profile: string; distance: DesignNumber; direction?: DesignPoint; body?: string; join?: DesignJoin; } /** * Turns a sketch's face `angle` degrees (360 by default) about `axis`. Bodies and joins as for * `extrude`; its faces are named `start`, `end` (none on a whole turn) and `side`. */ interface DesignRevolveFeature extends DesignFeatureBase { type: "revolve"; profile: string; axis: { origin: DesignPoint; direction: DesignPoint; }; angle?: DesignNumber; body?: string; join?: DesignJoin; } /** * Combines bodies: `body` goes on as the union, the difference or the intersection with `tools`, * which are used up. Faces no input owned are named `new`. */ interface DesignBooleanFeature extends DesignFeatureBase { type: "boolean"; operation: "union" | "difference" | "intersection"; body: string; tools: string[]; } /** * Rounds the edges `edges` names on `body`; the rounds are named `round`. */ interface DesignFilletFeature extends DesignFeatureBase { type: "fillet"; body: string; edges: DesignEdgeReference; radius: DesignNumber; } /** * Bevels the edges `edges` names on `body`; the bevels are named `bevel`. */ interface DesignChamferFeature extends DesignFeatureBase { type: "chamfer"; body: string; edges: DesignEdgeReference; distance: DesignNumber; } /** * Repeats `body` `count` times, the original included, `spacing` apart along `direction`, and * fuses the copies. Copy `i` (from 1) keeps its faces' names, picked with `copy`. */ interface DesignLinearPatternFeature extends DesignFeatureBase { type: "linearPattern"; body: string; direction: DesignPoint; spacing: DesignNumber; count: DesignNumber; } /** * Repeats `body` `count` times, the original included, turned evenly through `angle` degrees (360 * by default) about `axis`, and fuses the copies. Copies are picked with `copy`, as for * `linearPattern`. */ interface DesignPolarPatternFeature extends DesignFeatureBase { type: "polarPattern"; body: string; axis: { origin: DesignPoint; direction: DesignPoint; }; count: DesignNumber; angle?: DesignNumber; } /** * Mirrors `body` across the plane through `origin` facing `normal` and fuses the mirror image with * it, unless `keepOriginal` is false. The image is copy 1. */ interface DesignMirrorFeature extends DesignFeatureBase { type: "mirror"; body: string; plane: { origin: DesignPoint; normal: DesignPoint; }; keepOriginal?: boolean; } /** * Moves `body` as one rigid piece: it turns `rotate` degrees about X, then Y, then Z, each about an * axis through `pivot` (the origin when it is left out), and then shifts by `translate`. The body * keeps its faces and their names, so references made before the move still find them. */ interface DesignTransformFeature extends DesignFeatureBase { type: "transform"; body: string; translate?: DesignPoint; rotate?: DesignPoint; pivot?: DesignPoint; } /** * How a push or pull moves its face: `extrude` sweeps one flat face straight along its normal and adds * the swept solid to the body or cuts it away, whatever the faces around it do; `offset` moves the * faces themselves, flat or curved, and the faces around them stretch along their own surfaces to * follow. */ type DesignPushPullMode = "extrude" | "offset"; /** * Pushes or pulls the face `face` names along its outward normal by `distance`: out of the body when it * is above 0, into it when it is below. With `mode` `extrude`, the default, one flat face is swept * straight, as an extrude from the face would be, and the faces it sweeps out are named `side`. With * `offset` the faces themselves move and the faces around them follow, as Press Pull and Move Face do * in other CAD tools, so curved faces move as flat ones do; with a `count` the reference may name * several faces, which all move. Either way the moved faces keep their names and are also named `end`; * every other face keeps its names. */ interface DesignPushPullFeature extends DesignFeatureBase { type: "pushPull"; body: string; face: DesignFaceReference; distance: DesignNumber; mode?: DesignPushPullMode; } /** * Removes the `count` faces `faces` names from `body` and closes the gap by extending the faces around * them, as Delete Face does in other CAD tools: a hole's wall removed fills the hole, a round removed * sharpens its edge back. Every face that stays keeps its names. */ interface DesignRemoveFacesFeature extends DesignFeatureBase { type: "removeFaces"; body: string; faces: DesignFaceReference; } /** * Sweeps a sketch's outline along the outline of the sketch `path`, which should start where the * profile lies and cross it. Bodies and joins as for `extrude`; its faces are named `start`, `end` * and `side` (from each profile command). */ interface DesignSweepFeature extends DesignFeatureBase { type: "sweep"; profile: string; path: string; body?: string; join?: DesignJoin; } /** * Skins a surface through two or more sketches in order, closed into a solid unless `solid` is * false. Bodies and joins as for `extrude`; its faces are named `start` (on the first profile), * `end` (on the last) and `side` (from each profile's commands). */ interface DesignLoftFeature extends DesignFeatureBase { type: "loft"; profiles: string[]; solid?: boolean; body?: string; join?: DesignJoin; } /** * Hollows `body` into walls `thickness` thick, inward, or outward when it is negative, leaving open * the faces `open` names. The open faces become the `rim` and the walls offset from the others are * named `inner`. */ interface DesignShellFeature extends DesignFeatureBase { type: "shell"; body: string; thickness: DesignNumber; open: DesignFaceReference; } /** * A hole's position on its face with the `id` a reference names its walls by: x and y as a sketch on * the face reads them. */ interface DesignHolePosition { id: string; x: DesignNumber; y: DesignNumber; } /** * Drills holes into `body` through the flat face `on` names, at the points `at`, which are x and y * on that face as a sketch on it reads them (`origin` and `direction` as for a sketch on a face). * `depth` 0, the default, drills through; `tipAngle` gives the bottom a drill point. A `counterbore` * or a `countersink` widens each mouth. Every hole's faces are named `wall`, and a hole whose * position has an id, as `{ "id": "left", "x": -10, "y": 0 }`, also `wall` with that id, which a * reference names it by; a position is never named by where it comes in `at`. */ interface DesignHoleFeature extends DesignFeatureBase { type: "hole"; body: string; on: DesignFaceReference; origin?: DesignPoint; direction?: DesignPoint; at: (DesignHolePosition | [ DesignNumber, DesignNumber ])[]; diameter: DesignNumber; depth?: DesignNumber; tipAngle?: DesignNumber; counterbore?: { diameter: DesignNumber; depth: DesignNumber; }; countersink?: { diameter: DesignNumber; angle: DesignNumber; }; } /** * Raises a sketch drawn on a face of `body` out of that face: `distance` along the sketch's normal, * or `until` the face a reference names. Its walls are named `side` (from each sketch command) and * its top `end`. */ interface DesignBossFeature extends DesignFeatureBase { type: "boss"; profile: string; body: string; distance?: DesignNumber; until?: DesignFaceReference; } /** * Sinks a sketch drawn on a face of `body` into it: `distance` deep, `until` the face a reference * names, or `through` the whole body. Its walls are named `side` (from each sketch command) and its * floor `end`. */ interface DesignPocketFeature extends DesignFeatureBase { type: "pocket"; profile: string; body: string; distance?: DesignNumber; until?: DesignFaceReference; through?: boolean; } /** * Starts a body from one of the document's `assets`: BREP as text (`brep`) or binary * (`brep-binary`), STEP or IGES, read from the media type or the file extension when `format` is * left out. The shape is taken as the file has it. Its faces are named `face`, and `face` with * their index from 0. */ interface DesignImportFeature extends DesignFeatureBase { type: "import"; asset: string; format?: "brep" | "brep-binary" | "step" | "iges"; } /** * Runs any operation of this package by its dotted path with the kernel first, such as * `"occt.operations.offset"`, with `params` as its inputs. In `params`, `{ "body": "" }` passes a * body's shape and `{ "expr": "" }` a number. With `body` the result goes on as that * body, otherwise it starts a body named by the feature's id. An operation with a history twin * (`...WithHistory`) given bodies keeps the names of the faces it carries through, and names the * faces it makes of edges `round` (a fillet), `bevel` (a chamfer) or `side`, and its first and last * faces `start` and `end`; every other face is named `face`. An operation that makes a list of * shapes, such as `occt.shapes.face.subdivideToHexagonHoles`, makes their compound. */ interface DesignOperationFeature extends DesignFeatureBase { type: "operation"; operation: string; params: Record; body?: string; } /** * Runs a script on the document's geometry: the code of the asset `script` names, pinned by its * SHA-256, takes `params` as an operation does (`{ "body": "" }` passes a body's shape and * `{ "expr": "" }` a number), and `{ "faces": }` and * `{ "edges": }` pass the indexes a reference finds on the body it names. It * returns a shape and the roles its faces take, such as `{ shape, roles: { tooth: [3, 4] } }`, which * name those faces as other features' roles do; every other face is named `face`. With `body` the * result goes on as that body, otherwise it starts a body named by the feature's id. A kernel runs * no code: a build lists the feature under `pending`, and the caller that runs the script builds * again with its outcome. */ interface DesignScriptFeature extends DesignFeatureBase { type: "script"; script: string; params?: Record; body?: string; } /** * One feature of a design document. */ type DesignFeature = DesignSketchFeature | DesignExtrudeFeature | DesignRevolveFeature | DesignBooleanFeature | DesignFilletFeature | DesignChamferFeature | DesignLinearPatternFeature | DesignPolarPatternFeature | DesignMirrorFeature | DesignTransformFeature | DesignPushPullFeature | DesignRemoveFacesFeature | DesignSweepFeature | DesignLoftFeature | DesignShellFeature | DesignHoleFeature | DesignBossFeature | DesignPocketFeature | DesignImportFeature | DesignOperationFeature | DesignScriptFeature; /** * How a part or a material looks: `color` as `#rrggbb`, and `metallic`, `roughness` and `opacity` * from 0 to 1. `emissive` is the colour the surface gives off, as `#rrggbb`, and `emissiveStrength` * how strongly, from 0, 1 when left out. `edgeColor` is the colour of its edges as `#rrggbb`. A colour * may be `{ "expr": "..." }`, computed from the parameters. On a part, `faces` colours the faces a * reference names and `edges` the edges one names, so the colour follows them through rebuilds; a * material has neither, since it has no body to name them on. */ interface DesignAppearance { color?: DesignText; metallic?: DesignNumber; roughness?: DesignNumber; opacity?: DesignNumber; emissive?: DesignText; emissiveStrength?: DesignNumber; edgeColor?: DesignText; faces?: DesignFaceAppearance[]; edges?: DesignEdgeAppearance[]; } /** * The colour of the edges a reference names, as `#rrggbb`, over the edge colour of their part. */ interface DesignEdgeAppearance { edges: DesignEdgeReference; color?: DesignText; } /** * How the faces a reference names look, over the appearance of their part. */ interface DesignFaceAppearance { faces: DesignFaceReference; color?: DesignText; metallic?: DesignNumber; roughness?: DesignNumber; opacity?: DesignNumber; emissive?: DesignText; emissiveStrength?: DesignNumber; } /** * A value of a property: text, in which each `{expression}` is replaced by its value (`{{` and `}}` * write braces), a number, a boolean, or `{ "expr": "..." }` for a computed number. */ type DesignPropertyValue = string | number | boolean | DesignExpression; /** * Properties of a part, a material or an assembly by name. The names `partNumber`, `description`, * `finish` and `unitOfMeasure` mean what they say to the bill of materials, and the STEP export * writes every property of a part or an assembly as a user-defined property of its product. * `bomTreatment` is reserved for a later version of the format. Any other name is free, and a dotted * prefix such as `acme.costCentre` keeps a tool's names apart; revisions and suppliers belong to the * systems that manage them. */ type DesignProperties = Record; /** * A material: what it is made of, as a bill of materials and the mass need it. `density` is in * kilograms per cubic metre; `standard` names the grade, such as `EN AW-6061`. */ interface DesignMaterial extends DesignExtensible { id: string; name?: string; density?: DesignNumber; standard?: string; appearance?: DesignAppearance; properties?: DesignProperties; } /** * A product the document makes: the body it is, under a stable `id` that renaming keeps, with its * material, appearance and properties. A body no part names is construction geometry. `material` is * the id of one of the document's materials, or `{ "expr": "..." }` that gives one, so a parameter * can choose it. */ interface DesignPart extends DesignExtensible { id: string; name?: string; body: string; material?: DesignText; appearance?: DesignAppearance; properties?: DesignProperties; connectors?: DesignConnector[]; } /** * A named frame on a part, where an assembly fastens it to another: on the one flat face `on` names, * facing out of it, with its x axis along `direction` laid into the face. Its origin is where * `origin`, or the document's origin when it is left out, meets the face's plane square on, so it * stays on the face when a parameter moves the face; or where the axis of the cylindrical face * `axis` names crosses the face, such as a hole's wall; or the centre of the circular edge `centre` * names, met square on. An `axis` that names the walls of a hole with no `from` makes a set: one * connector per position of the hole, named `.`, which a component's `replicate` * places on. `direction` may be left out on a face facing along a world axis (it is then X, or Y on a * face facing along X), and is needed on any other. It follows the face through rebuilds as * references do. */ interface DesignConnector extends DesignExtensible { id: string; on: DesignFaceReference; origin?: DesignPoint; axis?: DesignFaceReference; centre?: DesignEdgeReference; direction?: DesignPoint; } /** * A file the document uses, such as a STEP model it imports: where it is, `uri` relative to the * document's own location in the store that keeps it (an absolute URL is allowed), and the SHA-256 * of its bytes, which an asset an import reads must carry, so the document's version pins the * geometry it reads and a changed file is refused. `mediaType` names the format; for OCCT's BREP it * records the format version, such as `model/vnd.occt.brep; version=3`. */ interface DesignAsset extends DesignExtensible { id: string; uri: string; sha256?: string; mediaType?: string; } /** * The units the document's numbers are in. Geometry is built from the numbers as they are; exports * and masses read the units. Angles are in degrees. Every document an assembly places is in the * assembly's length unit, so one build is in one unit. */ interface DesignUnits { length?: "mm" | "cm" | "m" | "in"; angle?: "deg"; } /** * What the document is and who made it, outside its version. `revision` is the id the store that * keeps the document gave this revision of it, which a component may pin as its source's `version`. */ interface DesignMeta { name?: string; description?: string; authors?: string[]; license?: string; generator?: string; revision?: string; } /** * The major version of each kernel API a document's `operation` features were written against, by * kernel name. Left out, the operations mean what the runner's own API version gives them. */ interface DesignApis { occt?: 1; } /** * A parametric part model as data: named `parameters` and `configurations`, an ordered list of * `features` that build bodies, and the `parts` they are (every body that is not used up, when left * out). `id` is a UUID that stays with the document for life; `units` default to millimetres and * `up` to `y`; `apis` records the kernel API its operations were written against. */ interface DesignPartDocument extends DesignExtensible { $schema?: string; schemaVersion: 1; kind?: "part"; id?: string; units?: DesignUnits; up?: "y" | "z"; meta?: DesignMeta; requires?: string[]; apis?: DesignApis; parameters?: Record; configurations?: DesignConfiguration[]; features: DesignFeature[]; parts?: DesignPart[]; materials?: DesignMaterial[]; assets?: DesignAsset[]; } /** * Where a component comes from: the `id` of a document given to the build beside this one, the * `part` of it when it is a part document (an assembly document is placed whole), its * `configuration`, and `parameters` replacing its values, each read by the kind of parameter it * sets: for a number or boolean parameter, a number, a boolean or an expression over this assembly's * parameters; for a text or choice parameter, text as it is written, or `{ "expr": "..." }` for text * this assembly's parameters compute. `version`, when given, pins the source: the document's * version (`design.versionOf`, the SHA-256 of its canonical JSON without what only editors and tools * read) or the store revision in its `meta.revision`. A document with other contents is refused, and * when several versions of one document are given, a component without a `version` is refused too. */ interface DesignComponentSource { document: string; version?: string; part?: string; configuration?: string; parameters?: Record; } /** * Which of a joint's `angle` and `offset` may move: none for `fastened`, the angle for `revolute`, * the offset for `slider`, and both for `cylindrical`. A value that may not move is still applied. */ type DesignJointType = "fastened" | "revolute" | "slider" | "cylindrical"; /** * How far the values a joint lets move may go, each as `[least, most]`: the angle in degrees and * the offset in the document's length unit. A value outside its limits is refused. */ interface DesignJointLimits { angle?: [ DesignNumber, DesignNumber ]; offset?: [ DesignNumber, DesignNumber ]; } /** * A joint of an assembly: it places `component` by one of its `connector`s against a connector of * another component or against a `frame`, the two faces meeting and facing each other with their x * axes along each other. `flip` makes them face the same way, `angle` turns the component about the * shared axis in degrees, and `offset` moves it along that axis, away from the face it meets. The * `type` says which of the two may move, within `limits`. A part component's connectors are its * part's; a sub-assembly's are the ones its document publishes. */ interface DesignJoint extends DesignExtensible { id: string; type: DesignJointType; component: string; connector: string; to: { component: string; connector: string; } | { frame: DesignFrame; }; flip?: boolean; angle?: DesignNumber; offset?: DesignNumber; limits?: DesignJointLimits; } /** * How a component is placed once on every member of a connector set: its own `connector` fastened, * as a fastened joint would, to each connector of the set `to.connector` names on `to.component`, * such as a bolt on every hole of a flange, with the joint's `flip`, `angle` and `offset`. A * `to.connector` that names one connector places one occurrence. */ interface DesignReplicate { connector: string; to: { component: string; connector: string; }; flip?: boolean; angle?: DesignNumber; offset?: DesignNumber; } /** * An axis through `origin` along `direction`, in the coordinates of the document that names it. */ interface DesignAxis { origin: DesignPoint; direction: DesignPoint; } /** * Copies of a component turned about `axis`, spaced as a polar pattern feature spaces its copies: * `count` occurrences through `angle` degrees (360 by default), a whole turn shared out evenly and * a part of one with both ends included, the first turned `start` degrees (0 by default) from where * the component is placed. The axis is in the assembly's own coordinates. */ interface DesignPolarComponentPattern { axis: DesignAxis; count: DesignNumber; angle?: DesignNumber; start?: DesignNumber; } /** * Copies of a component moved along `direction`: `count` occurrences, each `spacing` further on than * the one before, the first where the component is placed. */ interface DesignLinearComponentPattern { direction: DesignPoint; spacing: DesignNumber; count: DesignNumber; } /** * How a component is placed several times: copies turned about an axis (`polar`) or moved along a * direction (`linear`), each counted in the bill of materials. */ type DesignComponentPattern = { polar: DesignPolarComponentPattern; } | { linear: DesignLinearComponentPattern; }; /** * One placed occurrence of a part or of another assembly: its `source`, and where it goes, `at` a * frame (its own origin, X and Z axes moved onto the frame's origin, direction and normal), by the * joint that moves it, or where its source has it when neither places it. `replicate` places it * instead once on every member of a connector set, each occurrence named `.` and * counted in the bill of materials. `pattern` places copies of it where it is placed, turned about * an axis or moved along a direction, each occurrence named `.` from 1; a patterned * component is not moved by a joint, joined to or published. `suppressed` leaves it out, and * `properties` describe this occurrence, such as a position code. */ interface DesignComponent extends DesignExtensible { id: string; name?: string; source: DesignComponentSource; at?: DesignFrame; replicate?: DesignReplicate; pattern?: DesignComponentPattern; suppressed?: boolean | DesignNumber; properties?: DesignProperties; } /** * An assembly as data: named `parameters` and `configurations`, the `components` that place parts * and other assemblies, each built from a document given to the build with values this assembly's * parameters can drive, the `joints` that place them against each other, and the `connectors` it * publishes for the assemblies that place it, and its own `properties`, such as its part number, * evaluated over its parameters. Each component is moved by at most one joint, and joints form no * closed loop. */ interface DesignAssemblyDocument extends DesignExtensible { $schema?: string; schemaVersion: 1; kind: "assembly"; id?: string; units?: DesignUnits; up?: "y" | "z"; meta?: DesignMeta; requires?: string[]; parameters?: Record; configurations?: DesignConfiguration[]; components: DesignComponent[]; joints?: DesignJoint[]; connectors?: DesignAssemblyConnector[]; properties?: DesignProperties; } /** * A connector an assembly publishes, so an assembly that places it can join it and join to it: * under its own `id`, the `connector` of one of its `component`s, which may be a connector another * sub-assembly publishes. Only published connectors are seen from outside, so the components inside * can change without breaking the assemblies that use it. */ interface DesignAssemblyConnector extends DesignExtensible { id: string; component: string; connector: string; } /** * A design document: a part document, which builds parts from features, or an assembly document, * which places parts and other assemblies. */ type DesignDocument = DesignPartDocument | DesignAssemblyDocument; /** * One value `design.probeFillet` tried: the radius or distance, whether it built a valid solid, why * not when it did not, and how long the try took in milliseconds. */ interface DesignProbeAttempt { value: number; builds: boolean; ms: number; message?: string; } /** * What `design.probeFillet` found for a fillet or chamfer feature, on its body as it is just before * the feature. `between` holds the faces each of the edge reference's two face references finds and * `edges` what each edge between them is like, after the filter and before any count is checked; * `count` is the count the reference expects. `value` is the radius or distance the document gives * and `builds` whether it makes a valid solid. `largest` is the largest value tried that built and * `smallestFailing` the smallest one above it that did not, so the largest that builds lies between * them, found to about 2 percent. `attempts` lists every value tried, in order, with its time: a value * that fails just past the largest can take OCCT far longer than one that builds. `messages` says what * stopped the probe short. */ interface DesignFilletProbe { feature: string; type: "fillet" | "chamfer"; between: [ number[], number[] ]; edges: EdgeSignature[]; count: number; value?: number; builds: boolean; largest?: number; smallestFailing?: number; attempts: DesignProbeAttempt[]; messages: string[]; } /** * What `design.referenceFor` found for faces or edges picked on a built body: the `reference` a * document should store to name exactly them, hinted as `design.withHints` hints it, or why none * names them (`refused`). `nudged` lists the parameters the body depends on that were moved a little, * one at a time, to check the reference, and `lost` those after whose move it no longer found elements * like the picked ones: a reference that loses its elements under a small change is fragile. */ interface DesignReferenceFound { reference?: DesignFaceReference | DesignEdgeReference; refused?: string; nudged: string[]; lost: string[]; } /** * A shape's principal axes of inertia as a frame at its centre of mass: the direction is the axis * the shape turns about most easily, the normal the axis it resists most. The moments are about the * direction, the frame's y axis and the normal, in that order, for a density of 1. */ interface PrincipalFrame { frame: Base.Frame; moments: Base.Vector3; } /** * A box around a shape as a frame at its centre and half its size along the frame's direction, y * axis and normal. `analysis.measure.orientedBoundingBox` turns the box to fit the shape, its * direction along the longest side and its normal along the shortest; * `analysis.measure.boundingBoxInFrame` keeps the axes of the frame it is given. */ interface OrientedBoundingBox { frame: Base.Frame; halfSizes: Base.Vector3; } /** * 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; } /** * What an operation made of the faces, edges and vertices of one shape it was given, as lists of * indexes: faces as `shapes.face.getFaces` lists them, edges as `shapes.edge.getEdges` does and * vertices as `shapes.vertex.getVertices` does, of the input and the result alike. `faces[i]` holds * the result faces input face `i` became: itself where it is unchanged, its pieces where it was cut, * none where it is gone. `facesFromFaces[i]` holds the result faces made from input face `i`, such as * the inner wall a thick solid offsets from it, and `edgesFromFaces[i]` the result edges made from it, * such as where a boolean cut it. `facesFromEdges[i]` holds the result faces made from input edge `i`, * such as the round a fillet puts along it or the side a sweep makes of it; `firstFaces` and * `lastFaces` are where a sweep, a loft or a feature starts and ends. */ interface ShapeHistory { faces: number[][]; edges: number[][]; facesFromFaces: number[][]; edgesFromFaces: number[][]; facesFromEdges: number[][]; facesFromVertices: number[][]; edgesFromVertices: number[][]; firstFaces: number[]; lastFaces: number[]; } /** * A shape an operation made, with what it made of each face, edge and vertex of the shape it was * given. */ interface ShapeWithHistory { shape: T; history: ShapeHistory; } /** * A shape an operation made from several shapes, with the history of each shape it was given, in * the order they were given. */ interface ShapeWithHistories { shape: T; histories: ShapeHistory[]; } /** * The two texts of an OBJ export: `obj`, the mesh, and `mtl`, the material library its `mtllib` * line names, empty when the shapes carry no colours or materials. */ interface ObjFiles { obj: string; mtl: string; } /** * The product manufacturing information a document holds, as a STEP AP242 file brings it along: its * dimensions, its geometric tolerances and the datums the tolerances refer to. Each names the shapes * it applies to by their labels, which `assembly.query.getShapeFromLabel` reads. */ interface DocumentPmi { dimensions: PmiDimension[]; tolerances: PmiTolerance[]; datums: PmiDatum[]; } /** * A dimension: its label, its kind, such as `Size_Diameter` or `Location_LinearDistance`, its name, * and its nominal `value`. `upperTolerance` and `lowerTolerance`, both positive, say how far above * and below the value it may lie; `lowerBound` and `upperBound` give a range instead, whose middle is * the value. `shapes` and `otherShapes` hold the labels of the shapes it measures from and to. * Lengths are in the document's length unit and angles in degrees; a value that is not finite reads * NaN. */ interface PmiDimension { label: string; type: string; name: string; value: number; upperTolerance?: number | undefined; lowerTolerance?: number | undefined; lowerBound?: number | undefined; upperBound?: number | undefined; shapes: string[]; otherShapes: string[]; } /** * A geometric tolerance: its label, its kind, such as `Flatness` or `Position`, its name, its value * in the document's length unit (NaN when not finite), the labels of the shapes it applies to, and * the labels of the datums it refers to, which `datums` of the same `DocumentPmi` describes. */ interface PmiTolerance { label: string; type: string; name: string; value: number; shapes: string[]; datums: string[]; } /** * A datum: its label, its name, such as `A`, and the labels of the shapes it is taken from. */ interface PmiDatum { label: string; name: string; shapes: string[]; } /** * 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; } /** * One sub-shape with something wrong: its kind, its index as the getter of that kind numbers it * (`shapes.face.getFaces` for a face, `shapes.edge.getEdges` for an edge, `shapes.vertex.getVertices` * for a vertex, and so on), and the names of the checks it fails, such as `NotClosed`, * `BadOrientationOfSubshape` or `InvalidCurveOnSurface`. When the check itself fails, one fault names * the whole shape at index 0 with a status that starts with `CheckFail`. */ interface ValidityFault { type: OCCT.shapeTypeEnum; index: number; statuses: string[]; } /** * What a check of a shape found: whether it is a sound shape, every sub-shape with something wrong, * vertices first, then edges, wires, faces, shells and solids, and the smallest, largest and average * tolerance over its vertices, edges and faces, in model units. */ interface ValidityReport { isValid: boolean; faults: ValidityFault[]; minTolerance: number; maxTolerance: number; averageTolerance: number; } /** * The free boundaries of a shape, its edges that bound only one face joined into wires: `closed` * holds the wires that close on themselves, such as the rim of an opening, and `open` the others, * each as a compound of wires. */ interface FreeBoundaries { closed: T; open: T; } /** * What sewing made: the sewn shape, a compound of the edges left bounding only one face and their * count, how many edges ended up shared by more than two faces, how many were sewn together, and how * many degenerate edges and pieces smaller than the tolerance were found, such as the poles of a sphere. */ interface SewReport { shape: T; freeEdges: T; freeEdgeCount: number; multipleEdgeCount: number; contiguousEdgeCount: number; degeneratedCount: number; } /** * The two sides of a shape split by a plane: `front` on the side the plane's normal points to, * `back` on the other. */ interface SplitByFrameResult { front: T; back: T; } /** * The edges of a view of a shape, flattened into a drawing on the XZ plane: `visible` holds the * edges the eye sees, `hidden` the ones that faces cover. */ interface HiddenLinesResult { visible: T; hidden: T; } /** * A straight segment from the current point to `to`, which is a sketch point, or an offset from the * current point when `relative` is true. */ interface SketchLineCommand { type: "line"; id?: string; to: Base.Point2; relative?: boolean; } /** * A straight segment `length` along the sketch's x axis; a negative length runs the other way. */ interface SketchHLineCommand { type: "hLine"; id?: string; length: number; } /** * A straight segment `length` along the sketch's y axis; a negative length runs the other way. */ interface SketchVLineCommand { type: "vLine"; id?: string; length: number; } /** * A straight segment `length` long at `angle` degrees from the sketch's x axis, counterclockwise. */ interface SketchPolarLineCommand { type: "polarLine"; id?: string; length: number; angle: number; } /** * A straight segment `length` long that carries on in the direction the previous segment ended in. */ interface SketchTangentLineCommand { type: "tangentLine"; id?: string; length: number; } /** * A circular arc from the current point through `through` to `to`; with `relative` true both are * offsets from the current point. */ interface SketchThreePointArcCommand { type: "threePointArc"; id?: string; through: Base.Point2; to: Base.Point2; relative?: boolean; } /** * A circular arc to `to` that leaves the current point in the direction the previous segment ended * in. */ interface SketchTangentArcCommand { type: "tangentArc"; id?: string; to: Base.Point2; relative?: boolean; } /** * A circular arc to `to` whose middle stands `sagitta` away from the straight line between its ends: * a positive sagitta bulges to the left of the direction of travel, a negative one to the right. */ interface SketchSagittaArcCommand { type: "sagittaArc"; id?: string; to: Base.Point2; sagitta: number; relative?: boolean; } /** * A circular arc to `to` given by its bulge, as DXF files write arcs: the tangent of a quarter of the * angle it sweeps, positive counterclockwise. */ interface SketchBulgeArcCommand { type: "bulgeArc"; id?: string; to: Base.Point2; bulge: number; relative?: boolean; } /** * A quadratic Bezier segment to `to`, pulled toward `control`. */ interface SketchQuadraticCommand { type: "quadratic"; id?: string; control: Base.Point2; to: Base.Point2; relative?: boolean; } /** * A cubic Bezier segment to `to`, leaving toward `control1` and arriving from `control2`. */ interface SketchCubicCommand { type: "cubic"; id?: string; control1: Base.Point2; control2: Base.Point2; to: Base.Point2; relative?: boolean; } /** * A straight segment back to the start point, which closes the outline; when the pen is already * there, it only closes it. */ interface SketchCloseCommand { type: "close"; id?: string; } /** * Rounds the corner where the segment before it meets the segment after it with an arc of `radius`; * after `close`, the corner at the start point. */ interface SketchFilletCornerCommand { type: "filletCorner"; id?: string; radius: number; } /** * Bevels the corner where the segment before it meets the segment after it, cutting `distance` off * each, measured along the segments; after `close`, the corner at the start point. */ interface SketchChamferCornerCommand { type: "chamferCorner"; id?: string; distance: number; } /** * One move of the pen that `sketch.pen` draws: a line, an arc, a Bezier segment, closing the outline, * or rounding or beveling a corner. `type` says which; `id` names the command in the segments * `sketch.penWithSegments` reports. */ type SketchCommand = SketchLineCommand | SketchHLineCommand | SketchVLineCommand | SketchPolarLineCommand | SketchTangentLineCommand | SketchThreePointArcCommand | SketchTangentArcCommand | SketchSagittaArcCommand | SketchBulgeArcCommand | SketchQuadraticCommand | SketchCubicCommand | SketchCloseCommand | SketchFilletCornerCommand | SketchChamferCornerCommand; /** * The edges one command drew: `id` is the command's own id, or its position in the list as text when * it has none, `command` is that position, and `edges` are edge indexes as `shapes.edge.getEdges` * counts them on the result. */ interface SketchSegment { id: string; command: number; edges: number[]; } /** * An outline `sketch.penWithSegments` drew, with the edges each command drew; commands that drew * nothing, such as a `close` where the pen already was, are left out. */ interface SketchWithSegments { shape: T; segments: SketchSegment[]; } /** * 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 { /** * The level of detail picked by `things.enums.lodEnum`, which returns `lod` unchanged for a model's * `lod` input. */ declare class LodDto { /** * The level of detail to pick: low, middle or high. * @default low */ lod: lodEnum; } /** * The level of detail a finished model is built at: low, middle or high. Each model that takes it * decides what a lower level leaves out, and a lower level builds less geometry, so it is faster. */ declare enum lodEnum { /** * The least geometry, often outlines only, built fastest. */ low = "low", /** * Main surfaces without the finest parts. */ middle = "middle", /** * Every part the model has, built slowest. */ 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 { /** * What `things.architecture.houses.zenHideout.create` returns: the whole house in `compound`, its parts by * kind with their sizes and shapes, the drawing groups, every shape with its id, and the inputs used. */ declare class ZenHideoutData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result. */ name: string; /** * The inputs the house was built from. `drawModel` reads the detail level and skin opacity from here. */ originalInputs?: ZenHideoutDto; /** * Every part of the house as one compound, turned by `rotation` and moved to `origin`. */ compound?: T; /** * Every shape of the house with an id, the compound first. `dispose` deletes each of them. */ shapes?: Models.OCCT.ShapeWithId[]; /** * The house split into the groups that are drawn with different materials. Missing at low detail. */ drawingPart?: ZenHideoutDrawingPart; /** * The wall sections between columns and at the wing ends, each with exterior and interior panels and * a window. */ sandwitchPartsBetweenColumns?: Things.Architecture.SandwitchPart[]; /** * The facade panels that wrap the outer corners at a right angle. */ cornerParts?: Things.Architecture.CornerPart[]; /** * The columns along the walls. Built only at high and low detail; at low detail each is a line. */ columnParts?: Things.Architecture.ColumnPart[]; /** * The roof of each wing, with its covers, and at higher detail its panels and beams. */ roofParts?: Things.Architecture.RoofPart[]; /** * The entrance corner, with interior and exterior panels, a corner window and stairs. */ entranceCorner?: Things.Architecture.CornerEntrancePart; /** * The terrace corner, with interior and exterior panels, a corner window and stairs. */ entranceTerrace?: Things.Architecture.CornerEntrancePart; /** * The ground floor slab and the floor slab of each wing's roof space; at low detail only the ground * floor outline. */ floors?: Things.Architecture.FloorPart[]; /** * The ceilings of the wings; at low detail their outlines. */ ceilings?: Things.Architecture.CeilingPart[]; } /** * The Zen Hideout by drawing group, each a compound of every element of one kind. The same keys hold * shapes in a result and materials, meshes or settings while the house is drawn. */ declare class ZenHideoutDrawingPartShapes { /** * The glass of every window. */ windowGlassCompound?: T; /** * The frames that hold the glass of every window. */ glassFramesCompound?: T; /** * The outer frames of every window, as deep as the wall. */ windowFrameCompound?: T; /** * The ceiling and roof beams. Built only at high detail. */ beamsCompound?: T; /** * The columns. Built only at high detail. */ columnsCompound?: T; /** * The exterior facade panels of the walls, the corners and the entrances. */ firstFloorExteriorPanelsCompound?: T; /** * The interior panels of the walls and the entrances. */ firstFloorInteriorPanelsCompound?: T; /** * The exterior panels that close the roof spaces of both wings. */ roofExteriorPanelsCompound?: T; /** * The interior panels that close the roof spaces of both wings. */ roofInteriorPanelsCompound?: T; /** * The roof cover of the first wing. */ roofCoverFirstCompound?: T; /** * The roof cover of the second wing. */ roofCoverSecondCompound?: T; /** * The floor slabs. */ floorCompound?: T; /** * The ceilings. */ ceilingCompound?: T; /** * The stairs at the entrance and the terrace. */ stairsCompound?: T; } /** * The Zen Hideout split into the groups that are drawn with different materials, returned in * `ZenHideoutData.drawingPart` at middle and high detail. */ declare class ZenHideoutDrawingPart { /** * One entry per drawing group, from the window glass to the stairs. */ shapes?: ZenHideoutDrawingPartShapes; } /** * The property list of the Zen Hideout with its value types left open; `ZenHideoutDto` fills them in * with numbers, a detail level and a point, and documents each property. */ declare class ZenHideoutDtoBase { /** * Width of the first wing. */ widthFirstWing: T; /** * Length of the first wing. */ lengthFirstWing: T; /** * Width of the terrace corner. */ terraceWidth: T; /** * Width of the second wing. */ widthSecondWing: T; /** * Length of the second wing. */ lengthSecondWing: T; /** * Height of the walls. */ heightWalls: T; /** * Slope of the first wing's roof. */ roofAngleFirstWing: T; /** * Slope of the second wing's roof. */ roofAngleSecondWing: T; /** * Extra height before the roof starts. */ roofOffset: T; /** * Roof overhang on the terrace side. */ roofInsideOverhang: T; /** * Largest spacing of the roof attachment beams. */ roofMaxDistAttachmentBeams: T; /** * Width of the roof attachment beams. */ roofAttachmentBeamWidth: T; /** * Height of the roof attachment beams. */ roofAttachmentBeamHeight: T; /** * Roof overhang on the outer side. */ roofOutsideOverhang: T; /** * Side of the square columns. */ columnSize: T; /** * Height of the ceiling beams. */ ceilingBeamHeight: T; /** * Width of the ceiling beams. */ ceilingBeamWidth: T; /** * Number of ceiling beams per column spacing. */ nrCeilingBeamsBetweenColumns: T; /** * Spacing of the columns. */ distBetweenColumns: T; /** * Thickness of the floor slabs. */ floorHeight: T; /** * Height of the floor above the ground. */ groundLevel: T; /** * Thickness of the facade panels. */ facadePanelThickness: T; /** * Side margin of each window. */ windowWidthOffset: T; /** * Top margin of each window. */ windowHeightOffset: T; /** * Width of the window frames. */ windowFrameThickness: T; /** * Width of the frames around the glass. */ windowGlassFrameThickness: T; /** * How much of the house is built. */ lod: U; /** * Turn around the vertical axis. */ rotation?: T; /** * Point the house is moved to. */ origin?: V; } /** * Parameters of `things.architecture.houses.zenHideout.create`. The wing and wall sizes lay out the L-shaped * plan, the roof, column, beam, floor and window values shape the parts, `lod` and `skinOpacity` set detail * and look, and `rotation` and `origin` place the house. */ 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, along Z, in model units. * @default 4 * @minimum 3 * @maximum Infinity * @step 0.5 */ widthFirstWing: number; /** * Length of the first wing from the inner corner of the L, along X, in model units. * @default 10 * @minimum 3 * @maximum Infinity * @step 0.5 */ lengthFirstWing: number; /** * Width of the terrace corner in the inside of the L, in model units. * @default 3 * @minimum 1 * @maximum Infinity * @step 0.25 */ terraceWidth: number; /** * Width of the second wing, along X, in model units. * @default 5 * @minimum 3 * @maximum Infinity * @step 0.5 */ widthSecondWing: number; /** * Length of the second wing from the inner corner of the L, along Z, in model units. * @default 10 * @minimum 3 * @maximum Infinity * @step 0.5 */ lengthSecondWing: number; /** * Height of the walls from the floor to the ceiling, in model units. * @default 3 * @minimum 3 * @maximum Infinity * @step 0.1 */ heightWalls: number; /** * Slope of the first wing's single-slope roof, in degrees. * @default 15 * @minimum 5 * @maximum Infinity * @step 5 */ roofAngleFirstWing: number; /** * Slope of the second wing's single-slope roof, in degrees. * @default 25 * @minimum 5 * @maximum Infinity * @step 5 */ roofAngleSecondWing: number; /** * Extra height between the top of the ceiling beams and where the roof starts, in model units. * @default 0.5 * @minimum 0.2 * @maximum Infinity * @step 0.25 */ roofOffset: number; /** * How far the roofs reach past the walls on the inside of the L, where the terrace is, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.25 */ roofInsideOverhang: number; /** * Largest spacing of the attachment beams that run across the roof slope, in model units. The beams * are spread evenly at this spacing or less. * @default 0.8 * @minimum 0.1 * @maximum Infinity * @step 0.25 */ roofMaxDistAttachmentBeams: number; /** * Width of the roof attachment beams, in model units. * @default 0.2 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ roofAttachmentBeamWidth: number; /** * Height of the roof attachment beams, in model units. It also adds to the height of the roof covers. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ roofAttachmentBeamHeight: number; /** * How far the roofs reach past the walls on the outside of the L, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.25 */ roofOutsideOverhang: number; /** * Side of the square columns, in model units. It also sets the wall depth and the band above the walls. * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ columnSize: number; /** Height of the ceiling beams, in model units. It also sets the height of the main roof beams. * @default 0.25 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ ceilingBeamHeight: number; /** Width of the ceiling beams, in model units. * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ ceilingBeamWidth: number; /** Number of ceiling beams in each column spacing. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ nrCeilingBeamsBetweenColumns: number; /** Spacing of the columns along the walls, in model units. Each wall section between two columns gets * one window. * @default 2 * @minimum 0.5 * @maximum Infinity * @step 0.25 */ distBetweenColumns: number; /** Thickness of the floor slabs, in model units. * @default 0.1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ floorHeight: number; /** Height of the floor above the ground, in model units. The columns and facade panels reach down to * the ground, and the entrance stairs climb this height. * @default 0.6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ groundLevel: number; /** Thickness of the facade panels, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ facadePanelThickness: number; /** Margin on each side of a window inside its wall section, in model units, added to half a column. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowWidthOffset: number; /** How much shorter each window is than its wall section at the top, in model units, added to the * column size. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowHeightOffset: number; /** Width of the outer window frames, in model units. * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowFrameThickness: number; /** Width of the frames around the glass, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowGlassFrameThickness: number; /** * How much of the house is built: high builds every part with columns and beams, middle leaves the * columns and beams out, and low builds only outlines and lines. * @default high */ lod: Things.Enums.lodEnum; /** * Opacity of the glass, panels, roof covers, floors and ceilings when the house is drawn at high detail. * 1 is opaque. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ skinOpacity: number; /** * Turn of the house around the vertical Y axis through its inner corner, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Point the inner corner of the L, at floor level, is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } } } /** * One beam of a building model, such as a ceiling, roof or attachment beam of the Zen Hideout, with its * box sizes and its solid. */ declare class BeamPart { /** * Unique id of the beam: its name followed by its index. */ id?: string; /** * Kind of beam, such as "ceiling-beam-first-wing". */ name?: string; /** * Size of the beam's box along its first side, in model units. */ width?: number; /** * Size of the beam's box along its second side, in model units. */ length?: number; /** * Height of the beam's box, in model units. */ height?: number; /** * The beam solid. */ shapes?: { beam?: T; }; } /** * One ceiling of a building model, such as a wing ceiling of the Zen Hideout: its outline points, area, * thickness and shape. */ declare class CeilingPart { /** * Id of the ceiling, when the model sets one. */ id?: string; /** * Name of the ceiling, such as "ceiling-part-1". */ name?: string; /** * Area of the ceiling's face, in square model units. Not set for an outline-only ceiling. */ area?: number; /** * Thickness of the ceiling slab, in model units. */ thickness?: number; /** * Corner points of the ceiling's outline in plan, before it is raised to ceiling height. */ polygonPoints?: Inputs.Base.Point3[]; /** * The ceiling slab, or its outline at low detail. */ shapes?: { compound?: T; }; } /** * One column of a building model, such as a wall column of the Zen Hideout, with its sizes and its solid. */ declare class ColumnPart { /** * Id of the column, when the model sets one. */ id?: string; /** * Name of the column, such as "column-part". */ name?: string; /** * Size of the column along X, in model units. */ width?: number; /** * Size of the column along Z, in model units. */ length?: number; /** * Height of the column from the ground, in model units. */ height?: number; /** * The column solid, or a line at low detail. */ shapes?: { column?: T; }; } /** * The sizes of an L-shaped entrance corner of a building model: exterior and interior panels, a corner * window cut through them and optional stairs. The Zen Hideout fills it in for its entrance and terrace. */ declare class CornerEntranceDto { /** * Width of the stairs' top landing along the first leg, in model units. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ widthFirstWing: number; /** * Width of the stairs' top landing along the second leg, in model units. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ widthSecondWing: number; /** * Length of the stairs along the first leg, in model units. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthStairFirstWing: number; /** * Length of the stairs along the second leg, in model units. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthStairSecondWing: number; /** * Length of the wall along the first leg, in model units. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthWallFirstWing: number; /** * Length of the wall along the second leg, in model units. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthWallSecondWing: number; /** Thickness of the exterior and interior panels, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ facadePanelThickness: number; /** Thickness of the wall between the panels, in model units. * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ wallThickness: number; /** Height of the exterior panels above the floor, in model units. They also reach down by * `stairTotalHeight`. * @default 3 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ wallHeightExterior: number; /** Height of the interior panels, in model units. The corner window height is taken from it. * @default 3 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ wallHeightInterior: number; /** How much shorter the corner window is than the interior panels, at its top, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowFrameOffsetTop: number; /** Width of the corner window's outer frame, in model units. * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ windowFrameThickness: number; /** Width of the corner window's glass frame, in model units. * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ glassFrameThickness: number; /** Width of a door opening. Building the entrance does not use it yet. * @default 1 * @minimum 0.7 * @maximum Infinity * @step 0.1 */ doorWidth: number; /** How much shorter each leg of the corner window is than the wall, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowWidthOffset: number; /** Height the stairs climb to the floor, in model units. * @default 1 * @minimum 0.7 * @maximum Infinity * @step 0.1 */ stairTotalHeight: number; /** Whether the stairs are built. * @default false */ createStair: boolean; /** * When true, the panels and stairs are built on the other side of the corner, so outside and inside * swap. * @default false */ flipDirection: boolean; /** * Turn of the entrance around the vertical axis, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Point at the corner of the exterior panels, at floor level. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } /** * An L-shaped entrance corner of a building model: exterior and interior panels with a corner window cut * through them, and optional stairs, such as the entrance and terrace corners of the Zen Hideout. */ declare class CornerEntrancePart { /** * Id of the entrance, when the model sets one. */ id?: string; /** * Name of the entrance, such as "corner-entrance-part". */ name?: string; /** * Thickness of the panels, in model units, when the model sets it. */ panelThickness?: number; /** * Width of the first exterior panel, in model units, when the model sets it. */ widthPanelExteriorOne?: number; /** * Height of the exterior panels, in model units, when the model sets it. */ heightPanelsExterior?: number; /** * The stairs in front of the entrance. Missing when no stairs were built. */ stair?: CornerStairPart; /** * The L-shaped corner window. */ window?: WindowCornerPart; /** * The exterior and interior panels with the window cut out, and everything together as `compound`. */ shapes?: { compound?: T; panelExterior?: T; panelInterior?: T; }; } /** * One outer corner of a building model's facade, such as a corner of the Zen Hideout: two panels that * meet at a right angle, with their sizes. */ declare class CornerPart { /** * Id of the corner, when the model sets one. */ id?: string; /** * Name of the corner, such as "corner-part". */ name?: string; /** * Width of each of the two panels, in model units. */ widthPanel?: number; /** * Height of the panels, in model units. */ heightPanel?: number; /** * Thickness of the panels, in model units. */ thicknessPanel?: number; /** * The two panels of the corner as one shape. */ shapes?: { corner?: T; }; } /** * The sizes of L-shaped stairs of a building model, which step down from a landing at `origin`, each step * lower and wider than the one above. The Zen Hideout fills it in for its entrance and terrace stairs. */ declare class CornerStairDto { /** * When true, the steps grow toward the inside of the L instead of the outside. Such stairs can * intersect themselves. * @default false */ invert: boolean; /** * Width of the top landing along the first leg, in model units. Each lower step is wider by its depth. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ widthFirstLanding: number; /** * Width of the top landing along the second leg, in model units. Each lower step is wider by its depth. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ widthSecondLanding: number; /** * Length of the first leg of the L, in model units. * @default 2 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthFirstWing: number; /** * Length of the second leg of the L, in model units. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ lengthSecondWing: number; /** * Largest step height wanted, in model units. The step count is the total height divided by it, * rounded up, so every step is this high or lower. * @default 0.25 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ maxWishedStepHeight: number; /** * Ratio of step depth to step height. Building the stairs does not use it yet and always uses 1.35. * @default 0.25 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ stepHeightWidthProportion: number; /** * Height the stairs climb, from the ground to the landing, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ totalHeight: number; /** * Turn of the L around the vertical axis, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Point at the corner of the top landing. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } /** * L-shaped stairs of a building model, built from `CornerStairDto`: the inputs, the step count and * sizes worked out from them, and the stairs as one solid. */ declare class CornerStairPart extends CornerStairDto { /** * Id of the stairs, when the model sets one. */ id?: string; /** * Name of the stairs, such as "corner-stair-part". */ name?: string; /** * Number of steps: the total height divided by the largest wished step height, rounded up. */ steps?: number; /** * Depth each step adds to the one above it, in model units: 1.35 times the step height. */ stepWidth?: number; /** * Height of each step, in model units: the total height divided by the number of steps. */ stepHeight?: number; /** * All steps joined into one solid. */ shapes?: { stair?: T; }; } /** * One floor of a building model, such as the ground floor of the Zen Hideout: its outline points, area, * thickness and slab. */ declare class FloorPart { /** * Id of the floor, when the model sets one. */ id?: string; /** * Name of the floor, such as "ground-floor-part". */ name?: string; /** * Area of the floor's top face, in square model units. Not set for an outline-only floor. */ area?: number; /** * Thickness of the floor slab, in model units. */ thickness?: number; /** * Corner points of the floor's outline in plan. */ polygonPoints?: Inputs.Base.Point3[]; /** * The floor slab, or its outline at low detail. */ shapes?: { compound?: T; }; } /** * What `things.architecture.houses.zenHideout.create` returns: the whole house in `compound`, its parts by * kind with their sizes and shapes, the drawing groups, every shape with its id, and the inputs used. */ declare class ZenHideoutData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result. */ name: string; /** * The inputs the house was built from. `drawModel` reads the detail level and skin opacity from here. */ originalInputs?: ZenHideoutDto; /** * Every part of the house as one compound, turned by `rotation` and moved to `origin`. */ compound?: T; /** * Every shape of the house with an id, the compound first. `dispose` deletes each of them. */ shapes?: Models.OCCT.ShapeWithId[]; /** * The house split into the groups that are drawn with different materials. Missing at low detail. */ drawingPart?: ZenHideoutDrawingPart; /** * The wall sections between columns and at the wing ends, each with exterior and interior panels and * a window. */ sandwitchPartsBetweenColumns?: Things.Architecture.SandwitchPart[]; /** * The facade panels that wrap the outer corners at a right angle. */ cornerParts?: Things.Architecture.CornerPart[]; /** * The columns along the walls. Built only at high and low detail; at low detail each is a line. */ columnParts?: Things.Architecture.ColumnPart[]; /** * The roof of each wing, with its covers, and at higher detail its panels and beams. */ roofParts?: Things.Architecture.RoofPart[]; /** * The entrance corner, with interior and exterior panels, a corner window and stairs. */ entranceCorner?: Things.Architecture.CornerEntrancePart; /** * The terrace corner, with interior and exterior panels, a corner window and stairs. */ entranceTerrace?: Things.Architecture.CornerEntrancePart; /** * The ground floor slab and the floor slab of each wing's roof space; at low detail only the ground * floor outline. */ floors?: Things.Architecture.FloorPart[]; /** * The ceilings of the wings; at low detail their outlines. */ ceilings?: Things.Architecture.CeilingPart[]; } /** * The Zen Hideout by drawing group, each a compound of every element of one kind. The same keys hold * shapes in a result and materials, meshes or settings while the house is drawn. */ declare class ZenHideoutDrawingPartShapes { /** * The glass of every window. */ windowGlassCompound?: T; /** * The frames that hold the glass of every window. */ glassFramesCompound?: T; /** * The outer frames of every window, as deep as the wall. */ windowFrameCompound?: T; /** * The ceiling and roof beams. Built only at high detail. */ beamsCompound?: T; /** * The columns. Built only at high detail. */ columnsCompound?: T; /** * The exterior facade panels of the walls, the corners and the entrances. */ firstFloorExteriorPanelsCompound?: T; /** * The interior panels of the walls and the entrances. */ firstFloorInteriorPanelsCompound?: T; /** * The exterior panels that close the roof spaces of both wings. */ roofExteriorPanelsCompound?: T; /** * The interior panels that close the roof spaces of both wings. */ roofInteriorPanelsCompound?: T; /** * The roof cover of the first wing. */ roofCoverFirstCompound?: T; /** * The roof cover of the second wing. */ roofCoverSecondCompound?: T; /** * The floor slabs. */ floorCompound?: T; /** * The ceilings. */ ceilingCompound?: T; /** * The stairs at the entrance and the terrace. */ stairsCompound?: T; } /** * The Zen Hideout split into the groups that are drawn with different materials, returned in * `ZenHideoutData.drawingPart` at middle and high detail. */ declare class ZenHideoutDrawingPart { /** * One entry per drawing group, from the window glass to the stairs. */ shapes?: ZenHideoutDrawingPartShapes; } /** * The property list of the Zen Hideout with its value types left open; `ZenHideoutDto` fills them in * with numbers, a detail level and a point, and documents each property. */ declare class ZenHideoutDtoBase { /** * Width of the first wing. */ widthFirstWing: T; /** * Length of the first wing. */ lengthFirstWing: T; /** * Width of the terrace corner. */ terraceWidth: T; /** * Width of the second wing. */ widthSecondWing: T; /** * Length of the second wing. */ lengthSecondWing: T; /** * Height of the walls. */ heightWalls: T; /** * Slope of the first wing's roof. */ roofAngleFirstWing: T; /** * Slope of the second wing's roof. */ roofAngleSecondWing: T; /** * Extra height before the roof starts. */ roofOffset: T; /** * Roof overhang on the terrace side. */ roofInsideOverhang: T; /** * Largest spacing of the roof attachment beams. */ roofMaxDistAttachmentBeams: T; /** * Width of the roof attachment beams. */ roofAttachmentBeamWidth: T; /** * Height of the roof attachment beams. */ roofAttachmentBeamHeight: T; /** * Roof overhang on the outer side. */ roofOutsideOverhang: T; /** * Side of the square columns. */ columnSize: T; /** * Height of the ceiling beams. */ ceilingBeamHeight: T; /** * Width of the ceiling beams. */ ceilingBeamWidth: T; /** * Number of ceiling beams per column spacing. */ nrCeilingBeamsBetweenColumns: T; /** * Spacing of the columns. */ distBetweenColumns: T; /** * Thickness of the floor slabs. */ floorHeight: T; /** * Height of the floor above the ground. */ groundLevel: T; /** * Thickness of the facade panels. */ facadePanelThickness: T; /** * Side margin of each window. */ windowWidthOffset: T; /** * Top margin of each window. */ windowHeightOffset: T; /** * Width of the window frames. */ windowFrameThickness: T; /** * Width of the frames around the glass. */ windowGlassFrameThickness: T; /** * How much of the house is built. */ lod: U; /** * Turn around the vertical axis. */ rotation?: T; /** * Point the house is moved to. */ origin?: V; } /** * Parameters of `things.architecture.houses.zenHideout.create`. The wing and wall sizes lay out the L-shaped * plan, the roof, column, beam, floor and window values shape the parts, `lod` and `skinOpacity` set detail * and look, and `rotation` and `origin` place the house. */ 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, along Z, in model units. * @default 4 * @minimum 3 * @maximum Infinity * @step 0.5 */ widthFirstWing: number; /** * Length of the first wing from the inner corner of the L, along X, in model units. * @default 10 * @minimum 3 * @maximum Infinity * @step 0.5 */ lengthFirstWing: number; /** * Width of the terrace corner in the inside of the L, in model units. * @default 3 * @minimum 1 * @maximum Infinity * @step 0.25 */ terraceWidth: number; /** * Width of the second wing, along X, in model units. * @default 5 * @minimum 3 * @maximum Infinity * @step 0.5 */ widthSecondWing: number; /** * Length of the second wing from the inner corner of the L, along Z, in model units. * @default 10 * @minimum 3 * @maximum Infinity * @step 0.5 */ lengthSecondWing: number; /** * Height of the walls from the floor to the ceiling, in model units. * @default 3 * @minimum 3 * @maximum Infinity * @step 0.1 */ heightWalls: number; /** * Slope of the first wing's single-slope roof, in degrees. * @default 15 * @minimum 5 * @maximum Infinity * @step 5 */ roofAngleFirstWing: number; /** * Slope of the second wing's single-slope roof, in degrees. * @default 25 * @minimum 5 * @maximum Infinity * @step 5 */ roofAngleSecondWing: number; /** * Extra height between the top of the ceiling beams and where the roof starts, in model units. * @default 0.5 * @minimum 0.2 * @maximum Infinity * @step 0.25 */ roofOffset: number; /** * How far the roofs reach past the walls on the inside of the L, where the terrace is, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.25 */ roofInsideOverhang: number; /** * Largest spacing of the attachment beams that run across the roof slope, in model units. The beams * are spread evenly at this spacing or less. * @default 0.8 * @minimum 0.1 * @maximum Infinity * @step 0.25 */ roofMaxDistAttachmentBeams: number; /** * Width of the roof attachment beams, in model units. * @default 0.2 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ roofAttachmentBeamWidth: number; /** * Height of the roof attachment beams, in model units. It also adds to the height of the roof covers. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ roofAttachmentBeamHeight: number; /** * How far the roofs reach past the walls on the outside of the L, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.25 */ roofOutsideOverhang: number; /** * Side of the square columns, in model units. It also sets the wall depth and the band above the walls. * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ columnSize: number; /** Height of the ceiling beams, in model units. It also sets the height of the main roof beams. * @default 0.25 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ ceilingBeamHeight: number; /** Width of the ceiling beams, in model units. * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ ceilingBeamWidth: number; /** Number of ceiling beams in each column spacing. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ nrCeilingBeamsBetweenColumns: number; /** Spacing of the columns along the walls, in model units. Each wall section between two columns gets * one window. * @default 2 * @minimum 0.5 * @maximum Infinity * @step 0.25 */ distBetweenColumns: number; /** Thickness of the floor slabs, in model units. * @default 0.1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ floorHeight: number; /** Height of the floor above the ground, in model units. The columns and facade panels reach down to * the ground, and the entrance stairs climb this height. * @default 0.6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ groundLevel: number; /** Thickness of the facade panels, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ facadePanelThickness: number; /** Margin on each side of a window inside its wall section, in model units, added to half a column. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowWidthOffset: number; /** How much shorter each window is than its wall section at the top, in model units, added to the * column size. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowHeightOffset: number; /** Width of the outer window frames, in model units. * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowFrameThickness: number; /** Width of the frames around the glass, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowGlassFrameThickness: number; /** * How much of the house is built: high builds every part with columns and beams, middle leaves the * columns and beams out, and low builds only outlines and lines. * @default high */ lod: Things.Enums.lodEnum; /** * Opacity of the glass, panels, roof covers, floors and ceilings when the house is drawn at high detail. * 1 is opaque. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ skinOpacity: number; /** * Turn of the house around the vertical Y axis through its inner corner, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Point the inner corner of the L, at floor level, is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } /** * The beams of one roof of a building model, such as a wing roof of the Zen Hideout, grouped by kind. * They are built only at high detail. */ declare class RoofBeamsPart { /** * The ceiling beams the roof structure rests on. */ beamsCeiling?: BeamPart[]; /** * The vertical beams on the high side of the roof. */ beamsVerticalHigh?: BeamPart[]; /** * The vertical beams on the low side of the roof. */ beamsVerticalLow?: BeamPart[]; /** * The sloped beams that carry the roof. */ beamsTop?: BeamPart[]; /** * The attachment beams that run across the slope under the roof cover. */ beamsAttachment: BeamPart[]; /** * All the beams together as `compound`. */ shapes?: { compound?: T; }; } /** * The sizes of a single-slope roof cover of a building model: a folded sheet laid over the roof, tilted * by `roofAngle` and running along X for `roofLength`. The Zen Hideout fills it in for each wing. */ declare class RoofCoverOneSidedDto { /** * Name given to the cover. * @default roof-cover */ name: string; /** * Slope of the cover, in degrees. * @default 15 * @minimum 0 * @maximum Infinity * @step 5 */ roofAngle: number; /** * Length of the cover along the ridge, along X, in model units. * @default 3 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ roofLength: number; /** * Width of the cover down the slope, in model units, before the inside and outside overhangs are * added to it. * @default 3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ roofWidth: number; /** * How far the cover reaches past the walls on the outside, in model units. * @default 0.5 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ roofOutsideOverhang: number; /** * How far the cover reaches past the walls on the inside, in model units. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ roofInsideOverhang: number; /** * How far the cover's folded ends reach past the facade at each end, in model units. * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ roofOverhangFacade: number; /** * Thickness of the cover sheet, in model units. * @default 0.05 * @minimum 0.001 * @maximum Infinity * @step 0.01 */ roofThickness: number; /** * Height of the folded sides of the cover, in model units. * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ roofCoverHeight: number; /** * Turn of the cover around the vertical axis, in degrees, set when the cover is placed. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * How much detail the cover has. Low detail builds only the profile swept along the length; the * other levels add the folded ends. * @default high */ lod: Things.Enums.lodEnum; /** * Point the cover is moved to, set when the cover is placed. * @default [0, 0, 0] */ center: Inputs.Base.Point3; /** * Direction the cover's up axis points along, set when the cover is placed. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } /** * One roof cover of a building model, built from `RoofCoverOneSidedDto`: the inputs, with the placement * that was applied, and the cover shape. */ declare class RoofCoverPart extends RoofCoverOneSidedDto { /** * Id of the cover, when the model sets one. */ id?: string; /** * The cover shape, placed on the roof. */ shapes?: { compound?: T; }; } /** * The panels that close the space under one roof of a building model, such as a wing of the Zen Hideout, * on its inner side, its outer side and its ends, with compounds of their exterior and interior layers. */ declare class RoofPanelPart { /** * Id of the panel group, when the model sets one. */ id?: string; /** * Name of the panel group, when the model sets one. */ name?: string; /** * Panels on the inner side of the wing. */ innerPanels?: SandwitchPart[]; /** * Narrow panels that fill in between the panels on the inner side. */ innerFillPanels?: SandwitchPart[]; /** * Panels on the outer side of the wing. */ outerPanels?: SandwitchPart[]; /** * Narrow panels that fill in between the panels on the outer side. */ outerFillPanels?: SandwitchPart[]; /** * Panels that close the sloped ends of the wing, cut to the roof profile. */ ends?: SandwitchPartFlex[]; /** * Compounds of the exterior and interior layers of each panel group, and every panel as `compound`. */ shapes?: { compoundInnerExteriorPanels?: T; compoundInnerInteriorPanels?: T; compoundInnerFillExteriorPanels?: T; compoundInnerFillInteriorPanels?: T; compoundOuterExteriorPanels?: T; compoundOuterInteriorPanels?: T; compoundOuterFillExteriorPanels?: T; compoundOuterFillInteriorPanels?: T; compoundEndsInteriorPanels?: T; compoundEndsExteriorPanels?: T; compound?: T; }; } /** * The roof of one wing of a building model, such as the Zen Hideout, gathering its beams, the panels * under it and its covers. How many of them are built depends on the level of detail. */ declare class RoofPart { /** * Id of the roof, when the model sets one. */ id?: string; /** * Name of the roof, such as "roof-first-wing-part". */ name?: string; /** * The roof's beams. Built only at high detail. */ beams: RoofBeamsPart; /** * The panels that close the space under the roof. Built at middle and high detail. */ panels?: RoofPanelPart; /** * The roof covers. */ covers?: RoofCoverPart[]; /** * Everything built for this roof together as `compound`. */ shapes?: { compound?: T; }; } /** * The sizes of a wall section of a building model: an exterior and an interior panel on either side of * a wall gap, with an optional window cut through both. The Zen Hideout fills it in for each section. */ declare class SandwitchPanelDto { /** Name given to the wall section. * @default sandwitch-panel */ name: string; /** Whether a window is cut through the panels. * @default true */ createWindow: boolean; /** Whether the interior panel is built. * @default true */ createInnerPanel: boolean; /** Whether the exterior panel is built. * @default true */ createExteriorPanel: boolean; /** Gap between the exterior and interior panels, where the wall sits, along X, in model units. * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ wallWidth: number; /** Width of the exterior panel along Z, centered on the section, in model units. * @default 0.4 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ exteriorPanelWidth: number; /** Height of the exterior panel, in model units. * @default 3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ exteriorPanelHeight: number; /** Thickness of the exterior panel, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ exteriorPanelThickness: number; /** How far the exterior panel reaches below the section's base, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ exteriorPanelBottomOffset: number; /** Width of the interior panel along Z, centered on the section, in model units. The window width is * taken from it. * @default 0.4 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ interiorPanelWidth: number; /** Height of the interior panel, in model units. The window height is taken from it. * @default 3 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ interiorPanelHeight: number; /** Thickness of the interior panel, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ interiorPanelThickness: number; /** How far the interior panel reaches below the section's base, in model units. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ interiorPanelBottomOffset: number; /** Margin on each side of the window inside the interior panel's width, in model units. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowWidthOffset: number; /** How much shorter the window is than the interior panel, at its top, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ windowHeightOffset: number; /** Width of the window's outer frame, in model units. * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowFrameThickness: number; /** Width of the window's glass frame, in model units. Building the window does not use it yet. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ windowGlassFrameThickness: number; } /** * The outlines and thicknesses of a wall section whose panels follow any polygon, such as an end wall * under a sloped roof. The panels lie in the XY plane on either side of the wall gap along Z. */ declare class SandwitchPanelFlexDto { /** Name given to the wall section. * @default sandwitch-panel */ name: string; /** Whether the interior panel is built. Building the section does not check it yet. * @default true */ createInteriorPanel: boolean; /** Whether the exterior panel is built. Building the section does not check it yet. * @default true */ createExteriorPanel: boolean; /** Gap between the exterior and interior panels, where the wall sits, along Z, in model units. * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ wallWidth: number; /** Thickness of the exterior panel, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ exteriorPanelThickness: number; /** Thickness of the interior panel, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ interiorPanelThickness: number; /** * Corner points of the interior panel's outline in the XY plane, in model units. * @default [] */ interiorPanelPolygonPoints: Inputs.Base.Point2[]; /** * Corner points of the exterior panel's outline in the XY plane, in model units. * @default [] */ exteriorPanelPolygonPoints: Inputs.Base.Point2[]; } /** * A wall section of a building model, built from `SandwitchPanelDto`: the inputs, the placement that was * applied, an exterior and an interior panel, and the window cut through them. */ declare class SandwitchPart extends SandwitchPanelDto { /** * Id of the wall section, when the model sets one. */ id?: string; /** * Turn around the vertical axis that placed the section, in degrees. */ rotation?: number; /** * Point the section was moved to. */ center?: Inputs.Base.Point3; /** * Direction the section's up axis was turned to point along. */ direction?: Inputs.Base.Vector3; /** * The windows set into the section. */ windows?: WindowRectangularPart[]; /** * The exterior and interior panels, with any window cut out, and everything together as `compound`. */ shapes?: { panelExterior?: T; panelInterior?: T; compound?: T; }; } /** * A wall section of a building model with panels cut to any outline, built from `SandwitchPanelFlexDto`, * such as the sloped end walls under the roofs of the Zen Hideout. */ declare class SandwitchPartFlex extends SandwitchPanelFlexDto { /** * Id of the wall section, when the model sets one. */ id?: string; /** * Turn around the vertical axis that placed the section, in degrees. */ rotation?: number; /** * Point the section was moved to. */ center?: Inputs.Base.Point3; /** * Direction the section's up axis was turned to point along. */ direction?: Inputs.Base.Vector3; /** * The windows set into the section. */ windows?: WindowRectangularPart[]; /** * The exterior and interior panels, with any window cut out, and everything together as `compound`. */ shapes?: { panelExterior?: T; panelInterior?: T; compound?: T; }; } /** * The sizes of an L-shaped corner window of a building model, which the Zen Hideout fills in for its * entrance and terrace corners. The two legs of the L meet at `origin` and rise along Y. */ declare class WindowCornerDto { /** Thickness of the wall the window sits in, in model units. With the facade panels it sets how deep * the frame and the opening are. * @default 0.4 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ wallThickness: number; /** Thickness of the facade panels on the wall, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ facadePanelThickness: number; /** Width of the frame that holds the glass, in model units. * @default 0.02 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ glassFrameThickness: number; /** Thickness of the glass, in model units. * @default 0.005 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassThickness: number; /** Width of the outer frame, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ frameThckness: number; /** Height of the window, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ height: number; /** Length of the first leg of the L, in model units. * @default 1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ lengthFirst: number; /** Length of the second leg of the L, in model units. * @default 1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ lengthSecond: number; /** * Turn of the L around the vertical axis, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Point at the bottom of the window where the two legs meet. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; } /** * The shapes of a window in a building model: the cutout for the wall, the outer frame, the frame around * the glass, the glass, and those three together. */ declare class WindowPartShapes { /** * Solid the size of the whole window, used to cut the opening out of the wall panels. It is not * meant to be drawn. */ cutout?: T; /** * The glass pane. */ glass?: T; /** * The frame that holds the glass, inside the outer frame. */ glassFrame?: T; /** * The outer frame, as deep as the wall, that the glass frame sits in. */ frame?: T; /** * The frame, the glass frame and the glass together. Not set for a corner window. */ compound?: T; } /** * A rectangular window of a building model, built from `WindowRectangularDto`: the inputs and the frame, * glass frame, glass and cutout shapes. */ declare class WindowRectangularPart extends WindowRectangularDto { /** * Name of the window, such as "sandwitch-window". */ name: string; /** * Id of the window, when the model sets one. */ id?: string; /** * The frame, glass frame, glass and cutout of the window. */ shapes?: WindowPartShapes; } /** * An L-shaped corner window of a building model, built from `WindowCornerDto`: the inputs and the frame, * glass frame, glass and cutout shapes. */ declare class WindowCornerPart extends WindowCornerDto { /** * Name of the window, such as "corner-window". */ name: string; /** * Id of the window, when the model sets one. */ id?: string; /** * The frame, glass frame, glass and cutout of the window. */ shapes?: WindowPartShapes; } /** * The sizes of a rectangular window part of a building model, which the Zen Hideout fills in for the window * of each wall section. The window stands on its bottom edge with its depth along X and width along Z. */ declare class WindowRectangularDto { /** Depth of the window through the wall, along X, in model units. * @default 0.3 * @minimum 0.01 * @maximum Infinity * @step 0.05 */ thickness: number; /** Width of the frame that holds the glass, inside the outer frame, in model units. * @default 0.02 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ glassFrameThickness: number; /** Thickness of the glass pane, in model units. * @default 0.005 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassThickness: number; /** Width of the outer frame, in model units. The glass frame is this deep. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ frameThickness: number; /** Height of the window from its bottom edge, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ height: number; /** Width of the window along Z, in model units. * @default 1 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ width: number; /** * Turn of the window around the vertical axis, in degrees. Building the window shapes does not use * it. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Point the window is placed at. Building the window shapes does not use it. * @default [0, 0, 0] */ center: Inputs.Base.Point3; /** * Direction the window's up axis points along. Building the window shapes does not use it. * @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 `things.kidsCorner.birdhouses.wingtipVilla.create` returns: every part of the birdhouse in * `compound`, each part's own shapes by name, and the origin point the house was placed at. */ declare class WingtipVillaData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "wingtipVilla". */ name: string; /** * Every part of the birdhouse as one compound. */ compound?: T; /** * The two roof boards, together as `compound` and one by one in `shapes`. */ roof: { compound: T; shapes: T[]; }; /** * The back, front and two side walls, together as `compound` and one by one in `shapes`. */ walls: { compound: T; shapes: T[]; }; /** * The perch below the entrance hole. */ stick: { shape: T; }; /** * The floor board. */ floor: { shape: T; }; /** * The chimney on the roof. */ chimney: { shape: T; }; /** * Named points of the placed house; holds one entry of kind "origin" at `origin`. */ basicPoints: { kind: string; point: Inputs.Base.Point3; }[]; } /** * Parameters of `things.kidsCorner.birdhouses.wingtipVilla.create`. The inside sizes and board * thickness set the house, the hole and perch values must fit its front, and `rotation` and `origin` * place it. */ 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); /** * Inside width of the house between the side walls, along X, in model units. It must be at least * `holeDiameter`. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorWidth: number; /** * Inside depth of the house from the back wall to the front wall, along Z, in model units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorLength: number; /** * Inside height from the floor to where the roof starts, in model units. It must leave room for the * hole above `holeDistToBottom` and for the perch. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorHeight: number; /** * Thickness of every board, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ thickness: number; /** * Diameter of the round entrance hole in the front wall, in model units. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ holeDiameter: number; /** * Height of the bottom of the entrance hole above the floor, in model units. The perch sits halfway up * this distance, so it must be at least `stickDiameter`. * @default 2.5 * @minimum 0 * @maximum Infinity * @step 0.5 */ holeDistToBottom: number; /** * How far the perch sticks out from the front wall, in model units. * @default 1.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ stickLength: number; /** * Diameter of the round perch below the entrance hole, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ stickDiameter: number; /** * How far the back board reaches below the floor, in model units, giving room to fix the house to a * tree or a wall. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.5 */ baseAttachmentHeight: number; /** * How far the two roof boards reach past the walls at the eaves and at the front, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.5 */ roofOverhang: number; /** * Turn of the house around the vertical Y axis through `origin`, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Height of the chimney above the roof, in model units. It must be above 0. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.5 */ chimneyHeight: number; /** * Point the house is moved to: the middle of the back wall at floor level, where it is fixed to a * tree or a 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 `things.kidsCorner.birdhouses.chirpyChalet.create` returns: every part of the birdhouse in * `compound`, each part's own shapes by name, and the origin point the house was placed at. */ declare class ChirpyChaletData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "chirpyChalet". */ name: string; /** * Every part of the birdhouse as one compound. */ compound?: T; /** * The roof board as `compound`, with `shapes` listing the roof board and the perch. */ roof: { compound: T; shapes: T[]; }; /** * The back, front and two side walls, together as `compound` and one by one in `shapes`. */ walls: { compound: T; shapes: T[]; }; /** * The perch below the entrance hole. */ stick: { shape: T; }; /** * The floor board. */ floor: { shape: T; }; /** * Named points of the placed house; holds one entry of kind "origin" at `origin`. */ basicPoints: { kind: string; point: Inputs.Base.Point3; }[]; } /** * Parameters of `things.kidsCorner.birdhouses.chirpyChalet.create`. The inside sizes and board * thickness set the house, the hole and perch values must fit its front, the roof values set its slope * and overhang, and `rotation` and `origin` place it. */ 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); /** * Inside width of the house between the side walls, along X, in model units. It must be at least * `holeDiameter`. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorWidth: number; /** * Inside depth of the house from the back wall to the front wall, along Z, in model units. * @default 3 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorLength: number; /** * Inside height at the front, from the floor to where the roof starts, in model units. It must leave * room for the hole above `holeDistToBottom` and for the perch. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.5 */ interiorHeight: number; /** * Thickness of every board, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ thickness: number; /** * Diameter of the round entrance hole in the front wall, in model units. * @default 1.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ holeDiameter: number; /** * Height of the bottom of the entrance hole above the floor, in model units. The perch sits halfway up * this distance, so it must be at least `stickDiameter`. * @default 2.5 * @minimum 0 * @maximum Infinity * @step 0.5 */ holeDistToBottom: number; /** * How far the perch sticks out from the front wall, in model units. * @default 0.9 * @minimum 0 * @maximum Infinity * @step 0.1 */ stickLength: number; /** * Diameter of the round perch below the entrance hole, in model units. * @default 0.3 * @minimum 0 * @maximum Infinity * @step 0.1 */ stickDiameter: number; /** * How far the back board reaches below the floor, in model units, giving room to fix the house to a * tree or a wall. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.5 */ baseAttachmentHeight: number; /** * How far the roof board reaches past the side walls and past the front wall, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.5 */ roofOverhang: number; /** * Slope of the roof board, in degrees: it falls from the back wall toward the front, and a larger * angle makes the back wall taller. * @default 20 * @minimum 0 * @maximum 80 * @step 5 */ roofAngle: number; /** * Turn of the house around the vertical Y axis through `origin`, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Point the house is moved to: the middle of the back wall at floor level, where it is fixed to a * tree or a 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 `things.threeDPrinting.vases.serenitySwirl.create` returns: a type tag, the model name and the * vase shape. Pass it to `drawModel` to show the vase and to `dispose` to free it. */ declare class SerenitySwirlData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "serenitySwirl". */ name: string; /** * The whole vase as one shape: inner and outer walls, bottom and rim sewn together. */ compound?: T; } /** * Parameters of `things.threeDPrinting.vases.serenitySwirl.create`. The radius and height values are * added to the vase's fixed base proportions, `swirl` and `nrOfDivisions` shape the ribs, and `rotation` * and `origin` place the finished vase. */ declare class SerenitySwirlDto { constructor(swirl?: number, nrOfDivisions?: number, addRadiusNarrow?: number, addRadiusWide?: number, addMiddleHeight?: number, addTopHeight?: number, thickness?: number, rotation?: number, origin?: Inputs.Base.Point3); /** * How far the ribs twist as they rise. At 0 they run straight up; at 1 each rib makes a full turn * between the bottom ring and the top ring. * @default 0.6 * @minimum 0 * @maximum 1 * @step 0.1 */ swirl: number; /** * Sets how many ribs go around the vase. Each ring is divided into three times this many points, and * a rib runs through matching points on every ring. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrOfDivisions: number; /** * Added to the radius of the narrow rings at the bottom and below the top, in model units. Their * base radius is 1. * @default 0.4 * @minimum 0 * @maximum Infinity * @step 0.1 */ addRadiusNarrow: number; /** * Added to the radii of the wide rings, in model units. The bulge is an ellipse with base radii 2 and * 2.5, and the top opening is a circle with base radius 1.5. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ addRadiusWide: number; /** * Added to the height of the bulge above the bottom, in model units. It also raises every ring above * the bulge by the same amount. * @default 1.6 * @minimum 0 * @maximum Infinity * @step 0.1 */ addMiddleHeight: number; /** * Added to the distance from the upper narrow ring to the top opening, in model units, which * lengthens the neck of the vase. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ addTopHeight: number; /** * Wall thickness at the thickest ribs, in model units. The wall alternates between thick and thin * ribs around the vase, and the thin ones are a fifth to a quarter of this. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ thickness: number; /** * Turn of the finished vase around the vertical Y axis, in degrees, applied before it is moved to * `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Point the center of the vase's bottom is moved to. * @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 { /** * What `things.threeDPrinting.vases.arabicArchway.create` returns: the whole vase in `compound`, its * parts grouped for drawing in `drawingPart`, every shape with its id in `shapes`, and the inputs used. */ declare class ArabicArchwayData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "arabicArchway". */ name: string; /** * The whole vase as one compound, placed by `rotation`, `direction`, `origin` and `scale`. */ compound?: T; /** * The inputs the vase was built from. `drawModel` reads the detail level from here. */ originalInputs: ArabicArchwayDto; /** * Every shape of the vase with an id, the compound first. `dispose` deletes each of them. */ shapes?: Models.OCCT.ShapeWithId[]; /** * The vase split into the groups that are drawn with different materials. */ drawingPart?: ArabicArchwayDrawingPart; } /** * The groups of the Arabic Archway vase by key: the whole vase, the arches, the filled openings and the * base. The groups other than `compound` exist only at high detail. */ declare class ArabicArchwayDrawingPartShapes { /** * The whole vase. At high detail it is not drawn, since the other groups cover it. */ compound?: T; /** * The solid arches of every side, lifted by the base height. */ vasePartsCompound?: T; /** * The solids that fill the arch openings, present when `patchHoles` is on. */ glassPartsCompound?: T; /** * The solid base under the arches, present when `baseHeight` is above 0. */ vaseBaseCompound?: T; } /** * The Arabic Archway vase split into groups that `drawModel` gives different materials, returned in * `ArabicArchwayData.drawingPart`. */ declare class ArabicArchwayDrawingPart { /** * One entry per group. The same keys hold shapes in a result and materials or meshes while the vase * is drawn. */ shapes?: ArabicArchwayDrawingPartShapes | { [x: string]: T; }; } /** * The property list of the Arabic Archway vase with its value types left open; `ArabicArchwayDto` * fills them in with numbers, points, a detail level and a flag, and documents each property. */ declare class ArabicArchwayDtoBase { /** * Points of the profile curve that is turned around the vertical axis. */ profilePoints?: P; /** * Number of sides around the vase. */ nrOfSides: T; /** * Number of arches stacked up each side. */ nrOfVerticalArches: T; /** * How far the large arches stand out from the profile. */ thickness: T; /** * How far the edges between sides stand out from the profile. */ edgesThickness: T; /** * How far the small arch at the center of each side stands out from the profile. */ archCenterThickness: T; /** * Height of the solid base under the arches. */ baseHeight: T; /** * Whether the arch openings are filled. */ patchHoles: B; /** * How much of the vase is built. */ lod?: U; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Direction the vase's up axis points along. */ direction?: V; /** * Scale factor along each axis. */ scale?: V; /** * Point the vase is moved to. */ origin?: V; } /** * Parameters of `things.threeDPrinting.vases.arabicArchway.create`. The profile sets the outline, * the counts and depths shape the arches on it, `lod` sets how much is built, and `rotation`, * `direction`, `origin` and `scale` place the result. */ 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); /** * Points the profile curve passes through, in the XY plane: X is the distance from the vertical axis * and Y the height, in model units. The curve is turned around the Y axis to form the vase. * @default [[2, 0, 0],[4, 5, 0],[1.5, 10, 0],[2, 14, 0]] */ profilePoints: Inputs.Base.Point3[]; /** * Number of sides around the vase. Each side spans an equal share of a full turn and carries its own * column of arches. * @default 3 * @minimum 3 * @maximum 30 * @step 1 */ nrOfSides: number; /** * Number of arches stacked up each side. The profile is divided into this many equal stretches, * one arch each. * @default 6 * @minimum 2 * @maximum 30 * @step 1 */ nrOfVerticalArches: number; /** * How far the small arch at the center of each side stands out from the profile, in model units, * measured outward from the vertical axis. * @default 0.8 * @minimum 0 * @maximum 10 * @step 0.1 */ archCenterThickness: number; /** * How far the edges between neighboring sides stand out from the profile, in model units, measured * outward from the vertical axis. * @default 0.2 * @minimum 0 * @maximum 10 * @step 0.1 */ edgesThickness: number; /** * How far the large arches stand out from the profile, in model units, measured outward from the * vertical axis. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ thickness: number; /** * Height of the solid base under the arches, in model units. The arches are lifted by this amount, * and 0 builds no base. Built only at high detail. * @default 0.4 * @minimum 0 * @maximum 10 * @step 0.1 */ baseHeight: number; /** * When true, solids fill the openings of the small arches and are returned as their own drawing * group. Built only at high detail. * @default true */ patchHoles: boolean; /** * How much of the vase is built: high makes the solid arches, base and fillings, middle one surface * lofted through the turned profiles, and low only the turned profile curves. * @default high */ lod: Things.Enums.lodEnum; /** * Turn of the vase around its vertical axis, in degrees, applied before it is aligned to `direction` * and moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Point the bottom center of the vase is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the vase's up axis points along after placement. The default keeps it upright along Y. * @default [0, 1, 0] */ direction: Inputs.Base.Point3; /** * Scale factor along X, Y and Z, applied around `origin` after the vase is placed. 1 keeps the size. * @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 `things.threeDPrinting.cups.calmCup.create` returns: a type tag, the model name, the inputs the * cup was built from and the cup solid in `compound`. */ declare class CalmCupData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "calmCup". */ name: string; /** * The inputs the cup was built from. `drawModel` reads `precision` and `scale` from here. */ originalInputs: CalmCupDto; /** * The cup with its handles as one solid, placed by `rotation`, `scale`, `direction` and `origin`. */ compound?: T; } /** * The property list of the Calm Cup with its value types left open; `CalmCupDto` fills them in with * numbers and points, and documents each property. */ declare class CalmCupDtoBase { /** * Height of the cup. */ height: T; /** * Inner radius at the bottom. */ radiusBottom: T; /** * How much wider the rim is than the bottom. */ radiusTopOffset: T; /** * Wall thickness. */ thickness: T; /** * Radius that rounds every edge. */ fillet: T; /** * Number of handles. */ nrOfHandles: T; /** * How far the handles reach out from the wall. */ handleDist: T; /** * Meshing precision used when the cup is drawn. */ precision: T; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Uniform scale factor. */ scale?: T; /** * Point the cup is moved to. */ origin?: U; /** * Direction the cup's up axis points along. */ direction?: U; } /** * Parameters of `things.threeDPrinting.cups.calmCup.create`. The radii, height and thickness size the * cup and limit each other, `fillet` and the handle values shape the details, and `rotation`, `scale`, * `direction` and `origin` place it. */ 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 from its underside to the rim, in model units. It must be at least 6 times * `thickness`. * @default 6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ height: number; /** * Inner radius of the cup at its bottom, in model units. The outer wall sits `thickness` further out. * @default 4 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusBottom: number; /** * How much wider the inner radius at the rim is than `radiusBottom`, in model units. At most 0.75 * times `radiusBottom`. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusTopOffset: number; /** * Wall thickness in model units. The bottom is 1.3 times as thick, with a shallow recess underneath. * @default 0.6 * @minimum 0.05 * @maximum 3 * @step 0.01 */ thickness: number; /** * Radius that rounds every edge of the finished cup, in model units, at most half of `thickness`. 0 * leaves the edges sharp. * @default 0.2 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ fillet: number; /** * Number of loop handles, spaced evenly around the cup. 0 builds a cup without handles. * @default 1 * @minimum 0 * @maximum 2 * @step 1 */ nrOfHandles: number; /** * How far the inner loop of each handle reaches out from the wall, in model units. It must be more * than twice `thickness`. * @default 2 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ handleDist: number; /** * Meshing precision that `drawModel` uses, multiplied by `scale`. A smaller value draws a smoother * cup and takes longer. Building the solid ignores it. * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Turn of the cup around the Y axis, in degrees, applied before it is scaled, aligned to `direction` * and moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Uniform scale factor applied to the whole cup before it is placed. `drawModel` multiplies its edge * width and meshing precision by it too. * @default 1 * @minimum 0 * @maximum Infinity * @step 10 */ scale: number; /** * Point the center of the cup's bottom is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the cup's up axis points along after placement. The default keeps it upright along Y. * @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 `things.threeDPrinting.cups.dragonCup.create` returns: a type tag, the model name, the inputs * the cup was built from and the cup shape in `compound`. */ declare class DragonCupData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "dragonCup". */ name: string; /** * The inputs the cup was built from. `drawModel` reads `precision` and `scale` from here. */ originalInputs: DragonCupDto; /** * The whole scaled cup as one sewn shape, placed by `rotation`, `scale`, `direction` and `origin`. */ compound?: T; } /** * The property list of the Dragon Cup with its value types left open; `DragonCupDto` fills them in with * numbers and points, and documents each property. */ declare class DragonCupDtoBase { /** * Height of the wall. */ height: T; /** * Inner radius at the bottom. */ radiusBottom: T; /** * How much wider the rim is than the bottom. */ radiusTopOffset: T; /** * How much wider the middle is than the bottom. */ radiusMidOffset: T; /** * Turn of the middle circle relative to the bottom. */ rotationMidAngle: T; /** * Turn of the rim circle relative to the middle. */ rotationTopAngle: T; /** * Wall thickness. */ thickness: T; /** * Thickness of the floor. */ bottomThickness: T; /** * Number of scale cells around the cup. */ nrSkinCellsHorizontal: T; /** * Number of scale cells up the wall. */ nrSkinCellsVertical: T; /** * Number of scale cell rows across the rim. */ nrSkinCellDivisionsTop: T; /** * Number of scale cell rows across the floor and underside rings. */ nrSkinCellDivisionsBottom: T; /** * Height of the scales on the outer wall. */ skinCellOuterHeight: T; /** * Height of the scales on the inner wall and floor ring. */ skinCellInnerHeight: T; /** * Height of the scales on the underside ring. */ skinCellBottomHeight: T; /** * Height of the scales on the rim. */ skinCellTopHeight: T; /** * Meshing precision used when the cup is drawn. */ precision: T; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Uniform scale factor. */ scale?: T; /** * Point the cup is moved to. */ origin?: U; /** * Direction the cup's up axis points along. */ direction?: U; } /** * Parameters of `things.threeDPrinting.cups.dragonCup.create`. The radii, angles and height shape the * twisted wall, the skin cell values set the pyramid scales on each surface, and `rotation`, `scale`, * `direction` and `origin` place the cup. */ 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 wall from its bottom edge to the rim, in model units. The underside scales add * `skinCellBottomHeight` below it. * @default 6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ height: number; /** * Inner radius of the cup at its bottom, in model units. The outer wall sits `thickness` further out. * @default 4 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusBottom: number; /** * How much wider the inner radius at the rim is than `radiusBottom`, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusTopOffset: number; /** * How much wider the inner radius at half height is than `radiusBottom`, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusMidOffset: number; /** * Turn of the rim circle around the Y axis relative to the middle circle, in degrees. Together with * `rotationMidAngle` it twists the wall. * @default 20 * @minimum -90 * @maximum 90 * @step 1 */ rotationTopAngle: number; /** * Turn of the middle circle around the Y axis relative to the bottom circle, in degrees. The rim turns * by this plus `rotationTopAngle`. * @default 20 * @minimum -90 * @maximum 90 * @step 1 */ rotationMidAngle: number; /** * Number of rows of scale cells up the inner and outer walls. * @default 5 * @minimum 1 * @maximum Infinity * @step 1 */ nrSkinCellsVertical: number; /** * Number of scale cells around the cup on every surface. It must be at least 3. * @default 10 * @minimum 3 * @maximum Infinity * @step 1 */ nrSkinCellsHorizontal: number; /** * Number of rows of scale cells across the rim between the inner and outer walls. * @default 1 * @minimum 1 * @maximum Infinity * @step 1 */ nrSkinCellDivisionsTop: number; /** * Number of rows of scale cells across the floor ring inside the cup and the ring on its underside. * @default 3 * @minimum 1 * @maximum Infinity * @step 1 */ nrSkinCellDivisionsBottom: number; /** * Height of the pyramid scales on the outer wall, in model units. A negative value points them the * other way. * @default 0.4 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ skinCellOuterHeight: number; /** * Height of the pyramid scales on the inner wall and on the floor ring, in model units. A negative * value points them the other way. * @default 0.3 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ skinCellInnerHeight: number; /** * Height of the pyramid scales on the underside ring, in model units. The cup is lifted by this amount * so the scales sit on the ground. * @default 0.4 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ skinCellBottomHeight: number; /** * Height of the pyramid scales on the rim, in model units. A negative value points them the other way. * @default 0.4 * @minimum -Infinity * @maximum Infinity * @step 0.01 */ skinCellTopHeight: number; /** * Wall thickness in model units: the outer wall sits this far outside the inner radii. * @default 0.6 * @minimum 0.05 * @maximum Infinity * @step 0.01 */ thickness: number; /** * Thickness of the floor, in model units, measured from the bottom of the wall up to the floor inside. * @default 1 * @minimum 0.05 * @maximum Infinity * @step 0.01 */ bottomThickness: number; /** * Meshing precision that `drawModel` uses, multiplied by `scale`. A smaller value draws a smoother * cup and takes longer. Building the shape ignores it. * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Turn of the cup around the Y axis, in degrees, applied before it is scaled, aligned to `direction` * and moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Uniform scale factor applied to the whole cup before it is placed. `drawModel` multiplies its edge * width and meshing precision by it too. * @default 1 * @minimum 0 * @maximum Infinity * @step 10 */ scale: number; /** * Point the center of the cup's bottom is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the cup's up axis points along after placement. The default keeps it upright along Y. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } /** * A built Dragon Cup passed to `things.threeDPrinting.cups.dragonCup.getCompoundShape`, which reads the * whole cup shape out of it. */ declare class DragonCupModelDto { /** * The cup data returned by `things.threeDPrinting.cups.dragonCup.create`. * @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 `things.threeDPrinting.boxes.spicyBox.create` returns: a type tag, the model name, the inputs * the box was built from and its wall surfaces in `compound`. */ declare class SpicyBoxData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "spicyBox". */ name: string; /** * The inputs the box was built from. `drawModel` reads `precision` and `scale` from here. */ originalInputs: SpicyBoxDto; /** * The inner and outer wall surfaces as one compound, placed by `rotation`, `scale`, `direction` and * `origin`. */ compound?: T; } /** * The property list of the Spicy Box with its value types left open; `SpicyBoxDto` fills them in with * texts, numbers, a flag and points, and documents each property. */ declare class SpicyBoxDtoBase { /** * Text for the lid, not used yet. */ textTop: V; /** * Text for the front, not used yet. */ textFront: V; /** * Height of the box. */ height: T; /** * Height kept free for the cover. */ coverHeight: T; /** * Height of the base, not used yet. */ baseHeight: T; /** * Radius of the wall polygon. */ radiusBase: T; /** * How far the wall bulges out in each band. */ radiusOffset: T; /** * Distance between the inner and outer wall surfaces. */ thickness: T; /** * Depth of the zig-zag ridges. */ ornamentalThickness: T; /** * Number of zig-zags on each side. */ nrOrnamnetsPerSide: T; /** * Whether the zig-zags start on the other wire. */ invertOrnaments: Z; /** * Rounding radius, not used yet. */ fillet: T; /** * Number of sides of the wall polygon. */ nrSides: T; /** * Number of bulging bands up the wall. */ nrOffsets: T; /** * Meshing precision used when the box is drawn. */ precision: T; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Uniform scale factor. */ scale?: T; /** * Point the box is moved to. */ origin?: U; /** * Direction the box's up axis points along. */ direction?: U; } /** * Parameters of `things.threeDPrinting.boxes.spicyBox.create`. The sides, radii, heights and bands * shape the wall, the ornament values set its zig-zag ridges, and `rotation`, `scale`, `direction` and * `origin` place it. The texts, `baseHeight` and `fillet` are not used yet. */ 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 meant for the lid. The current build does not use it. * @default Pepper */ textTop: string; /** * Text meant for the front. The current build does not use it. * @default For Your Spicy Needs */ textFront: string; /** * Number of sides of the wall polygon. * @default 4 * @minimum 3 * @maximum 16 * @step 1 */ nrSides: number; /** * Number of bands stacked up the wall. In each band the wall bulges out by `radiusOffset` and comes * back in. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ nrOffsets: number; /** * Height of the box in model units. The ornamented wall fills it except for the top `coverHeight`. * @default 6 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ height: number; /** * Radius of the inner wall polygon, from its center to a corner, in model units. * @default 4 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusBase: number; /** * How far each band of the wall bulges out beyond `radiusBase`, in model units. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ radiusOffset: number; /** * Height at the top of the box left free of the ornamented wall, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ coverHeight: number; /** * Height meant for the base. The current build does not use it. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ baseHeight: number; /** * Distance between the inner and outer wall surfaces, in model units, added to every radius. * @default 0.6 * @minimum 0.05 * @maximum Infinity * @step 0.01 */ thickness: number; /** * Depth of the zig-zag ridges, in model units: the zig-zag runs between two polygons this far apart. * @default 0.1 * @minimum 0.05 * @maximum Infinity * @step 0.01 */ ornamentalThickness: number; /** * Number of zig-zags along each side of the polygon. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ nrOrnamnetsPerSide: number; /** * When true, the zig-zags start on the outer polygon instead of the inner one, so the ridges swap * places with the valleys. * @default false */ invertOrnaments: boolean; /** * Radius meant for rounding the edges. The current build does not use it. * @default 0.2 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ fillet: number; /** * Meshing precision that `drawModel` uses, multiplied by `scale`. Building the shape ignores it. * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Turn of the box around the Y axis, in degrees, applied before it is scaled, aligned to `direction` * and moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Uniform scale factor applied to the whole box before it is placed. `drawModel` multiplies its edge * width and meshing precision by it too. * @default 1 * @minimum 0 * @maximum Infinity * @step 10 */ scale: number; /** * Point the center of the box's bottom is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the box's up axis points along after placement. The default keeps it upright along Y. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } /** * A built Spicy Box passed to `things.threeDPrinting.boxes.spicyBox.getCompoundShape`, which reads the * compound of its wall surfaces out of it. */ declare class SpicyBoxModelDto { /** * The box data returned by `things.threeDPrinting.boxes.spicyBox.create`. * @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 `things.threeDPrinting.medals.eternalLove.create` returns: a type tag, the model name, the * inputs the medal was built from and the medal shape in `compound`. */ declare class EternalLoveData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "eternalLove". */ name: string; /** * The inputs the medal was built from. */ originalInputs: EternalLoveDto; /** * The whole medal as one compound: the ridged rim, the heart face and the letters. */ compound?: T; } /** * The property list of the Eternal Love medal with its value types left open; `EternalLoveDto` fills * them in with texts, numbers, a flag and points, and documents each property. */ declare class EternalLoveDtoBase { /** * Smaller text above the name. */ textHeading: T; /** * Larger text below the heading. */ textName: T; /** * Whether both halves of the medal are built. */ fullModel: B; /** * Thickness of the whole medal. */ thickness: U; /** * Extra height of the raised ridges. */ decorationThickness: U; /** * Turn around the vertical axis before placement. */ rotation?: U; /** * Point the medal is moved to. */ origin?: V; /** * Direction the medal's up axis points along. */ direction?: V; } /** * Parameters of `things.threeDPrinting.medals.eternalLove.create`: the two texts in raised letters, the * medal and ridge thicknesses, whether both halves are built, and the placement of the result. */ 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); /** * Text written above the name in smaller letters, at font size 20 before both texts are scaled to * fit the face. * @default LOVE YOU */ textHeading: string; /** * Text written below the heading in larger letters, at font size 30 before both texts are scaled to * fit the face. * @default NORA */ textName: string; /** * When true, the front half is copied and turned to form the back, giving a medal with two faces. * When false, only the front half with its flat back is built. * @default true */ fullModel: boolean; /** * Thickness of the full two-sided medal in model units; each half is half of it. It also sets the * cord channel, whose radius is a quarter of it, at most 1. * @default 6 * @minimum 0.5 * @maximum 20 * @step 0.1 */ thickness: number; /** * How far the raised ridges around the rim rise above each half, in model units. * @default 1 * @minimum 0.1 * @maximum 3 * @step 0.1 */ decorationThickness: number; /** * Turn of the medal around the Y axis, in degrees, applied before it is aligned to `direction` and * moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Point the center of the medal is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the medal's Y axis, which runs up its face from the name toward the heading, points * along after placement. * @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 { /** * What `things.threeDPrinting.desktop.phoneNest.create` returns: the stand and phone in `compound`, * their shapes by name in `mainPart` and `drawingPart`, every shape with its id, and the inputs used. */ declare class PhoneNestData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "phoneNest". */ name: string; /** * The inputs the model was built from. Drawing without options reads edge and precision settings * from here. */ originalInputs: PhoneNestDto; /** * The stand and the phone as one compound, placed by `rotation`, `scale`, `direction` and `origin`. */ compound?: T; /** * The stand and the phone as separate shapes, drawn with different materials. */ drawingPart?: PhoneNestDrawingPart; /** * The main part: the stand, the phone and their compound, with the placement applied to them. */ mainPart?: PhoneNestMainPart; /** * Every shape of the model with an id, the compound first. `dispose` deletes each of them. */ shapes?: Models.OCCT.ShapeWithId[]; } /** * Options for drawing a Phone Nest, made by `things.threeDPrinting.desktop.phoneNest.drawOptions`. The * two materials override the defaults, and the rest sets faces, edges and meshing precision. */ declare class PhoneNestDrawDto { /** * Material for the stand. Leave it out to keep the default wood material. * @defaul undefined * @optional true */ mainMaterial?: T; /** * Material for the phone. Leave it out to keep the default black glass material. * @defaul undefined * @optional true */ phoneMaterial?: T; /** * Whether faces are drawn. When false, only edges are drawn and no material is applied. * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn faces. A smaller value draws smoother curves and takes longer. * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether the edges of the model are drawn. * @default true */ drawEdges: boolean; /** * Color of the stand's edges as a hex string. The phone's edges are always black. * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Width of the drawn edges. * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * The Phone Nest by drawing group: the stand and the phone. The same keys hold shapes in a result and * materials or meshes while the model is drawn. */ declare class PhoneNestDrawingPartShapes { /** * The stand. */ main?: T; /** * The rounded box that stands in for the phone. */ phone?: T; } /** * The Phone Nest split into the groups that are drawn with different materials, returned in * `PhoneNestData.drawingPart` with the id "drawing-part". */ declare class PhoneNestDrawingPart extends Part { /** * The stand and the phone, one entry per drawing group. */ shapes?: PhoneNestDrawingPartShapes; } /** * The property list of the Phone Nest desk stand with its value types left open; `PhoneNestDto` fills * them in with numbers, points and a flag, and documents each property. */ declare class PhoneNestDtoBase { /** * Height of the front where the ledge is. */ heightBottom: T; /** * Height of the top of the leaning face. */ heightTop: T; /** * Width of the base at the back. */ widthBack: T; /** * Width of the front, the leaning face and the ledge. */ widthFront: T; /** * Depth of the base from back to front. */ length: T; /** * How far forward of the back edge the top of the leaning face sits. */ backOffset: T; /** * Wall thickness of the shell. */ thickness: T; /** * Radius of two of the rounded bends. */ filletRadius: T; /** * Whether a pattern of openings is cut into the shell. */ applyOrnaments: B; /** * Height of the phone. */ phoneHeight: T; /** * Width of the phone. */ phoneWidth: T; /** * Thickness of the phone. */ phoneThickness: T; /** * Meshing precision used when the model is drawn. */ precision: T; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Uniform scale factor. */ scale?: T; /** * Point the model is moved to. */ origin?: U; /** * Direction the model's up axis points along. */ direction?: U; } /** * Parameters of `things.threeDPrinting.desktop.phoneNest.create`. The heights, widths, depth and offset * shape the stand, the phone sizes set the ledge and the phone stand-in, and `rotation`, `scale`, * `direction` and `origin` place the result. */ 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 stand at its front, where the ledge holds the bottom of the phone, in model units. * @default 5 * @minimum 0 * @maximum Infinity * @step 0.01 */ heightBottom: number; /** * Height of the top of the leaning face that the phone rests against, in model units. * @default 16 * @minimum 0 * @maximum Infinity * @step 0.1 */ heightTop: number; /** * Width of the base at its back edge, across Z, in model units. * @default 25 * @minimum 0 * @maximum Infinity * @step 0.1 */ widthBack: number; /** * Width of the front, the leaning face and the ledge, across Z, in model units. * @default 10 * @minimum 0 * @maximum Infinity * @step 0.1 */ widthFront: number; /** * Depth of the base from its back edge to its front, along X, in model units. * @default 16 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * How far forward of the back edge the top of the leaning face sits, along X, in model units. * @default 6 * @minimum 0 * @maximum Infinity * @step 0.1 */ backOffset: number; /** * Wall thickness of the shell, in model units. It also sets how far the ledge reaches out together * with `phoneThickness`. * @default 0.4 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ thickness: number; /** * When true, a pattern of small rounded openings is cut into the curved surface. The openings are * picked at random, so two builds differ. * @default false */ applyOrnaments: boolean; /** * Radius that rounds two of the bends in the stand's profile, in model units. The bend at the ledge * is rounded by a radius set from `thickness` instead. * @default 2 * @minimum 0.001 * @maximum Infinity * @step 0.1 */ filletRadius: number; /** * Height of the phone the stand is made for, in model units; sizes the phone stand-in. * @default 16.8 * @minimum 0 * @maximum Infinitypho * @step 0.01 */ phoneHeight: number; /** * Width of the phone the stand is made for, in model units; sizes the phone stand-in. * @default 7.8 * @minimum 0 * @maximum Infinity * @step 0.01 */ phoneWidth: number; /** * Thickness of the phone, in model units. The ledge is made deep enough to hold it. * @default 0.7 * @minimum 0 * @maximum Infinity * @step 0.01 */ phoneThickness: number; /** * Meshing precision used when the model is drawn without options, multiplied by `scale`. Building the * shapes ignores it. * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether edges are drawn when the model is drawn without options. Building the shapes ignores it. * @default true */ drawEdges: boolean; /** * Turn of the model around the Y axis, in degrees, applied before it is aligned to `direction` and * moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Uniform scale factor, applied around `origin` after the model is placed. Drawing without options * also multiplies the edge width and precision by it. * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Point the center of the stand's base is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the model's up axis points along after placement. The default keeps it upright along Y. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } /** * A built Phone Nest passed to `things.threeDPrinting.desktop.phoneNest.getCompoundShape`, which reads * the compound of the stand and the phone out of it. */ declare class PhoneNestModelDto { /** * The stand data returned by `things.threeDPrinting.desktop.phoneNest.create`. * @default undefined */ model: PhoneNestData; } /** * The main part of the Phone Nest, with the id "main-part": the stand, the phone and their compound, * returned in `PhoneNestData.mainPart`. */ declare class PhoneNestMainPart extends Part { /** * The stand as `main`, the phone as `phone`, and both together as `compound`. */ 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 { /** * What `things.laserCutting.gadgets.dropletsPhoneHolder.create` returns: the main shape in `compound`, the * model and the flat outlines grouped in `drawingPart`, every shape with its id, and the inputs used. */ declare class DropletsPhoneHolderData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "dropletsPhoneHolder". */ name: string; /** * The assembled model when it was built, otherwise the flat cut and engraving outlines. */ compound?: T; /** * The inputs the holder was built from. */ originalInputs: DropletsPhoneHolderDto; /** * Every shape of the holder with an id. `dispose` deletes each of them. */ shapes?: Models.OCCT.ShapeWithId[]; /** * The model, the cut outlines and the engraving outlines as separate groups. */ drawingPart?: DropletsPhoneHolderDrawingPart; } /** * The Droplets Phone Holder by group: the main compound, the assembled model, the cut outlines and the * engraving outlines. The same keys hold shapes in a result and draw settings while it is drawn. */ declare class DropletsPhoneHolderDrawingPartShapes { /** * The same shape as the result's `compound`. It is not drawn on its own. */ compound?: T; /** * The assembled 3D model, present when `includeModel` is on. */ phoneHolderCompound?: T; /** * The flat outlines the laser cuts along, present when `includeDrawings` is on. */ cutWiresCompound?: T; /** * The flat outlines the laser engraves, present when `includeDrawings` is on and there is text to * engrave. */ engravingWiresCompound?: T; } /** * The Droplets Phone Holder split into the groups that are drawn with different settings, returned in * `DropletsPhoneHolderData.drawingPart`. */ declare class DropletsPhoneHolderDrawingPart { /** * The main compound, the model, the cut outlines and the engraving outlines, one entry per group. */ shapes?: DropletsPhoneHolderDrawingPartShapes | { [x: string]: T; }; } /** * The property list of the Droplets Phone Holder with its value types left open; * `DropletsPhoneHolderDto` fills them in with texts, flags, numbers and vectors, and documents each one. */ declare class DropletsPhoneHolderDtoBase { /** * Larger text engraved on the front panel. */ title?: S; /** * Smaller text engraved below the title. */ subtitle: S; /** * Whether the logo is cut and engraved on the back. */ includeLogo: B; /** * Thickness of the sheet. */ thickness: T; /** * Allowance for the laser's cut width at the slots. */ kerf: T; /** * Width of the phone. */ phoneWidth: T; /** * Height of the phone. */ phoneHeight: T; /** * Thickness of the phone. */ phoneThickness: T; /** * Length that sets the depth and height of the stand. */ backLength: T; /** * Lean of the back. */ angle: T; /** * Margin around the phone. */ offsetAroundPhone: T; /** * Depth of the shelf in front of the phone. */ penShelf: T; /** * Height of the lip that holds the phone. */ phoneLockHeight: T; /** * Corner radius of the parts. */ filletRadius: T; /** * Whether a pattern of holes is cut. */ includePattern: B; /** * Cell size of the hole pattern. */ densityPattern: T; /** * Whether notches for a charging cable are cut. */ holesForWire: B; /** * Width of the cable notches. */ wireInputThickness: T; /** * Whether the assembled 3D model is built. */ includeModel: B; /** * Whether the flat drawings are built. */ includeDrawings: B; /** * Gap between the flat drawings. */ spacingDrawings: T; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Direction the up axis points along. */ direction?: V; /** * Scale factor along each axis. */ scale?: V; /** * Point the result is moved to. */ origin?: V; } /** * Parameters of `things.laserCutting.gadgets.dropletsPhoneHolder.create`. The phone and stand values size the * three parts, the texts, logo and patterns decorate them, the include flags choose the model and the flat * drawings, and `rotation`, `direction`, `origin` and `scale` place the result. */ 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); /** * Text engraved on the front panel in larger letters. It is scaled down to fit the width; empty leaves * it out. * @default Your Name */ title: string; /** * Text engraved below the title in smaller letters. It is scaled down to fit the width; empty leaves * it out. * @default And Message */ subtitle: string; /** * When true, the logo outline is cut into the top of the back and "BITBYBIT.DEV" is engraved next to * it. * @default true */ includeLogo: boolean; /** * Thickness of the sheet the parts are cut from, in model units. It also sets the width of the slots. * @default 0.4 * @minimum 0 * @maximum Infinity * @step 0.1 */ thickness: number; /** * Allowance added to the slots so the parts still fit after the laser burns away its cut width, in * model units. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.001 */ kerf: number; /** * Width of the phone, in model units. Values under 4 are treated as 4. * @default 8 * @minimum 4 * @maximum Infinity * @step 0.1 */ phoneWidth: number; /** * Height of the phone, in model units. Values under 4 are treated as 4. * @default 16 * @minimum 4 * @maximum Infinity * @step 0.1 */ phoneHeight: number; /** * Thickness of the phone, in model units. The gap between the back and the lip fits it. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ phoneThickness: number; /** * Length, in model units, that together with `angle` sets how deep the stand is and how high the back * reaches. * @default 10 * @minimum 5 * @maximum Infinity * @step 0.1 */ backLength: number; /** * How far the back leans, in degrees. Values under 10 are treated as 10. * @default 20 * @minimum 0 * @maximum 60 * @step 1 */ angle: number; /** * Margin added on each side of the phone and above it, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ offsetAroundPhone: number; /** * Depth of the shelf in front of the phone that can hold a pen, in model units. * @default 1 * @minimum 0.5 * @maximum Infinity * @step 0.1 */ penShelf: number; /** * Height of the front lip that stops the phone from sliding off, in model units. It is at least * `filletRadius`. * @default 2 * @minimum 0.5 * @maximum Infinity * @step 0.1 */ phoneLockHeight: number; /** * Radius that rounds the corners of the parts, in model units. * @default 0.3 * @minimum 0.1 * @maximum 0.4 * @step 0.1 */ filletRadius: number; /** * When true, a pattern of rounded rectangular holes is cut into the back and the base. The holes are * picked at random, so two builds differ. * @default false */ includePattern: boolean; /** * Cell size of the hole pattern, in model units. A smaller value makes more, smaller holes. * @default 0.4 * @minimum 0 * @maximum 2 * @step 0.1 */ densityPattern: number; /** * When true, notches for a charging cable are cut into the back and the base. * @default true */ holesForWire: boolean; /** * Width of the cable notches, in model units. Values under 0.65 become 0.7, and it stays below * `phoneWidth`. * @default 1.5 * @minimum 0.7 * @maximum Infinity * @step 0.1 */ wireInputThickness: number; /** * When true, the parts are built assembled into a 3D model. * @default true */ includeModel: boolean; /** * When true, the flat cut and engraving outlines of every part are built, laid out beside the model. * @default true */ includeDrawings: boolean; /** * Gap between the laid-out flat drawings, and between them and the model, in model units. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ spacingDrawings: number; /** * Turn of the result around the Y axis, in degrees, applied before it is aligned to `direction` and * moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Point the result is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the result's up axis points along after placement. The default keeps Y up. * @default [0, 1, 0] */ direction: Inputs.Base.Point3; /** * Scale factor along X, Y and Z, applied around `origin` after placement. 1 keeps the size, so a laser * cutter gets the sizes as given. * @default [1, 1, 1] */ scale: Inputs.Base.Vector3; } /** * A built Droplets Phone Holder passed to the getters of `things.laserCutting.gadgets.dropletsPhoneHolder`, * which read its shapes out of it. */ declare class DropletsPhoneHolderModelDto { /** * The holder data returned by `things.laserCutting.gadgets.dropletsPhoneHolder.create`. * @default undefined */ model: DropletsPhoneHolderData; } /** * A built Droplets Phone Holder, colors, a file name and tracing settings for * `things.laserCutting.gadgets.dropletsPhoneHolder.downloadDXFDrawings`. The tracing settings decide how * closely the polylines in the file follow the curved outlines. */ declare class DropletsPhoneHolderModelDxfDto { /** * The holder data returned by `things.laserCutting.gadgets.dropletsPhoneHolder.create`. * @default undefined */ model: DropletsPhoneHolderData; /** * Color of the cut outlines in the file as a hex string. * @default #000000 */ cutWiresColor: Inputs.Base.Color; /** * Color of the engraving outlines in the file as a hex string. * @default #0000ff */ engravingWiresColor: Inputs.Base.Color; /** * Name of the downloaded DXF file. * @default bitbybit-droplets-phone-holder */ fileName: string; /** * Largest angle, in radians, a traced polyline may turn between two points. Smaller follows curves more * closely with more points. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.01 */ angularDeflection: number; /** * Largest distance, in model units, a traced polyline may stray from the curve. Smaller follows curves * more closely with more points. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.001 */ curvatureDeflection: number; /** * Fewest points any edge is traced with, however straight. * @default 2 * @minimum 0 * @maximum Infinity * @step 1 */ minimumOfPoints: number; /** * How close two parameter values on an edge 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 built Droplets Phone Holder and file settings for * `things.laserCutting.gadgets.dropletsPhoneHolder.downloadSTEPDrawings` and * `things.laserCutting.gadgets.dropletsPhoneHolder.download3dSTEPModel`. */ declare class DropletsPhoneHolderModelStepDto { /** * The holder data returned by `things.laserCutting.gadgets.dropletsPhoneHolder.create`. * @default undefined */ model: DropletsPhoneHolderData; /** * Name of the downloaded STEP file. * @default bitbybit-droplets-phone-holder */ fileName: string; /** * When true, the shapes are turned so this library's Y-up becomes Z-up, for tools that treat Z as up. * @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 { /** * What `things.furniture.chairs.snakeChair.create` returns: the chair body in `compound`, the seat outline * and center in `mainPart`, the drawing group, every shape with its id, and the inputs used. */ declare class SnakeChairData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "snakeChair". */ name: string; /** * The inputs the chair was built from. Drawing without options reads edge and precision settings * from here. */ originalInputs: SnakeChairDto; /** * The chair body as one compound, placed by `rotation`, `scale`, `direction` and `origin`. */ compound?: T; /** * The chair body as the one group that is drawn. */ drawingPart?: SnakeChairDrawingPart; /** * The main part: the body, the seat outline and the center of the seat. */ mainPart?: SnakeChairMainPart; /** * Every shape of the chair with an id, the compound first. `dispose` deletes each of them. */ shapes?: Models.OCCT.ShapeWithId[]; } /** * Options for drawing a Snake Chair, made by `things.furniture.chairs.snakeChair.drawOptions`. The material * overrides the default, and the rest sets faces, edges and meshing precision. */ declare class SnakeChairDrawDto { /** * Material for the chair body. Leave it out to keep the default white rough plastic. * @defaul undefined * @optional true */ mainMaterial?: T; /** * Whether faces are drawn. When false, only edges are drawn and no material is applied. * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn faces. A smaller value draws smoother curves and takes longer. * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether the edges of the model are drawn. * @default true */ drawEdges: boolean; /** * Color of the edges as a hex string. * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Width of the drawn edges. * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * The Snake Chair by drawing group; it has one, the body. The same key holds a shape in a result and a * material or mesh while the chair is drawn. */ declare class SnakeChairDrawingPartShapes { /** * The chair body. */ main?: T; } /** * The Snake Chair as drawing groups, returned in `SnakeChairData.drawingPart` with the id "drawing-part". */ declare class SnakeChairDrawingPart extends Part { /** * The chair body, the only drawing group. */ shapes?: SnakeChairDrawingPartShapes; } /** * The property list of the Snake Chair with its value types left open; `SnakeChairDto` fills them in * with numbers and points, and documents each property. */ declare class SnakeChairDtoBase { /** * Height of the seat. */ sittingHeight: T; /** * How far the backrest leans back. */ backRestOffset: T; /** * Height of the backrest above the seat. */ backRestHeight: T; /** * Width of the chair across the bent profile. */ width: T; /** * Depth of the seat along the bent profile. */ length: T; /** * Thickness of the bent board. */ thickness: T; /** * Depth of the grooves between the planks. */ ornamentDepth: T; /** * Number of planks across the width. */ nrOrnamentPlanks: T; /** * Radius of the bends. */ filletRadius: T; /** * Meshing precision used when the chair is drawn. */ precision: T; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Uniform scale factor. */ scale?: T; /** * Point the chair is moved to. */ origin?: U; /** * Direction the chair's up axis points along. */ direction?: U; } /** * Parameters of `things.furniture.chairs.snakeChair.create`. The seat and backrest values shape the bent * profile, the board, groove and bend values shape the body, and `rotation`, `scale`, `direction` and * `origin` place the chair. */ 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 seat surface above the ground, in model units. It must be more than twice `thickness`, * and the bend radius less than half of it. * @default 0.45 * @minimum 0.1 * @maximum Infinity * @step 0.01 */ sittingHeight: number; /** * How far the top of the backrest leans back past the rear edge of the seat, in model units. The * foot reaches back by the same amount. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ backRestOffset: number; /** * Height of the backrest above the seat, in model units. The bend radius must be less than half of it. * @default 0.7 * @minimum 0.1 * @maximum Infinity * @step 0.01 */ backRestHeight: number; /** * Width of the chair across the bent profile, along Z, in model units. * @default 0.45 * @minimum 0 * @maximum Infinity * @step 0.01 */ width: number; /** * Depth of the seat along the bent profile, along X, in model units. It must be more than twice * `thickness`, and the bend radius less than half of it. * @default 0.45 * @minimum 0 * @maximum Infinity * @step 0.01 */ length: number; /** * Thickness of the bent board, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ thickness: number; /** * Number of planks the board is split into across its width by the grooves. * @default 7 * @minimum 1 * @maximum Infinity * @step 1 */ nrOrnamentPlanks: number; /** * Depth of the grooves between the planks, in model units. * @default 0.01 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ ornamentDepth: number; /** * Radius of the rounded bends between the foot, front riser, seat and backrest, in model units. * @default 0.05 * @minimum 0.001 * @maximum Infinity * @step 0.01 */ filletRadius: number; /** * Meshing precision used when the chair is drawn without options, multiplied by `scale`. It must be * above 0; building the shapes does not use it. * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether edges are drawn when the chair is drawn without options. Building the shapes ignores it. * @default true */ drawEdges: boolean; /** * Turn of the chair around the Y axis, in degrees, applied before it is aligned to `direction` and * moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Uniform scale factor, applied around `origin` after the chair is placed. Drawing without options * also multiplies the edge width and precision by it. * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Point on the ground under the center of the seat that the chair is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the chair's up axis points along after placement. The default keeps it upright along Y. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } /** * A built Snake Chair passed to the getters of `things.furniture.chairs.snakeChair`, which read its shapes * and points out of it. */ declare class SnakeChairModelDto { /** * The chair data returned by `things.furniture.chairs.snakeChair.create`. * @default undefined */ model: SnakeChairData; } /** * The main part of the Snake Chair, with the id "main-part": the body, the seat outline and the center * of the seat, returned in `SnakeChairData.mainPart`. */ declare class SnakeChairMainPart extends Part { /** * Center of the seat outline at seat height. */ sittingCenter?: Inputs.Base.Point3; /** * The seat outline as `sittingWire` and the body as `compound`. */ 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 { /** * What `things.furniture.tables.elegantTable.create` returns: the whole table in `compound`, the top and * each leg as named parts with their shapes and points, the drawing groups, every shape with its id, and * the inputs used. */ declare class ElegantTableData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "elegantTable". */ name: string; /** * The inputs the table was built from. Drawing without options reads edge and precision settings * from here. */ originalInputs: ElegantTableDto; /** * The top panel, the base panel and every leg as one compound, placed by `rotation`, `scale`, * `direction` and `origin`. */ compound?: T; /** * The table split into the groups that are drawn with different materials: top, base panel and legs. */ drawingPart?: ElegantTableDrawingPart; /** * The top part: the top and base panels, their outlines, and the centers of the top surface and the * underside. */ topPart?: ElegantTableTopPart; /** * One part per leg with its solid, its end circles, their centers and radii. Each leg is followed by * its copy on the opposite side. */ legParts?: ElegantTableLegPart[]; /** * Every shape of the table with an id, the compound first. `dispose` deletes each of them. */ shapes?: Models.OCCT.ShapeWithId[]; } /** * Options for drawing an Elegant Table, made by `things.furniture.tables.elegantTable.drawOptions`. The * three materials override the defaults, and the rest sets faces, edges and meshing precision. */ declare class ElegantTableDrawDto { /** * Material for the top panel. Leave it out to keep the default wood material. * @defaul undefined * @optional true */ topMaterial?: T; /** * Material for the base panel under the top. Leave it out to keep the default wood material. * @defaul undefined * @optional true */ topBaseMaterial?: T; /** * Material for the legs. Leave it out to keep the default wood material. * @defaul undefined * @optional true */ legsMaterial?: T; /** * Whether faces are drawn. When false, only edges are drawn and no material is applied. * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn faces. A smaller value draws smoother curves and takes longer. * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether the edges of the model are drawn. * @default true */ drawEdges: boolean; /** * Color of the edges as a hex string. * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Width of the drawn edges. * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * The Elegant Table by drawing group: the top panel, the base panel and the legs. The same keys hold * shapes in a result and materials or meshes while the table is drawn. */ declare class ElegantTableDrawingPartShapes { /** * The top panel. */ top?: T; /** * The base panel under the top. */ topBase?: T; /** * Every leg as one compound. */ legs?: T; } /** * The Elegant Table split into the groups that are drawn with different materials, returned in * `ElegantTableData.drawingPart` with the id "drawing-part". */ declare class ElegantTableDrawingPart extends Part { /** * The top panel, the base panel and the legs, one entry per drawing group. */ shapes?: ElegantTableDrawingPartShapes; } /** * The property list of the Elegant Table with its value types left open; `ElegantTableDto` fills them * in with numbers and points, and documents each property. */ declare class ElegantTableDtoBase { /** * Height of the table. */ height: T; /** * Width of the table. */ width: T; /** * Length of the table. */ length: T; /** * Thickness of the top panel. */ topThickness: T; /** * How far the top panel overhangs the base panel. */ topOffset: T; /** * Thickness of the base panel. */ bottomThickness: T; /** * Corner radius of the panels. */ minFillet: T; /** * Leg radius under the base panel. */ radiusLegTop: T; /** * Leg radius at the ground. */ radiusLegBottom: T; /** * Number of leg pairs. */ nrLegPairs: T; /** * Meshing precision used when the table is drawn. */ precision: T; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Uniform scale factor. */ scale?: T; /** * Point the table is moved to. */ origin?: U; /** * Direction the table's up axis points along. */ direction?: U; } /** * Parameters of `things.furniture.tables.elegantTable.create`. The sizes, thicknesses and rounding shape * the top, the leg values shape the legs, and `rotation`, `scale`, `direction` and `origin` place the * table. */ 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 from the ground to its top surface, in model units. * @default 0.74 * @minimum 0.1 * @maximum Infinity * @step 0.01 */ height: number; /** * Width of the table, in model units. The panels' outline is derived from it together with `topOffset` * and `bottomThickness`. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * Length of the table, in model units. The panels' outline is derived from it together with * `topOffset` and `bottomThickness`. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * Thickness of the top panel, in model units. Its edge is beveled inward over the upper part of * this thickness. * @default 0.02 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ topThickness: number; /** * How far the top panel reaches out past the base panel on every side, in model units. * @default 0.03 * @minimum 0 * @maximum Infinity * @step 0.01 */ topOffset: number; /** * Thickness of the base panel under the top, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ bottomThickness: number; /** * Corner radius of the panels' rounded-rectangle outline, in model units. It also moves the legs in * from the corners. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ minFillet: number; /** * Radius of each leg where it meets the base panel, in model units. * @default 0.03 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ radiusLegTop: number; /** * Radius of each leg at the ground, in model units. * @default 0.01 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ radiusLegBottom: number; /** * Number of legs along each of two opposite sides. Each leg has a copy on the opposite side, so the * table has twice this many legs. * @default 2 * @minimum 2 * @maximum Infinity * @step 1 */ nrLegPairs: number; /** * Meshing precision used when the table is drawn without options, multiplied by `scale`. Building the * shapes ignores it. * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether edges are drawn when the table is drawn without options. Building the shapes ignores it. * @default true */ drawEdges: boolean; /** * Turn of the table around the Y axis, in degrees, applied before it is aligned to `direction` and * moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Uniform scale factor, applied around `origin` after the table is placed. Drawing without options * also multiplies the edge width and precision by it. * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Point on the ground under the center of the table that it is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the table's up axis points along after placement. The default keeps it upright along Y. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } /** * A built Elegant Table and a leg index, passed to `things.furniture.tables.elegantTable.getLegShapeByIndex` * to pick out one leg. */ declare class ElegantTableLegByIndexDto { /** * The table data returned by `things.furniture.tables.elegantTable.create`. * @default undefined */ model: ElegantTableData; /** * 0-based index of the leg in `legParts`. Each leg is followed by its copy on the opposite side. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * One leg of the Elegant Table, with an id of the form "leg-part-0": its solid, the circles at its ends, * their centers and its radii, returned in `ElegantTableData.legParts`. */ declare class ElegantTableLegPart extends Part { /** * Center of the leg's top circle, where it meets the base panel. */ topCenter?: Inputs.Base.Point3; /** * Center of the leg's bottom circle, on the ground. */ bottomCenter?: Inputs.Base.Point3; /** * Radius of the leg at its top, from `radiusLegTop`. */ topRadius?: number; /** * Radius of the leg at the ground, from `radiusLegBottom`. */ bottomRadius?: number; /** * The leg solid as `leg`, and the circles at its top and bottom. */ shapes?: { topCircleWire?: T; bottomCircleWire?: T; leg?: T; }; } /** * A built Elegant Table passed to the getters of `things.furniture.tables.elegantTable`, which read its * shapes and points out of it. */ declare class ElegantTableModelDto { /** * The table data returned by `things.furniture.tables.elegantTable.create`. * @default undefined */ model: ElegantTableData; } /** * The top of the Elegant Table, with the id "top-part": the top and base panels, their outlines and * centers, returned in `ElegantTableData.topPart`. */ declare class ElegantTableTopPart extends Part { /** * Center of the table's upper surface. */ topCenter?: Inputs.Base.Point3; /** * Center of the base panel's underside. */ bottomCenter?: Inputs.Base.Point3; /** * The top panel and its upper outline, the base panel and its lower outline, and both panels as * `compound`. */ 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 { /** * What `things.furniture.tables.goodCoffeeTable.create` returns: the whole table in `compound`, the top, the * shelf and each leg as named parts with their shapes and points, the drawing groups, every shape with its * id, and the inputs used. */ declare class GoodCoffeeTableData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "goodCoffeeTable". */ name: string; /** * The inputs the table was built from. Drawing without options reads edge and precision settings * from here. */ originalInputs: GoodCoffeeTableDto; /** * The top frame, the glass, the legs and the shelf as one compound, placed by `rotation`, `scale`, * `direction` and `origin`. */ compound?: T; /** * The table split into the groups that are drawn with different materials: top, glass, shelf and legs. */ drawingPart?: GoodCoffeeTableDrawingPart; /** * The top part: the frame, the glass panel, their outlines and the center of the top. */ topPart?: GoodCoffeeTableTopPart; /** * The shelf with its outlines and centers. Missing when `shelfTopOffset` is 0. */ shelfPart?: GoodCoffeeTableShelfPart; /** * One part per leg, four in all, with its solid, its outlines, their centers and its sizes. */ legParts?: GoodCoffeeTableLegPart[]; /** * Every shape of the table with an id, the compound first. `dispose` deletes each of them. */ shapes?: Models.OCCT.ShapeWithId[]; } /** * Options for drawing a Good Coffee Table, made by `things.furniture.tables.goodCoffeeTable.drawOptions`. The * four materials override the defaults, and the rest sets faces, edges and meshing precision. */ declare class GoodCoffeeTableDrawDto { /** * Material for the glass panel. Leave it out to keep the default black glass material. * @defaul undefined * @optional true */ topGlassMaterial?: T; /** * Material for the top frame. Leave it out to keep the default dark wood material. * @defaul undefined * @optional true */ topMaterial?: T; /** * Material for the shelf. Leave it out to keep the default dark wood material. * @defaul undefined * @optional true */ shelfMaterial?: T; /** * Material for the legs. Leave it out to keep the default dark wood material. * @defaul undefined * @optional true */ legsMaterial?: T; /** * Whether faces are drawn. When false, only edges are drawn and no material is applied. * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn faces. A smaller value draws smoother curves and takes longer. * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether the edges of the model are drawn. * @default true */ drawEdges: boolean; /** * Color of the edges as a hex string. * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Width of the drawn edges. * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * The Good Coffee Table by drawing group: the top frame, the glass, the shelf and the legs. The same * keys hold shapes in a result and materials or meshes while the table is drawn. */ declare class GoodCoffeeTableDrawingPartShapes { /** * The wooden top frame. */ top?: T; /** * The glass panel set into the top. */ topGlass?: T; /** * The shelf between the legs. Missing when the table has no shelf. */ shelf?: T; /** * The four legs as one compound. */ legs?: T; } /** * The Good Coffee Table split into the groups that are drawn with different materials, returned in * `GoodCoffeeTableData.drawingPart` with the id "drawing-part". */ declare class GoodCoffeeTableDrawingPart extends Part { /** * The top frame, the glass, the shelf and the legs, one entry per drawing group. */ shapes?: GoodCoffeeTableDrawingPartShapes; } /** * The property list of the Good Coffee Table with its value types left open; `GoodCoffeeTableDto` * fills them in with numbers and points, and documents each property. */ declare class GoodCoffeeTableDtoBase { /** * Height of the table. */ height: T; /** * Width of the table. */ width: T; /** * Length of the table. */ length: T; /** * Thickness of the top frame. */ topThickness: T; /** * Width of the frame around the glass. */ topGlassOffset: T; /** * Thickness of the glass. */ glassThickness: T; /** * Width of the ledge under the glass. */ glassHolderLength: T; /** * Size of the chamfers on the edges. */ chamfer: T; /** * Gap between the top and the shelf. */ shelfTopOffset: T; /** * Thickness of the shelf. */ shelfThickness: T; /** * Width of each leg. */ legWidth: T; /** * Depth of each leg. */ legDepth: T; /** * Meshing precision used when the table is drawn. */ precision: T; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Uniform scale factor. */ scale?: T; /** * Point the table is moved to. */ origin?: U; /** * Direction the table's up axis points along. */ direction?: U; } /** * Parameters of `things.furniture.tables.goodCoffeeTable.create`. The sizes shape the top frame and glass, * the shelf and leg values shape the parts below, the values must fit inside each other, and `rotation`, * `scale`, `direction` and `origin` place the table. */ 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 from the ground to its top surface, in model units. It must be more than * `topThickness`. * @default 0.4 * @minimum 0.1 * @maximum Infinity * @step 0.01 */ height: number; /** * Width of the top along X, in model units. It must be more than twice `legWidth` and twice * `topGlassOffset` plus `glassHolderLength`. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ width: number; /** * Length of the top along Z, in model units. It must be more than twice `legDepth` and twice * `topGlassOffset` plus `glassHolderLength`. * @default 1.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ length: number; /** * Size of the flat cuts on the edges of the top frame, the shelf and the legs, in model units. It must * be less than half of every thickness and leg size. * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.001 */ chamfer: number; /** * Thickness of the top frame, in model units. It must be more than twice `glassThickness`. * @default 0.05 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ topThickness: number; /** * Width of the wooden frame between the table's edge and the glass, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ topGlassOffset: number; /** * Thickness of the glass panel, in model units. The glass sits flush with the top surface. * @default 0.005 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassThickness: number; /** * How far the ledge under the glass reaches in from the frame, in model units. It must be at least * `glassThickness`. * @default 0.02 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassHolderLength: number; /** * Gap between the underside of the top and the top of the shelf, in model units. 0 builds no shelf, and * the shelf must stay above the ground. * @default 0.15 * @minimum 0 * @maximum Infinity * @step 0.01 */ shelfTopOffset: number; /** * Thickness of the shelf, in model units. The shelf spans the full width and the length between * the legs. * @default 0.03 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ shelfThickness: number; /** * Size of each leg along X, in model units. * @default 0.1 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ legWidth: number; /** * Size of each leg along Z, in model units. It must be less than `topGlassOffset` plus * `glassHolderLength`. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ legDepth: number; /** * Meshing precision used when the table is drawn without options, multiplied by `scale`. It must be * above 0; building the shapes does not use it. * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether edges are drawn when the table is drawn without options. Building the shapes ignores it. * @default true */ drawEdges: boolean; /** * Turn of the table around the Y axis, in degrees, applied before it is aligned to `direction` and * moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Uniform scale factor, applied around `origin` after the table is placed. Drawing without options * also multiplies the edge width and precision by it. * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Point on the ground under the center of the table that it is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the table's up axis points along after placement. The default keeps it upright along Y. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } /** * A built Good Coffee Table and a leg index, passed to * `things.furniture.tables.goodCoffeeTable.getLegShapeByIndex` to pick out one of its four legs. */ declare class GoodCoffeeTableLegByIndexDto { /** * The table data returned by `things.furniture.tables.goodCoffeeTable.create`. * @default undefined */ model: GoodCoffeeTableData; /** * 0-based index of the leg in `legParts`, from 0 to 3. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * One leg of the Good Coffee Table, with an id of the form "leg-part-0": its solid, its top and bottom * outlines, their centers and its sizes, returned in `GoodCoffeeTableData.legParts`. */ declare class GoodCoffeeTableLegPart extends Part { /** * Center of the leg's top outline, where it meets the top frame. */ topCenter?: Inputs.Base.Point3; /** * Center of the leg's bottom outline, on the ground. */ bottomCenter?: Inputs.Base.Point3; /** * Size of the leg along X, from `legWidth`, before scaling. */ width: number; /** * Size of the leg along Z, from `legDepth`, before scaling. */ depth: number; /** * Height of the leg: the table height less the top thickness, before scaling. */ height: number; /** * The leg solid as `leg`, and outline wires at its top and bottom. */ shapes?: { topWire?: T; bottomWire?: T; leg?: T; }; } /** * A built Good Coffee Table passed to the getters of `things.furniture.tables.goodCoffeeTable`, which read * its shapes and points out of it. */ declare class GoodCoffeeTableModelDto { /** * The table data returned by `things.furniture.tables.goodCoffeeTable.create`. * @default undefined */ model: GoodCoffeeTableData; } /** * The shelf of the Good Coffee Table, with the id "shelf-part": its solid, outlines and centers, * returned in `GoodCoffeeTableData.shelfPart` when `shelfTopOffset` is above 0. */ declare class GoodCoffeeTableShelfPart extends Part { /** * Center of the shelf's top outline. */ topCenter?: Inputs.Base.Point3; /** * Center of the shelf's bottom outline. */ bottomCenter?: Inputs.Base.Point3; /** * The shelf solid as `compound`, and outline wires at its top and bottom. */ shapes?: { topWire?: T; bottomWire?: T; compound?: T; }; } /** * The top of the Good Coffee Table, with the id "top-part": the wooden frame, the glass panel and their * outlines, returned in `GoodCoffeeTableData.topPart`. */ declare class GoodCoffeeTableTopPart extends Part { /** * Center of the top frame's outline wire. */ topCenter?: Inputs.Base.Point3; /** * The frame as `topFrame` with an outline in `topWire`, the glass as `glassPanel` with its upper * outline in `glassWire`, and the frame alone as `compound`. */ 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 { /** * What `things.furniture.tables.snakeTable.create` returns: the body and glass in `compound`, their shapes by * name in `mainPart` and `drawingPart`, every shape with its id, and the inputs used. */ declare class SnakeTableData { /** * Kind of result, always "parametric-model". */ type: string; /** * Name of the model that produced the result, always "snakeTable". */ name: string; /** * The inputs the table was built from. Drawing without options reads edge and precision settings * from here. */ originalInputs: SnakeTableDto; /** * The body and the glass as one compound, placed by `rotation`, `scale`, `direction` and `origin`. */ compound?: T; /** * The body and the glass as separate shapes, drawn with different materials. */ drawingPart?: SnakeTableDrawingPart; /** * The main part: the body, the glass, the top outline and the center of the top. */ mainPart?: SnakeTableMainPart; /** * Every shape of the table with an id, the compound first. `dispose` deletes each of them. */ shapes?: Models.OCCT.ShapeWithId[]; } /** * Options for drawing a Snake Table, made by `things.furniture.tables.snakeTable.drawOptions`. The two * materials override the defaults, and the rest sets faces, edges and meshing precision. */ declare class SnakeTableDrawDto { /** * Material for the body. Leave it out to keep the default white rough plastic. * @defaul undefined * @optional true */ mainMaterial?: T; /** * Material for the glass. Leave it out to keep the default black glass material. * @defaul undefined * @optional true */ glassMaterial?: T; /** * Whether faces are drawn. When false, only edges are drawn and no material is applied. * @default true */ drawFaces: boolean; /** * Meshing precision of the drawn faces. A smaller value draws smoother curves and takes longer. * @default 0.001 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether the edges of the model are drawn. * @default true */ drawEdges: boolean; /** * Color of the edges as a hex string. * @default #ffffff */ edgeColour: Inputs.Base.Color; /** * Width of the drawn edges. * @default 0.06 * @minimum 0 * @maximum Infinity */ edgeWidth: number; } /** * The Snake Table by drawing group: the body and the glass. The same keys hold shapes in a result and * materials or meshes while the table is drawn. */ declare class SnakeTableDrawingPartShapes { /** * The bent, grooved body. */ main?: T; /** * The glass panel on top. */ glass?: T; } /** * The Snake Table split into the groups that are drawn with different materials, returned in * `SnakeTableData.drawingPart` with the id "drawing-part". */ declare class SnakeTableDrawingPart extends Part { /** * The body and the glass, one entry per drawing group. */ shapes?: SnakeTableDrawingPartShapes; } /** * The property list of the Snake Table with its value types left open; `SnakeTableDto` fills them in * with numbers and points, and documents each property. */ declare class SnakeTableDtoBase { /** * Height of the table. */ height: T; /** * Width of the table across the bent profile. */ width: T; /** * Length of the table along the bent profile. */ length: T; /** * Length of the foot on the ground. */ supportLength: T; /** * Distance from the top down to the shelf. */ shelfHeight: T; /** * Thickness of the glass. */ glassThickness: T; /** * How far the glass reaches past the top. */ glassOffset: T; /** * Thickness of the bent board. */ thickness: T; /** * Depth of the grooves between the planks. */ ornamentDepth: T; /** * Number of planks across the width. */ nrOrnamentPlanks: T; /** * Radius of the bends. */ filletRadius: T; /** * Meshing precision used when the table is drawn. */ precision: T; /** * Turn around the vertical axis before placement. */ rotation?: T; /** * Uniform scale factor. */ scale?: T; /** * Point the table is moved to. */ origin?: U; /** * Direction the table's up axis points along. */ direction?: U; } /** * Parameters of `things.furniture.tables.snakeTable.create`. The sizes, foot and shelf height shape the bent * profile, the board, groove and bend values shape the body, the glass values the top, and `rotation`, * `scale`, `direction` and `origin` place the table. */ 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 from the ground to the top of the glass, in model units. It must be more than * twice `thickness`, and the bend radius less than half of it. * @default 0.74 * @minimum 0 * @maximum Infinity * @step 0.01 */ height: number; /** * Width of the table across the bent profile, along Z, in model units. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.01 */ width: number; /** * Length of the table along the bent profile, along X, in model units. It must be more than twice * `thickness`, and the bend radius less than half of it. * @default 2 * @minimum 0 * @maximum Infinity * @step 0.01 */ length: number; /** * Length of the foot that rests on the ground, centered under the table, in model units. The lower * riser rises from its back end. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.01 */ supportLength: number; /** * Distance from the top of the table down to the shelf, in model units. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.01 */ shelfHeight: number; /** * Thickness of the bent board, in model units. * @default 0.05 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ thickness: number; /** * Thickness of the glass panel on top, in model units. * @default 0.005 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ glassThickness: number; /** * How far the glass reaches past the edges of the top, in model units. 0 makes the glass the same * size as the top. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.01 */ glassOffset: number; /** * Number of planks the board is split into across its width by the grooves. * @default 7 * @minimum 1 * @maximum Infinity * @step 1 */ nrOrnamentPlanks: number; /** * Depth of the grooves between the planks, in model units. * @default 0.01 * @minimum 0.001 * @maximum Infinity * @step 0.001 */ ornamentDepth: number; /** * Radius of the rounded bends between the foot, risers, shelf and top, in model units. * @default 0.05 * @minimum 0.001 * @maximum Infinity * @step 0.01 */ filletRadius: number; /** * Meshing precision used when the table is drawn without options, multiplied by `scale`. It must be * above 0; building the shapes does not use it. * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; /** * Whether edges are drawn when the table is drawn without options. Building the shapes ignores it. * @default true */ drawEdges: boolean; /** * Turn of the table around the Y axis, in degrees, applied before it is aligned to `direction` and * moved to `origin`. * @default 0 * @minimum 0 * @maximum Infinity * @step 10 */ rotation: number; /** * Uniform scale factor, applied around `origin` after the table is placed. Drawing without options * also multiplies the edge width and precision by it. * @default 1 * @minimum 0 * @maximum Infinity */ scale: number; /** * Point on the ground under the center of the table that it is moved to. * @default [0, 0, 0] */ origin: Inputs.Base.Point3; /** * Direction the table's up axis points along after placement. The default keeps it upright along Y. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; } /** * A built Snake Table passed to the getters of `things.furniture.tables.snakeTable`, which read its shapes * and points out of it. */ declare class SnakeTableModelDto { /** * The table data returned by `things.furniture.tables.snakeTable.create`. * @default undefined */ model: SnakeTableData; } /** * The main part of the Snake Table, with the id "main-part": the body, the glass, the top outline and * the center of the top, returned in `SnakeTableData.mainPart`. */ declare class SnakeTableMainPart extends Part { /** * Center of the top outline at the full table height. */ topCenter?: Inputs.Base.Point3; /** * The body as `main`, the glass as `glass`, the top outline as `topWire`, and body and glass together * as `compound`. */ 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 { /** * The base of every named part of a finished model: an id and the placement the model applied to the * part's shapes. A part class extends it with the shapes it holds. */ declare class Part { /** * Name of the part within its model. */ id?: string; /** * Turn around the vertical axis applied to the part's shapes, in degrees. */ rotation?: number; /** * Point the part's shapes were moved to. */ center?: Inputs.Base.Point3; /** * Scale factor along X, Y and Z applied to the part's shapes. */ scale?: Inputs.Base.Vector3; /** * Direction the part's up axis was turned to point along. */ 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 text model: an id and the character's shape, a compound of its faces, solids or shells. * `advanced.text3d.getCharacterShape` and `getCharacterShapes` read it. */ declare class CharacterPart { /** * An identifier for the character, unique within the model. */ id: string; /** * The character's shape, under `compound`. */ shapes?: { compound?: T; }; } /** * One face left after cutting text out of the face it was placed on, with its role: the main cutout or a * piece enclosed by a character. The face getters of `advanced.text3d` read it. */ declare class FacePart { /** * An identifier for the face, unique within the model. */ id: string; /** * Whether this is the main cutout or a piece enclosed by a character, such as the inside of an O. */ type: faceTypeEnum; /** * The face itself, under `face`. */ shapes?: { face?: T; }; } /** * How text placed on a face meets that face. `separatedExtrusion` returns the letters on their own, * `integratedExtrusion` cuts the letters out of the face and sews the raised letters into the cut as one * shell, and `cutout` returns the face with the letters cut out. */ declare enum faceTextVarEnum { separatedExtrusion = "separatedExtrusion", integratedExtrusion = "integratedExtrusion", cutout = "cutout" } /** * The role of a face left after cutting text out of a face. `cutout` marks the main face with the * letter-shaped holes and `cutoutInsideCharacter` a piece enclosed by a character, such as the inside of an * O; the create methods do not produce `compound`. */ declare enum faceTypeEnum { compound = "compound", cutout = "originalCutout", cutoutInsideCharacter = "cutoutInsideCharacter" } /** * A loaded font: its name, family and variant, and the parsed font data the letter outlines are read from. * The create methods look fonts up by `name`. */ declare class FontDefinition { /** * The family and the variant joined by a hyphen, such as `Roboto-Regular`. */ name: string; /** * The font family. */ type?: fontsEnum; /** * The weight and style within the family. */ variant?: fontVariantsEnum; /** * The parsed font the letter outlines are read from. */ font: Font; } /** * The font families shipped with the library and the variants each one provides. The fonts are loaded * from this list, and `fontsEnum` and `fontVariantsEnum` hold the same names. */ declare const fontsModel: { key: string; variants: string[]; }[]; /** * The weights and styles found across the shipped font families. Not every family has every variant: * `fontsModel` lists the ones each family ships, and asking for a missing one throws. */ 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" } /** * The font families shipped with the library. Pass one as `fontType` together with a variant from * `fontVariantsEnum`; the letters are built from the outlines in that family's font file. */ declare enum fontsEnum { Aboreto = "Aboreto", Bungee = "Bungee", IndieFlower = "IndieFlower", Lugrasimo = "Lugrasimo", Orbitron = "Orbitron", Roboto = "Roboto", RobotoSlab = "RobotoSlab", Silkscreen = "Silkscreen", Tektur = "Tektur", Workbench = "Workbench" } /** * Which point of a text lands on its anchor, as one of nine positions from `leftTop` to `rightBottom`. The * offsets come from the text's bounding box, and the bottom positions sit on the baseline. */ declare enum recAlignmentEnum { leftTop = "leftTop", leftMiddle = "leftMiddle", leftBottom = "leftBottom", centerTop = "centerTop", centerMiddle = "centerMiddle", centerBottom = "centerBottom", rightTop = "rightTop", rightMiddle = "rightMiddle", rightBottom = "rightBottom" } /** * The result of every create method of `advanced.text3d`: the whole text as one shape, the shape of each * character and, for text cut into a face, the faces left by the cut. Pass it to the getters of * `advanced.text3d` to read its parts. */ declare class Text3DData { /** * The kind of object, always `parametric-model`. */ type: string; /** * The name of the model, `text3d`. */ name: string; /** * How far the text advances along its line, in the units of `fontSize`. `create` records it; text on a * face records it only when built from a font URL, one text at a time. */ advanceWidth: number; /** * The box around the text's outlines before alignment, in the font's layout coordinates where y grows * downward, scaled to `fontSize`. It is recorded where `advanceWidth` is. */ boundingBox: { x1: number; y1: number; x2: number; y2: number; }; /** * The inputs the model was made from. Only `createTextsOnFace` records them. */ originalInputs?: Text3DDto | Texts3DFaceDto; /** * The whole result as one shape: every letter for free-standing text, or what `faceTextVar` produced for * text on a face. */ compound?: T; /** * One entry per character that has an outline, each holding that character's shape; spaces are skipped. */ characterParts?: CharacterPart[]; /** * The faces left after cutting the letters out of the face the text was placed on, the main cutout first. * Only text on a face that cuts it has them. */ faceParts?: FacePart[]; /** * Every shape of the model paired with the id the model's parts refer to it by. */ shapes?: Models.OCCT.ShapeWithId[]; /** * The center of each character in the order of `characterParts`: the center of mass of its solids when * extruded, of its faces when flat. Several texts on one face leave it unset. */ characterCenterCoordinates: Inputs.Base.Point3[]; } /** * The text, shipped font and placement for `advanced.text3d.create`. The letters are drawn on the XZ plane * and extruded along Y by `height`; `rotation`, `direction`, `originAlignment` and `origin` then place them. */ 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 string to build. Spaces leave a gap but produce no character shape. * @default bitbybit.dev */ text: string; /** * The font family, one of the families shipped with the library. * @default Roboto */ fontType: fontsEnum; /** * The weight and style within `fontType`. Not every family ships every variant, and asking for one it * lacks throws. * @default Regular */ fontVariant: fontVariantsEnum; /** * The size of the font in model units, the height of its em square; capital letters come out somewhat * smaller. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * How far each letter is extruded along `direction`, in model units. 0 returns flat letter faces instead * of solids. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Spins the text about `direction` around the point on `origin`, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The point the anchor chosen by `originAlignment` is placed on. * @default [0, 0, 0] */ origin: Inputs.Base.Vector3; /** * The direction the letters face and are extruded along; the text lies in the plane perpendicular to it. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; /** * Which point of the text lands on its anchor: left, center or right combined with top, middle or bottom. * The offsets come from the text's bounding box, and the bottom positions sit on the baseline. * @default centerMiddle */ originAlignment: recAlignmentEnum; } /** * One text of `advanced.text3d.createTextsOnFace`, made with `advanced.text3d.definition3dTextOnFace`. It * holds what the inputs of `createTextOnFace` hold except the face and `facePlanar`, which every text in the * list shares. */ declare class Text3DFaceDefinitionDto { constructor(faceTextVar?: faceTextVarEnum, text?: string, fontType?: fontsEnum, fontVariant?: fontVariantsEnum, fontSize?: number, height?: number, rotation?: number, originParamU?: number, originParamV?: number, originAlignment?: recAlignmentEnum); /** * How the text meets the face: `separatedExtrusion` returns only the letters, `integratedExtrusion` sews * raised letters into the face with the letters cut out, and `cutout` returns that cut face. * @default separatedExtrusion */ faceTextVar: faceTextVarEnum; /** * The string to build. Spaces leave a gap but produce no character shape. * @default bitbybit.dev */ text: string; /** * The font family, one of the families shipped with the library. * @default Roboto */ fontType: fontsEnum; /** * The weight and style within `fontType`. Not every family ships every variant, and asking for one it * lacks throws. * @default Regular */ fontVariant: fontVariantsEnum; /** * The size of the font, measured in the face's real U and V values rather than in model units, so the * same size can look different on different faces. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * How far each letter is thickened along the face normal, in model units. 0 keeps the letters as faces on * the surface; `cutout` ignores it. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Spins the text around its anchor within the face's UV space, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Where the anchor sits along U, as a fraction of the face's U range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Where the anchor sits along V, as a fraction of the face's V range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Which point of the text lands on its anchor: left, center or right combined with top, middle or bottom. * The offsets come from the text's bounding box, and the bottom positions sit on the baseline. * @default centerMiddle */ originAlignment: recAlignmentEnum; } /** * One text of `advanced.text3d.createTextsOnFaceUrl`, made with `advanced.text3d.definition3dTextOnFaceUrl`. * It holds what the inputs of `createTextOnFaceUrl` hold except the face and `facePlanar`, which every text * in the list shares. */ declare class Text3DFaceDefinitionUrlDto { constructor(faceTextVar?: faceTextVarEnum, text?: string, fontUrl?: string, fontSize?: number, height?: number, rotation?: number, originParamU?: number, originParamV?: number, originAlignment?: recAlignmentEnum); /** * How the text meets the face: `separatedExtrusion` returns only the letters, `integratedExtrusion` sews * raised letters into the face with the letters cut out, and `cutout` returns that cut face. * @default separatedExtrusion */ faceTextVar: faceTextVarEnum; /** * The string to build. Spaces leave a gap but produce no character shape. * @default bitbybit.dev */ text: string; /** * Where to load the font file from. TTF, OTF and WOFF files are read, WOFF2 is not, and outlines that * cross themselves can fail to build. * @default https://git-cdn.bitbybit.dev/latest/fonts/Tektur/Tektur-Bold.ttf */ fontUrl: string; /** * The size of the font, measured in the face's real U and V values rather than in model units, so the * same size can look different on different faces. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * How far each letter is thickened along the face normal, in model units. 0 keeps the letters as faces on * the surface; `cutout` ignores it. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Spins the text around its anchor within the face's UV space, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Where the anchor sits along U, as a fraction of the face's U range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Where the anchor sits along V, as a fraction of the face's V range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Which point of the text lands on its anchor: left, center or right combined with top, middle or bottom. * The offsets come from the text's bounding box, and the bottom positions sit on the baseline. * @default centerMiddle */ originAlignment: recAlignmentEnum; } /** * One text of `advanced.text3d.createTextsOnFaceUrl` once its font file has been loaded: `letterPaths` holds * the outlines read from the font in place of its URL. */ declare class Text3DFaceDefinitionUrlParsedDto { constructor(faceTextVar?: faceTextVarEnum, text?: string, letterPaths?: any, fontSize?: number, height?: number, rotation?: number, originParamU?: number, originParamV?: number, originAlignment?: recAlignmentEnum); /** * How the text meets the face: `separatedExtrusion` returns only the letters, `integratedExtrusion` sews * raised letters into the face with the letters cut out, and `cutout` returns that cut face. * @default separatedExtrusion */ faceTextVar: faceTextVarEnum; /** * The string to build. Spaces leave a gap but produce no character shape. * @default bitbybit.dev */ text: string; /** * The outline of each character, read from the font, scaled to `fontSize` and shifted for * `originAlignment`. It replaces the font URL once the font has been loaded. * @default undefined */ letterPaths: any; /** * The size of the font, measured in the face's real U and V values rather than in model units, so the * same size can look different on different faces. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * How far each letter is thickened along the face normal, in model units. 0 keeps the letters as faces on * the surface; `cutout` ignores it. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Spins the text around its anchor within the face's UV space, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Where the anchor sits along U, as a fraction of the face's U range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Where the anchor sits along V, as a fraction of the face's V range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Which point of the text lands on its anchor: left, center or right combined with top, middle or bottom. * The offsets come from the text's bounding box, and the bottom positions sit on the baseline. * @default centerMiddle */ originAlignment: recAlignmentEnum; } /** * The face, text, shipped font and placement for `advanced.text3d.createTextOnFace`. The text is drawn in the * face's UV space around `originParamU` and `originParamV`, and `faceTextVar` sets how it meets the face. */ 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 to place the text on. * @default undefined */ face: T; /** * Set it to true when the face is flat, so each letter face is built as a plane; leave it false for a * curved face. * @default false */ facePlanar: boolean; /** * How the text meets the face: `separatedExtrusion` returns only the letters, `integratedExtrusion` sews * raised letters into the face with the letters cut out, and `cutout` returns that cut face. */ faceTextVar: faceTextVarEnum; /** * The string to build. Spaces leave a gap but produce no character shape. * @default bitbybit.dev */ text: string; /** * The font family, one of the families shipped with the library. * @default Roboto */ fontType: fontsEnum; /** * The weight and style within `fontType`. Not every family ships every variant, and asking for one it * lacks throws. * @default Regular */ fontVariant: fontVariantsEnum; /** * The size of the font, measured in the face's real U and V values rather than in model units, so the * same size can look different on different faces. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * How far each letter is thickened along the face normal, in model units. 0 keeps the letters as faces on * the surface; `cutout` ignores it. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Spins the text around its anchor within the face's UV space, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Where the anchor sits along U, as a fraction of the face's U range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Where the anchor sits along V, as a fraction of the face's V range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Which point of the text lands on its anchor: left, center or right combined with top, middle or bottom. * The offsets come from the text's bounding box, and the bottom positions sit on the baseline. * @default centerMiddle */ originAlignment: recAlignmentEnum; } /** * The face, text, font URL and placement for `advanced.text3d.createTextOnFaceUrl`. It works like the inputs * of `advanced.text3d.createTextOnFace`, with `fontUrl` naming the font file in place of a shipped family. */ 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 to place the text on. * @default undefined */ face: T; /** * Set it to true when the face is flat, so each letter face is built as a plane; leave it false for a * curved face. * @default false */ facePlanar: boolean; /** * How the text meets the face: `separatedExtrusion` returns only the letters, `integratedExtrusion` sews * raised letters into the face with the letters cut out, and `cutout` returns that cut face. */ faceTextVar: faceTextVarEnum; /** * The string to build. Spaces leave a gap but produce no character shape. * @default bitbybit.dev */ text: string; /** * Where to load the font file from. TTF, OTF and WOFF files are read, WOFF2 is not, and outlines that * cross themselves can fail to build. * @default https://git-cdn.bitbybit.dev/latest/fonts/Tektur/Tektur-Bold.ttf */ fontUrl: string; /** * The size of the font, measured in the face's real U and V values rather than in model units, so the * same size can look different on different faces. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * How far each letter is thickened along the face normal, in model units. 0 keeps the letters as faces on * the surface; `cutout` ignores it. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Spins the text around its anchor within the face's UV space, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Where the anchor sits along U, as a fraction of the face's U range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Where the anchor sits along V, as a fraction of the face's V range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Which point of the text lands on its anchor: left, center or right combined with top, middle or bottom. * The offsets come from the text's bounding box, and the bottom positions sit on the baseline. * @default centerMiddle */ originAlignment: recAlignmentEnum; } /** * The inputs of `advanced.text3d.createTextOnFaceUrl` once the font file has been loaded, as the geometry is * built from them: `letterPaths` holds the outlines read from the font in place of its URL. */ 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 to place the text on. * @default undefined */ face: T; /** * Set it to true when the face is flat, so each letter face is built as a plane; leave it false for a * curved face. * @default false */ facePlanar: boolean; /** * How the text meets the face: `separatedExtrusion` returns only the letters, `integratedExtrusion` sews * raised letters into the face with the letters cut out, and `cutout` returns that cut face. */ faceTextVar: faceTextVarEnum; /** * The string to build. Spaces leave a gap but produce no character shape. * @default bitbybit.dev */ text: string; /** * The outline of each character, read from the font, scaled to `fontSize` and shifted for * `originAlignment`. It replaces the font URL once the font has been loaded. * @default undefined */ letterPaths: any; /** * The size of the font, measured in the face's real U and V values rather than in model units, so the * same size can look different on different faces. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * How far each letter is thickened along the face normal, in model units. 0 keeps the letters as faces on * the surface; `cutout` ignores it. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Spins the text around its anchor within the face's UV space, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * Where the anchor sits along U, as a fraction of the face's U range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamU: number; /** * Where the anchor sits along V, as a fraction of the face's V range from 0 at its start to 1 at its end. * @default 0.5 * @minimum 0 * @maximum 1 * @step 0.1 */ originParamV: number; /** * Which point of the text lands on its anchor: left, center or right combined with top, middle or bottom. * The offsets come from the text's bounding box, and the bottom positions sit on the baseline. * @default centerMiddle */ originAlignment: recAlignmentEnum; } /** * A text model and the index of one of its characters, for `advanced.text3d.getCharacterShape`. */ declare class Text3DLetterByIndexDto { /** * A text model returned by one of the create methods of `advanced.text3d`. * @default undefined */ model: Text3DData; /** * Which character to return, counted from 0 over the characters that have an outline; spaces are skipped. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * A text model to read from, for the getters of `advanced.text3d` such as `getCompoundShape`, * `getCharacterShapes` and `getFaceCutout`. */ declare class Text3DModelDto { /** * A text model returned by one of the create methods of `advanced.text3d`. * @default undefined */ model: Text3DData; } /** * The text, font URL and placement for `advanced.text3d.createWithUrl`. It works like the inputs of * `advanced.text3d.create`, with `fontUrl` naming the font file in place of a shipped family. */ 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 string to build. Spaces leave a gap but produce no character shape. * @default bitbybit.dev */ text: string; /** * Where to load the font file from. TTF, OTF and WOFF files are read, WOFF2 is not, and outlines that * cross themselves can fail to build. * @default https://git-cdn.bitbybit.dev/latest/fonts/Tektur/Tektur-Bold.ttf */ fontUrl: string; /** * The size of the font in model units, the height of its em square; capital letters come out somewhat * smaller. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * How far each letter is extruded along `direction`, in model units. 0 returns flat letter faces instead * of solids. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Spins the text about `direction` around the point on `origin`, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The point the anchor chosen by `originAlignment` is placed on. * @default [0, 0, 0] */ origin: Inputs.Base.Vector3; /** * The direction the letters face and are extruded along; the text lies in the plane perpendicular to it. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; /** * Which point of the text lands on its anchor: left, center or right combined with top, middle or bottom. * The offsets come from the text's bounding box, and the bottom positions sit on the baseline. * @default centerMiddle */ originAlignment: recAlignmentEnum; } /** * The inputs of `advanced.text3d.createWithUrl` once the font file has been loaded, as the geometry is built * from them: `letterPaths` holds the outlines read from the font in place of its URL. */ 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 string to build. Spaces leave a gap but produce no character shape. * @default bitbybit.dev */ text: string; /** * The outline of each character, read from the font, scaled to `fontSize` and shifted for * `originAlignment`. It replaces the font URL once the font has been loaded. * @default undefined */ letterPaths: any; /** * The size of the font in model units, the height of its em square; capital letters come out somewhat * smaller. * @default 1.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ fontSize: number; /** * How far each letter is extruded along `direction`, in model units. 0 returns flat letter faces instead * of solids. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ height: number; /** * Spins the text about `direction` around the point on `origin`, in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 15 */ rotation: number; /** * The point the anchor chosen by `originAlignment` is placed on. * @default [0, 0, 0] */ origin: Inputs.Base.Vector3; /** * The direction the letters face and are extruded along; the text lies in the plane perpendicular to it. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; /** * Which point of the text lands on its anchor: left, center or right combined with top, middle or bottom. * The offsets come from the text's bounding box, and the bottom positions sit on the baseline. * @default centerMiddle */ originAlignment: recAlignmentEnum; } /** * One face and the texts to place on it, for `advanced.text3d.createTextsOnFace`. Every definition shares * `face` and `facePlanar` and brings its own font, size, placement and `faceTextVar`. */ declare class Texts3DFaceDto { constructor(face: T, facePlanar?: boolean, definitions?: Text3DFaceDefinitionDto[]); /** * The face every text is placed on. * @default undefined */ face: T; /** * Set it to true when the face is flat, so each letter face is built as a plane; leave it false for a * curved face. * @default false */ facePlanar: boolean; /** * The texts to place, each made with `advanced.text3d.definition3dTextOnFace`. * @default undefined */ definitions: Text3DFaceDefinitionDto[]; } /** * One face and the texts with font URLs to place on it, for `advanced.text3d.createTextsOnFaceUrl`. Every * definition shares `face` and `facePlanar` and brings its own font file, size and placement. */ declare class Texts3DFaceUrlDto { constructor(face: T, facePlanar?: boolean, definitions?: Text3DFaceDefinitionUrlDto[]); /** * The face every text is placed on. * @default undefined */ face: T; /** * Set it to true when the face is flat, so each letter face is built as a plane; leave it false for a * curved face. * @default false */ facePlanar: boolean; /** * The texts to place, each made with `advanced.text3d.definition3dTextOnFaceUrl`. * @default undefined */ definitions: Text3DFaceDefinitionUrlDto[]; } /** * The inputs of `advanced.text3d.createTextsOnFaceUrl` once every font file has been loaded, as the geometry * is built from them: each definition carries its outlines in place of its URL. */ declare class Texts3DFaceUrlParsedDto { constructor(face: T, facePlanar?: boolean, definitions?: Text3DFaceDefinitionUrlParsedDto[]); /** * The face every text is placed on. * @default undefined */ face: T; /** * Set it to true when the face is flat, so each letter face is built as a plane; leave it false for a * curved face. * @default false */ facePlanar: boolean; /** * The texts to place, each with the outlines read from its font. * @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 { /** * The faces, grid size and attractor points for * `advanced.patterns.facePatterns.pyramidSimple.createPyramidSimpleAffectors`. Every pyramid starts at * `defaultHeight`, and each affector adds height to the cells within its radius. */ declare class PyramidSimpleAffectorsDto { constructor(faces?: T[], affectorPoints?: Inputs.Base.Point3[], uNumber?: number, vNumber?: number, minHeight?: number, maxHeight?: number, precision?: number); /** * The faces to cover. Each gets its own grid, and the getters count faces from 0 in this order. * @default undefined */ faces: T[]; /** * The points that change the heights of nearby pyramids, measured from each cell's center. The radius and * factor lists pair with these points by index. * @default undefined */ affectorPoints: Inputs.Base.Point3[]; /** * How far each affector reaches, in model units; cells whose center lies farther away keep their height. * Leave it out to give every affector a radius of 10. * @default undefined * @optional true */ affectorRadiusList?: number[]; /** * How strongly each affector acts, from -1 to 1: a positive factor raises the pyramids near it, a * negative one lowers them. Leave it out to give every affector a factor of 1. * @default undefined * @optional true */ affectorFactors?: number[]; /** * How many cells, and so pyramids, each face gets along U. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ uNumber: number; /** * How many cells, and so pyramids, each face gets along V. * @default 5 * @minimum 1 * @maximum Infinity * @step 1 */ vNumber: number; /** * The height of every pyramid before the affectors act, in model units, measured along the averaged * surface normal. * @default 0.2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ defaultHeight: number; /** * The height an affector adds to the farthest cell it reaches, in model units, before its factor scales * it. * @default 0 * @minimum 0 * @maximum Infinity * @step 0.1 */ affectMinHeight: number; /** * The height an affector adds to the closest cell it reaches, in model units, before its factor scales * it. * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ affectMaxHeight: number; /** * The meshing precision used when the model is drawn; a smaller value gives a finer mesh. The shapes in * the model do not depend on it. * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; } /** * A pyramid model and the index of one of its pyramids. No method of * `advanced.patterns.facePatterns.pyramidSimple` takes it; the getters address cells by face, U and V index * instead. */ declare class PyramidSimpeByIndexDto { /** * A pyramid model returned by one of the create methods of * `advanced.patterns.facePatterns.pyramidSimple`. * @default undefined */ model: PyramidSimpleData; /** * Which pyramid to return, counted from 0. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ index: number; } /** * One cell of a pyramid model: its place in the grid, its corner, center and apex points and the triangles of * its pyramid. The cell getters of `advanced.patterns.facePatterns.pyramidSimple` read it. */ declare class PyramidSimpleCellPart { /** * An identifier built from the cell's indexes, such as `cell-0-0`. */ id: string; /** * The cell's position along U, counted from 0. */ uIndex: number; /** * The cell's position along V, counted from 0. */ vIndex: number; /** * The corner at the cell's own U and V step. */ cornerPoint1: Inputs.Base.Point3; /** * The corner one grid step further along U. */ cornerPoint2: Inputs.Base.Point3; /** * The corner one grid step further along both U and V. */ cornerPoint3: Inputs.Base.Point3; /** * The corner one grid step further along V. */ cornerPoint4: Inputs.Base.Point3; /** * The surface normal at `cornerPoint1`. */ cornerNormal1?: Inputs.Base.Vector3; /** * The surface normal at `cornerPoint2`. */ cornerNormal2?: Inputs.Base.Vector3; /** * The surface normal at `cornerPoint3`. */ cornerNormal3?: Inputs.Base.Vector3; /** * The surface normal at `cornerPoint4`. */ cornerNormal4?: Inputs.Base.Vector3; /** * The average of the four corner points; on a curved face it can sit slightly off the surface. */ centerPoint?: Inputs.Base.Point3; /** * The average of the four corner normals, scaled to length 1; the apex is raised along it. */ centerNormal?: Inputs.Base.Point3; /** * The apex of the pyramid, the center point moved along the center normal by the cell's height. */ topPoint?: Inputs.Base.Point3; /** * The four triangular sides and their closed outlines, numbered by the cell edge they stand on (1 runs * from corner 1 to 2), and their compound. A side whose corners coincide is missing. */ shapes?: { wire1?: T; wire2?: T; wire3?: T; wire4?: T; face1?: T; face2?: T; face3?: T; face4?: T; compound?: T; }; } /** * The result of both create methods of `advanced.patterns.facePatterns.pyramidSimple`: the compound of every * pyramid and, for each face, its cells and grid polylines. Pass it to the getters of the same class to read * its parts. */ declare class PyramidSimpleData { /** * The kind of object, always `parametric-model`. */ type: string; /** * The name of the model, `patternsFacePatternPyramidSimple`. */ name: string; /** * The inputs the model was made from, which the getters read the cell counts and drawing precision from. */ originalInputs?: PyramidSimpleDto | PyramidSimpleAffectorsDto; /** * Every pyramid on every face as one compound. */ compound?: T; /** * Every shape of the model paired with the id the model's parts refer to it by. */ shapes?: Models.OCCT.ShapeWithId[]; /** * One entry per face, in the order the faces were given, holding its cells and its shapes. */ faceParts?: PyramidSimpleFacePart[]; /** * The apex points of the pyramids. The create methods leave it unset; read the apexes with * `getTopPointsOfCells` instead. */ topCoordinates: Inputs.Base.Point3[]; } /** * The faces, grid size and pyramid height for * `advanced.patterns.facePatterns.pyramidSimple.createPyramidSimple`. Each face is split into `uNumber` by * `vNumber` cells, and every cell gets a pyramid `height` high. */ declare class PyramidSimpleDto { constructor(faces?: T[], uNumber?: number, vNumber?: number, height?: number); /** * The faces to cover. Each gets its own grid, and the getters count faces from 0 in this order. * @default undefined */ faces: T[]; /** * How many cells, and so pyramids, each face gets along U. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ uNumber: number; /** * How many cells, and so pyramids, each face gets along V. * @default 10 * @minimum 1 * @maximum Infinity * @step 1 */ vNumber: number; /** * How far each apex sits from its cell's center along the averaged surface normal, in model units. A * negative value points the pyramids against the normal. * @default 0.2 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ height: number; /** * The meshing precision used when the model is drawn; a smaller value gives a finer mesh. The shapes in * the model do not depend on it. * @default 0.01 * @minimum 0.000001 * @maximum 5 * @step 0.001 */ precision: number; } /** * The pyramids on one face of a pyramid model: the face's cells and the shapes built over its grid, the * compound of its pyramids and the polylines along the grid lines. */ declare class PyramidSimpleFacePart { /** * An identifier for the face, such as `face-0`, unique within the model. */ id: string; /** * The cells of this face, ordered by U index and then by V index within it. */ cells?: PyramidSimpleCellPart[]; /** * The compound of this face's pyramids and the grid polylines: the first and last line along each * direction, and compounds of all lines of constant U and of constant V. */ shapes?: { compound?: T; startPolylineWireU?: T; startPolylineWireV?: T; endPolylineWireU?: T; endPolylineWireV?: T; compoundPolylineWiresU?: T; compoundPolylineWiresV?: T; compoundPolylineWiresUV?: T; }; } /** * One pyramid cell to read from. No method of `advanced.patterns.facePatterns.pyramidSimple` takes it; the * cell getters take a list of cells instead. */ declare class PyramidSimpleModelCellDto { /** * The cell to read. * @default undefined */ cells: PyramidSimpleCellPart; } /** * A list of pyramid cells to read from, for the getters of `advanced.patterns.facePatterns.pyramidSimple` * that return one value per cell, such as `getTopPointsOfCells` and `getCompoundShapesOfCells`. */ declare class PyramidSimpleModelCellsDto { /** * The cells to read, as returned by `getAllPyramidCells` or its siblings. * @default undefined */ cells: PyramidSimpleCellPart[]; } /** * A list of pyramid cells and an index from 0 to 3, for the getters of * `advanced.patterns.facePatterns.pyramidSimple` that pick one corner, side or outline of each cell, such as * `getCornerPointOfCells` and `getFaceShapesOfCells`. */ declare class PyramidSimpleModelCellsIndexDto { /** * The cells to read, as returned by `getAllPyramidCells` or its siblings. * @default undefined */ cells: PyramidSimpleCellPart[]; /** * Which corner, side or outline of each cell to return: 0 to 3 pick corners 1 to 4, or the sides standing * on the edges that start at those corners. * @default 0 * @minimum 0 * @maximum 3 * @step 1 */ index: number; } /** * A pyramid model to read from, for the getters of `advanced.patterns.facePatterns.pyramidSimple` that need * nothing else, such as `getCompoundShape` and `getAllPyramidCells`. */ declare class PyramidSimpleModelDto { /** * A pyramid model returned by one of the create methods of * `advanced.patterns.facePatterns.pyramidSimple`. * @default undefined */ model: PyramidSimpleData; } /** * A pyramid model, one of its faces and one cell on it, for * `advanced.patterns.facePatterns.pyramidSimple.getCellOnIndex` and `getCompoundShapeCellOnFace`. */ declare class PyramidSimpleModelFaceCellIndexDto { /** * A pyramid model returned by one of the create methods of * `advanced.patterns.facePatterns.pyramidSimple`. * @default undefined */ model: PyramidSimpleData; /** * Which face of the model to read, counted from 0 in the order the faces were given. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ faceIndex: number; /** * The cell's position along U, counted from 0; it must be below the model's `uNumber`. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ uIndex: number; /** * The cell's position along V, counted from 0; it must be below the model's `vNumber`. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ vIndex: number; } /** * A pyramid model, one of its faces and a U index, for * `advanced.patterns.facePatterns.pyramidSimple.getAllPyramidUCellsOnFaceAtU`, which returns the row of cells * at that U index. */ declare class PyramidSimpleModelFaceCellsUIndexDto { /** * A pyramid model returned by one of the create methods of * `advanced.patterns.facePatterns.pyramidSimple`. * @default undefined */ model: PyramidSimpleData; /** * Which face of the model to read, counted from 0 in the order the faces were given. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ faceIndex: number; /** * The U index of the row, counted from 0; an index with no cells gives an empty list. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ uIndex: number; } /** * A pyramid model, one of its faces and a V index, for * `advanced.patterns.facePatterns.pyramidSimple.getAllPyramidUCellsOnFaceAtV`, which returns the row of cells * at that V index. */ declare class PyramidSimpleModelFaceCellsVIndexDto { /** * A pyramid model returned by one of the create methods of * `advanced.patterns.facePatterns.pyramidSimple`. * @default undefined */ model: PyramidSimpleData; /** * Which face of the model to read, counted from 0 in the order the faces were given. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ faceIndex: number; /** * The V index of the row, counted from 0; an index with no cells gives an empty list. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ vIndex: number; } /** * A pyramid model and the index of one of its faces, for the getters of * `advanced.patterns.facePatterns.pyramidSimple` that read one face, such as `getCompoundShapeOnFace` and * `getStartPolylineWireU`. */ declare class PyramidSimpleModelFaceIndexDto { /** * A pyramid model returned by one of the create methods of * `advanced.patterns.facePatterns.pyramidSimple`. * @default undefined */ model: PyramidSimpleData; /** * Which face of the model to read, counted from 0 in the order the faces were given. * @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 { /** * Destination and motion for `advanced.navigation.flyTo`: the camera ends at `cameraPosition` looking * at `cameraTarget`, getting there over `animationSpeed` seconds along the `ease` curve. */ declare class FlyToDto { constructor(cameraPosition?: Inputs.Base.Point3, cameraTarget?: Inputs.Base.Point3, animationSpeed?: number, ease?: Inputs.Math.easeEnum); /** * Where the camera ends up; with `cameraTarget` it sets the viewing direction and the orbit * distance. * @default [10, 10, 10] */ cameraPosition: Inputs.Base.Point3; /** * Point the camera looks at, and orbits around, once it arrives. * @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` curves start gently, `easeOut` curves end gently * and `easeInOut` curves do both; elastic, back and bounce curves overshoot or rebound. * @default easeInOutCubic */ ease: Inputs.Math.easeEnum; } /** * Meshes, viewing direction and motion for `advanced.navigation.focusFromAngle`, which targets the * center of the meshes' combined bounding box and orbits the camera to the angle `orientation` sets. */ declare class FocusFromAngleDto { constructor(meshes?: BABYLON.Mesh[], includeChildren?: boolean, orientation?: number[], distance?: number, padding?: number, animationSpeed?: number, ease?: Inputs.Math.easeEnum); /** * Meshes to focus on; an empty list logs a warning and leaves the camera where it is. * @default [] */ meshes: BABYLON.Mesh[]; /** * Counts each mesh's child meshes in the bounding box too. * @default true */ includeChildren: boolean; /** * Direction to view from as [x, y, z], scaled to any length: `y` sets how high the camera sits * over the center, and `x` and `z` its heading around the vertical axis. * @default [1, 1, 1] */ orientation: number[]; /** * Distance from the bounding box center to the camera, in model units. Leave it out, or set 0 or * less, to work it out from the box diagonal, the field of view and `padding`. * @default undefined * @minimum 0.01 * @maximum Infinity * @step 0.1 * @optional true */ distance?: number; /** * Multiplies the worked-out distance when `distance` is left out, so larger values leave more * room around the meshes. It is ignored when `distance` is given. * @default 1.5 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ padding: number; /** * Length of the camera move in seconds. * @default 1.0 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ animationSpeed: number; /** * Easing curve of the camera move: `easeIn` curves start gently, `easeOut` curves end gently * and `easeInOut` curves do both; elastic, back and bounce curves overshoot or rebound. * @default easeInOutCubic */ ease: Inputs.Math.easeEnum; } /** * A clickable marker for `advanced.navigation.pointOfInterest`: it sits at `position` with `name` as * its label, and a click flies the camera to `cameraPosition` looking at `cameraTarget` over * `animationSpeed` seconds along `ease`. */ 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); /** * Label shown beside the marker; an empty name shows no label. * @default Point of Interest */ name: string; /** * Where the marker sits in the scene. * @default [0, 1, 0] */ position: Inputs.Base.Point3; /** * Point the camera looks at, and orbits around, once a click has flown it to `cameraPosition`. * @default [0, 0, 0] */ cameraTarget: Inputs.Base.Point3; /** * Where a click flies the camera to; with `cameraTarget` it sets the viewing direction and the * orbit distance. * @default [10, 10, 10] */ cameraPosition: Inputs.Base.Point3; /** * Look of the marker, ring and label. Leave it out for the defaults; properties left out of a * given style keep their defaults too. * @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 click flight: `easeIn` curves start gently, `easeOut` curves end gently * and `easeInOut` curves do both; elastic, back and bounce curves overshoot or rebound. * @default easeInOutCubic */ ease: Inputs.Math.easeEnum; } /** * A point of interest ready to draw, returned by `advanced.navigation.pointOfInterest`: the * `PointOfInterestDto` properties plus the markers by which `draw.drawAnyAsync` recognizes it. */ declare class PointOfInterestEntity extends PointOfInterestDto { type: string; entityName: string; } /** * Look of a point of interest, built by `advanced.navigation.pointOfInterestStyle` and passed as * `style`. Sizes are in hundredths of a model unit, and with `stableSize` they hold steady on screen. */ 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 solid center sphere in hundredths of a model unit, so 20 is 0.2 units. With * `stableSize` that is its size seen from 10 units away. * @default 20 */ pointSize?: number | undefined; /** * Color of the center sphere, drawn unlit. * @default #ffffff */ pointColor?: Inputs.Base.Color; /** * Color of the center sphere while the pointer is over the marker; the sphere also grows by a fifth. * @default #0000ff */ hoverPointColor?: Inputs.Base.Color; /** * Color of the ring that pulses around the point, drawn at most 30 percent opaque. * @default #ffffff */ pulseColor?: Inputs.Base.Color; /** * Color of the pulsing ring while the pointer is over the marker. * @default #0000ff */ hoverPulseColor?: Inputs.Base.Color; /** * Diameter the ring starts each pulse at, in hundredths of a model unit. * @default 20 */ pulseMinSize?: number | undefined; /** * Diameter the ring grows to as it fades, in hundredths of a model unit. It is also the size of the * invisible sphere that catches hovers and clicks. * @default 50 */ pulseMaxSize?: number | undefined; /** * Thickness of the ring in hundredths of a model unit; 0 falls back to 10. * @default 2 */ pulseThickness?: number | undefined; /** * How fast the ring pulses: one grow-and-shrink cycle lasts 2 pi divided by this value, in seconds, * so 3 gives about two seconds. * @default 3 */ pulseSpeed?: number | undefined; /** * Color of the label text, and of the outline around its background when `textBackgroundStroke` * is set. * @default #ffffff */ textColor?: Inputs.Base.Color; /** * Color of the label text while the pointer is over the marker. * @default #0000ff */ hoverTextColor?: Inputs.Base.Color; /** * Label size: 16 makes the label plane 0.3 model units tall before `stableSize` scaling, and the * plane scales in proportion. * @default 14 */ textSize?: number | undefined; /** * Weight of the label's Arial font, as in CSS: 400 is regular and 700 bold. * @default 400 * @minimum 100 * @maximum 900 * @step 100 */ textFontWeight?: number | undefined; /** * Fill color behind the label; it shows only when `textBackgroundOpacity` is above 0. * @default #000000 */ textBackgroundColor?: Inputs.Base.Color; /** * Opacity of the label background, from 0 for none to 1 for solid. The default 0 shows no * background. * @default 0.0 * @minimum 0 * @maximum 1 * @step 0.1 */ textBackgroundOpacity: number; /** * Draws an outline in the text color around the label background, whatever its opacity. * @default false */ textBackgroundStroke: boolean; /** * Width of the background outline in pixels of the label's texture, on which the text is eight * times `textSize` pixels tall. * @default 8 * @minimum 1 * @maximum 20 * @step 1 */ textBackgroundStrokeThickness: number; /** * Corner radius of the label background in pixels of the label's texture, on which the text is * eight times `textSize` pixels tall. * @default 40 * @minimum 0 * @maximum 100 * @step 5 */ textBackgroundRadius: number; /** * Whether the label sits above or below the marker as seen from the camera; it is moved every frame * to stay there. * @default bottom */ textPosition: Inputs.Base.topBottomEnum; /** * Rescales the marker and its label every frame by their camera distance divided by 10, never below * 0.1, so they keep the size they have 10 model units away. * @default true */ stableSize: boolean; /** * Draws the sphere, the ring and the label over other geometry instead of letting it hide them. * @default false */ alwaysOnTop: boolean; } /** * Meshes and motion for `advanced.navigation.zoomOn` and `advanced.navigation.zoomOnAspect`, which * keep the viewing angle and move the camera's target and distance so the meshes fill the view. */ declare class ZoomOnDto { constructor(meshes?: BABYLON.Mesh[], includeChildren?: boolean, animationSpeed?: number, offset?: number, doNotUpdateMaxZ?: boolean, ease?: Inputs.Math.easeEnum); /** * Meshes to frame; an empty list logs a warning and leaves the camera where it is. * @default [] */ meshes: BABYLON.Mesh[]; /** * Frames each mesh's child meshes too. `zoomOn` counts only meshes that have vertices, while * `zoomOnAspect` counts the bounding box of every mesh. * @default true */ includeChildren: boolean; /** * Length of the camera move in seconds. * @default 0.8 * @minimum 0.01 * @maximum Infinity * @step 0.01 */ animationSpeed: number; /** * Scales the framed distance by 1 plus this value, so negative values move closer and positive ones * leave more room. At 0, `zoomOn` keeps the camera's built-in margin and `zoomOnAspect` fits the box * to the view. * @default 0 * @minimum -0.9 * @maximum Infinity * @step 0.1 */ offset: number; /** * Keeps the camera's far clipping distance as it is. When false, `zoomOn` sets it from the size of * the framed meshes; `zoomOnAspect` never changes it. * @default true */ doNotUpdateMaxZ: boolean; /** * Easing curve of the camera move: `easeIn` curves start gently, `easeOut` curves end gently * and `easeInOut` curves do both; elastic, back and bounce curves overshoot or rebound. * @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 { /** * An angular dimension for `advanced.dimensions.angularDimension`: the angle at `centerPoint` between * `direction1` and `direction2`, drawn as an arc of `radius`, with the label text set by * `decimalPlaces`, `labelSuffix` and `labelOverwrite`. */ 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); /** * Vertex of the angle, where both directions start. * @default [0, 0, 0] */ centerPoint: Inputs.Base.Point3; /** * First arm of the angle; only its direction counts, not its length. * @default [1, 0, 0] */ direction1: Inputs.Base.Vector3; /** * Second arm of the angle. The arc spans the smaller angle between the two arms, so the value is * at most half a turn. * @default [0, 1, 0] */ direction2: Inputs.Base.Vector3; /** * Radius of the arc in model units; the line along each arm runs past it by the style's * `extensionLineLength`. * @default 1 * @minimum 0.1 * @maximum Infinity * @step 0.1 */ radius: number; /** * Distance in model units beyond the arc at which the label sits, on the line halfway between * the two arms. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Digits after the decimal point in the label. * @default 1 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Text after the value, separated by a space. The value is in radians although the default is a * degree sign; set `labelOverwrite` to `val*57.29578` to show degrees. * @default ° */ labelSuffix: string; /** * Label expression where `val` is the measured value: arithmetic such as `val/25.4` is evaluated, * while other text such as `Width val` shows the rounded value in place of `val`. * @default 1*val */ labelOverwrite: string; /** * Not read when the dimension is drawn: the label always shows radians unless `labelOverwrite` * converts the value. * @default false */ radians: boolean; /** * Drops zeros at the end of the rounded value, so 2.50 reads 2.5 and 3.00 reads 3. * @default false */ removeTrailingZeros: boolean; /** * Look of the lines, arrowheads and label; leave it out for the defaults of `DimensionStyleDto`. * @default undefined * @optional true */ style?: DimensionStyleDto; } /** * An angular dimension ready to draw, returned by `advanced.dimensions.angularDimension`: the * `AngularDimensionDto` properties plus the markers by which `draw.drawAnyAsync` recognizes it. */ declare class AngularDimensionEntity extends AngularDimensionDto { type: string; entityName: string; /** * Identifier the caller may attach to tell dimensions apart; drawing does not read it. * @ignore true */ id?: string; } /** * A diametral dimension for `advanced.dimensions.diametralDimension`: a line of length `diameter` * through `centerPoint` along `direction`, labeled with that diameter after a diameter sign. */ 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 of the circle; the diameter line is centered on it. * @default [0, 0, 0] */ centerPoint: Inputs.Base.Point3; /** * Direction the diameter line runs in; only its direction counts, not its length. * @default [1, 0, 0] */ direction: Inputs.Base.Vector3; /** * Length of the line and the value shown, in model units. It is taken as given, not measured * from any geometry. * @default 2 * @minimum 0.01 * @maximum Infinity * @step 0.1 */ diameter: number; /** * Distance in model units from the center to the label, square to `direction` in the XZ plane, * or along X when `direction` is vertical. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Digits after the decimal point in the label. * @default 2 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Text after the value, separated by a space. Lengths are in model units, so `mm` is only a label. * @default mm */ labelSuffix: string; /** * Label expression where `val` is the measured value: arithmetic such as `val/25.4` is evaluated, * other text gets the rounded value in place of `val`. The diameter-sign prefix is added either way. * @default 1*val */ labelOverwrite: string; /** * Draws a small cross at `centerPoint` with its arms along X and Y, four times the style's * `arrowSize` across. * @default true */ showCenterMark: boolean; /** * Drops zeros at the end of the rounded value, so 2.50 reads 2.5 and 3.00 reads 3. * @default false */ removeTrailingZeros: boolean; /** * Look of the lines, arrowheads and label; leave it out for the defaults of `DimensionStyleDto`. * @default undefined * @optional true */ style?: DimensionStyleDto; } /** * A diametral dimension ready to draw, returned by `advanced.dimensions.diametralDimension`: the * `DiametralDimensionDto` properties plus the markers by which `draw.drawAnyAsync` recognizes it. */ declare class DiametralDimensionEntity extends DiametralDimensionDto { type: string; entityName: string; /** * Identifier the caller may attach to tell dimensions apart; drawing does not read it. * @ignore true */ id?: string; } /** * Colors, sizes and label settings shared by every dimension kind, built by * `advanced.dimensions.dimensionStyle` and passed as `style`. Lengths are in model units; label * background measures are in pixels of the label's texture. */ 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 the dimension, extension and leader lines and of the center mark, drawn unlit so it * reads the same under any lighting. * @default #ffffff */ lineColor: Inputs.Base.Color; /** * Diameter of the tubes the lines are drawn as, in model units. * @default 0.01 * @minimum 0.01 * @maximum 0.5 * @step 0.01 */ lineThickness: number; /** * How far extension lines run past the dimension line, in model units. Linear dimensions scale it * by the length of their `direction`; radial, diametral and ordinate ones draw no extension lines. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ extensionLineLength: number; /** * Length in model units of the short line that continues past each arrowhead; 0 draws none. Only * linear and angular dimensions draw it. * @default 0.2 * @minimum 0 * @maximum Infinity * @step 0.1 */ arrowTailLength: number; /** * Color of the label text, and of the outline around its background when `textBackgroundStroke` * is set. * @default #ffffff */ textColor: Inputs.Base.Color; /** * Label size: 16 makes the label plane 0.3 model units tall, and the plane scales in proportion. * @default 16 * @minimum 0 * @maximum Infinity * @step 2 */ textSize: number; /** * Weight of the label's Arial font, as in CSS: 400 is regular and 700 bold. * @default 400 * @minimum 100 * @maximum 900 * @step 100 */ textFontWeight: number; /** * Fill color behind the label; it shows only when `textBackgroundOpacity` is above 0. * @default #000000 */ textBackgroundColor: Inputs.Base.Color; /** * Opacity of the label background, from 0 for none to 1 for solid. The default 0 shows no * background. * @default 0.0 * @minimum 0 * @maximum 1 * @step 0.1 */ textBackgroundOpacity: number; /** * Draws an outline in the text color around the label background, whatever its opacity. * @default false */ textBackgroundStroke: boolean; /** * Width of the background outline in pixels of the label's texture, on which the text is eight * times `textSize` pixels tall. * @default 8 * @minimum 1 * @maximum 20 * @step 1 */ textBackgroundStrokeThickness: number; /** * Corner radius of the label background in pixels of the label's texture, on which the text is * eight times `textSize` pixels tall. * @default 40 * @minimum 0 * @maximum 100 * @step 5 */ textBackgroundRadius: number; /** * Rescales the label every frame by its camera distance divided by 10, so it keeps the size it has * 10 model units from the camera. * @default false */ textStableSize: boolean; /** * Arrowhead size in model units: each cone is twice this long and 1.5 times this wide. Center * marks span four times this. * @default 0.05 * @minimum 0 * @maximum Infinity * @step 0.01 */ arrowSize: number; /** * Color of the arrowheads, drawn unlit like the lines. * @default #ffffff */ arrowColor: Inputs.Base.Color; /** * Draws the cone arrowheads; when false the lines end bare. * @default true */ showArrows: boolean; /** * Turns the label to face the camera every frame; when false it stays a flat plane parallel to * the XY plane. * @default true */ textBillboard: boolean; /** * Has no effect: labels are planes in the scene, hidden behind other geometry by depth unless * `alwaysOnTop` is set. * @default 100 * @minimum 50 * @maximum 1000 * @step 50 */ occlusionCheckInterval: number; /** * Draws the label over other geometry instead of letting it be hidden. Lines and arrowheads are * not affected. * @default false */ alwaysOnTop: boolean; } /** * A linear dimension for `advanced.dimensions.linearDimension`: the distance between `startPoint` and * `endPoint`, drawn on a line shifted from them by `direction`, with the label text set by * `decimalPlaces`, `labelSuffix` and `labelOverwrite`. */ 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); /** * First point measured; an extension line runs from it to the dimension line. * @default [0, 0, 0] */ startPoint: Inputs.Base.Point3; /** * Second point measured. The value shown is its straight-line distance from `startPoint`, not a * distance along any axis. * @default [1, 0, 0] */ endPoint: Inputs.Base.Point3; /** * Shift from the measured points to the dimension line; its length is how far the line sits from * them, in model units, and it also scales the style's `extensionLineLength`. * @default [0, 1, 0] */ direction: Inputs.Base.Vector3; /** * Distance in model units from the middle of the dimension line to the label, further along * `direction`. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Digits after the decimal point in the label. * @default 2 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Text after the value, separated by a space. Lengths are in model units, so `mm` is only a label. * @default mm */ labelSuffix: string; /** * Label expression where `val` is the measured value: arithmetic such as `val/25.4` is evaluated, * while other text such as `Width val` shows the rounded value in place of `val`. * @default 1*val */ labelOverwrite: string; /** * Drops zeros at the end of the rounded value, so 2.50 reads 2.5 and 3.00 reads 3. * @default false */ removeTrailingZeros: boolean; /** * Look of the lines, arrowheads and label; leave it out for the defaults of `DimensionStyleDto`. * @default undefined * @optional true */ style?: DimensionStyleDto; } /** * A linear dimension ready to draw, returned by `advanced.dimensions.linearDimension`: the * `LinearDimensionDto` properties plus the markers by which `draw.drawAnyAsync` recognizes it. */ declare class LinearDimensionEntity extends LinearDimensionDto { type: string; entityName: string; /** * Identifier the caller may attach to tell dimensions apart; drawing does not read it. * @ignore true */ id?: string; } /** * Axis an ordinate dimension measures along: `x`, `y` or `z`. The label shows the difference of that * coordinate between the measured point and the reference point, after the axis letter. */ declare enum ordinateAxisEnum { x = "x", y = "y", z = "z" } /** * An ordinate dimension for `advanced.dimensions.ordinateDimension`: the difference along `axis` * between `measurementPoint` and `referencePoint`, labeled beside the measured point. */ 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); /** * The point whose coordinate is measured; the leader line and the label start from it. * @default [1, 1, 1] */ measurementPoint: Inputs.Base.Point3; /** * The datum the coordinate is measured from: the value is the measured point's coordinate minus * this point's, so it can be negative. * @default [0, 0, 0] */ referencePoint: Inputs.Base.Point3; /** * Which coordinate to measure; its letter comes before the value in the label. * @default x */ axis: ordinateAxisEnum; /** * Distance in model units from the measured point to the label. For the X axis the label moves * along Y, to the measured point's side of the reference; for Y and Z it moves along X likewise. * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Digits after the decimal point in the label. * @default 2 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Text after the value, separated by a space. Lengths are in model units, so `mm` is only a label. * @default mm */ labelSuffix: string; /** * Label expression where `val` is the measured value: arithmetic such as `val/25.4` is evaluated, * other text gets the rounded value in place of `val`. The axis-letter prefix is added either way. * @default 1*val */ labelOverwrite: string; /** * Draws a line from the measured point to the label, with an arrowhead at the point when the * style shows arrows. Without the line no arrowhead is drawn either. * @default true */ showLeaderLine: boolean; /** * Drops zeros at the end of the rounded value, so 2.50 reads 2.5 and 3.00 reads 3. * @default false */ removeTrailingZeros: boolean; /** * Look of the lines, arrowheads and label; leave it out for the defaults of `DimensionStyleDto`. * @default undefined * @optional true */ style?: DimensionStyleDto; } /** * An ordinate dimension ready to draw, returned by `advanced.dimensions.ordinateDimension`: the * `OrdinateDimensionDto` properties plus the markers by which `draw.drawAnyAsync` recognizes it. */ declare class OrdinateDimensionEntity extends OrdinateDimensionDto { type: string; entityName: string; /** * Identifier the caller may attach to tell dimensions apart; drawing does not read it. * @ignore true */ id?: string; } /** * A radial dimension for `advanced.dimensions.radialDimension`: the distance from `centerPoint` to * `radiusPoint`, labeled as a radius after an R or, with `showDiameter`, as a diameter. */ 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 of the circle or arc, where the radius line starts. * @default [0, 0, 0] */ centerPoint: Inputs.Base.Point3; /** * A point on the rim. Its distance from `centerPoint` is the radius shown, and the radius line * ends there with an arrowhead. * @default [1, 0, 0] */ radiusPoint: Inputs.Base.Point3; /** * Distance in model units beyond `radiusPoint` at which the label sits, continuing along the * radius line. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ labelOffset: number; /** * Digits after the decimal point in the label. * @default 2 * @minimum 0 * @maximum 10 * @step 1 */ decimalPlaces: number; /** * Text after the value, separated by a space. Lengths are in model units, so `mm` is only a label. * @default mm */ labelSuffix: string; /** * Label expression where `val` is the measured value: arithmetic such as `val/25.4` is evaluated, * other text gets the rounded value in place of `val`. The R or diameter-sign prefix is added either way. * @default 1*val */ labelOverwrite: string; /** * Shows twice the radius after a diameter sign instead of the radius after an R. * @default false */ showDiameter: boolean; /** * Draws a small cross at `centerPoint` with its arms along X and Y, four times the style's * `arrowSize` across. * @default true */ showCenterMark: boolean; /** * Drops zeros at the end of the rounded value, so 2.50 reads 2.5 and 3.00 reads 3. * @default false */ removeTrailingZeros: boolean; /** * Look of the lines, arrowheads and label; leave it out for the defaults of `DimensionStyleDto`. * @default undefined * @optional true */ style?: DimensionStyleDto; } /** * A radial dimension ready to draw, returned by `advanced.dimensions.radialDimension`: the * `RadialDimensionDto` properties plus the markers by which `draw.drawAnyAsync` recognizes it. */ declare class RadialDimensionEntity extends RadialDimensionDto { type: string; entityName: string; /** * Identifier the caller may attach to tell dimensions apart; drawing does not read it. * @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.ExpandDto): 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. * * The points may be 2D or 3D; only X and Y are used. 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, revolving, lofting through frames or sweeping along a path, 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; /** * Joins cross-sections placed by frames into a solid, each section to the next by straight * sides, closed at both ends: a taper from one outline to another, or one outline through many * frames. * * Corner `i` of a section joins corner `i` of the next, so differing sections need matching loops; * frames move the sections apart, mirroring all or none. * @param inputs - The cross-sections, one or one per frame, and the frames that place them * @returns The lofted solid * @group basic * @shortname loft * @drawable true * @example * ```typescript * const square = await bitbybit.manifold.crossSection.shapes.square({ size: 2, center: true }); * const solid = await bitbybit.manifold.crossSection.operations.loft({ crossSections: [square], frames: [[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], [0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 4, 1]] }); * ``` */ loft(inputs: Inputs.Manifold.LoftDto): Promise; /** * Carries a cross-section along a path of points into a solid, square to the path at every * point and turning with it without twisting, like a pipe, a rail or a cable. * * Sharp corners are mitred so the solid keeps its width; `cornerRadius` rounds them instead. * `xDirection` sets where the profile's X axis points at the start. * @param inputs - The cross-section, the path, the corner radius and its segments, and the profile's starting X direction * @returns The swept solid * @group basic * @shortname sweep * @drawable true * @example * ```typescript * const ring = await bitbybit.manifold.crossSection.shapes.circle({ radius: 1, circularSegments: 32 }); * const pipe = await bitbybit.manifold.crossSection.operations.sweep({ crossSection: ring, path: [[0, 0, 0], [10, 0, 0], [10, 10, 0], [10, 10, 10]], cornerRadius: 3, circularSegments: 32 }); * ``` */ sweep(inputs: Inputs.Manifold.SweepDto): 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, * `mesh` reads the triangle data, and `recipes` builds solids described as 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; readonly recipes: ManifoldRecipes; /** * 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 channel holding normals the solid carries. With `minSharpAngle`, normals * follow each position, smooth across flatter edges and split across sharper ones. * @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; } /** * Building recipes: solids described as data - polygons, circles, extrusions, turns and lofts, cuts, * unions, openings, transforms and triangle meshes - by a package that does not build geometry * itself, such as one that reads building models. Every result is a watertight mesh solid, so walls with their * openings cut and roofs clipped come back ready to draw or to combine further. * * Experimental: the recipe format may still change before it is declared stable. * @beta */ declare class ManifoldRecipes { private readonly manifoldWorkerManager; /** * Builds each root of a recipe as a solid placed by its matrix, in root order. * * Shared nodes are built once. An invalid recipe throws before anything is built; a root the * kernel cannot build, such as an open mesh, throws naming its node unless `emptyWhenFailed` is * set. Circles get `circularSegments` sides; `tolerance` and `millimetresPerUnit` are not applied. * @param inputs - The recipe, how finely circles are divided, and whether Z turns into Y * @returns One solid per root, in root order * @group build * @shortname build recipe * @drawable true * @example * ```typescript * const recipe = await bitbybit.ifc.geometry.recipe({ model }); * const solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true, emptyWhenFailed: true }); * ``` */ build(inputs: Inputs.Manifold.BuildRecipeDto): Promise; /** * Builds a recipe into the meshes its roots draw, each step several roots place meshed once in * its own coordinates, and gives every root a placement: its mesh, its matrix and its tag. * * Turns and moves fold into the placements, so a door type placed a hundred times is one mesh; * normals split at edges sharper than `minSharpAngle`. * @param inputs - The recipe, how finely circles are divided, whether Z turns into Y, whether failures are skipped, and where normals split * @returns The meshes and one placement per root, in root order * @group build * @shortname recipe meshes * @drawable false * @example * ```typescript * const recipe = await bitbybit.ifc.geometry.recipe({ model }); * const { meshes, placements } = await bitbybit.manifold.recipes.meshes({ recipe, adjustZtoY: true, emptyWhenFailed: true }); * ``` */ meshes(inputs: Inputs.Manifold.BuildRecipeMeshesDto): Promise; /** * Gives the roots of a recipe made of triangle meshes alone as meshes, placed as `build` places * its solids, without building anything. * * `build` gives an open mesh back empty, since it cannot be a solid; this gives it as the surface * it is, its openings left uncut. A root holding any other step comes back as an empty mesh. * @param inputs - The recipe, which roots to read, and whether Z turns into Y * @returns One mesh per asked root, in the order asked, ready to draw * @group build * @shortname surface meshes * @drawable true * @example * ```typescript * const solids = await bitbybit.manifold.recipes.build({ recipe, adjustZtoY: true, emptyWhenFailed: true }); * const meshes = await bitbybit.manifold.manifold.manifoldsToMeshes({ manifolds: solids }); * const open = meshes.flatMap((mesh, index) => mesh.triVerts.length === 0 ? [index] : []); * const surfaces = await bitbybit.manifold.recipes.surfaceMeshes({ recipe, roots: open, adjustZtoY: true }); * ``` */ surfaceMeshes(inputs: Inputs.Manifold.RecipeSurfaceMeshesDto): Promise; } /** * A reference to another entity of the same file, by its express id: `#12` in the file. * @beta */ interface IfcReference { /** * The express id of the entity referred to. */ readonly ref: number; } /** * An enumeration value, written between dots: `.ELEMENT.` in the file. * @beta */ interface IfcEnumerationValue { /** * The value, in upper case. */ readonly enum: string; } /** * A value carried with its defined type, as a select needs it: `IFCLABEL('Wall')` in the file. * @beta */ interface IfcTypedValue { /** * The defined type, in the schema's spelling, such as `IfcLabel`. */ readonly type: string; /** * The value itself. */ readonly value: IfcValue; } /** * A binary value: its bits as hexadecimal digits, after a first digit that counts the unused * leading bits. * @beta */ interface IfcBinaryValue { /** * The digits as the file writes them. */ readonly binary: string; } /** * An attribute a subtype derives from its other attributes, written `*` in the file. * @beta */ interface IfcDerivedValue { /** * Always true. */ readonly derived: true; } /** * One attribute value of an IFC entity. `null` is an unset optional attribute (`$` in the file), a * number is a real or an integer as the schema says, and a list is an aggregate. * @beta */ type IfcValue = null | boolean | number | string | IfcReference | IfcEnumerationValue | IfcTypedValue | IfcBinaryValue | IfcDerivedValue | readonly IfcValue[]; /** * One entity instance: its express id, its type in the schema's spelling, and its attribute values * in the order the schema lists them. * @beta */ interface IfcEntity { /** * The express id, unique within the file. */ readonly id: number; /** * The entity type, in the schema's spelling, such as `IfcWall`. */ readonly type: string; /** * The attribute values, inherited attributes first, in the order a file writes them. */ readonly args: readonly IfcValue[]; } /** * The HEADER section of an IFC file: what the file declares about itself. * @beta */ interface IfcFileHeader { /** * Free texts describing the file; IFC uses the first to declare the model view, such as * `ViewDefinition [ReferenceView_V1.2]`. */ readonly description: readonly string[]; /** * The conformance level of the file's encoding, `2;1` for files written by this library. */ readonly implementationLevel: string; /** * The name of the file. */ readonly name: string; /** * When the file was written, as ISO 8601 date and time. */ readonly timeStamp: string; /** * The people who wrote the file. */ readonly author: readonly string[]; /** * The organizations of those people. */ readonly organization: readonly string[]; /** * The software that encoded the file. */ readonly preprocessorVersion: string; /** * The software the data comes from. */ readonly originatingSystem: string; /** * Who approved the file. */ readonly authorization: string; /** * The schemas the data follows, such as `IFC4`. */ readonly schemaIdentifiers: readonly string[]; } interface StepHeaderEntity { readonly type: string; readonly args: readonly IfcValue[]; readonly text: string; readonly offset: number; } interface StepIndex { readonly bytes: Uint8Array; readonly count: number; readonly ids: Int32Array; readonly typeCodes: Uint16Array; readonly typeTable: readonly string[]; readonly argStart: Uint32Array; readonly argEnd: Uint32Array; readonly rowStart: Uint32Array; readonly rowEnd: Uint32Array; readonly header: readonly StepHeaderEntity[]; readonly headerEnd: number; readonly afterHeader: number; readonly sectionStarts: readonly number[]; } interface StepRows { count: number; ids: Int32Array; typeCodes: Uint16Array; readonly typeTable: string[]; readonly codesOfHash: Map; argStart: Uint32Array; argEnd: Uint32Array; rowStart: Uint32Array; rowEnd: Uint32Array; } interface RowSpans { readonly rowStart: number; readonly argStart: number; readonly argEnd: number; readonly rowEnd: number; } interface ParseFrame { readonly items: IfcValue[]; readonly typeName: string | undefined; } type TypeSpelling = (typeName: string) => string; /** * Assemblies: elements made of other elements, such as a facade's cladding boards or a truss's * members, which other tools list as one element with its parts and the STEP export of a model * nests as one assembly. * @beta */ declare class IFCAssemblies { private readonly ifcWorkerManager; /** * Makes elements the parts of a new assembly standing in their storey in their place. The parts * keep their geometry and placement and stand in the model through it; removing the assembly * removes them. * * They must share one storey, or other part of the structure, and belong to no other assembly; * openings cannot be parts. * @param inputs - The model, the parts, and the assembly's id, name and kind * @returns A new model with the assembly * @group create * @shortname add assembly * @drawable false * @example * ```typescript * model = await bitbybit.ifc.assemblies.add({ model, parts: ["board-1", "board-2", "board-3"], id: "south-cladding", name: "South cladding", predefinedType: Bit.Inputs.IFC.elementAssemblyPredefinedTypeEnum.userDefined, objectType: "Cladding" }); * ``` */ add(inputs: Inputs.IFC.AddAssemblyDto): Promise; } /** * Beams: sections swept straight between two points of a storey, each a rectangle, a circle or an I * section centred on the line between them. * @beta */ declare class IFCBeams { private readonly ifcWorkerManager; /** * Adds a beam from `start` to `end` in a storey, its section centred on the line between them. * * The section's Y points up, so an I section stands upright on a level beam; `rotation` turns it * about the beam's axis. The section is chosen by `profile` as for columns. * @param inputs - The model, the storey, the two ends and the section * @returns A new model with the beam * @group create * @shortname add beam * @drawable false * @example * ```typescript * model = await bitbybit.ifc.beams.add({ * model, * storey: "first", * start: [0, 4000, 2850], * end: [10000, 4000, 2850], * profile: Bit.Inputs.IFC.profileKindEnum.iShape, * width: 150, * depth: 300, * }); * ``` */ add(inputs: Inputs.IFC.AddBeamDto): Promise; } /** * The IFC library behind a web worker, for use on its own without the other bitbybit packages: * `ifc` holds every method, each answering with a promise. Experimental, as the IFC library is. * @beta */ declare class BitByBitIFC { /** * Sends the calls to the worker and reports its state. */ ifcWorkerManager: IFCWorkerManager; /** * Every method of the IFC library, each answering with a promise. */ ifc: IFCBitByBit; constructor(); /** * Hands over the web worker that runs the IFC library. * * Create the worker from a script that calls the package's `initializationComplete` and passes * every message to `onMessageInput`, hand it over here, and wait for it to report that it has * started before making calls. An `IFCWorkerMock` runs the library on the same thread instead. * @param worker - The worker running the IFC library, or a stand-in on the same thread */ init(worker: Worker | IFCWorkerMock): void; } /** * Columns: sections standing upright on a storey, each a rectangle, a circle or an I section * extruded up by the column's height. * @beta */ declare class IFCColumns { private readonly ifcWorkerManager; /** * Adds a column standing on `position` in a storey's plan, its section centred on that point and * extruded `height` up from `baseOffset` above the floor. * * `profile` picks the section: a rectangle reads `width` and `depth`, a circle `radius`, an I * section also `webThickness` and `flangeThickness`. `rotation` turns it about the axis. * @param inputs - The model, the storey, the position, the height and the section * @returns A new model with the column * @group create * @shortname add column * @drawable false * @example * ```typescript * model = await bitbybit.ifc.columns.add({ model, storey: "ground", position: [5000, 4000], height: 2700, width: 300, depth: 300 }); * ``` */ add(inputs: Inputs.IFC.AddColumnDto): Promise; } /** * Doors: door types, each a lining around one panel, and doors of those types placed in walls. A * door cuts its own opening and shares its type's geometry, so a type placed many times is written * once. * @beta */ declare class IFCDoors { private readonly ifcWorkerManager; /** * Adds a door type: a lining around one panel, `width` by `height`, which doors are then placed * from. * * The lining's sides and head are `liningThickness` wide and `liningDepth` deep; the panel sits * in the middle of the depth. A `handle` goes on both faces, away from the hinges. Materials give * the lining, panel and handle their colours. * @param inputs - The model, the type's id and name, its sizes and how it opens * @returns A new model with the door type * @group types * @shortname add door type * @drawable false * @example * ```typescript * model = await bitbybit.ifc.doors.addType({ model, id: "door-90", name: "Door 900", width: 900, height: 2100 }); * ``` */ addType(inputs: Inputs.IFC.AddDoorTypeDto): Promise; /** * Places a door of a door type in a wall, `offset` along the wall's axis from its start, cutting * an opening as wide and high as the type. * * The door is centred in the wall's thickness and belongs to the wall's storey. It must fit * along the wall. * @param inputs - The model, the wall, the door type, and where the door goes * @returns A new model with the door * @group create * @shortname add door * @drawable false * @example * ```typescript * model = await bitbybit.ifc.doors.add({ model, wall: "south", doorType: "door-90", id: "front-door", offset: 2000 }); * ``` */ add(inputs: Inputs.IFC.AddDoorDto): Promise; } /** * Describes a model's geometry as a recipe: data that a geometry kernel builds into solids or * meshes, one result per element, with the openings of walls and slabs cut through them and each * door or window type described once however many times it is placed. * * The recipe stays in the model's units and its Z up; each result is tagged with its element's * `globalId`, `type`, `name` and, when its material has a colour, `rgba`. * @beta */ declare class IFCGeometry { private readonly ifcWorkerManager; /** * Describes the geometry of a model's elements as a recipe, ready for a kernel to build. * * Each element with a body becomes one root, placed by its matrix and tagged with its GlobalId; * openings are cut from their hosts rather than becoming roots. An element that cannot be * described is left out, and `geometry.unsupported` lists it with the reason. * @param inputs - The model and, optionally, the elements to describe * @returns A recipe with one root per element * @group recipes * @shortname geometry recipe * @drawable false * @example * ```typescript * const recipe = await bitbybit.ifc.geometry.recipe({ model }); * console.log(recipe.roots.length, recipe.millimetresPerUnit); * ``` */ recipe(inputs: Inputs.IFC.GeometryDto): Promise; /** * Lists the elements whose geometry `geometry.recipe` leaves out, each with what it could not * describe, such as a profile type that is not supported yet. * * An element asked for in `elements` is listed too when it has no body to describe, such as an * opening, a storey or an element without a 'Body' representation. * @param inputs - The model and, optionally, the elements to check * @returns The elements left out, empty when every one is described * @group recipes * @shortname unsupported geometry * @drawable false * @example * ```typescript * const problems = await bitbybit.ifc.geometry.unsupported({ model }); * problems.forEach((problem) => console.log(problem.type, problem.message)); * ``` */ unsupported(inputs: Inputs.IFC.GeometryElementsDto): Promise; } /** * The entry point to IFC, the open BIM exchange format: `model` creates, reads, writes and edits * models; `spatial`, `spaces`, `materials` and `site` add storeys, rooms, materials and the terrain; * `walls`, `openings`, `doors`, `windows`, `slabs`, `roofs`, `columns`, `beams` and `members` add * elements, `assemblies` groups them; `properties` attaches property sets, `quantities` measures, and `geometry` describes * elements as a recipe a kernel builds. * * A model is a value: every method that changes one returns a new model and leaves the one it was * given as it was. Elements are parametric IFC4 that other BIM tools edit as walls, slabs and doors. * Experimental: names and inputs may still change before the first stable version. * @beta */ declare class IFCBitByBit { readonly model: IFCModels; readonly spatial: IFCSpatial; readonly spaces: IFCSpaces; readonly materials: IFCMaterials; readonly walls: IFCWalls; readonly openings: IFCOpenings; readonly doors: IFCDoors; readonly windows: IFCWindows; readonly slabs: IFCSlabs; readonly roofs: IFCRoofs; readonly site: IFCSite; readonly columns: IFCColumns; readonly beams: IFCBeams; readonly members: IFCMembers; readonly assemblies: IFCAssemblies; readonly properties: IFCProperties; readonly quantities: IFCQuantities; readonly geometry: IFCGeometry; } /** * The materials elements are made of: plain materials with an optional colour, and layer sets that * stack materials into the thickness of a wall or slab. Materials and layer sets are referred to by * their names, which are unique in a model. * @beta */ declare class IFCMaterials { private readonly ifcWorkerManager; /** * Adds a material, which layer sets, columns and beams then refer to by its name. * * With a `color`, the material carries a surface style that viewers show it in. * @param inputs - The model, the material's name, category, colour and transparency * @returns A new model with the material * @group materials * @shortname add material * @drawable false * @example * ```typescript * model = await bitbybit.ifc.materials.add({ model, name: "Brick", category: "brick", color: "#b5651d" }); * ``` */ add(inputs: Inputs.IFC.AddMaterialDto): Promise; /** * Adds a layer set: materials stacked in order, each with its thickness, which walls, wall types, * slabs and roofs are then made of. * * A wall's first layer is on its right face, looking from its start to its end; a slab's or a * roof's first layer is at its top. A layer's material must have been added before, by name. * @param inputs - The model, the layer set's name and its layers * @returns A new model with the layer set * @group materials * @shortname add layer set * @drawable false * @example * ```typescript * model = await bitbybit.ifc.materials.addLayerSet({ * model, * name: "Exterior wall", * layers: [{ material: "Brick", thickness: 115 }, { material: "Insulation", thickness: 100 }], * }); * ``` */ addLayerSet(inputs: Inputs.IFC.AddLayerSetDto): Promise; } /** * Members: the linear parts of frames, roofs and facades that are neither columns nor beams, such as * braces, rafters, studs and mullions, each a section swept straight between two points. * @beta */ declare class IFCMembers { private readonly ifcWorkerManager; /** * Adds a member from `start` to `end` in a storey, its section centred on the line between them, * as a brace, a rafter, a stud, a mullion or another kind. The section is chosen by `profile` and * turned by `rotation` as for beams. * @param inputs - The model, the storey, the two ends, the section and the kind of member * @returns A new model with the member * @group create * @shortname add member * @drawable false * @example * ```typescript * model = await bitbybit.ifc.members.add({ model, storey: "ground", start: [0, 0, 0], end: [4000, 0, 3000], predefinedType: Bit.Inputs.IFC.memberPredefinedTypeEnum.brace, width: 100, depth: 100 }); * ``` */ add(inputs: Inputs.IFC.AddMemberDto): Promise; } /** * Creates, reads, writes and inspects whole IFC models. A model is a value: every method that * changes one returns a new model and leaves the one it was given as it was, so a change can be * undone by keeping the earlier model. * * Objects are found by their GlobalId or by the id given when they were added, such as `north-wall`, * which the model turns into a GlobalId of its own. Storeys are in `spatial`, building elements in * `walls`, `slabs`, `doors` and the rest. * @beta */ declare class IFCModels { private readonly ifcWorkerManager; /** * Starts a new IFC4 model with a project, its site and one building, ready for storeys. * * Every length later given to the model is in `lengthUnit`, millimetres by default. With a * `seed`, the same calls always write the same file; without one, the GlobalIds are random. * @param inputs - The project's name, the site and building names, the length unit and a seed * @returns A new model * @group create * @shortname create model * @drawable false * @example * ```typescript * let model = await bitbybit.ifc.model.create({ name: "House", seed: "house-1" }); * model = await bitbybit.ifc.spatial.addStorey({ model, id: "ground", name: "Ground floor", elevation: 0 }); * ``` */ create(inputs: Inputs.IFC.CreateModelDto): Promise; /** * Reads an IFC file into a model to inspect, change and write back. * * Entities are decoded only when asked for, and unchanged ones are written back exactly as read. * An IFC2X3 file is read through IFC4, to be shown and queried; `upgradeToIfc4` makes it * editable. An `.ifczip` archive is read from the `.ifc` file it holds. * @param inputs - The file's text or bytes * @returns The model the file holds * @group io * @shortname read ifc * @drawable false * @example * ```typescript * const model = await bitbybit.ifc.model.read({ data: ifcText }); * const summary = await bitbybit.ifc.model.summary({ model }); * ``` */ read(inputs: Inputs.IFC.ReadModelDto): Promise; /** * Turns a model read from an IFC2X3 file into an IFC4 model, which can be changed and is * written as IFC4. * * New attributes stay unset, a newly required enumeration takes `NOTDEFINED`, sets lose repeats * and a merged entity becomes its parent; other rows are written as read. Anything else stops * the upgrade, naming the entity. * @param inputs - The model * @returns The upgraded model * @group io * @shortname upgrade to ifc4 * @drawable false * @example * ```typescript * const old = await bitbybit.ifc.model.read({ data: ifc2x3Bytes }); * const model = await bitbybit.ifc.model.upgradeToIfc4({ model: old }); * ``` */ upgradeToIfc4(inputs: Inputs.IFC.ModelDto): Promise; /** * Writes a model as the text of an `.ifc` file. * * The header records `fileName` and `timeStamp`; give a fixed `timeStamp` to write the same text * every time. Entities read from a file and left unchanged are written as they were read, character * for character. * @param inputs - The model, the file name and the time stamp * @returns The text of the IFC file * @group io * @shortname write ifc * @drawable false * @example * ```typescript * const text = await bitbybit.ifc.model.write({ model, fileName: "house.ifc" }); * ``` */ write(inputs: Inputs.IFC.WriteModelDto): Promise; /** * Writes a model as the bytes of an `.ifc` file, at any size. * * The header records `fileName` and `timeStamp`, as `model.write`'s does. Entities read from a file * and left unchanged are copied byte for byte, so a file of hundreds of megabytes writes in a moment, * where its text would not fit one JavaScript string. * @param inputs - The model, the file name and the time stamp * @returns The bytes of the IFC file * @group io * @shortname write ifc bytes * @drawable false * @example * ```typescript * const bytes = await bitbybit.ifc.model.writeBytes({ model, fileName: "house.ifc" }); * ``` */ writeBytes(inputs: Inputs.IFC.WriteModelDto): Promise; /** * Describes what a model holds: its schema, its project, its unit, its storeys and how many * elements of each type. * @param inputs - The model * @returns The model's summary * @group query * @shortname summary * @drawable false * @example * ```typescript * const summary = await bitbybit.ifc.model.summary({ model }); * console.log(summary.elementCounts.IfcWall); * ``` */ summary(inputs: Inputs.IFC.ModelDto): Promise; /** * Reads where a model sits on the Earth: the map conversion that places its coordinates in a * projected coordinate reference system, and its site's reference latitude, longitude and * elevation. A file without them gives the defaults, with `mapped` and `located` false. * @param inputs - The model * @returns The model's georeference * @group query * @shortname georeference * @drawable false * @example * ```typescript * const georeference = await bitbybit.ifc.model.georeference({ model }); * console.log(georeference.crs, georeference.eastings, georeference.northings); * ``` */ georeference(inputs: Inputs.IFC.ModelDto): Promise; /** * Lists the objects of one IFC type, its subtypes included, optionally only those standing in * one storey or other spatial element. An aggregate's part stands where its whole stands. * * `type` is any type with a GlobalId, such as `IfcWall`, `IfcDoor` or `IfcElement` for every * building element. The list is in the order the model holds them. * @param inputs - The model, the type and an optional storey * @returns Each object's GlobalId, type, name and the spatial element it stands in * @group query * @shortname elements * @drawable false * @example * ```typescript * const walls = await bitbybit.ifc.model.elements({ model, type: "IfcWall", storey: "ground" }); * ``` */ elements(inputs: Inputs.IFC.ElementsDto): Promise; /** * Describes one object of a model: its GlobalId, its type, its name and the spatial element it * stands in. * @param inputs - The model and the object * @returns The object's GlobalId, type, name and the spatial element it stands in * @group query * @shortname element * @drawable false * @example * ```typescript * const wall = await bitbybit.ifc.model.element({ model, element: "north-wall" }); * ``` */ element(inputs: Inputs.IFC.ElementDto): Promise; /** * Removes an element, an empty storey or space, or a type nothing is of, with what only it uses. * A wall takes its openings with their doors and windows, and the walls it was joined to are * trimmed again; a door or window leaves its opening; an opening takes its doors and windows. * @param inputs - The model and the object * @returns A new model without the object * @group edit * @shortname remove * @drawable false * @example * ```typescript * model = await bitbybit.ifc.model.remove({ model, element: "partition" }); * ``` */ remove(inputs: Inputs.IFC.ElementDto): Promise; /** * Moves an element or a space, and turns it about the vertical through its own origin; what is * placed on it, such as a wall's openings, moves with it. A joined wall moves with `walls.edit`, * and an opening, door or window with `openings.edit`. * @param inputs - The model, the element, how far to move it and how far to turn it * @returns A new model with the element moved * @group edit * @shortname move * @drawable false * @example * ```typescript * model = await bitbybit.ifc.model.move({ model, element: "column-1", translation: [500, 0, 0], rotation: 45 }); * ``` */ move(inputs: Inputs.IFC.MoveElementDto): Promise; /** * Sets one attribute of an object to a text, a number, true or false, such as a wall's `Name`, * `Description` or `Tag`. * * The value is checked against the IFC schema, and an attribute that holds a reference, a derived * attribute or the `GlobalId` cannot be set this way. * @param inputs - The model, the object, the attribute's name and the new value * @returns A new model with the attribute set * @group edit * @shortname set attribute * @drawable false * @example * ```typescript * model = await bitbybit.ifc.model.setAttribute({ model, element: "north-wall", attribute: "Description", value: "Load bearing" }); * ``` */ setAttribute(inputs: Inputs.IFC.SetAttributeDto): Promise; /** * Reads one attribute of an object, such as a wall's `Name`, `Description` or `Tag`. * * The value comes back as the model holds it: a text, a number, true or false, `null` when the * attribute is unset, `{ enum }` for an enumeration value, `{ type, value }` for a typed value, * `{ ref }` for a reference to another entity, or a list of these. * @param inputs - The model, the object and the attribute's name * @returns The attribute's value * @group query * @shortname get attribute * @drawable false * @example * ```typescript * const description = await bitbybit.ifc.model.getAttribute({ model, element: "north-wall", attribute: "Description" }); * ``` */ getAttribute(inputs: Inputs.IFC.GetAttributeDto): Promise; /** * Says which GlobalId an id stands for in a model: the GlobalId itself, or the one the model * derives from an id of your own such as `north-wall`. * * The answer does not depend on whether the model holds such an object yet. * @param inputs - The model and the id * @returns The GlobalId, 22 characters * @group query * @shortname global id of * @drawable false * @example * ```typescript * const globalId = await bitbybit.ifc.model.globalIdOf({ model, id: "north-wall" }); * ``` */ globalIdOf(inputs: Inputs.IFC.GlobalIdOfDto): Promise; } /** * Openings: voids cut through walls and slabs, the holes doors and windows sit in. Doors and windows * cut their own openings, so this is for an opening that stays empty, such as a pass-through or a * stairwell, and for moving an opening along its wall. * @beta */ declare class IFCOpenings { private readonly ifcWorkerManager; /** * Cuts a rectangular opening through a wall, `offset` along its axis from its start and `sill` * above its base. * * The opening goes through the wall's whole thickness and stays with the wall when its joins * change. It must fit along the wall. * @param inputs - The model, the wall, and the opening's position and size * @returns A new model with the wall cut * @group create * @shortname add opening in wall * @drawable false * @example * ```typescript * model = await bitbybit.ifc.openings.add({ model, wall: "inner", offset: 1500, width: 1200, height: 2200 }); * ``` */ add(inputs: Inputs.IFC.AddOpeningDto): Promise; /** * Moves an opening along its wall or up and down it, or resizes it. Given a door or window, it * moves it with the opening it is in, which keeps its size. A door or window placed elsewhere than * on its opening or wall is refused, as it would stay behind. * @param inputs - The model, the opening or the door or window in it, and its new position or size * @returns A new model with the opening moved or resized * @group edit * @shortname edit opening * @drawable false * @example * ```typescript * model = await bitbybit.ifc.openings.edit({ model, opening: "front-door", offset: 2500 }); * ``` */ edit(inputs: Inputs.IFC.EditOpeningDto): Promise; /** * Cuts an opening of any outline, such as a stairwell or a shaft, through a slab's whole thickness. * The outline is given in the plan of the slab's storey and must lie inside the slab's outline or on * its edge, which is checked when that outline is a polyline, as in the slabs this library adds. * @param inputs - The model, the slab and the opening's outline * @returns A new model with the slab cut * @group create * @shortname add opening in slab * @drawable false * @example * ```typescript * model = await bitbybit.ifc.openings.addInSlab({ model, slab: "first-floor", outline: [[1000, 1000], [3500, 1000], [3500, 2200], [1000, 2200]] }); * ``` */ addInSlab(inputs: Inputs.IFC.AddSlabOpeningDto): Promise; } /** * Properties: named sets of values attached to elements and types, such as `Pset_WallCommon` with * `IsExternal` and `FireRating`, which other tools list, filter and schedule by. * @beta */ declare class IFCProperties { private readonly ifcWorkerManager; /** * Attaches a property set to one or more objects: walls, doors, types or any object with a * GlobalId. * * Each value is written as its `type`, or as a label, an integer, a real or a boolean by the * kind of value. One set is shared by every object it is attached to. * @param inputs - The model, the objects, the set's name and its properties * @returns A new model with the property set * @group properties * @shortname add property set * @drawable false * @example * ```typescript * model = await bitbybit.ifc.properties.addSet({ * model, * elements: ["south", "east"], * name: "Pset_WallCommon", * properties: [{ name: "IsExternal", value: true }, { name: "FireRating", value: "REI 60" }], * }); * ``` */ addSet(inputs: Inputs.IFC.AddPropertySetDto): Promise; /** * Reads the property sets attached to an object, with each single value by name. * * Values of other kinds of property, such as lists and tables, and logical values that are * unknown are left out. * @param inputs - The model and the object * @returns The object's property sets * @group properties * @shortname get property sets * @drawable false * @example * ```typescript * const sets = await bitbybit.ifc.properties.getSets({ model, element: "south" }); * ``` */ getSets(inputs: Inputs.IFC.ElementDto): Promise; /** * Sets property values of one object, in its property set of the given name, and makes the set * when the object has none. A set the object shares with other objects is copied first, so only * this object's values change. * @param inputs - The model, the object, the set's name and the properties * @returns A new model with the values set * @group properties * @shortname set property values * @drawable false * @example * ```typescript * model = await bitbybit.ifc.properties.setValues({ model, element: "south", name: "Pset_WallCommon", properties: [{ name: "FireRating", value: "REI 90" }] }); * ``` */ setValues(inputs: Inputs.IFC.SetPropertyValuesDto): Promise; /** * Takes properties out of one object's property set; the set goes when none are left. A set the * object shares with other objects is copied first, so the others keep their values. * @param inputs - The model, the object, the set's name and the names of the properties * @returns A new model without the properties * @group properties * @shortname remove property values * @drawable false * @example * ```typescript * model = await bitbybit.ifc.properties.removeValues({ model, element: "south", name: "Pset_WallCommon", names: ["FireRating"] }); * ``` */ removeValues(inputs: Inputs.IFC.RemovePropertyValuesDto): Promise; /** * Takes a property set away from one object. Other objects that share the set keep it. * @param inputs - The model, the object and the set's name * @returns A new model without the set on the object * @group properties * @shortname remove property set * @drawable false * @example * ```typescript * model = await bitbybit.ifc.properties.removeSet({ model, element: "south", name: "Pset_WallCommon" }); * ``` */ removeSet(inputs: Inputs.IFC.RemovePropertySetDto): Promise; } /** * Quantities: the base quantity sets IFC defines, such as `Qto_WallBaseQuantities` with a wall's * length, side areas and volumes net of its openings, measured from the elements' own geometry, so * other tools schedule and price them. * @beta */ declare class IFCQuantities { private readonly ifcWorkerManager; /** * Measures elements and writes their base quantity sets, replacing any set of the same name: walls, * slabs, columns, beams, members, doors, windows, wall openings, spaces and roofs. A wall's volume * and side area follow its clippings and lose its openings. Measure again after changing elements. * @param inputs - The model and, optionally, the elements to measure * @returns A new model with the quantity sets * @group quantities * @shortname compute quantities * @drawable false * @example * ```typescript * model = await bitbybit.ifc.quantities.compute({ model }); * ``` */ compute(inputs: Inputs.IFC.ComputeQuantitiesDto): Promise; /** * Reads the quantity sets of an element, with each quantity's value by name. * @param inputs - The model and the element * @returns The element's quantity sets * @group quantities * @shortname get quantities * @drawable false * @example * ```typescript * const sets = await bitbybit.ifc.quantities.get({ model, element: "south" }); * ``` */ get(inputs: Inputs.IFC.ElementDto): Promise; } /** * Roofs: flat, mono-pitch, gable and hip roofs over a rectangle, each an `IfcRoof` whose parts are the * sloping slabs of its planes. Walls are clipped under a roof with `walls.clipByRoof`. * @beta */ declare class IFCRoofs { private readonly ifcWorkerManager; /** * Adds a roof over a rectangle of a storey: flat, sloping one way, gabled, or hipped on all four * sides. Every slope has the same `pitch`; its underside meets the outline at `baseOffset` above * the storey's floor and reaches `overhang` past it on every side. * @param inputs - The model, the storey, the rectangle, the roof's shape, pitch, thickness and overhang * @returns A new model with the roof * @group create * @shortname add roof * @drawable false * @example * ```typescript * model = await bitbybit.ifc.roofs.add({ model, storey: "first", id: "roof", outline: [[0, 0], [10000, 0], [10000, 8000], [0, 8000]], kind: Bit.Inputs.IFC.roofKindEnum.gable, pitch: 35, baseOffset: 3000, overhang: 400 }); * ``` */ add(inputs: Inputs.IFC.AddRoofDto): Promise; } /** * The site around the building: its terrain and its trees, written as geographic elements of the * site, so the ground and planting travel with the building in the file. * @beta */ declare class IFCSite { private readonly ifcWorkerManager; /** * Adds terrain to the site: the ground as an outline in the site's plan, with holes where the * building or paving meets it, its top at `elevation` and `depth` deep. * @param inputs - The model, the outline and its holes, the depth and elevation, and the ground's material * @returns A new model with the terrain * @group create * @shortname add terrain * @drawable false * @example * ```typescript * model = await bitbybit.ifc.site.addTerrain({ model, outline: [[-30000, -30000], [30000, -30000], [30000, 30000], [-30000, 30000]], holes: [[[0, 0], [10000, 0], [10000, 8000], [0, 8000]]], material: "Lawn" }); * ``` */ addTerrain(inputs: Inputs.IFC.AddTerrainDto): Promise; /** * Adds a tree to the site: a tapering trunk and a rounded crown at `position`, `height` tall, * each part in its own material, with its species written as the element's object type. * @param inputs - The model, where the tree stands, its sizes, its species and its materials * @returns A new model with the tree * @group create * @shortname add tree * @drawable false * @example * ```typescript * model = await bitbybit.ifc.site.addTree({ model, species: "Silver birch", position: [-6000, -8000], height: 9000, crownRadius: 2200, crownMaterial: "Foliage", trunkMaterial: "Bark" }); * ``` */ addTree(inputs: Inputs.IFC.AddTreeDto): Promise; } /** * Slabs: floors, roofs and landings, each an outline in a storey's plan with optional holes, * extruded down from its top by its thickness or by the layer set it is made of. * @beta */ declare class IFCSlabs { private readonly ifcWorkerManager; /** * Adds a slab: an outline in a storey's plan, with optional holes, its top `topOffset` above the * storey's floor and its thickness below that. * * The slab is made of the named `layerSet`, first layer at the top, or of one layer `thickness` * thick. Outlines may wind either way. * @param inputs - The model, the storey, the outline and holes, the thickness or layer set, and the slab's kind * @returns A new model with the slab * @group create * @shortname add slab * @drawable false * @example * ```typescript * model = await bitbybit.ifc.slabs.add({ * model, * storey: "ground", * outline: [[0, 0], [10000, 0], [10000, 8000], [0, 8000]], * thickness: 250, * }); * ``` */ add(inputs: Inputs.IFC.AddSlabDto): Promise; } /** * Spaces: the rooms and areas of a storey, each an outline in the storey's plan extruded up to its * height, with a number and a name. Tools schedule rooms and their areas from them. * @beta */ declare class IFCSpaces { private readonly ifcWorkerManager; /** * Adds a space to a storey: a room or an area, from an outline in the storey's plan, `height` * high. A space is part of its storey, as IFC aggregates spaces, rather than an element on it. * @param inputs - The model, the storey, the outline, the height, and the space's number and name * @returns A new model with the space * @group create * @shortname add space * @drawable false * @example * ```typescript * model = await bitbybit.ifc.spaces.add({ model, storey: "ground", id: "kitchen", name: "0.01", longName: "Kitchen", outline: [[0, 0], [4000, 0], [4000, 3000], [0, 3000]], height: 2700 }); * ``` */ add(inputs: Inputs.IFC.AddSpaceDto): Promise; /** * Lists the spaces of the model, or of one storey, with their numbers, names, areas and heights. * @param inputs - The model and, optionally, the storey * @returns The spaces * @group query * @shortname list spaces * @drawable false * @example * ```typescript * const rooms = await bitbybit.ifc.spaces.list({ model, storey: "ground" }); * ``` */ list(inputs: Inputs.IFC.SpacesDto): Promise; } /** * The spatial structure of a model: the storeys of its building, which every wall, slab, column and * beam is added to. A storey has an elevation; what stands on it is placed in its plan, with Z up * from its floor. * @beta */ declare class IFCSpatial { private readonly ifcWorkerManager; /** * Adds a storey to the model's building at an elevation above the building's origin. * * Give it an `id` such as `ground` to refer to it when adding walls and slabs. The model must * have exactly one building, as `model.create` makes. * @param inputs - The model, the storey's id, name and elevation * @returns A new model with the storey * @group storeys * @shortname add storey * @drawable false * @example * ```typescript * model = await bitbybit.ifc.spatial.addStorey({ model, id: "first", name: "First floor", elevation: 3000 }); * ``` */ addStorey(inputs: Inputs.IFC.AddStoreyDto): Promise; /** * Raises or lowers a storey to a new elevation. Everything placed on the storey moves with it; * the other storeys stay where they are. * @param inputs - The model, the storey and its new elevation * @returns A new model with the storey moved * @group storeys * @shortname set storey elevation * @drawable false * @example * ```typescript * model = await bitbybit.ifc.spatial.setElevation({ model, storey: "first", elevation: 3200 }); * ``` */ setElevation(inputs: Inputs.IFC.SetStoreyElevationDto): Promise; /** * Lists the storeys of the model's buildings, lowest first, with their GlobalIds, names and * elevations. * @param inputs - The model * @returns The storeys, lowest first * @group storeys * @shortname storeys * @drawable false * @example * ```typescript * const storeys = await bitbybit.ifc.spatial.storeys({ model }); * ``` */ storeys(inputs: Inputs.IFC.ModelDto): Promise; } /** * Walls: straight walls on a storey, from an axis, a height and a thickness or a layer set, joined * at their corners and clipped under roofs. A wall keeps its axis, layers and height, so joins and * clippings are worked out again from them whenever a wall changes, and tools that edit IFC walls * edit these as walls. * * Doors, windows and openings go into walls through `doors`, `windows` and `openings`. * @beta */ declare class IFCWalls { private readonly ifcWorkerManager; /** * Adds a straight wall on a storey, from `start` to `end` in the storey's plan, `height` high. * * The wall is made of its type's layer set, the named `layerSet`, or one layer `thickness` thick, * in that order of preference. `alignment` says which side of the axis the layers lie on; join * walls at their corners afterwards with `walls.connect`. * @param inputs - The model, the storey, the axis, the height, the thickness or layer set, and the alignment * @returns A new model with the wall * @group create * @shortname add wall * @drawable false * @example * ```typescript * model = await bitbybit.ifc.walls.add({ model, storey: "ground", id: "south", start: [0, 0], end: [10000, 0], height: 2700, thickness: 250 }); * model = await bitbybit.ifc.walls.add({ model, storey: "ground", id: "east", start: [10000, 0], end: [10000, 8000], height: 2700, thickness: 250 }); * model = await bitbybit.ifc.walls.connect({ model, wall: "south", other: "east" }); * ``` */ add(inputs: Inputs.IFC.AddWallDto): Promise; /** * Joins two walls where they meet, trimming both: two walls meeting at their ends are mitred * into a corner, and a wall ending against another's side is cut back to that side. * * The join is recorded in the model, and joining the two walls again replaces it. Walls that do * not meet cannot be joined. * @param inputs - The model and the two walls * @returns A new model with the walls joined * @group edit * @shortname connect walls * @drawable false * @example * ```typescript * model = await bitbybit.ifc.walls.connect({ model, wall: "south", other: "east" }); * ``` */ connect(inputs: Inputs.IFC.ConnectWallsDto): Promise; /** * Takes away the join between two walls, so the ends it trimmed are square again. * @param inputs - The model and the two walls * @returns A new model with the walls no longer joined * @group edit * @shortname disconnect walls * @drawable false * @example * ```typescript * model = await bitbybit.ifc.walls.disconnect({ model, wall: "south", other: "east" }); * ``` */ disconnect(inputs: Inputs.IFC.ConnectWallsDto): Promise; /** * Changes a wall's axis, height, base, layers or alignment. Joined walls are trimmed again, * clippings stay put, and openings, doors and windows move with it, keeping their offset and sill. A * change is refused when it parts the wall from a joined wall, puts an opening off its end, or leaves * behind an opening, door or window placed elsewhere. * @param inputs - The model, the wall and what to change * @returns A new model with the wall changed * @group edit * @shortname edit wall * @drawable false * @example * ```typescript * model = await bitbybit.ifc.walls.edit({ model, wall: "south", height: 3200, thickness: 300 }); * ``` */ edit(inputs: Inputs.IFC.EditWallDto): Promise; /** * Reads a wall's parameters back from the model: its axis, height, base, thickness, layers and * alignment, the walls it is joined to, its openings and its clippings. It reads walls other tools * wrote too, when they keep an axis and a layer set usage as IFC's standard walls do. * @param inputs - The model and the wall * @returns The wall's parameters, in the plan of its storey * @group query * @shortname wall parameters * @drawable false * @example * ```typescript * const wall = await bitbybit.ifc.walls.parameters({ model, wall: "south" }); * ``` */ parameters(inputs: Inputs.IFC.WallDto): Promise; /** * Clips a wall with a plane, removing the part on the side the plane's normal points to, as a * wall is cut under a sloping roof. * * The plane is given in the wall's storey, and a wall can be clipped by several planes. Clipping * keeps the wall's full height in its data, so joins stay right. * @param inputs - The model, the wall, a point on the plane and its normal * @returns A new model with the wall clipped * @group edit * @shortname clip wall by plane * @drawable false * @example * ```typescript * model = await bitbybit.ifc.walls.clipByPlane({ model, wall: "south", origin: [0, 0, 2600], normal: [0, -0.5, 1] }); * ``` */ clipByPlane(inputs: Inputs.IFC.ClipWallDto): Promise; /** * Clips a wall under a roof by each of the roof's planes that cuts it: under the eaves level or * along the slope, under a gable to the gable's triangle. Planes above the wall leave it alone, and * clipping again changes nothing. A plane below the wall's bottom everywhere is refused, as it would * leave nothing of the wall. * @param inputs - The model, the wall and the roof * @returns A new model with the wall clipped * @group edit * @shortname clip wall by roof * @drawable false * @example * ```typescript * model = await bitbybit.ifc.walls.clipByRoof({ model, wall: "west", roof: "roof" }); * ``` */ clipByRoof(inputs: Inputs.IFC.ClipWallByRoofDto): Promise; /** * Adds a wall type: a named kind of wall made of a layer set. Walls added with this type as their * `wallType` are made of its layers. * @param inputs - The model, the type's id and name, its layer set and its kind * @returns A new model with the wall type * @group types * @shortname add wall type * @drawable false * @example * ```typescript * model = await bitbybit.ifc.walls.addType({ model, id: "exterior", name: "Exterior 230", layerSet: "Exterior wall" }); * ``` */ addType(inputs: Inputs.IFC.AddWallTypeDto): Promise; } /** * Windows: window types, each a frame around one pane of glass, and windows of those types placed * in walls. A window cuts its own opening and shares its type's geometry, so a type placed many * times is written once. * @beta */ declare class IFCWindows { private readonly ifcWorkerManager; /** * Adds a window type: a frame around one pane, `width` by `height`, which windows are then * placed from. * * The frame's members are `frameThickness` wide and `frameDepth` deep; the glass sits in the * middle of the depth. A `frameMaterial` and a `glassMaterial` give each part its material and * colour. * @param inputs - The model, the type's id and name, and its sizes * @returns A new model with the window type * @group types * @shortname add window type * @drawable false * @example * ```typescript * model = await bitbybit.ifc.materials.add({ model, name: "Glass", color: "#a9c7d6", transparency: 0.7 }); * model = await bitbybit.ifc.windows.addType({ model, id: "window-120", name: "Window 1200", width: 1200, height: 1400, glassMaterial: "Glass" }); * ``` */ addType(inputs: Inputs.IFC.AddWindowTypeDto): Promise; /** * Places a window of a window type in a wall, `offset` along the wall's axis from its start and * `sill` above its base, cutting an opening as wide and high as the type. * * The window is centred in the wall's thickness and belongs to the wall's storey. It must fit * along the wall. * @param inputs - The model, the wall, the window type, and where the window goes * @returns A new model with the window * @group create * @shortname add window * @drawable false * @example * ```typescript * model = await bitbybit.ifc.windows.add({ model, wall: "south", windowType: "window-120", offset: 6000, sill: 900 }); * ``` */ add(inputs: Inputs.IFC.AddWindowDto): 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; } /** * Questions asked of OpenCascade shapes, answered with points, numbers and index lists rather than * new shapes. `curves` reads edges and wires, `surfaces` reads faces, `measure` measures boxes, * distances, angles and radii, and `clashes` finds shapes and faces that overlap or come too close. * `signatures` describes every face and edge of a shape at once. The shapes themselves are left as * they are. */ declare class OCCTAnalysis { private readonly occWorkerManager; readonly curves: OCCTAnalysisCurves; readonly surfaces: OCCTAnalysisSurfaces; readonly measure: OCCTAnalysisMeasure; readonly clashes: OCCTAnalysisClashes; /** * Describes every face and edge of a shape in one pass: each face's surface kind, area, centre, * outward normal and box, and each edge's curve kind, length, midpoint and direction there. * * The numbering and the measures are the selectors' own, so a kept description finds the same * face again after a rebuild. * @param inputs - The shape * @returns The signature of every face and every edge * @group shape * @shortname signatures * @drawable false * @example * ```typescript * const { faces, edges } = await bitbybit.occt.analysis.signatures({ shape: bracket }); * const largest = faces.reduce((a, b) => (b.area > a.area ? b : a)); * ``` */ signatures(inputs: Inputs.OCCT.ShapeDto): Promise; } /** * Finding shapes and faces that overlap or come closer than a clearance: pairs among a list of * placed shapes, faces of two shapes within a distance of each other, and faces of one shape that * cut through each other. Each clash names the two items by index with the distance between them * and, for solids, the volume they share. */ declare class OCCTAnalysisClashes { private readonly occWorkerManager; /** * Finds every pair among a list of shapes that overlap, touch or come within a clearance of each * other, such as colliding parts. * * A clash names the two by their positions in the list, from 0, with their distance, 0 where they * touch, overlap or nest, and the volume two solids share. * @param inputs - The shapes and the clearance * @returns The clashing pairs, in list order * @group clashes * @shortname clashes between shapes * @drawable false * @example * ```typescript * const clashes = await bitbybit.occt.analysis.clashes.betweenShapes({ shapes: [bracket, bolt, plate], clearance: 0.5 }); * const overlapping = clashes.filter(clash => clash.volume > 0); * ``` */ betweenShapes(inputs: Inputs.OCCT.ClashesBetweenShapesDto): Promise; /** * Finds the faces of one shape that come within a clearance of faces of another, each pair * measured exactly. * * A clash names a face of each as `shapes.face.getFaces` numbers them, sorted by the first shape's * face. Candidates come from meshes of copies at `precision`, so the shapes given stay unmeshed; * faces without a surface take no part. * @param inputs - The two shapes, the clearance and the meshing precision * @returns The pairs of faces within the clearance * @group clashes * @shortname faces within * @drawable false * @example * ```typescript * const tooClose = await bitbybit.occt.analysis.clashes.facesWithin({ shapeA: housing, shapeB: board, clearance: 0.2, precision: 0.01 }); * ``` */ facesWithin(inputs: Inputs.OCCT.FacesWithinDto): Promise; /** * Finds the pairs of faces of one shape that cross each other anywhere but along an edge they * share. * * A clash names the two faces as `shapes.face.getFaces` numbers them, with both points at one * place on their crossing. Candidates come from a mesh of a copy at `precision` and are confirmed * exactly; a mere touch can be missed. * @param inputs - The shape and the meshing precision * @returns The pairs of crossing faces * @group clashes * @shortname self intersections * @drawable false * @example * ```typescript * const crossings = await bitbybit.occt.analysis.clashes.selfIntersections({ shape: sweep, precision: 0.01 }); * const isClean = crossings.length === 0; * ``` */ selfIntersections(inputs: Inputs.OCCT.SelfIntersectionsDto): Promise; } /** * Questions asked of edges and wires, answered with points and numbers rather than new shapes: the * closest point with its parameter and length along the curve, curvature and its comb, kinks where * the tangent turns, extremes along a direction, and intersections with other curves and with faces. * Parameters are fractions from 0 at the start to 1 at the end, where each edge of a wire takes an * equal share, as `shapes.wire.pointOnWireAtParam` takes them. Edges are numbered as * `shapes.edge.getEdgesAlongWire` lists them, and angles are in degrees. */ declare class OCCTAnalysisCurves { private readonly occWorkerManager; /** * Finds the point of an edge or a wire nearest each given point, with where it lies along the * curve. * * Each result carries the point, its parameter as a fraction of the curve, its length from the * start, its distance from the given point and the edge it lies on; at a corner that is the * edge starting there. * @param inputs - The edge or wire and the points to measure from * @returns One closest point per given point, in the same order * @group points * @shortname closest points * @drawable false * @example * ```typescript * const nearest = await bitbybit.occt.analysis.curves.closestPoints({ shape: wire, points: [[12, 0, 5], [3, 0, -2]] }); * const cut = await bitbybit.occt.shapes.wire.splitWireAtParams({ shape: wire, params: nearest.map(result => result.param) }); * ``` */ closestPoints(inputs: Inputs.OCCT.ClosestPointsOnShapeFromPointsDto): Promise; /** * Reads how an edge or a wire bends at places given as fractions from 0 at its start to 1 at its * end. * * Each result holds the point, tangent, normal, binormal, curvature, radius, center and torsion; * a straight stretch reads `isStraight` with an `Infinity` radius. At a corner of a wire the edge * starting there is read. * @param inputs - The edge or wire and the fractions along it * @returns One curvature per fraction, in the same order * @group curvature * @shortname curvatures at params * @drawable false * @example * ```typescript * const [start, middle] = await bitbybit.occt.analysis.curves.curvaturesAtParams({ shape: spline, params: [0, 0.5] }); * const bendRadius = middle.radius; * ``` */ curvaturesAtParams(inputs: Inputs.OCCT.DataOnGeometryAtParamsDto): Promise; /** * Reads how an edge or a wire bends at places given as lengths along it from its start, in model * units. * * Each result is what `curvaturesAtParams` gives: the point, the tangent, normal and binormal, * the curvature with its radius and center, and the torsion. At a corner of a wire the edge * starting there is read. * @param inputs - The edge or wire and the lengths along it * @returns One curvature per length, in the same order * @group curvature * @shortname curvatures at lengths * @drawable false * @example * ```typescript * const curvatures = await bitbybit.occt.analysis.curves.curvaturesAtLengths({ shape: spline, lengths: [0, 2.5, 5] }); * const tightest = Math.max(...curvatures.map(result => result.curvature)); * ``` */ curvaturesAtLengths(inputs: Inputs.OCCT.DataOnGeometryAtLengthsDto): Promise; /** * Draws a curvature comb along an edge or a wire: teeth standing on the curve, as long as the * curvature there, pointing away from its center. * * The first polyline runs through the tips, showing how the curvature changes; then comes one * two-point polyline per tooth, from the curve to its tip. The teeth are spaced evenly by length. * @param inputs - The edge or wire, the number of teeth and their scale * @returns The polyline through the tips, then one polyline per tooth * @group curvature * @shortname curvature comb * @drawable true * @example * ```typescript * const comb = await bitbybit.occt.analysis.curves.curvatureComb({ shape: spline, samples: 80, scale: 0 }); * const outline = comb[0]; * ``` */ curvatureComb(inputs: Inputs.OCCT.CurvatureCombDto): Promise; /** * Finds the corners of an edge or a wire where the tangent turns by more than an angle, such as * the corners of a polyline. * * Each kink comes with the edge ending there and the turn in degrees, in walking order; a closed * wire's closing corner, at its start, comes first. * @param inputs - The edge or wire and the angle in degrees * @returns The kinks, in order along the curve * @group shape * @shortname kinks * @drawable false * @example * ```typescript * const corners = await bitbybit.occt.analysis.curves.kinks({ shape: outline, angle: 10 }); * const cornerPoints = corners.map(kink => kink.point); * ``` */ kinks(inputs: Inputs.OCCT.CurveKinksDto): Promise; /** * Finds the highest and lowest points of an edge or a wire along a direction, such as the crests * of a wave. * * They come in order along the curve, marked as maxima or minima, and as global when nothing lies * higher, or lower; ties are all global. An open curve's ends count; a level stretch is reported * at its start. * @param inputs - The edge or wire and the direction that is up * @returns The highest and lowest points, in order along the curve * @group shape * @shortname extremes along * @drawable false * @example * ```typescript * const extremes = await bitbybit.occt.analysis.curves.extremesAlong({ shape: wave, direction: [0, 1, 0] }); * const crests = extremes.filter(extreme => extreme.isMaximum); * ``` */ extremesAlong(inputs: Inputs.OCCT.CurveExtremesAlongDto): Promise; /** * Finds where two edges or wires cross or touch, with the parameter and the edge of each point on * both curves. * * The points come in order along the first curve. Where the curves run together, the two ends of * the shared stretch come back marked `isOverlap`; curves that do not meet give an empty list. * @param inputs - The two edges or wires and the tolerance * @returns The points where they meet, in order along the first curve * @group intersections * @shortname intersect curves * @drawable false * @example * ```typescript * const crossings = await bitbybit.occt.analysis.curves.intersectCurves({ shapeA: path, shapeB: border, tolerance: 1e-7 }); * const pieces = await bitbybit.occt.shapes.wire.splitWireAtParams({ shape: path, params: crossings.map(crossing => crossing.paramA) }); * ``` */ intersectCurves(inputs: Inputs.OCCT.IntersectCurvesDto): Promise; /** * Finds where an edge or a wire passes through a face or lies on it, within the face's edges. * * The points come in order along the curve, with `u` and `v` as the fractions that * `shapes.face.pointOnUV` takes. A stretch lying on the face gives its two ends, marked * `isOverlap`. * @param inputs - The edge or wire, the face and the tolerance * @returns The points where the curve meets the face, in order along the curve * @group intersections * @shortname intersect curve with face * @drawable false * @example * ```typescript * const hits = await bitbybit.occt.analysis.curves.intersectCurveWithFace({ shape: path, face, tolerance: 1e-7 }); * const normals = await Promise.all(hits.map(hit => bitbybit.occt.shapes.face.normalOnUV({ shape: face, paramU: hit.u, paramV: hit.v }))); * ``` */ intersectCurveWithFace(inputs: Inputs.OCCT.IntersectCurveWithFaceDto): Promise; /** * Tells what kind of curve an edge runs along: a line, a circle, an ellipse, a hyperbola, a * parabola, a Bezier curve, a B-spline, an offset curve or another kind. * * The kinds are the ones `select.edges.ofType` chooses edges by. * @param inputs - The edge * @returns The kind of curve the edge runs along * @group shape * @shortname curve type * @drawable false * @example * ```typescript * const kind = await bitbybit.occt.analysis.curves.curveType({ shape: edge }); * const isRound = kind === Bit.Inputs.OCCT.curveTypeEnum.circle; * ``` */ curveType(inputs: Inputs.OCCT.ShapeDto): Promise; } /** * Measurements of shapes: a bounding box that follows the geometry exactly, a box in a frame, the * box turned to fit and the principal axes of inertia, every closest pair of points between two * shapes with the sub-shapes they lie on, angles between faces and edges, the dihedral angle along an * edge, and the tightest radius of curvature. Lengths are in model units and angles in degrees. */ declare class OCCTAnalysisMeasure { private readonly occWorkerManager; /** * Finds the box lined up with the axes that just holds a shape's exact geometry. * * Unlike `operations.boundingBoxOfShape`, which may add tolerances and the mesh, it leaves no gap: * a ball of radius 3 gets a box of 6. A face carrying only a mesh is boxed by its nodes; a shape * with nothing to bound is refused. * @param inputs - The shape * @returns The box as `min`, `max`, `center` and `size` * @group boxes * @shortname tight bbox * @drawable false * @example * ```typescript * const box = await bitbybit.occt.analysis.measure.tightBoundingBox({ shape: part }); * console.log(box.size, box.center); * ``` */ tightBoundingBox(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the box that just holds a shape with its sides along a frame's axes instead of the * world's. * * The box's x runs along the frame's direction and its z along the normal. It comes back as a * frame at its center and half its size along each axis; `orientedBoundingBox` turns the box to * fit instead. * @param inputs - The shape and the frame whose axes the box follows * @returns The frame at the box's center and the half sizes along its direction, y axis and normal * @group boxes * @shortname bbox in frame * @drawable false * @example * ```typescript * const { frame, halfSizes } = await bitbybit.occt.analysis.measure.boundingBoxInFrame({ * shape: part, * frame: { origin: [0, 0, 0], normal: [0, 0, 1], direction: [1, 1, 0] }, * }); * ``` */ boundingBoxInFrame(inputs: Inputs.OCCT.BoundingBoxInFrameDto): Promise; /** * Finds the smallest box that fits around a shape, turned to follow it rather than the axes: a * frame at the box's centre, its direction along the longest side and its normal along the * shortest, with half the box's size along each. * * `boundingBoxInFrame` keeps the axes of a frame you give instead. * @param inputs - The shape * @returns The frame and the half sizes along its direction, y axis and normal * @group boxes * @shortname oriented bounding box * @drawable false * @example * ```typescript * const { frame, halfSizes } = await bitbybit.occt.analysis.measure.orientedBoundingBox({ shape: part }); * ``` */ orientedBoundingBox(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds a shape's principal axes of inertia as a frame at its centre of mass: the direction is * the axis it turns about most easily, the normal the one it resists most. * * Solids are measured by volume, even inside out, else faces by area, else edges by length, at * a density of 1. Each axis's largest coordinate is positive. * @param inputs - The shape * @returns The frame and the moments about its direction, y axis and normal * @group frames * @shortname principal frame * @drawable false * @example * ```typescript * const { frame, moments } = await bitbybit.occt.analysis.measure.principalFrame({ shape: part }); * ``` */ principalFrame(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds every nearest pair of points between two shapes, with the vertex, edge or face each point * lies on and where on it. * * Touching, overlapping and nested shapes are 0 apart; a shape inside another gives one pair on * one of its vertices, with -1 as the containing side's index. * `operations.closestPointsBetweenTwoShapes` gives one pair alone. * @param inputs - The two shapes * @returns The nearest pairs * @group distances * @shortname extrema * @drawable false * @example * ```typescript * const [nearest] = await bitbybit.occt.analysis.measure.extrema({ shapeA: box, shapeB: ball }); * console.log(nearest.distance, nearest.supportA, nearest.indexA); * ``` */ extrema(inputs: Inputs.OCCT.TwoShapesDto): Promise; /** * Measures the angle in degrees between two faces or edges where they come nearest each other. * * Faces compare their normals, 0 when they look the same way and 180 when opposite; edges compare * their tangents; a face and an edge compare the normal with the tangent, so the edge meets the * face's plane at 90 minus the angle. * @param inputs - The two faces or edges * @returns The angle in degrees, with the points and directions it was read at * @group angles * @shortname angle between * @drawable false * @example * ```typescript * const top = await bitbybit.occt.shapes.face.getFace({ shape: box, index: 5 }); * const side = await bitbybit.occt.shapes.face.getFace({ shape: box, index: 0 }); * const { angle } = await bitbybit.occt.analysis.measure.angleBetween({ shapeA: top, shapeB: side }); * ``` */ angleBetween(inputs: Inputs.OCCT.TwoShapesDto): Promise; /** * Measures the angle through the material between the two faces that meet at an edge. * * A box's edges read 90 degrees, a smooth join 180 and an L's inner edge 270; up to 180 the edge * is convex. `param` is a share of the edge's parameter range, and of its length only on lines and * circles. * @param inputs - The shape, the edge as `shapes.edge.getEdges` counts it and the place along it * @returns The angle in degrees, with the point, the two faces and their normals * @group angles * @shortname dihedral angle * @drawable false * @example * ```typescript * const { angle, isConvex } = await bitbybit.occt.analysis.measure.dihedralAngle({ shape: part, index: 3, param: 0.5 }); * ``` */ dihedralAngle(inputs: Inputs.OCCT.DihedralAngleDto): Promise; /** * Finds the tightest bend of a shape, sampled over its faces and edges, and where it is. * * Each face is read on a grid of `samples` by `samples` places inside its trims and each edge at * `samples` places, so a tighter bend between them can be missed. A sharp edge between faces is no * bend; `dihedralAngle` measures it. * @param inputs - The shape, the sample count and whether only concave bends count * @returns The smallest radius found, where, and on which face or edge * @group curvature * @shortname min curvature radius * @drawable false * @example * ```typescript * const { radius, support, index } = await bitbybit.occt.analysis.measure.minCurvatureRadius({ shape: part, samples: 16, concaveOnly: true }); * ``` */ minCurvatureRadius(inputs: Inputs.OCCT.MinCurvatureRadiusDto): Promise; } /** * Questions asked of faces, answered with points and numbers: the closest point with its (u, v), the * principal, mean and Gaussian curvature at (u, v) values, and the kind of surface a face lies on. * (u, v) values are fractions of the face's UV bounds, from 0 at the start to 1 at the end, the * values `shapes.face.pointOnUV` and the other face samplers take. */ declare class OCCTAnalysisSurfaces { private readonly occWorkerManager; /** * Finds the point of a face nearest each given point, with its (u, v) and the face's normal there. * * The face is bounded, so a point beyond its edges comes to its boundary, which `isOnBoundary` * says. `u` and `v` are fractions of the face's UV bounds, as `shapes.face.pointOnUV` takes them; * `operations.closestPointsOnShapeFromPoints` gives the points alone, for any shape. * @param inputs - The face and the points to measure from * @returns One closest point per given point, in the same order * @group points * @shortname closest points * @drawable false * @example * ```typescript * const [nearest] = await bitbybit.occt.analysis.surfaces.closestPoints({ shape: face, points: [[3, 4, 15]] }); * const normal = await bitbybit.occt.shapes.face.normalOnUV({ shape: face, paramU: nearest.u, paramV: nearest.v }); * ``` */ closestPoints(inputs: Inputs.OCCT.ClosestPointsOnShapeFromPointsDto): Promise; /** * Reads how a face bends at (u, v) pairs: its largest and smallest curvature with their * directions, their mean and product, and the normal. * * U and V are fractions of the face's UV bounds. A curvature is 1 over a radius, positive where the * face bulges out along its normal, so the inside of a hole reads negative. * @param inputs - The face and the U and V fraction pairs * @returns One curvature per pair, in the same order * @group curvature * @shortname curvatures on uvs * @drawable false * @example * ```typescript * const [middle] = await bitbybit.occt.analysis.surfaces.curvaturesOnUVs({ shape: face, paramsUV: [[0.5, 0.5]] }); * console.log(middle.maxCurvature, middle.gaussianCurvature); * ``` */ curvaturesOnUVs(inputs: Inputs.OCCT.DataOnUVsDto): Promise; /** * Tells what kind of surface a face lies on, such as a plane, a cylinder or a B-spline. * * A surface trimmed to a rectangle reads as the surface it trims, as `select.faces.ofType` reads * it, and a face without a surface, as an imported mesh has, reads as `other`. A shape that is not * a face is refused. * @param inputs - The face * @returns The kind of surface * @group shape * @shortname surface type * @drawable false * @example * ```typescript * const type = await bitbybit.occt.analysis.surfaces.surfaceType({ shape: face }); * const isFlat = type === Bit.Inputs.OCCT.surfaceTypeEnum.plane; * ``` */ surfaceType(inputs: Inputs.OCCT.ShapeDto): Promise; } /** * 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, glTF and OBJ files * into them, changes labels and exports to STEP, glTF, OBJ and PLY; `query` reads parts, shapes, * colors, placements, the hierarchy and the dimensions and tolerances 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, * glTF or OBJ file into a document. Then recolor and rename labels, update or remove parts, and * export to STEP, glTF, OBJ or PLY. 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`, `removals` go first, then `partUpdates`, then new parts and nodes; * with neither, the document is cleared unless `clearDocument` is false. `sourceDocuments` feeds * imported parts; a placed root assembly goes under a top "Assembly". 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; /** * Loads a glTF file into a new assembly document, with its hierarchy, names and colors, the * meshes becoming faces that carry triangles. * * `gltfData` is a binary `.glb` or a `.gltf` with its buffers embedded; the file's header tells * which. glTF's Y-up becomes the document's Z-up, as `exportDocumentToGltf` writes it, and a file * that holds no mesh is refused. * @param inputs - The glTF file * @returns The document handle * @group assembly * @shortname load glTF to document * @drawable false * @example * ```typescript * const doc = await bitbybit.occt.assembly.manager.loadGltfToDoc({ gltfData: glbBytes }); * const parts = await bitbybit.occt.assembly.query.getDocumentParts({ document: doc }); * ``` */ loadGltfToDoc(inputs: Inputs.OCCT.LoadGltfToDocDto): Promise; /** * Loads an OBJ file into a new assembly document, its meshes becoming faces that carry * triangles, named as the file names them. * * Coordinates are taken as they are, since OBJ has no agreed up axis. A material library the * file names is not read, and a file that holds no mesh is refused. * @param inputs - The OBJ file * @returns The document handle * @group assembly * @shortname load OBJ to document * @drawable false * @example * ```typescript * const doc = await bitbybit.occt.assembly.manager.loadObjToDoc({ objData: objText }); * const tree = await bitbybit.occt.assembly.query.getAssemblyHierarchy({ document: doc }); * ``` */ loadObjToDoc(inputs: Inputs.OCCT.LoadObjToDocDto): 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; /** * Triangulates an assembly document and writes it as OBJ, returning the file's text and the * text of the material library its `mtllib` line names. * * The file name without its extension names the library, which holds the parts' colors and is * empty for a document without any. Coordinates keep six decimals. `meshDeflection` sets how * finely curved surfaces are triangulated. * @param inputs - The document, the meshing tolerance, the file name and the download option * @returns The OBJ text and the material library text * @group export * @shortname export document OBJ * @drawable false * @example * ```typescript * const files = await bitbybit.occt.assembly.manager.exportDocumentToObj({ document: doc, meshDeflection: 0.1, fileName: "assembly.obj", tryDownload: false }); * console.log(files.obj, files.mtl); * ``` */ exportDocumentToObj(inputs: Inputs.OCCT.ExportDocumentToObjDto): Promise; /** * Triangulates an assembly document and writes it as ASCII PLY with a normal per vertex and the * parts' colors, returning the file's text. * * Coordinates keep six significant digits, so a model more than about 1000 units across loses * detail below 0.01. `meshDeflection` sets how finely curved surfaces are triangulated. * @param inputs - The document, the meshing tolerance, the file name and the download option * @returns The PLY file as text * @group export * @shortname export document PLY * @drawable false * @example * ```typescript * const ply = await bitbybit.occt.assembly.manager.exportDocumentToPly({ document: doc, meshDeflection: 0.1, fileName: "assembly.ply", tryDownload: false }); * ``` */ exportDocumentToPly(inputs: Inputs.OCCT.ExportDocumentToPlyDto): Promise; private downloadFile; /** * 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, the whole hierarchy as a tree, and the dimensions and * tolerances it carries. 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; /** * Reads the product manufacturing information a document holds, as a STEP AP242 file brings it: * dimensions, geometric tolerances and the datums they refer to. * * Each entry names its shapes by label, which `getShapeFromLabel` reads. Lengths are in the * document's unit, millimeters for a loaded STEP file, and angles in degrees; a document without * any gives empty lists. * @param inputs - The document * @returns The dimensions, the tolerances and the datums * @group query * @shortname get PMI * @drawable false * @example * ```typescript * const pmi = await bitbybit.occt.assembly.query.getDocumentPmi({ document: doc }); * const measured = await bitbybit.occt.assembly.query.getShapeFromLabel({ document: doc, label: pmi.dimensions[0].shapes[0] }); * ``` */ getDocumentPmi(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. * * A compound counts as its pieces, so overlapping pieces of one compound merge too. `strategy` * sets how many shapes go into each step, and `keepEdges` false, the default, merges faces left * on one surface. * @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; /** * Fuses shapes as `union` does, and reports for each shape given, in order, what became of its * faces, edges and vertices in the result, as indexes the selectors and fillets take. * @param inputs - The shapes to fuse, the strategy and whether to keep the seam edges * @returns The fused shape and one history per shape given * @group booleans * @shortname union with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.booleans.unionWithHistory({ shapes: [box, cylinder], keepEdges: false }); * ``` */ unionWithHistory(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. * * `strategy` sets how many shapes are cut away in each step. With `keepEdges` false, the * default, faces left on one surface are merged, and a lone remaining solid is returned * without 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; /** * Cuts shapes away as `difference` does, and reports what became of the faces, edges and * vertices of the main shape and of each cutting shape, in that order: a drill's side becomes * the wall of its hole. * @param inputs - The main shape, the shapes to subtract, the strategy and whether to keep the seam edges * @returns What is left of the main shape and one history per shape given, the main shape first * @group booleans * @shortname difference with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.booleans.differenceWithHistory({ shape: plate, shapes: [drill], keepEdges: false }); * const holeWalls = histories[1].faces.flat(); * ``` */ differenceWithHistory(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; /** * Intersects shapes as `intersection` does, and reports what became of every shape's faces, * edges and vertices, in the order given, as indexes into the compound it returns. * * A shape that does not touch the first adds no piece and maps to nothing. * @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 and one history per shape given * @group booleans * @shortname intersection with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.booleans.intersectionWithHistory({ shapes: [box, sphere], keepEdges: false }); * const fromSphere = histories[1].faces.flat(); * ``` */ intersectionWithHistory(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; `shapeFix.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; } /** * Builds parametric parts and assemblies kept as data: a part document holds typed parameters, * configurations, an ordered list of features and the parts they make, with materials, appearance, * properties such as part numbers and connectors; an assembly document places parts and other * assemblies, fastened by their connectors. * * Features find faces and edges by the feature that made them and the role it made them in, so a * reference keeps pointing at the same face when the parameters change. Sketches come from `sketch`, * the operations from `operations`, `booleans`, `fillets` and `features`. * * Experimental: the document format may still change before its first stable version, and * documents written before then are not migrated. * @beta */ declare class OCCTDesign { private readonly occWorkerManager; /** * Checks a design document without building it and lists every problem found. * * Each problem carries the JSON pointer of the value it is about, such as `/features/2/radius`, * and a message. An assembly is checked with the `documents` it places, whose problems come * under their position, such as `/documents/2`. Undefined properties and bad expressions count. * @param inputs - The document to check * @returns The problems, empty when there are none * @group document * @shortname validate design * @drawable false * @example * ```typescript * const issues = await bitbybit.occt.design.validate({ * document: { schemaVersion: 1, parameters: { size: 10 }, features: [{ id: "block", type: "extrude", profile: "base", distance: "size" }] }, * }); * console.log(issues[0]?.path, issues[0]?.message); * ``` */ validate(inputs: Inputs.OCCT.DesignDocumentDto): Promise; /** * Works out the version of a design document, the value a component's `version` pins its source * with. * * The version is the SHA-256 of the document's canonical JSON (RFC 8785) without what only * editors and tools read, such as `meta` but its name, `extras`, labels, descriptions and * reference hints, so editing those keeps it. * @param inputs - The document; `documents` is not read * @returns The version, 64 lower-case hexadecimal digits * @group document * @shortname design version * @drawable false * @example * ```typescript * const version = await bitbybit.occt.design.versionOf({ * document: { schemaVersion: 1, id: "3f2c9a1e-5b7d-4e8f-9a0b-1c2d3e4f5a6b", features: [] }, * }); * console.log(version); * ``` */ versionOf(inputs: Inputs.OCCT.DesignDocumentDto): Promise; /** * Builds the parts of a design document, with a configuration's values and then `parameters` * replacing the document's own. * * A document `validate` faults is refused. A failed feature is reported and what uses it * skipped; unchanged features are reused. `structure` exports the parts to STEP and glTF through * `assembly.manager.buildAssemblyDocument`; an assembly adds components and a bill of materials. * @param inputs - The document, the configuration and the parameter values to build it with * @returns The parts, a report per feature, the problems found after the features ran, and the parameter values used * @group document * @shortname build design * @drawable true * @example * ```typescript * const { parts, report } = await bitbybit.occt.design.build({ * document: { schemaVersion: 1, parameters: { width: 40, height: 10 }, features: [ * { id: "base", type: "sketch", on: { plane: "XY" }, pen: [{ type: "hLine", length: "width" }, { type: "vLine", length: 20 }, { type: "hLine", length: "-width" }, { type: "close" }] }, * { id: "plate", type: "extrude", profile: "base", distance: "height" }, * ], parts: [{ id: "plate", body: "plate", properties: { partNumber: "PL-{width}x{height}" } }] }, * parameters: { width: 60 }, * }); * console.log(parts[0]?.properties.partNumber); * ``` */ build(inputs: Inputs.OCCT.DesignBuildDto): Promise>; /** * Builds a design document whose script features run here, on the main thread, as the kernel runs no * code: it builds, runs the code of every script the build lists as `pending`, and builds again * with what each made, until no script waits. * * A script's code is the asset its feature names, given in `assets` as an import's file is, and * is the body of an async function given `inputs`, the feature's params with bodies as shapes and * references as indexes, and `occt`, this package's API: it returns a shape, or `{ shape, roles }` * naming faces by role, such as `{ shape, roles: { tooth: [3, 4] } }`. Run only documents whose * scripts you trust: their code runs with the rights of the page that runs it. * @param inputs - The document, the configuration, the values, the assets with each script's code, and the documents an assembly places * @returns What the last build made: the parts, a report per feature and the problems found, as `build` returns them * @group document * @shortname build design with scripts * @drawable true * @ignore true * @example * ```typescript * const code = "const box = await occt.shapes.solid.createBox({ width: inputs.size, length: inputs.size, height: 2, center: [0, 0, 0] }); return { shape: box, roles: { slab: [0, 1, 2, 3, 4, 5] } };"; * const result = await bitbybit.occt.design.buildWithScripts({ * document: { * schemaVersion: 1, * parameters: { size: 20 }, * assets: [{ id: "slab", uri: "slab.js", sha256: "be4375e273b65ebd4034cef2a4e3c9b5a9141f6b92abcd3796fc624369fa231d" }], * features: [{ id: "slab", type: "script", script: "slab", params: { size: { expr: "size" } } }], * }, * assets: { slab: code }, * }); * console.log(result.report[0]?.status); * ``` */ buildWithScripts(inputs: Inputs.OCCT.DesignBuildDto): Promise>; /** * Writes a hint onto every face reference of a part document: what the faces it resolves to are * like in a build with the configuration and values given, so a later build can find them again * by likeness if an edit loses their names. * * Hints record the body's box and, for each face, its surface type, its area and centre relative * to the body, its normal and the names of the faces next to it. They are left out of the * document's version, and a build reads them only for a reference whose faces are lost (see * `rebind`). A reference that resolves to different faces in different places, such as a connector * set's axis, gets no hint. Write them when a document is saved. * @param inputs - The part document, and the configuration, values and asset contents to build it with * @returns The document with a hint on every face reference the build resolved * @group document * @shortname design hints * @drawable false * @ignore true * @example * ```typescript * const hinted = await bitbybit.occt.design.withHints({ * document: { schemaVersion: 1, features: [ * { id: "base", type: "sketch", on: { plane: "XY" }, pen: [{ type: "hLine", length: 4 }, { type: "vLine", length: 4 }, { type: "hLine", length: -4 }, { type: "close" }] }, * { id: "block", type: "extrude", profile: "base", distance: 2 }, * ], parts: [{ id: "block", body: "block", appearance: { faces: [{ faces: { of: "block", role: "end", count: 1 }, color: "#ff0000" }] } }] }, * }); * console.log(hinted.parts?.[0]?.appearance?.faces?.[0]?.faces.hint); * ``` */ withHints(inputs: Inputs.OCCT.DesignBuildDto): Promise; /** * Writes a design document as TypeScript that builds the same parts with this package's own * calls, for the configuration and parameter values given. * * Parameters become constants and expressions TypeScript over them, so dimensions stay editable. * The faces and edges features pick are written as the indexes this build finds. A document that * does not build with these values is refused. * @param inputs - The document, the configuration and the parameter values to write it for * @returns The TypeScript, ending with the parts drawn * @group document * @shortname design to typescript * @drawable false * @ignore true * @example * ```typescript * const code = await bitbybit.occt.design.toTypeScript({ * document: { schemaVersion: 1, parameters: { width: 40 }, features: [ * { id: "base", type: "sketch", on: { plane: "XY" }, pen: [{ type: "hLine", length: "width" }, { type: "vLine", length: 20 }, { type: "hLine", length: "-width" }, { type: "close" }] }, * { id: "plate", type: "extrude", profile: "base", distance: 10 }, * ] }, * }); * console.log(code); * ``` */ toTypeScript(inputs: Inputs.OCCT.DesignBuildDto): Promise; /** * Finds the placed parts of a design build that overlap, touch or come within `clearance` of each * other, such as a sleeve that runs into the arm it slides on. * * The document is built as `build` builds it and every part placement is checked against every * other in place. Two components a joint holds together are expected to touch, so a touch between * them is left out and an overlap is listed with `joined` true. A part document's parts are checked * where they were built. * @param inputs - The document, the documents an assembly places, the values to build with and the clearance * @returns The clashing pairs, with their distance, the volume they share and their nearest points * @group document * @shortname design clashes * @drawable false * @ignore true * @example * ```typescript * const clashes = await bitbybit.occt.design.clashes({ document: assembly, documents: [bracket, pin], clearance: 0.2 }); * const overlaps = clashes.filter(clash => clash.volume > 0); * ``` */ clashes(inputs: Inputs.OCCT.DesignClashesDto): Promise; /** * Probes a fillet or chamfer feature of a part document: the faces and edges its reference * finds, and the largest radius or distance that builds a valid solid. * * The features before it are built with the values given, its reference is resolved without * checking counts, and values are tried, the document's own first, up to `maxAttempts`. * @param inputs - The document, the feature's id, the values to build with and how many values to try * @returns The faces and edges found, whether the document's value builds, and the range the largest value that builds lies in * @group document * @shortname probe design fillet * @drawable false * @ignore true * @example * ```typescript * const probe = await bitbybit.occt.design.probeFillet({ * document: { schemaVersion: 1, features: [ * { id: "base", type: "sketch", on: { plane: "XY" }, pen: [{ type: "hLine", length: 40 }, { type: "vLine", length: 20 }, { type: "hLine", length: -40 }, { type: "close" }] }, * { id: "plate", type: "extrude", profile: "base", distance: 10 }, * { id: "round", type: "fillet", body: "plate", radius: 2, edges: { between: [{ of: "plate", role: "end" }, { of: "plate", role: "side" }], count: 4 } }, * ] }, * feature: "round", * }); * console.log(probe.edges.length, probe.builds, probe.largest, probe.smallestFailing); * ``` */ probeFillet(inputs: Inputs.OCCT.DesignProbeFilletDto): Promise; /** * Names faces or edges picked on a built body the way a document stores them: a reference by the * names of the features that made them, narrowed by an axis filter when names alone do not single * them out, with their count and a hint of what the faces are like, so a build can find them again * by likeness if their names are lost. * * With `nudge`, the default, the document is built again with each number the body depends on * moved a little, at most eight of them; `lost` lists those after which the reference no longer * finds elements like the picked ones. `refused` says why no reference names the picks. * @param inputs - The document, the body, the picked faces or edges and the values to build it with * @returns The reference or why there is none, the numbers it was checked against and those it lost its elements to * @group document * @shortname design reference for * @drawable false * @ignore true * @example * ```typescript * const found = await bitbybit.occt.design.referenceFor({ * document: { schemaVersion: 1, parameters: { height: 10 }, features: [ * { id: "base", type: "sketch", on: { plane: "XY" }, pen: [{ type: "hLine", length: 40 }, { type: "vLine", length: 20 }, { type: "hLine", length: -40 }, { type: "close" }] }, * { id: "plate", type: "extrude", profile: "base", distance: "height" }, * ] }, * body: "plate", * faces: [1], * }); * console.log(found.reference, found.lost); * ``` */ referenceFor(inputs: Inputs.OCCT.DesignReferenceForDto): 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; } /** * Local modelling features on solids: holes drilled at frames, bosses and pockets from a profile * sketched on a face, tapered and revolved ones, ribs and grooves from a wire, and faces removed or * pushed and pulled. Each method returns a new shape and leaves the one it was given as it is; faces * are counted from 0 as `shapes.face.getFaces` and the face selectors count them. Sweeps that need no * base, such as `operations.sweepEvolved`, live in `operations`. */ declare class OCCTFeatures { private readonly occWorkerManager; /** * Drills plain holes into a shape, one at each frame: its origin is where the hole enters and its * normal points out of the material. * * `depth` 0 drills through the whole shape; `tipAngle` 0 leaves a flat bottom and 118 the point of * a twist drill, in degrees. Holes that meet are cut as one. * @param inputs - The shape, the frames and the size of the holes * @returns The drilled shape * @group holes * @shortname holes * @drawable true * @example * ```typescript * const plate = await bitbybit.occt.shapes.solid.createBox({ width: 20, length: 20, height: 5, center: [0, 2.5, 0] }); * const drilled = await bitbybit.occt.features.holes({ * shape: plate, * frames: [ * { origin: [5, 5, 5], normal: [0, 1, 0], direction: [1, 0, 0] }, * { origin: [-5, 5, -5], normal: [0, 1, 0], direction: [1, 0, 0] }, * ], * diameter: 3, * depth: 0, * tipAngle: 0, * }); * ``` */ holes(inputs: Inputs.OCCT.HolesDto): Promise; /** * Drills holes as `holes` does, and reports a history for the shape, then one per hole in the * order of `frames`. * * `histories[i + 1].faces.flat()` lists every face hole `i` left in the shape. * @param inputs - The shape, the frames and the size of the holes * @returns The drilled shape and one history for the shape, then one per hole * @group holes * @shortname holes with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.features.holesWithHistory({ * shape: plate, * frames: [{ origin: [5, 5, 5], normal: [0, 1, 0], direction: [1, 0, 0] }], * diameter: 3, * depth: 0, * tipAngle: 0, * }); * const firstHoleFaces = histories[1].faces.flat(); * ``` */ holesWithHistory(inputs: Inputs.OCCT.HolesDto): Promise>; /** * Drills holes as `holes` does, each with a wider, flat-bottomed counterbore at its mouth that * sinks a screw head below the surface. * * The counterbore must be wider than the hole and, in a hole of a given `depth`, shallower than * it; a hole that breaks either rule is refused. * @param inputs - The shape, the frames, the size of the holes and the size of the counterbores * @returns The drilled shape * @group holes * @shortname counterbored holes * @drawable true * @example * ```typescript * const drilled = await bitbybit.occt.features.counterboredHoles({ * shape: plate, * frames: [{ origin: [0, 5, 0], normal: [0, 1, 0], direction: [1, 0, 0] }], * diameter: 3.4, * depth: 0, * tipAngle: 0, * counterboreDiameter: 6.5, * counterboreDepth: 3.4, * }); * ``` */ counterboredHoles(inputs: Inputs.OCCT.CounterboredHolesDto): Promise; /** * Drills holes as `counterboredHoles` does, and reports a history for the shape, then one per hole in the * order of `frames`. * * `histories[i + 1].faces.flat()` lists every face hole `i` left in the shape. * @param inputs - The shape, the frames, the size of the holes and the size of the counterbores * @returns The drilled shape and one history for the shape, then one per hole * @group holes * @shortname counterbored holes with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.features.counterboredHolesWithHistory({ * shape: plate, * frames: [{ origin: [5, 5, 5], normal: [0, 1, 0], direction: [1, 0, 0] }], * diameter: 3.4, * depth: 0, * tipAngle: 0, * counterboreDiameter: 6.5, * counterboreDepth: 3.4, * }); * const firstHoleFaces = histories[1].faces.flat(); * ``` */ counterboredHolesWithHistory(inputs: Inputs.OCCT.CounterboredHolesDto): Promise>; /** * Drills holes as `holes` does, each with a cone-shaped countersink at its mouth that sinks a * flat screw head flush with the surface. * * `countersinkAngle` is the cone's full angle in degrees. The countersink must be wider than the * hole and end above the bottom of a hole of a given `depth`. * @param inputs - The shape, the frames, the size of the holes and the size of the countersinks * @returns The drilled shape * @group holes * @shortname countersunk holes * @drawable true * @example * ```typescript * const drilled = await bitbybit.occt.features.countersunkHoles({ * shape: plate, * frames: [{ origin: [0, 5, 0], normal: [0, 1, 0], direction: [1, 0, 0] }], * diameter: 3.4, * depth: 0, * tipAngle: 0, * countersinkDiameter: 6.5, * countersinkAngle: 90, * }); * ``` */ countersunkHoles(inputs: Inputs.OCCT.CountersunkHolesDto): Promise; /** * Drills holes as `countersunkHoles` does, and reports a history for the shape, then one per hole in the * order of `frames`. * * `histories[i + 1].faces.flat()` lists every face hole `i` left in the shape. * @param inputs - The shape, the frames, the size of the holes and the size of the countersinks * @returns The drilled shape and one history for the shape, then one per hole * @group holes * @shortname countersunk holes with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.features.countersunkHolesWithHistory({ * shape: plate, * frames: [{ origin: [5, 5, 5], normal: [0, 1, 0], direction: [1, 0, 0] }], * diameter: 3.4, * depth: 0, * tipAngle: 0, * countersinkDiameter: 6.5, * countersinkAngle: 90, * }); * const firstHoleFaces = histories[1].faces.flat(); * ``` */ countersunkHolesWithHistory(inputs: Inputs.OCCT.CountersunkHolesDto): Promise>; /** * Removes faces from a solid and closes the gap by extending the faces around them, as when a * hole or a rounded edge is deleted from a part. * * The shape must hold solids only; a gap its neighbours cannot close, such as the top of a box * leaves, is refused rather than left open. * @param inputs - The shape and the faces to remove * @returns The shape without the faces * @group faces * @shortname remove faces * @drawable true * @example * ```typescript * const walls = await bitbybit.occt.select.faces.ofType({ shape: drilled, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder }); * const filled = await bitbybit.occt.features.removeFaces({ shape: drilled, indexes: walls }); * ``` */ removeFaces(inputs: Inputs.OCCT.RemoveFacesDto): Promise; /** * Removes faces as `removeFaces` does, and reports one history, the shape's: a removed face's * `faces` entry is empty, and each face that stays lists the face it became, grown over the gap. * @param inputs - The shape and the faces to remove * @returns The shape without the faces, and the history of the shape as the one entry of `histories` * @group faces * @shortname remove faces with history * @drawable false * @example * ```typescript * const walls = await bitbybit.occt.select.faces.ofType({ shape: drilled, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder }); * const { shape, histories: [history] } = await bitbybit.occt.features.removeFacesWithHistory({ shape: drilled, indexes: walls }); * const topNow = history.faces[0]; * ``` */ removeFacesWithHistory(inputs: Inputs.OCCT.RemoveFacesDto): Promise>; /** * Moves faces of a shape along their outward normals and stretches the faces around them to * follow, such as raising the top of a block. * * `distance` moves every chosen face, a negative one inward; `distances` gives one per index * instead. Each solid of a compound moves on its own and stays a solid. * @param inputs - The shape, the faces and how far to move them * @returns The shape with the faces moved * @group faces * @shortname push pull faces * @drawable true * @example * ```typescript * const top = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0], angle: 0 }); * const taller = await bitbybit.occt.features.pushPullFaces({ shape: block, indexes: top, distance: 2 }); * ``` */ pushPullFaces(inputs: Inputs.OCCT.PushPullFacesDto): Promise; /** * Moves faces as `pushPullFaces` does, and reports one history, the shape's: each face, edge and * vertex lists what it became, so a moved face is followed to where it went, curved ones too. * @param inputs - The shape, the faces and how far to move them * @returns The shape with the faces moved, and the history of the shape as the one entry of `histories` * @group faces * @shortname push pull faces with history * @drawable false * @example * ```typescript * const [wall] = await bitbybit.occt.select.faces.ofType({ shape: rod, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder }); * const { shape, histories: [history] } = await bitbybit.occt.features.pushPullFacesWithHistory({ shape: rod, indexes: [wall], distance: 1 }); * const [movedWall] = history.faces[wall]; * ``` */ pushPullFacesWithHistory(inputs: Inputs.OCCT.PushPullFacesDto): Promise>; /** * Grows a boss out of a base by sweeping a profile face that lies on one of its faces along * `direction`. * * `extent` stops it after `length`, at the face `untilFaceIndex` names, such as the underside of * an overhang, or through all of the base in its way, which needs base ahead of it. * @param inputs - The base, the profile, its sketch face, the direction and how far to go * @returns The base with the boss * @group forms * @shortname boss * @drawable true * @example * ```typescript * const block = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 5, 0] }); * const [top] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0], angle: 0 }); * const profile = await bitbybit.occt.shapes.face.createSquareFace({ size: 2, center: [0, 10, 0], direction: [0, 1, 0] }); * const bossed = await bitbybit.occt.features.boss({ shape: block, profile, sketchFaceIndex: top, direction: [0, 1, 0], length: 3 }); * ``` */ boss(inputs: Inputs.OCCT.PrismFeatureDto): Promise; /** * Grows a boss as `boss` does, and reports two histories: the base's, then the profile's, whose * `facesFromEdges` holds the side each profile edge swept and `lastFaces` the far end. * * A face the kernel leaves unreported is found from where it lies, and left out when it could * belong to more than one input. * @param inputs - The base, the profile, its sketch face, the direction and how far to go * @returns The base with the boss, and the histories of the base and of the profile * @group forms * @shortname boss with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.features.bossWithHistory({ shape: block, profile, sketchFaceIndex: top, direction: [0, 1, 0], length: 3 }); * const [baseHistory, profileHistory] = histories; * const bossTop = profileHistory.lastFaces; * ``` */ bossWithHistory(inputs: Inputs.OCCT.PrismFeatureDto): Promise>; /** * Cuts a pocket into a base by sweeping a profile face that lies on one of its faces along * `direction`, which points into the base. * * `extent` stops it after `length`, at the face `untilFaceIndex` names, such as the ceiling of a * void or the far side of the base, or through all of it. * @param inputs - The base, the profile, its sketch face, the direction and how far to go * @returns The base with the pocket * @group forms * @shortname pocket * @drawable true * @example * ```typescript * const [top] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0], angle: 0 }); * const profile = await bitbybit.occt.shapes.face.createSquareFace({ size: 2, center: [0, 10, 0], direction: [0, 1, 0] }); * const pocketed = await bitbybit.occt.features.pocket({ shape: block, profile, sketchFaceIndex: top, direction: [0, -1, 0], length: 3 }); * ``` */ pocket(inputs: Inputs.OCCT.PrismFeatureDto): Promise; /** * Cuts a pocket as `pocket` does, and reports two histories: the base's, then the profile's, * whose `facesFromEdges` holds the wall each profile edge swept and `lastFaces` the floor. * * A face the kernel leaves unreported is found from where it lies, and left out when it could * belong to more than one input. * @param inputs - The base, the profile, its sketch face, the direction and how far to go * @returns The base with the pocket, and the histories of the base and of the profile * @group forms * @shortname pocket with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.features.pocketWithHistory({ shape: block, profile, sketchFaceIndex: top, direction: [0, -1, 0], length: 3 }); * const floor = histories[1].lastFaces; * const walls = histories[1].facesFromEdges.flat(); * ``` */ pocketWithHistory(inputs: Inputs.OCCT.PrismFeatureDto): Promise>; /** * Grows a boss out of a base as `boss` does, straight out of the sketch face, with its sides * leaning by `angle` degrees. * * A positive angle narrows the boss as it rises from the sketch face, a negative one widens it * and rounds its outer corners. `extent` works as for `boss`. * @param inputs - The base, the profile, its sketch face, the draft angle in degrees and how far to go * @returns The base with the tapered boss * @group forms * @shortname tapered boss * @drawable true * @example * ```typescript * const [top] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0], angle: 0 }); * const profile = await bitbybit.occt.shapes.face.createSquareFace({ size: 2, center: [0, 10, 0], direction: [0, 1, 0] }); * const bossed = await bitbybit.occt.features.taperedBoss({ shape: block, profile, sketchFaceIndex: top, angle: 10, length: 3 }); * ``` */ taperedBoss(inputs: Inputs.OCCT.TaperedPrismFeatureDto): Promise; /** * Cuts a pocket into a base as `pocket` does, straight in from the sketch face, with its sides * leaning by `angle` degrees. * * A positive angle narrows the pocket as it deepens, a negative one widens it. The kernel cannot * stop a tapered pocket at the far side of the base; run it through all instead. * @param inputs - The base, the profile, its sketch face, the draft angle in degrees and how far to go * @returns The base with the tapered pocket * @group forms * @shortname tapered pocket * @drawable true * @example * ```typescript * const [top] = await bitbybit.occt.select.faces.facing({ shape: block, direction: [0, 1, 0], angle: 0 }); * const profile = await bitbybit.occt.shapes.face.createSquareFace({ size: 2, center: [0, 10, 0], direction: [0, 1, 0] }); * const pocketed = await bitbybit.occt.features.taperedPocket({ shape: block, profile, sketchFaceIndex: top, angle: 5, length: 3 }); * ``` */ taperedPocket(inputs: Inputs.OCCT.TaperedPrismFeatureDto): Promise; /** * Adds a ring to a base by turning a profile face about an axis, such as a collar round a shaft: * the profile lies on a face of the base, in a plane through the axis. * * `angle` is in degrees and follows the right-hand rule about `axisDirection`; 360 makes a whole * ring. * @param inputs - The base, the profile, its sketch face, the axis and the angle in degrees * @returns The base with the ring * @group forms * @shortname revolved boss * @drawable true * @example * ```typescript * const shaft = await bitbybit.occt.shapes.solid.createCylinder({ radius: 5, height: 10, center: [0, 0, 0], direction: [0, 1, 0] }); * const [side] = await bitbybit.occt.select.faces.ofType({ shape: shaft, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder }); * const profile = await bitbybit.occt.shapes.face.createRectangleFace({ width: 2, length: 1, center: [5.5, 5, 0], direction: [0, 0, 1] }); * const collared = await bitbybit.occt.features.revolvedBoss({ shape: shaft, profile, sketchFaceIndex: side, axisOrigin: [0, 0, 0], axisDirection: [0, 1, 0], angle: 360 }); * ``` */ revolvedBoss(inputs: Inputs.OCCT.RevolvedFeatureDto): Promise; /** * Cuts a groove round a base by turning a profile face about an axis, such as the seat of a * circlip on a shaft: the profile lies on a face of the base, in a plane through the axis. * * `angle` is in degrees and follows the right-hand rule about `axisDirection`; 360 cuts all the * way round. * @param inputs - The base, the profile, its sketch face, the axis and the angle in degrees * @returns The base with the groove * @group forms * @shortname revolved pocket * @drawable true * @example * ```typescript * const [side] = await bitbybit.occt.select.faces.ofType({ shape: shaft, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder }); * const profile = await bitbybit.occt.shapes.face.createRectangleFace({ width: 2, length: 1, center: [4.5, 5, 0], direction: [0, 0, 1] }); * const grooved = await bitbybit.occt.features.revolvedPocket({ shape: shaft, profile, sketchFaceIndex: side, axisOrigin: [0, 0, 0], axisDirection: [0, 1, 0], angle: 360 }); * ``` */ revolvedPocket(inputs: Inputs.OCCT.RevolvedFeatureDto): Promise; /** * Adds a rib to a base: the region between a wire and the base's faces, on the wire's left as it * runs seen from the side the frame's normal points to, filled and thickened across the plane. * * A wire across the inside corner of an L fills the corner; an edge is made into a wire first. * @param inputs - The base, the wire, the plane it lies in and the thickness on each side * @returns The base with the rib * @group forms * @shortname rib * @drawable true * @example * ```typescript * const wire = await bitbybit.occt.shapes.wire.createPolylineWire({ points: [[12, 2, 0], [2, 12, 0]] }); * const ribbed = await bitbybit.occt.features.rib({ * shape: bracket, * wire, * frame: { origin: [0, 0, 0], normal: [0, 0, 1], direction: [1, 0, 0] }, * thickness: 0.5, * otherSideThickness: 0.5, * }); * ``` */ rib(inputs: Inputs.OCCT.RibFeatureDto): Promise; /** * Cuts a groove into a base: the part of the base's section on the left of a wire as it runs, * seen from the side the frame's normal points to, removed across the plane. * * A wire bent round a corner keeps the region inside the bend and cuts the rest; an edge is made * into a wire first. * @param inputs - The base, the wire, the plane it lies in and the thickness on each side * @returns The base with the groove * @group forms * @shortname groove * @drawable true * @example * ```typescript * const wire = await bitbybit.occt.shapes.wire.createPolylineWire({ points: [[10, 12, 0], [10, 5, 0], [22, 5, 0]] }); * const grooved = await bitbybit.occt.features.groove({ * shape: block, * wire, * frame: { origin: [0, 0, 0], normal: [0, 0, -1], direction: [1, 0, 0] }, * thickness: 0.5, * otherSideThickness: 0.5, * }); * ``` */ groove(inputs: Inputs.OCCT.RibFeatureDto): 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 edges as `filletEdges` does, and reports what became of every face, edge and vertex * of the shape: `history.facesFromEdges` holds the round made along each edge, and * `history.faces` what each face was trimmed to, all as indexes the selectors and fillets take. * @param inputs - The shape, the radius or the radius list, and the optional 0-based edge indexes * @returns The shape with rounded edges and its history * @group 3d fillets * @shortname fillet edges with history * @drawable false * @example * ```typescript * const { shape, history } = await bitbybit.occt.fillets.filletEdgesWithHistory({ shape: box, radius: 1, indexes: [0] }); * const round = history.facesFromEdges[0]; * ``` */ filletEdgesWithHistory(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, flat or not, each with an arc in the plane of the two edges * that meet there, as a bent rod would be. * * Corner `i` joins edge `i` to the next, counted from 0; a closed wire's last corner joins its * last edge to its first. Smooth corners stay; `direction` is unused. * @param inputs - The wire, the radius or radius list and the optional 0-based corner indexes * @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 }); * ``` */ fillet3DWire(inputs: Inputs.OCCT.Fillet3DWireDto): Promise; /** * Rounds the corners of several wires, as `fillet3DWire` does for one, with the same radius and * indexes for all. * @param inputs - The wires, the radius or radius list and the optional corner indexes * @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 }); * ``` */ 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 `indexes`, counted from 0 as * `shapes.edge.getEdges` lists them, only those are, each with `distance` or, in edge order, * its entry of `distanceList`. Indexes naming no edge change nothing. * @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 edges as `chamferEdges` does, and reports what became of every face, edge and vertex of * the shape: `history.facesFromEdges` holds the bevel made along each edge, and `history.faces` * what each face was trimmed to. * @param inputs - The shape, the distance or the distance list, and the optional 0-based edge indexes * @returns The beveled shape and its history * @group 3d chamfers * @shortname chamfer edges with history * @drawable false * @example * ```typescript * const { shape, history } = await bitbybit.occt.fillets.chamferEdgesWithHistory({ shape: box, distance: 1, indexes: [0] }); * ``` */ chamferEdgesWithHistory(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, only * those corners are rounded, each with `radius` or the matching entry of `radiusList`, as long * as `indexes`. Straight corners stay; free-form wires 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, IGES, STL and BREP in; STEP, STL, * BREP, OBJ, PLY, SVG 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, Y and Z swap, which mirrors the shape; to keep it as built, turn it 90 * degrees about X with `transforms.rotate` first. `fileName` names the download, `tryDownload` * false skips it, and `saveShapeSTEPAndReturn` gives the 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, Y and Z swap so Y-up becomes STEP's Z-up, which mirrors the shape; * turn it 90 degrees about X with `transforms.rotate` first to keep it as built. `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, `adjustYtoZ` swaps Y and Z, which * mirrors the shape, and `binary` writes the smaller binary form. `fileName` names the * download, `tryDownload` false skips it. `saveShapeStlAndReturn` gives the file instead. * @param inputs - The shape, the file name, the meshing precision, the axis adjustment, the form 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, binary: 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, or its bytes when `binary` is true. * * `precision` is the meshing tolerance in model units; smaller values follow curved surfaces * more closely. `adjustYtoZ` swaps Y and Z, which mirrors the shape. `fileName` and * `tryDownload` matter only for a download. * @param inputs - The shape, the file name, the meshing precision, the axis adjustment, the form and the download options * @returns The STL file as text, or as bytes when `binary` is true * @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 }); * const bytes = await bitbybit.occt.io.saveShapeStlAndReturn({ shape: box, fileName: "box.stl", precision: 0.01, adjustYtoZ: true, tryDownload: false, binary: true }); * ``` */ saveShapeStlAndReturn(inputs: Inputs.OCCT.SaveStlDto): Promise; private downloadStep; private downloadStl; /** * Writes a shape as BREP, the text format that keeps its exact geometry and topology, and starts * a browser download of the file. * * `io.loadBrep` reads the file back into the same shape. `fileName` names the download and * `tryDownload` false skips it; `saveShapeBrepAndReturn` gives the text instead. * @param inputs - The shape, the file name and the download option * @returns Nothing; the download starts when the file is ready * @group io * @shortname save brep * @drawable false * @example * ```typescript * await bitbybit.occt.io.saveShapeBrep({ shape: box, fileName: "box.brep", tryDownload: true }); * ``` */ saveShapeBrep(inputs: Inputs.OCCT.SaveBrepDto): Promise; /** * Writes a shape as BREP, the text format that keeps its exact geometry and topology, and * returns the file's text. * * `io.loadBrep` reads the text back into the same shape, placement and orientation included. * `fileName` and `tryDownload` only matter where a download can start. * @param inputs - The shape, the file name and the download option * @returns The BREP file as text * @group io * @shortname save brep and return * @drawable false * @example * ```typescript * const brep = await bitbybit.occt.io.saveShapeBrepAndReturn({ shape: box, fileName: "box.brep", tryDownload: false }); * const copy = await bitbybit.occt.io.loadBrep({ brepData: brep }); * ``` */ saveShapeBrepAndReturn(inputs: Inputs.OCCT.SaveBrepDto): Promise; /** * Writes a shape as binary BREP, the exact geometry and topology `saveShapeBrep` writes as text, * in bytes, and starts a browser download of the file. * * `io.loadBrepBinary` reads the file back into the same shape. `fileName` names the download and * `tryDownload` false skips it; `saveShapeBrepBinaryAndReturn` gives the bytes instead. * @param inputs - The shape, the file name, the download option and whether to keep the mesh * @returns Nothing; the download starts when the file is ready * @group io * @shortname save brep binary * @drawable false * @example * ```typescript * await bitbybit.occt.io.saveShapeBrepBinary({ shape: box, fileName: "box.bbrep", tryDownload: true, withTriangulation: false }); * ``` */ saveShapeBrepBinary(inputs: Inputs.OCCT.SaveBrepBinaryDto): Promise; /** * Writes a shape as binary BREP, the exact geometry and topology `saveShapeBrep` writes as text, * in bytes, and returns them. * * `io.loadBrepBinary` reads them back with every face and edge at the same index. * `withTriangulation` false leaves out the mesh. * @param inputs - The shape, the file name, the download option and whether to keep the mesh * @returns The binary BREP file's bytes * @group io * @shortname save brep binary and return * @drawable false * @example * ```typescript * const bytes = await bitbybit.occt.io.saveShapeBrepBinaryAndReturn({ shape: box, fileName: "box.bbrep", tryDownload: false, withTriangulation: false }); * const copy = await bitbybit.occt.io.loadBrepBinary({ brepData: bytes }); * ``` */ saveShapeBrepBinaryAndReturn(inputs: Inputs.OCCT.SaveBrepBinaryDto): Promise; /** * Triangulates a shape, writes it as OBJ, the mesh format most 3D programs read, and starts a * browser download of the file. * * `precision` is the meshing tolerance in model units and `adjustYtoZ` swaps Y and Z, which * mirrors the shape. The file name may hold no spaces or slashes; `tryDownload` false skips the * download, and `saveShapeObjAndReturn` gives the text instead. * @param inputs - The shape, the file name, the meshing precision, the axis adjustment and the download option * @returns Nothing; the download starts when the file is ready * @group io * @shortname save obj * @drawable false * @example * ```typescript * await bitbybit.occt.io.saveShapeObj({ shape: box, fileName: "box.obj", precision: 0.01, adjustYtoZ: false, tryDownload: true }); * ``` */ saveShapeObj(inputs: Inputs.OCCT.SaveObjDto): Promise; /** * Triangulates a shape and writes it as OBJ, the mesh format most 3D programs read, returning * the file's text. * * `precision` is the meshing tolerance in model units, `adjustYtoZ` swaps Y and Z, which * mirrors the shape, and coordinates keep six decimals. `mtl` stays empty, since a shape * carries no colors; `assembly.manager.exportDocumentToObj` writes colored parts. * @param inputs - The shape, the file name, the meshing precision, the axis adjustment and the download option * @returns The OBJ text, with an empty material library text * @group io * @shortname save obj and return * @drawable false * @example * ```typescript * const files = await bitbybit.occt.io.saveShapeObjAndReturn({ shape: box, fileName: "box.obj", precision: 0.01, adjustYtoZ: false, tryDownload: false }); * console.log(files.obj); * ``` */ saveShapeObjAndReturn(inputs: Inputs.OCCT.SaveObjDto): Promise; /** * Triangulates a shape, writes it as ASCII PLY with a normal per vertex, and starts a browser * download of the file. * * `precision` is the meshing tolerance in model units and `adjustYtoZ` swaps Y and Z, which * mirrors the shape. `fileName` names the download and `tryDownload` false skips it; * `saveShapePlyAndReturn` gives the text instead. * @param inputs - The shape, the file name, the meshing precision, the axis adjustment and the download option * @returns Nothing; the download starts when the file is ready * @group io * @shortname save ply * @drawable false * @example * ```typescript * await bitbybit.occt.io.saveShapePly({ shape: box, fileName: "box.ply", precision: 0.01, adjustYtoZ: false, tryDownload: true }); * ``` */ saveShapePly(inputs: Inputs.OCCT.SavePlyDto): Promise; /** * Triangulates a shape and writes it as ASCII PLY with a normal per vertex, a mesh format * scanning tools read, returning the file's text. * * Coordinates keep six significant digits, so past 1000 units they keep two decimals. * `precision` is the meshing tolerance in model units and `adjustYtoZ` swaps Y and Z, which * mirrors the shape. * @param inputs - The shape, the file name, the meshing precision, the axis adjustment and the download option * @returns The PLY file as text * @group io * @shortname save ply and return * @drawable false * @example * ```typescript * const ply = await bitbybit.occt.io.saveShapePlyAndReturn({ shape: box, fileName: "box.ply", precision: 0.01, adjustYtoZ: false, tryDownload: false }); * ``` */ saveShapePlyAndReturn(inputs: Inputs.OCCT.SavePlyDto): Promise; /** * Draws the edges a view of a shape sees as an SVG drawing, with the hidden edges dashed when * asked, and starts a browser download of the file. * * The drawing shows the view from the frame's normal side, x running right along its direction. * `tryDownload` false skips the download; `saveShapeSvgAndReturn` gives the text instead. * @param inputs - The shape, the view, whether to draw hidden edges, the precision and the download options * @returns Nothing; the download starts when the file is ready * @group io * @shortname save svg * @drawable false * @example * ```typescript * const view = { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] }; * await bitbybit.occt.io.saveShapeSvg({ shape: part, frame: view, drawHidden: true, precision: 0.01, fileName: "top.svg", tryDownload: true }); * ``` */ saveShapeSvg(inputs: Inputs.OCCT.SaveSvgDto): Promise; /** * Draws the edges a view of a shape sees as an SVG drawing, with the hidden edges dashed when * asked, and returns the file's text. * * It shows the view from the frame's normal side in model units, x running right along the * frame's direction and y up, so the file holds each point as x and minus y. * @param inputs - The shape, the view, whether to draw hidden edges, the precision and the download options * @returns The SVG file as text * @group io * @shortname save svg and return * @drawable false * @example * ```typescript * const view = { origin: [0, 0, 0], normal: [1, 1, 1], direction: [1, -1, 0] }; * const svg = await bitbybit.occt.io.saveShapeSvgAndReturn({ shape: box, frame: view, drawHidden: true, precision: 0.01, fileName: "box.svg", tryDownload: false }); * ``` */ saveShapeSvgAndReturn(inputs: Inputs.OCCT.SaveSvgDto): Promise; private downloadObj; private downloadFile; /** * Reads an STL file, ASCII or binary, into a shape: one planar face per triangle, or one face * that carries the whole mesh. * * With `asFaces` true the faces share their corners' edges in a compound that * `shapeFix.sewWithReport` can join into a shell. `adjustZtoY` turns Z-up into Y-up, and a file * without triangles is refused. * @param inputs - The STL file, the face option and the axis adjustment * @returns A compound of triangular faces, or one face that carries the mesh * @group io * @shortname load stl * @drawable true * @example * ```typescript * const mesh = await bitbybit.occt.io.loadStl({ stlData: stlText, asFaces: true, adjustZtoY: true }); * const sewn = await bitbybit.occt.shapeFix.sewWithReport({ shapes: [mesh], tolerance: 1e-6 }); * ``` */ loadStl(inputs: Inputs.OCCT.LoadStlDto): Promise; /** * Reads a BREP file, the text format that keeps a shape's exact geometry and topology, back into * the shape `io.saveShapeBrep` wrote. * * The shape keeps its placement and orientation. Text that is not a whole BREP file, such as * one cut short, is refused, and so is a damaged one, with where it is damaged. * @param inputs - The BREP file * @returns The shape the file holds * @group io * @shortname load brep * @drawable true * @example * ```typescript * const brep = await bitbybit.occt.io.saveShapeBrepAndReturn({ shape: box, fileName: "box.brep", tryDownload: false }); * const copy = await bitbybit.occt.io.loadBrep({ brepData: brep }); * ``` */ loadBrep(inputs: Inputs.OCCT.LoadBrepDto): Promise; /** * Reads a binary BREP file, the bytes `io.saveShapeBrepBinary` writes, back into the shape it * holds, with its faces and edges in the same order. * * The bytes are checked first: damaged ones, or ones not in version 4, are refused, saying where. * @param inputs - The binary BREP file * @returns The shape the file holds * @group io * @shortname load brep binary * @drawable true * @example * ```typescript * const bytes = await bitbybit.occt.io.saveShapeBrepBinaryAndReturn({ shape: box, fileName: "box.bbrep", tryDownload: false, withTriangulation: true }); * const copy = await bitbybit.occt.io.loadBrepBinary({ brepData: bytes }); * ``` */ loadBrepBinary(inputs: Inputs.OCCT.LoadBrepBinaryDto): Promise; /** * 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`, `draft` and `features` * change shapes; `select` picks faces and edges by kind and place; `analysis` measures shapes; * `geom` handles curves and surfaces; `io` reads and writes STEP, IGES, STL and other files; * `sketch` draws flat outlines with a pen; `design` and `recipes` build models and solids kept as * data; `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 features: OCCTFeatures; readonly select: OCCTSelect; readonly analysis: OCCTAnalysis; readonly io: OCCTIO; readonly path: OCCTPath; readonly sketch: OCCTSketch; readonly svg: OCCTSVG; readonly design: OCCTDesign; readonly recipes: OCCTRecipes; /** * 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. `isoCurvesU` and `isoCurvesV` add each * face's iso curves as polylines, and `surfaceAnalysis` a value per vertex. 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, with iso curves and analysis values when asked for * @group convert * @shortname shape to mesh * @drawable false * @example * ```typescript * const mesh = await bitbybit.occt.shapeToMesh({ shape: sphere, precision: 0.01, isoCurvesU: 4, isoCurvesV: 4, surfaceAnalysis: Bit.Inputs.OCCT.surfaceAnalysisEnum.gaussian }); * console.log(mesh.isoCurveList?.length, mesh.faceList[0]?.analysisValues); * ``` */ shapeToMesh(inputs: Inputs.OCCT.ShapeToMeshDto): Promise; /** * Meshes a shape into one indexed triangle mesh whose faces share vertices where they meet, the * form `manifold.shapes.manifoldFromMesh` takes, so an OCCT solid can carry on as a Manifold * solid. * * Vertices are shared through the shape's own edges, not by matching coordinates, so a closed * solid gives a closed mesh. `precision` is the meshing tolerance. * @param inputs - The shape and the meshing precision * @returns The mesh: three numbers per vertex and three vertex indexes per triangle * @group convert * @shortname shape to manifold mesh * @drawable false * @example * ```typescript * const mesh = await bitbybit.occt.shapeToManifoldMesh({ shape: solid, precision: 0.01 }); * const manifold = await bitbybit.manifold.manifold.shapes.manifoldFromMesh({ mesh }); * ``` */ shapeToManifoldMesh(inputs: Inputs.OCCT.ShapeToManifoldMeshDto): Promise; /** * Triangulates several shapes with the same settings, as `shapeToMesh` does for one, iso curves * and surface analysis included. * @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, isoCurvesU: 2, isoCurvesV: 2 }); * ``` */ 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, sectioning and splitting, and hidden-line * drawings, plus bounding boxes, bounding spheres and closest-point queries, which move to * `analysis.measure` in the next major version. Distances are in model units and angles in degrees; * every operation returns a new shape. Booleans live in `booleans`, rounding in `fillets` and local * features such as holes in `features`. */ 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; /** * Lofts as `loft` does, and reports one history per section: `facesFromEdges` holds the skin * along each section edge, the first section's `firstFaces` and the last's `lastFaces` the caps * of a solid. * @param inputs - The section wires or edges and whether to make a solid * @returns The lofted shell or solid and one history per section * @group lofts * @shortname loft with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.operations.loftWithHistory({ shapes: [bottom, upper], makeSolid: true }); * const bottomCap = histories[0].firstFaces; * ``` */ loftWithHistory(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; /** * Lofts as `loftAdvanced` does, and reports what each section in `shapes` became, as * `loftWithHistory` does: the sides along each section edge, and the caps at the start and end * of a solid. * * A `periodic` loft runs through curves resampled from the sections rather than the sections * themselves, so it has no history to report and is refused. * @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 and one history per section in `shapes` * @group lofts * @shortname loft adv. with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.operations.loftAdvancedWithHistory({ * 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, * }); * const side = histories[0].facesFromEdges[0]; * ``` */ loftAdvancedWithHistory(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. `analysis.measure.extrema` gives every closest pair, * with the sub-shapes the points lie on. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The two shapes * @returns The point on the first shape and the point on the second * @deprecated Moves to `analysis.measure.closestPointsBetweenTwoShapes` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape and the points * @returns One point on the shape per input point, in the same order * @deprecated Moves to `analysis.measure.closestPointsOnShapeFromPoints` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shapes and the points * @returns The closest points, grouped shape by shape * @deprecated Moves to `analysis.measure.closestPointsOnShapesFromPoints` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape and the points * @returns One distance per point, in the same order * @deprecated Moves to `analysis.measure.distancesToShapeFromPoints` in the next major version; it works here until then. * @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. `analysis.measure.tightBoundingBox` * follows the exact geometry. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The box as `min`, `max`, `center` and `size` * @deprecated Moves to `analysis.measure.boundingBoxOfShape` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The minimum corner * @deprecated Moves to `analysis.measure.boundingBoxMinOfShape` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The maximum corner * @deprecated Moves to `analysis.measure.boundingBoxMaxOfShape` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The center of the box * @deprecated Moves to `analysis.measure.boundingBoxCenterOfShape` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The width, height and length of the box * @deprecated Moves to `analysis.measure.boundingBoxSizeOfShape` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The box solid * @deprecated Moves to `analysis.measure.boundingBoxShapeOfShape` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The sphere as `center` and `radius` * @deprecated Moves to `analysis.measure.boundingSphereOfShape` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The center of the sphere * @deprecated Moves to `analysis.measure.boundingSphereCenterOfShape` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The radius * @deprecated Moves to `analysis.measure.boundingSphereRadiusOfShape` in the next major version; it works here until then. * @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. * * It moves to `analysis.measure` in the next major version, with the same inputs and result. * @param inputs - The shape * @returns The sphere solid * @deprecated Moves to `analysis.measure.boundingSphereShapeOfShape` in the next major version; it works here until then. * @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. A solid, or a vector of length 0, is refused. * @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; /** * Extrudes a shape as `extrude` does, and reports what each part of the profile became: * `history.firstFaces` and `lastFaces` are the caps of a face profile (a wire has none), * `history.facesFromEdges` the side swept from each profile edge and * `history.edgesFromVertices` the edge swept from each vertex. * @param inputs - The profile and the direction and length of the extrusion * @returns The extruded shape and its history * @group extrusions * @shortname extrude with history * @drawable false * @example * ```typescript * const { shape, history } = await bitbybit.occt.operations.extrudeWithHistory({ shape: squareFace, direction: [0, 0, 5] }); * const top = history.lastFaces; * ``` */ extrudeWithHistory(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 and may be negative to spin the other way; 360 or more either way makes * a full turn, and 0 throws. The profile must not cross the axis along `direction`. * @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; /** * Revolves a shape as `revolve` does, and reports what each part of the profile became: * `history.firstFaces` and `lastFaces` are the ends of a partial turn, `history.facesFromEdges` * the surface swept from each profile edge, a whole turn included. * @param inputs - The profile, the angle in degrees, the axis direction and the copy flag * @returns The revolved shape and its history * @group revolutions * @shortname revolve with history * @drawable false * @example * ```typescript * const { shape, history } = await bitbybit.occt.operations.revolveWithHistory({ shape: profile, angle: 90, direction: [0, 0, 1], copy: false }); * ``` */ revolveWithHistory(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 profiles along a path as `pipe` does, and reports what each profile became, one * history per profile in the order given: `facesFromEdges` holds the side each profile edge * swept, `firstFaces` and `lastFaces` the caps at the two ends of the path. * @param inputs - The path wire and the profiles to sweep along it * @returns The swept solid and one history per profile * @group pipeing * @shortname pipe with history * @drawable false * @example * ```typescript * const { shape, histories } = await bitbybit.occt.operations.pipeWithHistory({ shape: pathWire, shapes: [profileAtStart] }); * const endCap = histories[0].lastFaces; * ``` */ pipeWithHistory(inputs: Inputs.OCCT.ShapeShapesDto): Promise>; /** * Sweeps a regular polygon along a wire, giving a bar with `nrCorners` flat sides. * * The polygon of `radius` starts perpendicular to the wire. `makeSolid` gives a solid instead of * a shell, `trihedronEnum` sets how the profile turns, and `forceApproxC1` smooths the result. * An invalid bar is refused; on a nearly straight path, use the discrete trihedron. * @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 starts perpendicular to the wire. `makeSolid` gives a solid instead of a shell, * `trihedronEnum` sets how the profile turns, and `forceApproxC1` smooths the result. An invalid * tube is refused; on a nearly straight path, use the discrete trihedron. * @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; /** * Sweeps a profile along a flat spine, keeping its place beside it, as a moulding follows a wall. * * Draw the profile about the origin: x along the spine, y to the left of travel, inside a * counter-clockwise loop, and z up from the spine's plane. A spine out of plane is refused. * @param inputs - The flat spine, the profile and whether to make a solid * @returns The swept shell or solid * @group pipeing * @shortname sweep evolved * @drawable true * @example * ```typescript * const spine = await bitbybit.occt.shapes.wire.createSquareWire({ size: 10, center: [0, 0, 0], direction: [0, 1, 0] }); * const profile = await bitbybit.occt.shapes.wire.createPolygonWire({ points: [[0, 0, 0], [0, 1, 0], [0, 1, 3], [0, 0, 3]] }); * const wall = await bitbybit.occt.operations.sweepEvolved({ spine, profile, makeSolid: true }); * ``` */ sweepEvolved(inputs: Inputs.OCCT.SweepEvolvedDto): Promise; /** * Sweeps a profile along a spine while scaling it, such as a tube that widens toward one end. * * `params` are places along the spine from 0 to 1, each scaled by the entry of `scales` at the * same position; between them the scale changes smoothly. Place the profile across the start of * the spine; `makeSolid` needs it closed. * @param inputs - The spine, the profile, the places and their scales, and whether to make a solid * @returns The swept solid or shell * @group pipeing * @shortname pipe with scaling * @drawable true * @example * ```typescript * const spine = await bitbybit.occt.shapes.edge.line({ start: [0, 0, 0], end: [0, 10, 0] }); * const profile = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 1, center: [0, 0, 0], direction: [0, 1, 0] }); * const horn = await bitbybit.occt.operations.pipeWithScaling({ spine, profile, params: [0, 1], scales: [1, 2], makeSolid: true }); * ``` */ pipeWithScaling(inputs: Inputs.OCCT.PipeWithScalingDto): 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 along the surface normal, a negative one against it. Faces are * offset one by one, so walls meeting at a sharp edge leave a gap of up to 1.4 times `offset`, * bridged by tolerance. * @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; /** * Thickens a shape as `makeThickSolidSimple` does, and reports what became of its faces and * edges: each face stays where it was (`faces`) and gains its offset copy (`facesFromFaces`), * and each free edge raises the wall between the two (`facesFromEdges`). * @param inputs - The shape to thicken and the thickness * @returns The thickened solid and its history * @group offsets * @shortname thicken with history * @drawable false * @example * ```typescript * const { shape, history } = await bitbybit.occt.operations.makeThickSolidSimpleWithHistory({ shape: plateFace, offset: 2 }); * const top = history.facesFromFaces[0]; * ``` */ makeThickSolidSimpleWithHistory(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; /** * Hollows a solid as `makeThickSolidByJoin` does, and reports what became of its faces: each * kept face stays (`faces`) and gains the inner wall offset from it (`facesFromFaces`), and each * removed face becomes the rim left where it was. * @param inputs - The solid, the faces to remove, the wall thickness, the tolerance and the join options * @returns The hollowed solid and its history * @group offsets * @shortname joined thicken with history * @drawable false * @example * ```typescript * const { shape, history } = await bitbybit.occt.operations.makeThickSolidByJoinWithHistory({ * shape: box, * shapes: [top], * offset: -1, * tolerance: 1e-3, * intersection: false, * selfIntersection: false, * joinType: Bit.Inputs.OCCT.joinTypeEnum.arc, * removeIntEdges: false, * }); * const innerWalls = history.facesFromFaces.flat(); * ``` */ makeThickSolidByJoinWithHistory(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, all in one compound. The * shape must contain solids, and a step giving more than 100000 slices is refused. * @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 repeats from the bottom of the shape up to its top. Steps must add up to more than * 0 and give at most 100000 slices. * @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; /** * Finds the curves where two shapes meet and joins them end to end into wires, such as the * outline a plane cuts from a solid. * * A loop comes back as a closed wire, branches or loose ends as open wires, and shapes that do * not meet give an empty list. * @param inputs - The two shapes and the joining tolerance * @returns The wires where the shapes meet * @group divisions * @shortname section wires * @drawable true * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10, center: [0, 5, 0] }); * const plane = await bitbybit.occt.shapes.face.createSquareFace({ size: 20, center: [0, 3, 0], direction: [0, 1, 0] }); * const outline = await bitbybit.occt.operations.sectionWires({ shapeA: box, shapeB: plane, tolerance: 1e-7 }); * ``` */ sectionWires(inputs: Inputs.OCCT.SectionWiresDto): Promise; /** * Slices a shape with the plane of each frame, which passes through the frame's origin square to * its normal. * * With `makeFaces` true a slice holds the faces where the plane passes through the solids, holes * included; with false, the section wires. A plane that misses the shape gives an empty compound. * @param inputs - The shape, the frames, whether to make faces and the joining tolerance * @returns One compound per frame, in the order of the frames * @group divisions * @shortname slice by frames * @drawable true * @example * ```typescript * const slices = await bitbybit.occt.operations.sliceByFrames({ * shape: vase, * frames: [ * { origin: [0, 2, 0], normal: [0, 1, 0], direction: [1, 0, 0] }, * { origin: [0, 4, 0], normal: [0, 1, 0], direction: [1, 0, 0] }, * ], * makeFaces: true, * tolerance: 1e-7, * }); * ``` */ sliceByFrames(inputs: Inputs.OCCT.SliceByFramesDto): Promise; /** * Splits a shape in two with the plane of a frame: what lies on the side the frame's normal * points to comes back as `front`, the rest as `back`. * * The pieces are solids when the shape has any, else faces, else edges. A shape the plane misses * comes back whole on its side. * @param inputs - The shape and the frame whose plane splits it * @returns The pieces in front of the plane and behind it, each in a compound * @group divisions * @shortname split by frame * @drawable false * @example * ```typescript * const { front, back } = await bitbybit.occt.operations.splitByFrame({ * shape: box, * frame: { origin: [2, 0, 0], normal: [1, 0, 0], direction: [0, 1, 0] }, * }); * ``` */ splitByFrame(inputs: Inputs.OCCT.SplitByFrameDto): Promise>; /** * Cuts a face into pieces along edges or wires lying on it, like scoring a sheet. * * A cutter cuts only where it lies on the face, and a closed loop inside it cuts out the region it * encloses. With no cutters the face comes back whole. * @param inputs - The face and the edges or wires to cut it along * @returns The pieces of the face * @group divisions * @shortname split face by wires * @drawable true * @example * ```typescript * const square = await bitbybit.occt.shapes.face.createSquareFace({ size: 10, center: [0, 0, 0], direction: [0, 1, 0] }); * const line = await bitbybit.occt.shapes.edge.line({ start: [0, 0, -6], end: [0, 0, 6] }); * const halves = await bitbybit.occt.operations.splitFaceByWires({ shape: square, wires: [line] }); * ``` */ splitFaceByWires(inputs: Inputs.OCCT.SplitFaceByWiresDto): Promise; /** * Offsets a wire that does not lie in one plane: every point moves by `offset` at right angles to * both the wire and `direction`, keeping its height along `direction`. * * Best on smooth wires; round sharp corners first with `fillets.fillet3DWire`, since at one the * offset edges do not meet and come back as a list of edges. * @param inputs - The wire, the offset distance and the direction to offset across * @returns The offset wire, or its edges in order when they do not meet * @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; /** * Draws a shape seen from a view frame as a technical drawing does, flat on the XZ plane: the * edges the eye sees and those that faces hide. * * The eye looks back along the frame's normal. Its origin lands on the world origin, its direction * on x and the normal crossed with the direction on z. Both compounds hold edges. * @param inputs - The shape, the view frame and the drawing options * @returns The visible and the hidden edges, each a compound on the XZ plane * @group views * @shortname hidden lines * @drawable false * @example * ```typescript * const { visible, hidden } = await bitbybit.occt.operations.hiddenLines({ * shape: part, * frame: { origin: [0, 0, 0], normal: [1, 1, 1], direction: [1, 0, -1] }, * exact: true, * smoothEdges: false, * hiddenEdges: true, * focus: 0, * precision: 0.01, * }); * ``` */ hiddenLines(inputs: Inputs.OCCT.HiddenLinesDto): 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; } /** * Building recipes exactly: solids described as data - polygons, circles, extrusions, turns, * lofts, cuts by solids and planes, openings, unions, intersections, transforms and triangle meshes - * by a package that does not build geometry itself, such as one that reads building models. Every * step becomes an OpenCascade shape, so circles stay circles and the results measure, cut and export * to STEP like any other shape. A whole recipe is built in one kernel call, its steps in parallel on * the multithreaded kernel. * * Experimental: the recipe format may still change before it is declared stable. * @beta */ declare class OCCTRecipes { private readonly occWorkerManager; /** * Builds each root of a recipe as a shape placed by its matrix, in root order. * * Shared steps are built once. A mesh keeps its triangles unless `facetedMeshes` is set or a * boolean needs it. A root that failed, or whose opening failed, throws naming the step; with * `emptyWhenFailed` it comes back empty, or cut by the openings built. * @param inputs - The recipe, whether Z turns into Y, whether failed roots come back empty, and the largest mesh built * @returns One shape per root, in root order * @group build * @shortname build recipe * @drawable true * @example * ```typescript * const recipe = await bitbybit.ifc.geometry.recipe({ model }); * const shapes = await bitbybit.occt.recipes.build({ recipe, adjustZtoY: true, emptyWhenFailed: true }); * ``` */ build(inputs: Inputs.OCCT.BuildRecipeDto): Promise; /** * Builds the roots of a recipe into an assembly document, ready to export to STEP. * * Roots sharing the `groupBy` tag form one product named by its `name` tag, with its tags as * properties and its parts coloured by `rgba`. A step only moved and turned is one part placed * by each root. Failures are handled as in `build`. * @param inputs - The recipe, the top assembly's name, the grouping tag, whether failed roots are left out, and the largest mesh built * @returns The document handle * @group build * @shortname build recipe document * @drawable false * @example * ```typescript * const recipe = await bitbybit.ifc.geometry.recipe({ model }); * const document = await bitbybit.occt.recipes.buildDocument({ recipe, name: "House" }); * const step = await bitbybit.occt.assembly.manager.exportDocumentToStep({ document, fileName: "house.step", tryDownload: false }); * ``` */ buildDocument(inputs: Inputs.OCCT.BuildRecipeDocumentDto): Promise; } /** * Choosing the edges of an OpenCascade shape by what they are, where they lie and how they meet, * so that "the edges round the top" still names the right edges after a parameter changes. Every * method returns edge indexes as `shapes.edge.getEdges` counts them, from 0, which `fillets`, the * getters and the other selectors take as they are. `indexes` limits a filter to edges chosen * before, keeping their order; left out, every edge is a candidate, and an empty list chooses * nothing. Degenerate edges, the poles of a sphere, are never chosen. */ declare class OCCTSelectEdges { private readonly occWorkerManager; /** * Chooses the edges that run along one kind of curve, such as the straight edges of a part or * the circular rims of its holes. * @param inputs - The shape, the curve type and the edges to choose among * @returns The indexes of the chosen edges * @group by geometry * @shortname edges of type * @drawable false * @example * ```typescript * const rims = await bitbybit.occt.select.edges.ofType({ shape: part, type: Bit.Inputs.OCCT.curveTypeEnum.circle }); * ``` */ ofType(inputs: Inputs.OCCT.SelectEdgesOfTypeDto): Promise; /** * Chooses the straight edges that run within `angle` degrees of `direction`, either way along * it: an angle of 0 finds the edges parallel to it. * @param inputs - The shape, the direction, the angle in degrees and the edges to choose among * @returns The indexes of the chosen edges * @group by geometry * @shortname edges along * @drawable false * @example * ```typescript * const upright = await bitbybit.occt.select.edges.along({ shape: part, direction: [0, 0, 1], angle: 0 }); * ``` */ along(inputs: Inputs.OCCT.SelectByDirectionDto): Promise; /** * Chooses the edges whose centres lie furthest along `direction`, with any others within * `tolerance` of them: the edges round the top along z. * @param inputs - The shape, the direction, the tolerance and the edges to choose among * @returns The indexes of the chosen edges * @group by position * @shortname extreme edges * @drawable false * @example * ```typescript * const topEdges = await bitbybit.occt.select.edges.extreme({ shape: part, direction: [0, 0, 1], tolerance: 1e-7 }); * ``` */ extreme(inputs: Inputs.OCCT.SelectExtremeDto): Promise; /** * Chooses the edges whose centres lie inside a box lined up with the axes, given by two opposite * corners in either order. * @param inputs - The shape, the two corners and the edges to choose among * @returns The indexes of the chosen edges * @group by position * @shortname edges in box * @drawable false * @example * ```typescript * const near = await bitbybit.occt.select.edges.inBox({ shape: part, corner: [0, 0, 9], oppositeCorner: [10, 10, 11] }); * ``` */ inBox(inputs: Inputs.OCCT.SelectInBoxDto): Promise; /** * Chooses the edges whose centres lie within `radius` of `center`. * @param inputs - The shape, the center, the radius and the edges to choose among * @returns The indexes of the chosen edges * @group by position * @shortname edges in sphere * @drawable false * @example * ```typescript * const around = await bitbybit.occt.select.edges.inSphere({ shape: part, center: [5, 5, 10], radius: 6 }); * ``` */ inSphere(inputs: Inputs.OCCT.SelectInSphereDto): Promise; /** * Chooses the `count` edges whose centres lie nearest `point`, nearest first; edges as near as * each other keep their order. * @param inputs - The shape, the point, how many and the edges to choose among * @returns The indexes of the chosen edges, nearest first * @group by position * @shortname nearest edges * @drawable false * @example * ```typescript * const [picked] = await bitbybit.occt.select.edges.nearest({ shape: part, point: [5, 0, 10], count: 1 }); * ``` */ nearest(inputs: Inputs.OCCT.SelectNearestDto): Promise; /** * Chooses the edges that lie in a plane, given by a point on it and its normal: every point of an * edge within `tolerance` of the plane. * @param inputs - The shape, the plane, the tolerance and the edges to choose among * @returns The indexes of the chosen edges * @group by position * @shortname edges on plane * @drawable false * @example * ```typescript * const outline = await bitbybit.occt.select.edges.onPlane({ shape: part, origin: [0, 0, 0], normal: [0, 0, 1] }); * ``` */ onPlane(inputs: Inputs.OCCT.SelectOnPlaneDto): Promise; /** * Chooses the edges whose length lies between `min` and `max`, both included. * @param inputs - The shape, the range of lengths and the edges to choose among * @returns The indexes of the chosen edges * @group by geometry * @shortname edges by length * @drawable false * @example * ```typescript * const short = await bitbybit.occt.select.edges.byLength({ shape: part, min: 0, max: 2 }); * ``` */ byLength(inputs: Inputs.OCCT.SelectInRangeDto): Promise; /** * Chooses the circular edges whose radius lies between `min` and `max`, both included. * @param inputs - The shape, the range of radii and the edges to choose among * @returns The indexes of the chosen edges * @group by geometry * @shortname edges by radius * @drawable false * @example * ```typescript * const rims = await bitbybit.occt.select.edges.byRadius({ shape: part, min: 1.9, max: 2.1 }); * ``` */ byRadius(inputs: Inputs.OCCT.SelectInRangeDto): Promise; /** * Chooses the edges that bound any of the given faces, counted as `shapes.face.getFaces` counts * them. * @param inputs - The shape and the faces to start from * @returns The indexes of the edges, in order * @group by relation * @shortname edges of faces * @drawable false * @example * ```typescript * const rim = await bitbybit.occt.select.edges.ofFaces({ shape: part, indexes: [5] }); * ``` */ ofFaces(inputs: Inputs.OCCT.SelectFromIndexesDto): Promise; /** * Chooses the edges where a face of `indexes` meets a different face of `otherIndexes`, such as * the edges round a top face where it meets the sides. * @param inputs - The shape and the two sets of faces * @returns The indexes of the edges, in order * @group by relation * @shortname edges between faces * @drawable false * @example * ```typescript * const seam = await bitbybit.occt.select.edges.between({ shape: part, indexes: [5], otherIndexes: [0, 1, 2, 3] }); * ``` */ between(inputs: Inputs.OCCT.SelectBetweenDto): Promise; /** * Grows the given edges into the chains they continue smoothly: two edges meeting where their * tangents turn by no more than `angle` degrees are one chain, as a fillet runs along. * @param inputs - The shape, the edges to start from and the angle in degrees * @returns The indexes of the edges in the chains, in order * @group by relation * @shortname tangent chain * @drawable false * @example * ```typescript * const loop = await bitbybit.occt.select.edges.tangentChain({ shape: rounded, indexes: [3], angle: 1 }); * ``` */ tangentChain(inputs: Inputs.OCCT.SelectTangentChainDto): Promise; /** * Chooses the edges where two faces meet at an outside corner, the ridges a fillet rounds off; * faces meeting within `tangentAngle` degrees of smooth count as neither. * @param inputs - The shape, the angle in degrees and the edges to choose among * @returns The indexes of the chosen edges * @group by geometry * @shortname convex edges * @drawable false * @example * ```typescript * const ridges = await bitbybit.occt.select.edges.convex({ shape: part, tangentAngle: 1 }); * ``` */ convex(inputs: Inputs.OCCT.SelectConvexityDto): Promise; /** * Chooses the edges where two faces meet at an inside corner, the valleys a fillet fills; faces * meeting within `tangentAngle` degrees of smooth count as neither. * @param inputs - The shape, the angle in degrees and the edges to choose among * @returns The indexes of the chosen edges * @group by geometry * @shortname concave edges * @drawable false * @example * ```typescript * const valleys = await bitbybit.occt.select.edges.concave({ shape: part, tangentAngle: 1 }); * ``` */ concave(inputs: Inputs.OCCT.SelectConvexityDto): Promise; /** * Orders edges by how far along `direction` their centres lie, from the lowest to the highest; * edges level with each other keep their order. * @param inputs - The shape, the direction and the edges to sort * @returns The indexes of the edges, sorted * @group order * @shortname sort edges along * @drawable false * @example * ```typescript * const leftToRight = await bitbybit.occt.select.edges.sortAlong({ shape: part, direction: [1, 0, 0] }); * ``` */ sortAlong(inputs: Inputs.OCCT.SelectSortAlongDto): Promise; /** * Sorts edges along `direction` and groups them by level: a group ends where the next centre lies * more than `tolerance` beyond the group's first. * @param inputs - The shape, the direction, the tolerance and the edges to group * @returns One list of edge indexes per level, from the lowest * @group order * @shortname group edges along * @drawable false * @example * ```typescript * const levels = await bitbybit.occt.select.edges.groupAlong({ shape: part, direction: [0, 0, 1], tolerance: 0.01 }); * ``` */ groupAlong(inputs: Inputs.OCCT.SelectGroupAlongDto): Promise; } /** * Choosing the faces of an OpenCascade shape by what they are and where they lie, so that "the top * face" still names the right face after a parameter changes. Every method returns face indexes as * `shapes.face.getFaces` counts them, from 0, which the getters and the other selectors take as they * are. `indexes` limits a filter to faces chosen before, keeping their order; left out, every face is * a candidate, and an empty list chooses nothing. Positions are read at each face's centre of mass. */ declare class OCCTSelectFaces { private readonly occWorkerManager; /** * Chooses the faces that lie on one kind of surface, such as the planar faces of a part or the * cylindrical walls of its holes. * @param inputs - The shape, the surface type and the faces to choose among * @returns The indexes of the chosen faces * @group by geometry * @shortname faces of type * @drawable false * @example * ```typescript * const walls = await bitbybit.occt.select.faces.ofType({ shape: part, type: Bit.Inputs.OCCT.surfaceTypeEnum.cylinder }); * ``` */ ofType(inputs: Inputs.OCCT.SelectFacesOfTypeDto): Promise; /** * Chooses the faces whose normal, read at the middle of each face, points within `angle` * degrees of `direction`: an angle of 0 finds the faces looking straight that way. * @param inputs - The shape, the direction, the angle in degrees and the faces to choose among * @returns The indexes of the chosen faces * @group by geometry * @shortname faces facing * @drawable false * @example * ```typescript * const up = await bitbybit.occt.select.faces.facing({ shape: part, direction: [0, 0, 1], angle: 0 }); * ``` */ facing(inputs: Inputs.OCCT.SelectByDirectionDto): Promise; /** * Chooses the faces whose centres lie furthest along `direction`, with any others within * `tolerance` of them: the top faces along z, the lowest along minus z. * @param inputs - The shape, the direction, the tolerance and the faces to choose among * @returns The indexes of the chosen faces * @group by position * @shortname extreme faces * @drawable false * @example * ```typescript * const top = await bitbybit.occt.select.faces.extreme({ shape: part, direction: [0, 0, 1], tolerance: 1e-7 }); * ``` */ extreme(inputs: Inputs.OCCT.SelectExtremeDto): Promise; /** * Chooses the faces whose centres lie inside a box lined up with the axes, given by two * opposite corners in either order. * @param inputs - The shape, the two corners and the faces to choose among * @returns The indexes of the chosen faces * @group by position * @shortname faces in box * @drawable false * @example * ```typescript * const near = await bitbybit.occt.select.faces.inBox({ shape: part, corner: [0, 0, 9], oppositeCorner: [10, 10, 11] }); * ``` */ inBox(inputs: Inputs.OCCT.SelectInBoxDto): Promise; /** * Chooses the faces whose centres lie within `radius` of `center`. * @param inputs - The shape, the center, the radius and the faces to choose among * @returns The indexes of the chosen faces * @group by position * @shortname faces in sphere * @drawable false * @example * ```typescript * const around = await bitbybit.occt.select.faces.inSphere({ shape: part, center: [5, 5, 10], radius: 2 }); * ``` */ inSphere(inputs: Inputs.OCCT.SelectInSphereDto): Promise; /** * Chooses the `count` faces whose centres lie nearest `point`, nearest first; faces as near as * each other keep their order. * @param inputs - The shape, the point, how many and the faces to choose among * @returns The indexes of the chosen faces, nearest first * @group by position * @shortname nearest faces * @drawable false * @example * ```typescript * const [picked] = await bitbybit.occt.select.faces.nearest({ shape: part, point: [5, 5, 12], count: 1 }); * ``` */ nearest(inputs: Inputs.OCCT.SelectNearestDto): Promise; /** * Chooses the planar faces that lie in a plane, given by a point on it and its normal; a face * counts from either side, within `tolerance`. * @param inputs - The shape, the plane, the tolerance and the faces to choose among * @returns The indexes of the chosen faces * @group by position * @shortname faces on plane * @drawable false * @example * ```typescript * const bottom = await bitbybit.occt.select.faces.onPlane({ shape: part, origin: [0, 0, 0], normal: [0, 0, 1] }); * ``` */ onPlane(inputs: Inputs.OCCT.SelectOnPlaneDto): Promise; /** * Chooses the faces whose area lies between `min` and `max`, both included. * @param inputs - The shape, the range of areas and the faces to choose among * @returns The indexes of the chosen faces * @group by geometry * @shortname faces by size * @drawable false * @example * ```typescript * const small = await bitbybit.occt.select.faces.bySize({ shape: part, min: 0, max: 10 }); * ``` */ bySize(inputs: Inputs.OCCT.SelectInRangeDto): Promise; /** * Chooses the faces on cylinders and spheres whose radius lies between `min` and `max`, and the * faces on tori whose tube radius does, the rounds a fillet makes along a curved edge. * @param inputs - The shape, the range of radii and the faces to choose among * @returns The indexes of the chosen faces * @group by geometry * @shortname faces by radius * @drawable false * @example * ```typescript * const holes = await bitbybit.occt.select.faces.byRadius({ shape: part, min: 1.9, max: 2.1 }); * ``` */ byRadius(inputs: Inputs.OCCT.SelectInRangeDto): Promise; /** * Chooses the faces that share an edge with any of the given faces, leaving out the given faces * themselves. * @param inputs - The shape and the faces to start from * @returns The indexes of the neighbouring faces, in order * @group by relation * @shortname adjacent faces * @drawable false * @example * ```typescript * const sides = await bitbybit.occt.select.faces.adjacentTo({ shape: part, indexes: [5] }); * ``` */ adjacentTo(inputs: Inputs.OCCT.SelectFromIndexesDto): Promise; /** * Chooses the faces bounded by any of the given edges, counted as `shapes.edge.getEdges` counts * them: the two faces that meet along each. * @param inputs - The shape and the edges to start from * @returns The indexes of the faces, in order * @group by relation * @shortname faces of edges * @drawable false * @example * ```typescript * const beside = await bitbybit.occt.select.faces.ofEdges({ shape: part, indexes: [0] }); * ``` */ ofEdges(inputs: Inputs.OCCT.SelectFromIndexesDto): Promise; /** * Orders faces by how far along `direction` their centres lie, from the lowest to the highest; * faces level with each other keep their order. * @param inputs - The shape, the direction and the faces to sort * @returns The indexes of the faces, sorted * @group order * @shortname sort faces along * @drawable false * @example * ```typescript * const bottomToTop = await bitbybit.occt.select.faces.sortAlong({ shape: part, direction: [0, 0, 1] }); * ``` */ sortAlong(inputs: Inputs.OCCT.SelectSortAlongDto): Promise; /** * Sorts faces along `direction` and groups them by level: a group ends where the next centre lies * more than `tolerance` beyond the group's first. * @param inputs - The shape, the direction, the tolerance and the faces to group * @returns One list of face indexes per level, from the lowest * @group order * @shortname group faces along * @drawable false * @example * ```typescript * const levels = await bitbybit.occt.select.faces.groupAlong({ shape: part, direction: [0, 0, 1], tolerance: 0.01 }); * ``` */ groupAlong(inputs: Inputs.OCCT.SelectGroupAlongDto): Promise; } /** * Choosing faces and edges of OpenCascade shapes by what they are, where they lie and how they * meet, rather than by an index that shifts whenever the model changes. `faces` and `edges` return * index lists in the getters' numbering, which fillets, chamfers and the getters take as they are, * and which the selectors narrow further through their `indexes` input. A choice of nothing stays * empty through the selectors, but `fillets.filletEdges` and `fillets.chamferEdges` read an empty * `indexes` as every edge, and hand out `radiusList` and `distanceList` in the getters' order. */ declare class OCCTSelect { readonly faces: OCCTSelectFaces; readonly edges: OCCTSelectEdges; } /** * Checks and repairs for OpenCascade shapes that came out of a file or an operation with defects: * gaps between edges, edges too short to matter, faces turned the wrong way, shells left open, * tolerances that drifted. `isValid` tells whether a shape is well formed, `validityReport` says what * is wrong and where, and `freeBoundaries` shows the rims of openings; `basicShapeRepair` is the * general fix, the shell, solid and sewing fixes and the wire fixes handle the rest. Every repair * 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 `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; /** * Tells whether the shape is well formed, which a successful operation does not always guarantee. * * It checks that edges lie on their faces, wires and shells close, and tolerances agree. A fillet * too large for its faces fails; a shape passing through itself, such as a pipe wider than its * bends, passes. Large parts take a few hundred milliseconds. * @param inputs - The shape * @returns True when the shape is well formed * @group shape * @shortname is valid * @drawable false * @example * ```typescript * const box = await bitbybit.occt.shapes.solid.createBox({ width: 10, length: 10, height: 10 }); * const rounded = await bitbybit.occt.fillets.filletEdges({ shape: box, radius: 6 }); * const wellFormed = await bitbybit.occt.shapeFix.isValid({ shape: rounded }); * ``` */ isValid(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Checks a shape as `isValid` does and reports each faulty sub-shape with the checks * it fails, and the spread of its tolerances. * * A fault's index is the one the getter of its kind uses: `shapes.face.getFace` with a face * fault's index gives that face. Overlapping faces are not looked for; * `analysis.clashes.selfIntersections` finds those. * @param inputs - The shape to check * @returns Whether the shape is valid, its faults and its smallest, largest and average tolerance * @group shape * @shortname validity report * @drawable false * @example * ```typescript * const report = await bitbybit.occt.shapeFix.validityReport({ shape: imported }); * const badFaces = report.faults.filter(fault => fault.type === Bit.Inputs.OCCT.shapeTypeEnum.face).map(fault => fault.index); * ``` */ validityReport(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Finds the edges of a shape that bound only one face, joined into wires: the rims of an open * shell's openings, or a lone face's outline and holes. * * Wires that close on themselves come back in `closed`, the rest in `open`; a closed solid has * none. Edges closer than `tolerance`, in model units, count as one. * @param inputs - The shape and the tolerance * @returns Two compounds of wires, the closed and the open ones * @group shape * @shortname free boundaries * @drawable false * @example * ```typescript * const rims = await bitbybit.occt.shapeFix.freeBoundaries({ shape: openShell, tolerance: 1e-7 }); * const holes = await bitbybit.occt.shapes.wire.getWires({ shape: rims.closed }); * ``` */ freeBoundaries(inputs: Inputs.OCCT.ShapeWithToleranceDto): Promise>; /** * Repairs a shell: turns its faces so they all face the same way and fixes its faces and edges. * * When the faces cannot all be turned one way, as on a strip given a half twist, the result is * a compound of shells. A shape that is not a shell is refused. * @param inputs - The shell to repair * @returns The repaired shell, or a compound of shells * @group shell * @shortname fix shell * @drawable true * @example * ```typescript * const shell = await bitbybit.occt.shapes.shell.sewFaces({ shapes: faces, tolerance: 1e-7 }); * const fixed = await bitbybit.occt.shapeFix.fixShell({ shape: shell }); * ``` */ fixShell(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Repairs a solid, or makes one from a closed shell, with its shells fixed and turned so the * material is inside. * * A shell that encloses nothing comes back fixed but still a shell, and shells that fix into * separate solids come back as a compound of them. Other kinds of shape are refused. * @param inputs - The solid or shell to repair * @returns The repaired solid, or a shell or a compound when no single solid can be made * @group solid * @shortname fix solid * @drawable true * @example * ```typescript * const shell = await bitbybit.occt.shapes.shell.sewFaces({ shapes: faces, tolerance: 1e-7 }); * const solid = await bitbybit.occt.shapeFix.fixSolid({ shape: shell }); * ``` */ fixSolid(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Turns a closed solid so its material is inside, which gives an inside-out solid its positive * volume back; only the orientation changes. * * A shape that is not a solid, a solid without a shell and a solid whose shell has an opening * are refused. * @param inputs - The closed solid * @returns The solid, oriented with its material inside * @group solid * @shortname orient closed solid * @drawable true * @example * ```typescript * const oriented = await bitbybit.occt.shapeFix.orientClosedSolid({ shape: insideOut }); * const volume = await bitbybit.occt.shapes.solid.getSolidVolume({ shape: oriented }); * ``` */ orientClosedSolid(inputs: Inputs.OCCT.ShapeDto): Promise; /** * Sews the faces of shapes together along edges that lie within `tolerance` of each other, as * `shapes.shell.sewFaces` does, and reports what it joined and what it left open. * * `freeEdges` holds the edges left bounding only one face; with `nonManifold` true an edge may * join more than two faces. The shapes given are left as they were. * @param inputs - The shapes, the tolerance and whether an edge may join more than two faces * @returns The sewn shape, the free edges and the counts of free, multiple, sewn and degenerate edges * @group shape * @shortname sew with report * @drawable false * @example * ```typescript * const sewn = await bitbybit.occt.shapeFix.sewWithReport({ shapes: faces, tolerance: 1e-4, nonManifold: false }); * const closed = sewn.freeEdgeCount === 0; * ``` */ sewWithReport(inputs: Inputs.OCCT.SewWithReportDto): 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 lines and circles * tangent to other curves in a plane; cut, lengthen and blend them; 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; /** * Finds a frame on an edge at a parameter, from 0 where the edge starts in its own direction. * `kind` sets how it follows: carried from the start without twisting, across the edge level with * `up`, or in the plane it bends in; Frenet frames throw where the edge runs straight, level * ones where it runs along `up`. * @param inputs - The edge, the fraction along it, the kind of frame and the up vector * @returns The frame at that place * @group frames * @shortname frame on edge at param * @drawable true * @example * ```typescript * const frame = await bitbybit.occt.shapes.edge.frameOnEdgeAtParam({ shape: edge, param: 0.5, kind: Bit.Inputs.OCCT.curveFrameEnum.perpendicular, up: [0, 0, 1] }); * ``` */ frameOnEdgeAtParam(inputs: Inputs.OCCT.FrameOnCurveAtParamDto): Promise; /** * Finds a frame on an edge at a length from its start, as `frameOnEdgeAtParam` finds it at a * parameter. * @param inputs - The edge, the length along it, the kind of frame and the up vector * @returns The frame at that place * @group frames * @shortname frame on edge at length * @drawable true * @example * ```typescript * const frame = await bitbybit.occt.shapes.edge.frameOnEdgeAtLength({ shape: edge, length: 2, kind: Bit.Inputs.OCCT.curveFrameEnum.perpendicular, up: [0, 0, 1] }); * ``` */ frameOnEdgeAtLength(inputs: Inputs.OCCT.FrameOnCurveAtLengthDto): Promise; /** * Finds frames on an edge at several parameters in one pass. Rotation-minimizing frames are * carried along the whole edge from its start, so each is the frame a swept profile would ride * on there. * @param inputs - The edge, the fractions along it, the kind of frame and the up vector * @returns One frame per parameter, in the same order * @group frames * @shortname frames on edge at params * @drawable true * @example * ```typescript * const frames = await bitbybit.occt.shapes.edge.framesOnEdgeAtParams({ shape: edge, params: [0, 0.5, 1], kind: Bit.Inputs.OCCT.curveFrameEnum.rotationMinimizing, up: [0, 0, 1] }); * ``` */ framesOnEdgeAtParams(inputs: Inputs.OCCT.FramesOnCurveAtParamsDto): Promise; /** * Finds frames on an edge at several lengths from its start in one pass, as * `framesOnEdgeAtParams` finds them at parameters. * @param inputs - The edge, the lengths along it, the kind of frame and the up vector * @returns One frame per length, in the same order * @group frames * @shortname frames on edge at lengths * @drawable true * @example * ```typescript * const frames = await bitbybit.occt.shapes.edge.framesOnEdgeAtLengths({ shape: edge, lengths: [0, 1, 2], kind: Bit.Inputs.OCCT.curveFrameEnum.rotationMinimizing, up: [0, 0, 1] }); * ``` */ framesOnEdgeAtLengths(inputs: Inputs.OCCT.FramesOnCurveAtLengthsDto): 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; /** * Cuts an edge into pieces at places given as fractions from 0 at its start to 1 at its end. * * The pieces keep the edge's curve and direction, so the pieces of an arc are arcs. Fractions * follow the parameter, not the length; ends and repeats are skipped, so n places inside the edge * give n + 1 pieces. * @param inputs - The edge and the fractions to cut at * @returns The pieces, in order from the start * @group edit * @shortname split edge at params * @drawable true * @example * ```typescript * const [firstHalf, secondHalf] = await bitbybit.occt.shapes.edge.splitEdgeAtParams({ shape: arc, params: [0.5] }); * ``` */ splitEdgeAtParams(inputs: Inputs.OCCT.DataOnGeometryAtParamsDto): Promise; /** * Cuts an edge into pieces at places given as lengths along it from its start, in model units. * * Each piece runs along the edge's own curve and keeps its direction. Lengths at or past the * ends and repeats are skipped, so n lengths inside the edge give n + 1 pieces. * @param inputs - The edge and the lengths to cut at * @returns The pieces, in order from the start * @group edit * @shortname split edge at lengths * @drawable true * @example * ```typescript * const pieces = await bitbybit.occt.shapes.edge.splitEdgeAtLengths({ shape: edge, lengths: [2, 5] }); * ``` */ splitEdgeAtLengths(inputs: Inputs.OCCT.DataOnGeometryAtLengthsDto): Promise; /** * Lengthens an edge before its start and past its end, carrying its curve on the way it runs. * * A line stays a line and an arc an arc, up to a full circle. Other curves become B-splines * ending that far along the end's tangent, bending smoothly across the join; one still turning * there gains a little more. * @param inputs - The edge and the lengths to add at its start and its end * @returns A new, longer edge running the same way * @group edit * @shortname extend edge * @drawable true * @example * ```typescript * const longer = await bitbybit.occt.shapes.edge.extendEdge({ shape: edge, atStart: 0, atEnd: 2 }); * ``` */ extendEdge(inputs: Inputs.OCCT.ExtendEdgeDto): Promise; /** * Bridges the gap from the end of one edge to the start of another with a smooth Bezier edge * that leaves and arrives along their tangents. * * With `matchCurvature` it also bends as each edge bends at its end. `bulge` sets how long it * holds each tangent; edges whose ends already meet are refused. * @param inputs - The edge to leave, the edge to reach and how the blend joins them * @returns The blend edge * @group edit * @shortname blend between edges * @drawable true * @example * ```typescript * const bridge = await bitbybit.occt.shapes.edge.blendBetweenEdges({ from: first, to: second, matchCurvature: true, bulge: 1 }); * const path = await bitbybit.occt.shapes.wire.combineEdgesAndWiresIntoAWire({ shapes: [first, bridge, second] }); * ``` */ blendBetweenEdges(inputs: Inputs.OCCT.BlendBetweenEdgesDto): 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. It is replaced * by `linesTangentToTwo`, which takes curves other than circles too. * @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 * @deprecated Use `linesTangentToTwo` once per point, with the point as a vertex * (`shapes.vertex.vertexFromPoint`) and a frame in the circle's plane; it gives no circle piece. * It is removed in a future major version and works until then. * @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. It is replaced by * `linesTangentToTwo`, which takes curves other than circles too. * @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 * @deprecated Use `linesTangentToTwo` with the point as a vertex (`shapes.vertex.vertexFromPoint`) * and a frame in the circle's plane; it gives no circle piece. It is removed in a future major version and works until then. * @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. It is replaced by `linesTangentToTwo`, which takes curves other than circles too. * @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 * @deprecated Use `linesTangentToTwo` with the two circles and a frame in their plane; it gives no * circle pieces. It is removed in a future major version and works until then. * @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. * * It is replaced by `circlesTangentToTwoWithRadius`, which takes curves other than circles too. * @param inputs - The two circle edges, the tolerance and the radius of the new circles * @returns The tangent circles * @deprecated Use `circlesTangentToTwoWithRadius` with the two circles and a frame in their plane. * It is removed in a future major version and works until then. * @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. * * It is replaced by `circlesTangentToTwoWithRadius`, which takes a vertex and a curve other than a * circle too. * @param inputs - The circle edge, the point, the tolerance and the radius of the new circles * @returns The tangent circles * @deprecated Use `circlesTangentToTwoWithRadius` with the circle, the point as a vertex * (`shapes.vertex.vertexFromPoint`) and a frame in the circle's plane. It is removed in a future major version and works until then. * @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; /** * Draws every circle that touches three edges, or passes through the vertices among them, in the * plane of a frame. * * Straight edges count as endless lines and arcs as whole circles unless `onArgumentsOnly` is * set; other curves are touched within their ends. A circle that is one of the edges is left out. * @param inputs - The three edges or vertices, the plane, the tolerance and whether the circles must touch the edges themselves * @returns One whole circle per solution * @group constraint * @shortname circles tangent to three * @drawable true * @example * ```typescript * const circles = await bitbybit.occt.shapes.edge.circlesTangentToThree({ * shapes: [sideA, sideB, sideC], * frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] }, * tolerance: 1e-7, * onArgumentsOnly: true, * }); * ``` */ circlesTangentToThree(inputs: Inputs.OCCT.CirclesTangentToThreeDto): Promise; /** * Draws every circle of a given radius that touches two edges, or passes through the vertices * among them, in the plane of a frame. * * Straight edges count as endless lines and arcs as whole circles unless `onArgumentsOnly` is * set; other curves are touched within their ends. A circle that is one of the given edges is * left out. * @param inputs - The two edges or vertices, the plane, the radius, the tolerance and whether the circles must touch the edges themselves * @returns One whole circle per solution * @group constraint * @shortname circles tangent to two with radius * @drawable true * @example * ```typescript * const fillets = await bitbybit.occt.shapes.edge.circlesTangentToTwoWithRadius({ * shapes: [wall, floor], * frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] }, * radius: 2, * tolerance: 1e-7, * onArgumentsOnly: true, * }); * ``` */ circlesTangentToTwoWithRadius(inputs: Inputs.OCCT.CirclesTangentToTwoWithRadiusDto): Promise; /** * Draws every circle centered on an edge that touches two other edges, or passes through the * vertices among them, in the plane of a frame. * * Straight edges count as endless lines and arcs as whole circles, the edge of centers too, * unless `onArgumentsOnly` is set, which also keeps each center within `centerOn`. Other curves * are touched within their ends. * @param inputs - The two edges or vertices, the edge of centers, the plane, the tolerance and whether the circles must touch the edges themselves * @returns One whole circle per solution * @group constraint * @shortname circles tangent to two centered on * @drawable true * @example * ```typescript * const circles = await bitbybit.occt.shapes.edge.circlesTangentToTwoCenteredOn({ * shapes: [top, bottom], * centerOn: axis, * frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] }, * tolerance: 1e-7, * onArgumentsOnly: false, * }); * ``` */ circlesTangentToTwoCenteredOn(inputs: Inputs.OCCT.CirclesTangentToTwoCenteredOnDto): Promise; /** * Draws every straight line that touches two curved edges, or touches one and passes through a * vertex, in the plane of a frame. * * Each line runs from the first shape to the second, like a belt between two wheels. Arcs count * as whole circles unless `onArgumentsOnly` is set; straight edges and two vertices are refused. * @param inputs - The two shapes, the plane, the angular tolerance and whether the lines must touch the edges themselves * @returns One line per solution, from contact to contact * @group constraint * @shortname lines tangent to two * @drawable true * @example * ```typescript * const belt = await bitbybit.occt.shapes.edge.linesTangentToTwo({ * shapes: [wheelA, wheelB], * frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] }, * angularTolerance: 1e-6, * onArgumentsOnly: false, * }); * ``` */ linesTangentToTwo(inputs: Inputs.OCCT.LinesTangentToTwoDto): Promise; /** * Draws every straight line that touches a curved edge at an angle to a straight reference edge, * in the plane of a frame. * * The angle, in degrees, turns counterclockwise about the frame's normal. Each line runs from its * touch to the reference's line; a parallel one is centered on its touch, as long as the * reference. * @param inputs - The curve, the reference, the plane, the angle in degrees, the tolerance and whether the lines must touch the edges themselves * @returns One line per solution, from the touch to the reference * @group constraint * @shortname lines tangent at angle * @drawable true * @example * ```typescript * const tangents = await bitbybit.occt.shapes.edge.linesTangentAtAngle({ * shape: arc, * reference: baseLine, * frame: { origin: [0, 0, 0], normal: [0, 1, 0], direction: [1, 0, 0] }, * angle: 30, * angularTolerance: 1e-6, * onArgumentsOnly: false, * }); * ``` */ linesTangentAtAngle(inputs: Inputs.OCCT.LinesTangentAtAngleDto): 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, through point grids, * between or inside edges, 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, iso curves and grids of wires; cut hole patterns into them, lay * them flat, 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 B-spline face through a grid of points, or near them. * * The rows step along u and each row runs along v. Interpolating passes through every point at * degree 3, closed in u when `periodic`; approximating keeps within `tolerance` at a degree from * `degreeMin` to `degreeMax`. Neighbouring rows or columns holding the same points are refused. * @param inputs - The rows of points, whether to interpolate, and the degrees and tolerance of an approximation * @returns The face * @group from * @shortname face from point grid * @drawable true * @example * ```typescript * const face = await bitbybit.occt.shapes.face.fromPointGrid({ * points: [ * [[0, 0, 0], [0, 1, 5], [0, 0, 10]], * [[5, 2, 0], [5, 3, 5], [5, 2, 10]], * [[10, 0, 0], [10, 1, 5], [10, 0, 10]], * ], * interpolate: true, * }); * ``` */ fromPointGrid(inputs: Inputs.OCCT.FaceFromPointGridDto): Promise; /** * Creates the ruled surface between two edges, or two wires edge by edge: straight lines from one * to the other. * * Each line joins the points at the same share of the two curves, so reversing one twists the * surface. Wires need as many edges each, paired as each wire runs. The shapes given are left * unchanged. * @param inputs - Two edges or two wires * @returns A face for two edges, a shell of one face per pair of edges for two wires * @group from * @shortname ruled between * @drawable true * @example * ```typescript * const bottom = await bitbybit.occt.shapes.edge.line({ start: [0, 0, 0], end: [10, 0, 0] }); * const top = await bitbybit.occt.shapes.edge.arcThroughThreePoints({ start: [0, 5, 0], middle: [5, 5, 3], end: [10, 5, 0] }); * const face = await bitbybit.occt.shapes.face.ruledBetween({ shapeA: bottom, shapeB: top }); * ``` */ ruledBetween(inputs: Inputs.OCCT.TwoShapesDto): Promise; /** * Creates a B-spline face bounded by two, three or four edges. * * Four edges, in any order and direction, must close up. Of three, one must meet the other two, * and a straight side closes their free ends. Two are opposite sides joined start to start; the * curved style instead sweeps one along the other from a shared corner. * @param inputs - The boundary edges and the filling style * @returns The face * @group from * @shortname boundary patch * @drawable true * @example * ```typescript * const edges = await bitbybit.occt.shapes.edge.fromPoints({ points: [[0, 0, 0], [10, 0, 2], [10, 10, 0], [0, 10, 2], [0, 0, 0]] }); * const patch = await bitbybit.occt.shapes.face.boundaryPatch({ edges, style: Bit.Inputs.OCCT.fillingStyleEnum.coons }); * ``` */ boundaryPatch(inputs: Inputs.OCCT.BoundaryPatchDto): Promise; /** * Creates a face that fills a closed loop of edges and passes near given points. * * The edges may come in any order and direction. Each continuity says whether the patch passes * through its edge, meets the face beside it at a tangent, or also bends as it does; an edge that * stores no face takes that face in `supports`. * @param inputs - The boundary edges, their continuities and support faces, the points and the fit's settings * @returns The face * @group from * @shortname fill patch * @drawable true * @example * ```typescript * const cylinder = await bitbybit.occt.shapes.solid.createCylinder({ radius: 2, height: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * const side = await bitbybit.occt.shapes.face.getFace({ shape: cylinder, index: 0 }); * const rim = await bitbybit.occt.shapes.edge.getEdge({ shape: cylinder, index: 0 }); * const dome = await bitbybit.occt.shapes.face.fillPatch({ * edges: [rim], * continuities: [Bit.Inputs.OCCT.continuityEnum.tangent], * supports: [side], * points: [[0, 7, 0]], * }); * ``` */ fillPatch(inputs: Inputs.OCCT.FillPatchDto): Promise; /** * Lays a plane, cylinder or cone face out flat without stretching it, as the pattern a sheet is * cut from. * * Lengths and areas are kept, holes and notches included, and a closed face opens along its seam. * The flat face lies on the ground plane facing +Y, as the other flat shapes do, ready for a DXF * export. * @param inputs - The face and the tolerance of the flat edges * @returns The flat face on the XZ plane * @group develop * @shortname unroll * @drawable true * @example * ```typescript * const cylinder = await bitbybit.occt.shapes.solid.createCylinder({ radius: 2, height: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * const wall = await bitbybit.occt.shapes.face.getFace({ shape: cylinder, index: 0 }); * const pattern = await bitbybit.occt.shapes.face.unroll({ shape: wall, tolerance: 1e-4 }); * ``` */ unroll(inputs: Inputs.OCCT.UnrollFaceDto): 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. * * Border offsets trim the range; each rectangle is centered in its cell, sized by the scale * patterns, rounded by the fillet pattern, skipped by the inclusion pattern. One crossing a trim * or hole is left out. * @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 cells and patterns of `subdivideToRectangleWires`; with no scale pattern * each covers half its cell, and existing holes stay. With `holesToFaces` true one face per hole * follows the perforated face. * @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. * * Border offsets trim the range; `flatU` turns a flat side toward U, the extend flags stretch * the outer rows past the edges, and patterns repeat per hexagon. One crossing a trim or hole is * left out. * @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 layout and patterns of `subdivideToHexagonWires`; with no scale pattern * each is half its hexagon, and existing holes stay. With `holesToFaces` true one face per hole * follows 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 and follow the face's orientation, as `normalOnUV` does, so a reversed face gives them * flipped. * @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; /** * Finds the frame of a face at a UV fraction pair, where a profile or a copy would sit: at the * surface point, normal as `normalOnUV` gives it, direction along U. * * U and V run from 0 to 1 over the face's range. Where the surface has no normal, as at a cone's * point, it is read inside the face. * @param inputs - The face and the U and V fractions * @returns The frame at that place * @group frames * @shortname frame on uv * @drawable true * @example * ```typescript * const frame = await bitbybit.occt.shapes.face.frameOnUV({ shape: face, paramU: 0.5, paramV: 0.5 }); * ``` */ frameOnUV(inputs: Inputs.OCCT.DataOnUVDto): Promise; /** * Finds the frames of a face at several UV fraction pairs at once, each as `frameOnUV` finds it. * @param inputs - The face and the list of U and V fraction pairs * @returns One frame per pair, in the same order * @group frames * @shortname frames on uvs * @drawable true * @example * ```typescript * const frames = await bitbybit.occt.shapes.face.framesOnUVs({ shape: face, paramsUV: [[0.25, 0.5], [0.75, 0.5]] }); * ``` */ framesOnUVs(inputs: Inputs.OCCT.DataOnUVsDto): Promise; /** * Places frames on a face in a grid, one at each point `subdivideToPoints` gives for the same * inputs, each turned as `frameOnUV` turns it. * * The frames come in the order of the points, their normals match `subdivideToNormals` and * their X axes run along the face's U direction. * @param inputs - The face, the number of points in U and V, and the shift and removal options * @returns One frame per point of the grid, in order * @group frames * @shortname subdivide to frames * @drawable true * @example * ```typescript * const frames = await bitbybit.occt.shapes.face.subdivideToFrames({ * shape: face, * nrDivisionsU: 5, * nrDivisionsV: 5, * shiftHalfStepU: false, * removeStartEdgeU: false, * removeEndEdgeU: false, * shiftHalfStepV: false, * removeStartEdgeV: false, * removeEndEdgeV: false, * }); * const studs = await bitbybit.occt.transforms.placeOnFrames({ shape: stud, frames }); * ``` */ subdivideToFrames(inputs: Inputs.OCCT.FaceSubdivisionDto): Promise; /** * Finds the frame of a face at the place nearest a point, as `frameOnUV` finds it there; a point * beyond the face's edge comes to the edge. * @param inputs - The face and the point * @returns The frame at the nearest place * @group frames * @shortname frame nearest point * @drawable true * @example * ```typescript * const frame = await bitbybit.occt.shapes.face.frameNearestPoint({ shape: face, point: [1, 2, 10] }); * ``` */ frameNearestPoint(inputs: Inputs.OCCT.FrameNearestPointDto): Promise; /** * Finds the frames of a face at the places nearest several points at once, each as * `frameNearestPoint` finds it. * @param inputs - The face and the points * @returns One frame per point, in the same order * @group frames * @shortname frames nearest points * @drawable true * @example * ```typescript * const frames = await bitbybit.occt.shapes.face.framesNearestPoints({ shape: face, points: [[1, 2, 10], [4, 5, 10]] }); * ``` */ framesNearestPoints(inputs: Inputs.OCCT.FramesNearestPointsDto): 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. The wires ignore the face's trims; `isoCurves` gives the * exact curves trimmed to the face. * @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; /** * Finds a face's exact iso curves at fractions of its UV range, trimmed to the face. * * With `isU` true each curve holds u at its fraction and runs along v; false swaps them. A curve * stops at a hole and goes on past it; 0 and 1 give the boundary, and values outside give none. * @param inputs - The face, the direction and the fractions * @returns The edges, value after value, each value's pieces in order along the curve * @group extract * @shortname iso curves * @drawable true * @example * ```typescript * const curves = await bitbybit.occt.shapes.face.isoCurves({ shape: face, isU: true, params: [0.25, 0.5, 0.75] }); * ``` */ isoCurves(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 or the same object as another, and two clean-ups: * `unifySameDomain`, which merges faces and edges that lie on one surface after a boolean, and * `purgeInternalEdges`, which removes edges left inside faces. 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; /** * Removes the edges that lie inside a face without bounding it, such as the segment a split * leaves on a face, and rebuilds the faces around them. * * An edge that bounds any face of the shape stays, and a shape with nothing to remove comes * back as it was. * @param inputs - The shape * @returns The shape without its internal edges * @group edit * @shortname purge internal edges * @drawable true * @example * ```typescript * const clean = await bitbybit.occt.shapes.shape.purgeInternalEdges({ shape: splitBox }); * ``` */ 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 further apart than the tolerance stay unjoined, so a closed shell may come out open; a * larger tolerance sews more. A lone face comes back as that face, and faces that do not all * join as a compound of what did. * @param inputs - The faces and the sewing tolerance * @returns The shell, or the face or compound when the faces do not join into one * @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: 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. * * `valid` is false only for an empty or null shape, which gives zero counts; it does not check * the geometry, which `shapeFix.isValid` does. * @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; offset an open * one to one side; map, wrap or project them onto faces and 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; /** * Cuts a wire into pieces at places given as fractions from 0 at its start to 1 at its end, every * edge an equal share. * * A piece running across a corner holds an edge on each side. Ends and repeats are skipped, so n * places inside give n + 1 pieces; an edge is cut as a one-edge wire. * @param inputs - The wire and the fractions to cut at * @returns The pieces as wires, in order from the start * @group edit * @shortname split wire at params * @drawable true * @example * ```typescript * const [first, second] = await bitbybit.occt.shapes.wire.splitWireAtParams({ shape: wire, params: [0.5] }); * ``` */ splitWireAtParams(inputs: Inputs.OCCT.DataOnGeometryAtParamsDto): Promise; /** * Cuts a wire into pieces at places given as lengths along it from its start, in model units. * * A piece running across a corner holds an edge on each side. Lengths at or past the ends and * repeats are skipped, so n lengths inside give n + 1 pieces; an edge is cut as a wire of that one * edge. * @param inputs - The wire and the lengths to cut at * @returns The pieces as wires, in order from the start * @group edit * @shortname split wire at lengths * @drawable true * @example * ```typescript * const dashes = await bitbybit.occt.shapes.wire.splitWireAtLengths({ shape: wire, lengths: [1, 2, 3, 4] }); * ``` */ splitWireAtLengths(inputs: Inputs.OCCT.DataOnGeometryAtLengthsDto): Promise; /** * Draws the offset of an open wire or an edge on one side of it, not the loop * `operations.offset` draws around it. * * A positive distance lies to the right of the wire's direction, seen from the side `face` looks * to, or from above on the ground plane. A straight wire needs a flat `face` to give it a plane. * @param inputs - The open wire or edge, an optional flat face, the distance and the corner style * @returns The offset curve as a wire * @group offsets * @shortname offset open * @drawable true * @example * ```typescript * const alongside = await bitbybit.occt.shapes.wire.offsetOpen({ shape: path, distance: 1, joinType: Bit.Inputs.OCCT.joinTypeEnum.arc }); * ``` */ offsetOpen(inputs: Inputs.OCCT.OffsetOpenDto): 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` holds the gaps in model units, repeated from the start, and must add up to more * than 0 or it throws. `includeFirst` adds the start point, `includeLast` the end, and * `tryNext` one point past the last gap. * @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 ]>; /** * Finds a frame on a wire at a parameter, from 0 where the wire starts in its own direction. * `kind` sets how it follows: carried from the start without twisting, across the wire level with * `up`, or in the plane it bends in; Frenet frames throw where the wire runs straight, level * ones where it runs along `up`. * @param inputs - The wire, the fraction along it, the kind of frame and the up vector * @returns The frame at that place * @group frames * @shortname frame on wire at param * @drawable true * @example * ```typescript * const frame = await bitbybit.occt.shapes.wire.frameOnWireAtParam({ shape: wire, param: 0.5, kind: Bit.Inputs.OCCT.curveFrameEnum.perpendicular, up: [0, 0, 1] }); * ``` */ frameOnWireAtParam(inputs: Inputs.OCCT.FrameOnCurveAtParamDto): Promise; /** * Finds a frame on a wire at a length from its start, as `frameOnWireAtParam` finds it at a * parameter. * @param inputs - The wire, the length along it, the kind of frame and the up vector * @returns The frame at that place * @group frames * @shortname frame on wire at length * @drawable true * @example * ```typescript * const frame = await bitbybit.occt.shapes.wire.frameOnWireAtLength({ shape: wire, length: 2, kind: Bit.Inputs.OCCT.curveFrameEnum.perpendicular, up: [0, 0, 1] }); * ``` */ frameOnWireAtLength(inputs: Inputs.OCCT.FrameOnCurveAtLengthDto): Promise; /** * Finds frames on a wire at several parameters in one pass. Rotation-minimizing frames are * carried along the whole wire from its start, so each is the frame a swept profile would ride on * there. * @param inputs - The wire, the fractions along it, the kind of frame and the up vector * @returns One frame per parameter, in the same order * @group frames * @shortname frames on wire at params * @drawable true * @example * ```typescript * const frames = await bitbybit.occt.shapes.wire.framesOnWireAtParams({ shape: wire, params: [0, 0.5, 1], kind: Bit.Inputs.OCCT.curveFrameEnum.rotationMinimizing, up: [0, 0, 1] }); * ``` */ framesOnWireAtParams(inputs: Inputs.OCCT.FramesOnCurveAtParamsDto): Promise; /** * Finds frames on a wire at several lengths from its start in one pass, as * `framesOnWireAtParams` finds them at parameters. * @param inputs - The wire, the lengths along it, the kind of frame and the up vector * @returns One frame per length, in the same order * @group frames * @shortname frames on wire at lengths * @drawable true * @example * ```typescript * const frames = await bitbybit.occt.shapes.wire.framesOnWireAtLengths({ shape: wire, lengths: [0, 1, 2], kind: Bit.Inputs.OCCT.curveFrameEnum.rotationMinimizing, up: [0, 0, 1] }); * ``` */ framesOnWireAtLengths(inputs: Inputs.OCCT.FramesOnCurveAtLengthsDto): Promise; /** * Spreads `count` frames evenly by length along a wire, the first at its start, to place copies * along a path or to carry a profile along it. * * On an open wire the last sits at the end; on a closed wire they go around the loop without * repeating the first, unless `skipEndOnClosed` is off. * @param inputs - The wire, how many frames, the kind of frame, the up vector and the closed-wire rule * @returns The frames from the start onward * @group frames * @shortname frames along wire * @drawable true * @example * ```typescript * const circle = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * const frames = await bitbybit.occt.shapes.wire.framesAlongWire({ shape: circle, count: 10, kind: Bit.Inputs.OCCT.curveFrameEnum.rotationMinimizing, up: [0, 0, 1], skipEndOnClosed: true }); * ``` */ framesAlongWire(inputs: Inputs.OCCT.FramesAlongWireDto): Promise; /** * 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; /** * Wraps flat wires drawn on the ground plane around a plane, cylinder or cone face, keeping every * length, as a label wraps a can. * * On a cylinder of radius r, X runs around it from the face's start, 2 pi r to a turn, and Z runs * along its axis. The wires follow the surface past the face's edges. * @param inputs - The flat wires or edges, the face and the tolerance * @returns The wrapped wires, in the same order * @group place * @shortname wrap wires on face * @drawable true * @example * ```typescript * const band = await bitbybit.occt.shapes.wire.createRectangleWire({ width: 6, length: 1, center: [3, 0, 2], direction: [0, 1, 0] }); * const wrapped = await bitbybit.occt.shapes.wire.wrapWiresOnFace({ wires: [band], face: cylinderWall, tolerance: 1e-4 }); * ``` */ wrapWiresOnFace(inputs: Inputs.OCCT.WrapWiresOnFaceDto): 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; /** * Lays edges or wires onto the faces of a shape along the surface's normals, rather than along one * direction as `project` does. * * The pieces join into wires, one per loop or chain, within the faces' edges. `maxDistance` drops * the parts landing farther than it; a projection that misses gives an empty compound. * @param inputs - The edges or wires, the shape, the fitting tolerance and the greatest distance * @returns A compound of the projected wires * @group place * @shortname project normal * @drawable true * @example * ```typescript * const onBall = await bitbybit.occt.shapes.wire.projectNormal({ wires: [circle], shape: sphere, tolerance: 1e-4, maxDistance: 0 }); * ``` */ projectNormal(inputs: Inputs.OCCT.ProjectNormalDto): Promise; /** * Casts an edge or a wire onto the faces of a shape along the lines from a point through it, like * the shadow a lamp throws. * * The result is a compound of the wires where those lines meet the shape, near side and far side * alike; lines that miss give an empty compound. * @param inputs - The edge or wire, the shape and the point to cast from * @returns A compound of the projected wires * @group place * @shortname project conical * @drawable true * @example * ```typescript * const shadow = await bitbybit.occt.shapes.wire.projectConical({ wire: square, shape: floor, from: [0, 20, 0] }); * ``` */ projectConical(inputs: Inputs.OCCT.ProjectConicalDto): Promise; } /** * Making the commands `sketch.pen` draws, one at a time: lines, circular arcs, Bezier curves, * closing the outline, and rounding or beveling a corner. Each method returns one command as plain * data, the same object a script can write by hand, so a list of them is what `sketch.pen` takes. */ declare class OCCTSketchCommands { private readonly occWorkerManager; /** * Makes a command that draws a straight segment to a point. * * `to` is a point in the sketch's x and y, or an offset from where the pen is when `relative` * is true. * @param inputs - The point to draw to, whether it is relative and the command's id * @returns The command * @group lines * @shortname line * @drawable false * @example * ```typescript * const side = await bitbybit.occt.sketch.commands.line({ to: [0, 10], relative: true, id: "side" }); * const outline = await bitbybit.occt.sketch.pen({ commands: [side, { type: "hLine", length: 20 }] }); * ``` */ line(inputs: Inputs.OCCT.SketchLineDto): Promise; /** * Makes a command that draws a straight segment along the sketch's x axis. * * A negative `length` draws in the negative x direction. * @param inputs - The length and the command's id * @returns The command * @group lines * @shortname h line * @drawable false * @example * ```typescript * const base = await bitbybit.occt.sketch.commands.hLine({ length: 40, id: "base" }); * ``` */ hLine(inputs: Inputs.OCCT.SketchHLineDto): Promise; /** * Makes a command that draws a straight segment along the sketch's y axis. * * A negative `length` draws in the negative y direction. * @param inputs - The length and the command's id * @returns The command * @group lines * @shortname v line * @drawable false * @example * ```typescript * const side = await bitbybit.occt.sketch.commands.vLine({ length: 10, id: "side" }); * ``` */ vLine(inputs: Inputs.OCCT.SketchVLineDto): Promise; /** * Makes a command that draws a straight segment of a given length at an angle. * * `angle` is in degrees from the sketch's x axis, counterclockwise; a negative `length` draws * the opposite way. * @param inputs - The length, the angle in degrees and the command's id * @returns The command * @group lines * @shortname polar line * @drawable false * @example * ```typescript * const slope = await bitbybit.occt.sketch.commands.polarLine({ length: 12, angle: 30 }); * ``` */ polarLine(inputs: Inputs.OCCT.SketchPolarLineDto): Promise; /** * Makes a command that draws straight on in the direction the previous segment ended in. * * It needs a segment before it, and is how a straight run leaves an arc smoothly. * @param inputs - The length and the command's id * @returns The command * @group lines * @shortname tangent line * @drawable false * @example * ```typescript * const runOut = await bitbybit.occt.sketch.commands.tangentLine({ length: 15 }); * ``` */ tangentLine(inputs: Inputs.OCCT.SketchTangentLineDto): Promise; /** * Makes a command that draws a circular arc through one point to another. * * The arc turns whichever way takes it from where the pen is through `through` to `to`; the * three points must not lie on one line. * @param inputs - The point to pass through, the point to end at, whether they are relative and the command's id * @returns The command * @group arcs * @shortname three point arc * @drawable false * @example * ```typescript * const crown = await bitbybit.occt.sketch.commands.threePointArc({ through: [10, 4], to: [20, 0] }); * ``` */ threePointArc(inputs: Inputs.OCCT.SketchThreePointArcDto): Promise; /** * Makes a command that draws a circular arc to a point, leaving in the direction the previous * segment ended in. * * It needs a segment before it. The arc's radius follows from where it ends; an end straight * ahead is refused, as `tangentLine` draws that. * @param inputs - The point to end at, whether it is relative and the command's id * @returns The command * @group arcs * @shortname tangent arc * @drawable false * @example * ```typescript * const bend = await bitbybit.occt.sketch.commands.tangentArc({ to: [10, 10], relative: true }); * ``` */ tangentArc(inputs: Inputs.OCCT.SketchTangentArcDto): Promise; /** * Makes a command that draws a circular arc to a point, bowed out by a given distance. * * `sagitta` is how far the middle of the arc stands off the straight line to `to`: positive to * the left of the direction of travel, negative to the right. * @param inputs - The point to end at, the sagitta, whether the point is relative and the command's id * @returns The command * @group arcs * @shortname sagitta arc * @drawable false * @example * ```typescript * const bow = await bitbybit.occt.sketch.commands.sagittaArc({ to: [20, 0], sagitta: 3 }); * ``` */ sagittaArc(inputs: Inputs.OCCT.SketchSagittaArcDto): Promise; /** * Makes a command that draws a circular arc to a point, given by its bulge as DXF files write * arcs. * * `bulge` is the tangent of a quarter of the angle swept: positive turns counterclockwise, 1 * draws a half circle and 0 is refused, being a straight line. * @param inputs - The point to end at, the bulge, whether the point is relative and the command's id * @returns The command * @group arcs * @shortname bulge arc * @drawable false * @example * ```typescript * const half = await bitbybit.occt.sketch.commands.bulgeArc({ to: [-20, 0], bulge: 1, relative: true }); * ``` */ bulgeArc(inputs: Inputs.OCCT.SketchBulgeArcDto): Promise; /** * Makes a command that draws a quadratic Bezier curve to a point, pulled toward a control point. * * With `relative` true, `control` and `to` are offsets from where the pen is. * @param inputs - The control point, the point to end at, whether they are relative and the command's id * @returns The command * @group curves * @shortname quadratic * @drawable false * @example * ```typescript * const sweep = await bitbybit.occt.sketch.commands.quadratic({ control: [10, 8], to: [20, 0] }); * ``` */ quadratic(inputs: Inputs.OCCT.SketchQuadraticDto): Promise; /** * Makes a command that draws a cubic Bezier curve to a point, shaped by two control points. * * The curve leaves toward `control1` and arrives from `control2`; with `relative` true all three * points are offsets from where the pen is. * @param inputs - The two control points, the point to end at, whether they are relative and the command's id * @returns The command * @group curves * @shortname cubic * @drawable false * @example * ```typescript * const wave = await bitbybit.occt.sketch.commands.cubic({ control1: [5, 10], control2: [15, -10], to: [20, 0] }); * ``` */ cubic(inputs: Inputs.OCCT.SketchCubicDto): Promise; /** * Makes a command that closes the outline with a straight segment back to the start point. * * Only corner commands may follow it. When the pen is already at the start point it draws * nothing and only closes the outline. * @param inputs - The command's id * @returns The command * @group outline * @shortname close * @drawable false * @example * ```typescript * const close = await bitbybit.occt.sketch.commands.close({ id: "back" }); * ``` */ close(inputs: Inputs.OCCT.SketchCloseDto): Promise; /** * Makes a command that rounds the corner between the segment before it and the segment after * it with an arc of a given radius. * * Placed after `close`, it rounds the corner at the start point. Only lines and circular arcs * take a corner, and a radius too large for them is refused. * @param inputs - The radius and the command's id * @returns The command * @group corners * @shortname fillet corner * @drawable false * @example * ```typescript * const round = await bitbybit.occt.sketch.commands.filletCorner({ radius: 2 }); * ``` */ filletCorner(inputs: Inputs.OCCT.SketchFilletCornerDto): Promise; /** * Makes a command that bevels the corner between the segment before it and the segment after it, * cutting the same distance off each. * * `distance` is measured along each segment. Placed after `close`, it bevels the corner at the * start point; only lines and circular arcs take a corner. * @param inputs - The distance and the command's id * @returns The command * @group corners * @shortname chamfer corner * @drawable false * @example * ```typescript * const bevel = await bitbybit.occt.sketch.commands.chamferCorner({ distance: 1.5 }); * ``` */ chamferCorner(inputs: Inputs.OCCT.SketchChamferCornerDto): Promise; } /** * Drawing flat outlines with a pen: a start point and a list of moves (lines, arcs, Bezier curves, * rounded and beveled corners) become one exact wire, or a face when the outline closes, in the plane * of a frame. `commands` makes the moves one at a time; `stroke` and `hull` outline wires and wrap * shapes. A sketch's x axis is the frame's direction and its y axis the normal crossed with it. */ declare class OCCTSketch { private readonly occWorkerManager; readonly commands: OCCTSketchCommands; /** * Draws an outline with a pen, from a start point through a list of moves, in a frame's plane. * * Each command draws on from where the previous one ended, and lines and arcs come out as exact * lines and circles. `makeFace` turns a closed outline into a face facing along the frame's * normal; one that crosses itself is refused. * @param inputs - The commands, the start point, the frame and whether to make a face * @returns The outline as a wire, or a face when `makeFace` is true * @group draw * @shortname pen * @drawable true * @example * ```typescript * const plate = await bitbybit.occt.sketch.pen({ * commands: [ * { type: "hLine", length: 40 }, * { type: "vLine", length: 10 }, * { type: "filletCorner", radius: 2 }, * { type: "tangentArc", to: [-10, 10], relative: true }, * { type: "close" }, * ], * makeFace: true, * }); * ``` */ pen(inputs: Inputs.OCCT.SketchPenDto): Promise; /** * Draws an outline as `pen` does and reports which edges each command drew, so later steps can * find the edges and faces a command made by its `id`. * * Edges are numbered as `shapes.edge.getEdges` numbers them on the result. A command without an * `id` is named by its position, and a command that drew nothing is left out. * @param inputs - The commands, the start point, the frame and whether to make a face * @returns The outline and, per command, the edges it drew * @group draw * @shortname pen with segments * @drawable false * @example * ```typescript * const drawn = await bitbybit.occt.sketch.penWithSegments({ * commands: [{ type: "hLine", id: "base", length: 40 }, { type: "vLine", id: "side", length: 10 }, { type: "close", id: "slope" }], * makeFace: true, * }); * console.log(drawn.segments.find(segment => segment.id === "slope")?.edges); * ``` */ penWithSegments(inputs: Inputs.OCCT.SketchPenDto): Promise>; /** * Outlines a wire as if it were drawn with a pen of a given width, in a frame's plane. * * Half of `width` lies to each side; `cap` finishes an open wire's ends and `join` its corners. * A closed wire gives a ring: a face with one hole, or its two wires in a compound without * `makeFace`. * @param inputs - The wire, the width, the end and corner styles, the frame and whether to make a face * @returns The outline as a face, or as a wire or compound of wires when `makeFace` is false * @group outline * @shortname stroke * @drawable true * @example * ```typescript * const path = await bitbybit.occt.sketch.pen({ commands: [{ type: "hLine", length: 30 }, { type: "tangentArc", to: [10, 10], relative: true }] }); * const slot = await bitbybit.occt.sketch.stroke({ shape: path, width: 4, cap: Bit.Inputs.OCCT.strokeCapEnum.round }); * ``` */ stroke(inputs: Inputs.OCCT.SketchStrokeDto): Promise; /** * Wraps vertices, straight edges and circular edges lying in a frame's plane in the tightest * convex outline around them. * * The outline is exact: straight where it spans between shapes, following a circle where a circle * or an arc bulges out. Other curves are refused, as are shapes off the frame's plane or circles * tilted out of it. * @param inputs - The shapes, the frame and whether to make a face * @returns The hull as a face, or as a wire when `makeFace` is false * @group outline * @shortname hull * @drawable true * @example * ```typescript * const left = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 5, center: [0, 0, 0], direction: [0, 1, 0] }); * const right = await bitbybit.occt.shapes.wire.createCircleWire({ radius: 2, center: [20, 0, 0], direction: [0, 1, 0] }); * const lever = await bitbybit.occt.sketch.hull({ shapes: [left, right] }); * ``` */ hull(inputs: Inputs.OCCT.SketchHullDto): 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 from one frame onto another in a single rigid motion: whatever sat on `from` * sits the same way on `to`. The result shares its geometry with the shape. * * Leaving out `from` moves from the world frame at the origin, normal along z and direction along x. * @param inputs - The shape, the frame to land on and the frame to move from * @returns The moved shape * @group frames * @shortname orient * @drawable true * @example * ```typescript * const placed = await bitbybit.occt.transforms.orient({ shape: bracket, to: { origin: [10, 0, 0], normal: [1, 0, 0], direction: [0, 1, 0] } }); * ``` */ orient(inputs: Inputs.OCCT.OrientDto): Promise; /** * Places a copy of a shape on every frame, as `orient` would move it from `from`, all in one * compound whose copies share the shape's geometry: an array of hundreds costs one shape's worth * of geometry, and an export writes it once. * @param inputs - The shape, the frames and the frame to move from * @returns A compound of the placed copies, in the order of the frames * @group frames * @shortname place on frames * @drawable true * @example * ```typescript * const pattern = await bitbybit.occt.transforms.placeOnFrames({ shape: bolt, frames }); * ``` */ placeOnFrames(inputs: Inputs.OCCT.PlaceOnFramesDto): Promise; /** * Places a copy of a shape by every placement, a matrix or a list of them, in one compound whose * copies share the shape's geometry. Each must come to a turn and a move; one that scales or * mirrors is refused and named, since a shared copy cannot hold either. * @param inputs - The shape and one placement per copy * @returns A compound of the placed copies, in the order of the placements * @group frames * @shortname place by matrices * @drawable true * @example * ```typescript * const frames = bitbybit.frame.polar({ count: 6, radius: 20 }); * const matrices = frames.map(frame => bitbybit.frame.toMatrix({ frame })); * const copies = await bitbybit.occt.transforms.placeByMatrices({ shape: bolt, matrices }); * ``` */ placeByMatrices(inputs: Inputs.OCCT.PlaceByMatricesDto): 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, with the translation at indices 12 to 14. A move, turn, mirror or * even scale keeps circles and planes exact; a stretch or shear turns every surface into a * B-spline, which fillets and booleans handle more slowly. * @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, frames, 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; private defaultFrameOptions; /** * Draws any entity the library produces into the scene and gives back the drawn object: kernel * shapes, alone or with their appearance, design builds, points, lines, polylines, frames, * 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>; private cachedSyncHandlers; private syncHandlers; private cachedAsyncHandlers; private asyncHandlers; /** * Every branch of the asynchronous dispatch, typed as what it can actually produce. * * A package that adds entity kinds overrides this rather than the public signature: two * unresolved conditional types over the same `E` have no provable relation to each other, so a * narrower override of `drawAnyAsync` cannot typecheck however correct it is. * @ignore true */ protected drawResolvedAsync(inputs: Inputs.Draw.DrawAny): Promise; private 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, frames, 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 drawing options for frames: how long the axes are and their colors, whether the small * grid in the frame's plane is drawn and in which color, the line width and whether the frame * can be redrawn in place, with defaults for what is left out. * @param inputs - The options to start from * @returns The drawing options * @group options * @shortname frame * @example * ```typescript * const options = bitbybit.draw.optionsFrame({ size: 2, colorX: "#ff0000", colorY: "#00ff00", colorZ: "#0000ff", drawPlane: true, colorPlane: "#808080", lineWidth: 2, updatable: false }); * const drawn = bitbybit.draw.drawAny({ entity: bitbybit.frame.world(), options }); * ``` */ optionsFrame(inputs: Inputs.Draw.DrawFrameOptions): Inputs.Draw.DrawFrameOptions; /** * 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, iso curves, a surface * analysis coloring the faces 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, drawIsoCurves: true, isoCurvesU: 5, isoCurvesV: 5, isoCurvesColour: "#808080", surfaceAnalysis: Bit.Inputs.OCCT.surfaceAnalysisEnum.gaussian, draftDirection: [0, 1, 0] }); * ``` */ optionsOcctShape(inputs: Inputs.Draw.DrawOcctShapeOptions): Inputs.Draw.DrawOcctShapeOptions; /** * Builds drawing options for the meshes of a recipe, as `manifold.recipes.meshes` gives them: * the tag naming an element, the batch size, and the color and surface of roots without a * color. PlayCanvas draws every placement into merged batches, instancing left aside. * @param inputs - The options to start from * @returns The drawing options * @group options * @shortname recipe meshes draw options * @example * ```typescript * const options = bitbybit.draw.optionsRecipeMeshes({ elementKey: "globalId", maxBatchVertices: 1000000, defaultColour: "#cccccc", defaultOpacity: 1, metallic: 0, roughness: 0.8 }); * const drawn = await bitbybit.draw.drawAnyAsync({ entity: meshes, options }); * ``` */ optionsRecipeMeshes(inputs: Inputs.Draw.DrawRecipeMeshesOptions): Inputs.Draw.DrawRecipeMeshesOptions; /** * Shows or hides elements of a recipe drawn from its meshes, such as one storey's walls, by the * values of their element tag, rewriting the triangles of the batches they are in. * @param inputs - The drawn recipe, the elements and whether they are shown * @group recipe elements * @shortname show recipe elements * @drawable false * @example * ```typescript * const drawn = await bitbybit.draw.drawAnyAsync({ entity: meshes }); * bitbybit.draw.setRecipeElementsVisible({ drawn, keys: ["2O2Fr$t4X7Zf8NOew3FLOH"], visible: false }); * ``` */ setRecipeElementsVisible(inputs: Inputs.Draw.RecipeElementsVisibilityDto): void; /** * Shows elements of a recipe drawn from its meshes in one color, such as the ones selected, or * with no color gives each its own back, by the values of their element tag. * @param inputs - The drawn recipe, the elements, and the color and opacity, or none * @group recipe elements * @shortname color recipe elements * @drawable false * @example * ```typescript * const drawn = await bitbybit.draw.drawAnyAsync({ entity: meshes }); * bitbybit.draw.setRecipeElementsColour({ drawn, keys: ["2O2Fr$t4X7Zf8NOew3FLOH"], colour: "#ffaa00" }); * bitbybit.draw.setRecipeElementsColour({ drawn, keys: ["2O2Fr$t4X7Zf8NOew3FLOH"] }); * ``` */ setRecipeElementsColour(inputs: Inputs.Draw.RecipeElementsColourDto): void; /** * Gives the element a pick hit in a recipe drawn from its meshes, as the value of its element * tag, from the mesh instance hit and the triangle a ray test found in it. * @param inputs - The drawn recipe, the mesh instance hit and its triangle * @returns The value of the element's tag, or undefined when the pick hit no element of it * @group recipe elements * @shortname recipe element of pick * @drawable false * @example * ```typescript * const drawn = await bitbybit.draw.drawAnyAsync({ entity: meshes }); * const globalId = bitbybit.draw.recipeElementOfPick({ drawn, mesh: meshInstance, triangle }); * ``` */ recipeElementOfPick(inputs: Inputs.Draw.RecipeElementPickDto): string | undefined; /** * 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; private applyTextureTransform; private hexToRgb; private handleJscadMesh; private handleJscadMeshes; private handleManifoldShape; private handleManifoldShapes; private handleManifoldMesh; private handleManifoldMeshes; private handleRecipeMeshes; private handleOcctShape; private handleShapeWithAppearance; private handleShapesWithAppearance; private handleDesignBuild; private handleOcctShapes; private handleLine; private handlePoint; private handleJscadPath; private handleJscadPaths; private handlePolyline; private handleVerbCurve; private handleVerbSurface; private handleFrames; private handlePolylines; private handleLines; private handlePoints; private handleVerbCurves; private handleVerbSurfaces; private handleTag; private handleTags; private updateAny; private basicOptions; private occtOptions; private manifoldOptions; private handle; private handleAsync; private applyGlobalSettingsAndMetadataAndShadowCasting; private resolveDrawOptions; 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; } /** * Frames: a frame is a point with three axes at right angles, written as its `origin`, its `normal` * (the Z axis) and its `direction` (the X axis), the Y axis following from those two. Frames place * things: a shape lands on one, points convert between one and the world, and frame patterns lay * out copies. Every method returns new values and never changes its inputs. */ declare class Frame { private readonly vector; private readonly math; private readonly geometryHelper; constructor(vector: Vector, math: MathBitByBit, geometryHelper: GeometryHelper); /** * Builds a frame from where it sits, where its Z axis points and roughly where its X axis * points. * * `direction` is turned square to `normal` and both are scaled to length 1, so they only have * to be roughly right. A `normal` of zero length or a `direction` along it throws. * @param inputs - The origin, the normal and the rough X direction * @returns A new frame * @group create * @shortname frame * @drawable true * @example * ```typescript * const tilted = bitbybit.frame.create({ origin: [0, 5, 0], normal: [0, 1, 1], direction: [1, 0, 0] }); * ``` */ create(inputs: Inputs.Frame.CreateFrameDto): Inputs.Base.Frame; /** * Gives the world frame: its origin at zero, its X, Y and Z axes along the world's. * * Placing something on the world frame leaves it where it is, and it is the frame the other * methods use when one is left out. * @returns The world frame * @group create * @shortname world * @drawable true * @example * ```typescript * const world = bitbybit.frame.world(); * const raised = bitbybit.frame.offset({ frame: world, distance: 5 }); * ``` */ world(): Inputs.Base.Frame; /** * Builds a frame lying in the XY plane: its X axis along the world X, its Y axis along the * world Y and its normal along the world Z. * @param inputs - Where the frame sits * @returns A new frame * @group create * @shortname xy * @drawable true * @example * ```typescript * const floor = bitbybit.frame.xy({ origin: [0, 0, 2] }); * ``` */ xy(inputs: Inputs.Frame.OriginDto): Inputs.Base.Frame; /** * Builds a frame lying in the YZ plane: its X axis along the world Y, its Y axis along the * world Z and its normal along the world X. * @param inputs - Where the frame sits * @returns A new frame * @group create * @shortname yz * @drawable true * @example * ```typescript * const side = bitbybit.frame.yz({ origin: [3, 0, 0] }); * ``` */ yz(inputs: Inputs.Frame.OriginDto): Inputs.Base.Frame; /** * Builds a frame lying in the ZX plane, the ground when Y points up: its X axis along the world * Z, its Y axis along the world X and its normal along the world Y. * @param inputs - Where the frame sits * @returns A new frame * @group create * @shortname zx * @drawable true * @example * ```typescript * const ground = bitbybit.frame.zx({ origin: [0, 0, 0] }); * ``` */ zx(inputs: Inputs.Frame.OriginDto): Inputs.Base.Frame; /** * Builds a frame from three points: where it sits, a point its X axis runs toward and a point * on the side its Y axis points to. * * The normal follows by the right-hand rule. `xPoint` at `origin`, or three points on one line, * throws. * @param inputs - The origin, a point along the X axis and a point in the plane * @returns A new frame * @group create * @shortname from three points * @drawable true * @example * ```typescript * const frame = bitbybit.frame.fromThreePoints({ origin: [0, 0, 0], xPoint: [4, 0, 0], planePoint: [0, 0, -3] }); * ``` */ fromThreePoints(inputs: Inputs.Frame.ThreePointsDto): Inputs.Base.Frame; /** * Builds a frame from a point and a normal, choosing its X axis by a fixed rule. * * The same normal always gives the same X axis: square to the normal and to the world axis the * normal leans on least. A normal of zero length throws. * @param inputs - The origin and the normal * @returns A new frame * @group create * @shortname from point and normal * @drawable true * @example * ```typescript * const onSlope = bitbybit.frame.fromPointAndNormal({ origin: [2, 1, 0], normal: [0, 1, 1] }); * ``` */ fromPointAndNormal(inputs: Inputs.Frame.PointAndNormalDto): Inputs.Base.Frame; /** * Fits a frame to points that lie on or near one plane. * * It sits at their average. The normal follows their order by the right-hand rule, and X runs * along their widest spread, toward the first point; with no widest spread, as around a square, * X points at the first point. Fewer than three points, or nearly collinear ones, throw. * @param inputs - The points to fit * @returns A new frame in the plane that fits the points best * @group create * @shortname best fit * @drawable true * @example * ```typescript * const frame = bitbybit.frame.bestFit({ points: [[0, 0, 0], [4, 0.1, 0], [4, 3, 0.1], [0, 3, 0]] }); * ``` */ bestFit(inputs: Inputs.Frame.BestFitDto): Inputs.Base.Frame; /** * Reads where a frame sits: the point its three axes start from. * @param inputs - The frame to read * @returns The origin * @group read * @shortname origin * @drawable true */ origin(inputs: Inputs.Frame.FrameDto): Inputs.Base.Point3; /** * Reads where a frame's Z axis points, as a vector of length 1. * @param inputs - The frame to read * @returns The normal * @group read * @shortname normal * @drawable false */ normal(inputs: Inputs.Frame.FrameDto): Inputs.Base.Vector3; /** * Reads where a frame's X axis points, as a vector of length 1 square to the normal. * @param inputs - The frame to read * @returns The X direction * @group read * @shortname direction * @drawable false */ direction(inputs: Inputs.Frame.FrameDto): Inputs.Base.Vector3; /** * Reads where a frame's Y axis points: the normal crossed with the direction, as a vector of * length 1. * @param inputs - The frame to read * @returns The Y direction * @group read * @shortname y direction * @drawable false */ yDirection(inputs: Inputs.Frame.FrameDto): Inputs.Base.Vector3; /** * Moves a frame by a vector in world coordinates, keeping the directions of its axes. * @param inputs - The frame and the vector to move it by * @returns A new frame * @group change * @shortname translate * @drawable true * @example * ```typescript * const moved = bitbybit.frame.translate({ frame: bitbybit.frame.world(), translation: [2, 0, 1] }); * ``` */ translate(inputs: Inputs.Frame.TranslateDto): Inputs.Base.Frame; /** * Moves frames by one vector in world coordinates, as `translate` moves one; their axes keep * their directions. * @param inputs - The frames and the vector to move them by * @returns New frames, in the same order * @group change * @shortname translate frames * @drawable true * @example * ```typescript * const floor = bitbybit.frame.grid({ countX: 3, countY: 3, spacingX: 2, spacingY: 2, centered: true }); * const ceiling = bitbybit.frame.translateFrames({ frames: floor, translation: [0, 0, 3] }); * ``` */ translateFrames(inputs: Inputs.Frame.TranslateFramesDto): Inputs.Base.Frame[]; /** * Moves a frame along its own normal, keeping the directions of its axes. * * A negative distance moves it against the normal. * @param inputs - The frame and the distance in model units * @returns A new frame * @group change * @shortname offset * @drawable true * @example * ```typescript * const lid = bitbybit.frame.offset({ frame: bitbybit.frame.zx({ origin: [0, 0, 0] }), distance: 10 }); * ``` */ offset(inputs: Inputs.Frame.OffsetDto): Inputs.Base.Frame; /** * Moves each frame along its own normal by the same distance, as `offset` moves one; their * axes keep their directions. * * Frames facing different ways move different ways: a negative distance moves each against its * own normal. * @param inputs - The frames and the distance in model units * @returns New frames, in the same order * @group change * @shortname offset frames * @drawable true * @example * ```typescript * const ring = bitbybit.frame.polar({ count: 8, radius: 5, angle: 360, startAngle: 0, rotate: true }); * const raised = bitbybit.frame.offsetFrames({ frames: ring, distance: 2 }); * ``` */ offsetFrames(inputs: Inputs.Frame.OffsetFramesDto): Inputs.Base.Frame[]; /** * Turns a frame about one of its own axes, through its origin. * * The angle is in degrees; positive is counter-clockwise when that axis points toward you. * @param inputs - The frame, the axis to turn about and the angle * @returns A new frame * @group change * @shortname rotate * @drawable true * @example * ```typescript * const tilted = bitbybit.frame.rotate({ frame: bitbybit.frame.world(), axis: Bit.Inputs.Frame.frameAxisEnum.x, angle: 30 }); * ``` */ rotate(inputs: Inputs.Frame.RotateDto): Inputs.Base.Frame; /** * Turns each frame about one of its own axes, through its own origin, as `rotate` turns one. * * The angle is in degrees; positive is counter-clockwise when that axis points toward you. * @param inputs - The frames, the axis to turn each about and the angle * @returns New frames, in the same order * @group change * @shortname rotate frames * @drawable true * @example * ```typescript * const row = bitbybit.frame.grid({ countX: 4, countY: 1, spacingX: 2, spacingY: 2, centered: true }); * const tilted = bitbybit.frame.rotateFrames({ frames: row, axis: Bit.Inputs.Frame.frameAxisEnum.x, angle: 30 }); * ``` */ rotateFrames(inputs: Inputs.Frame.RotateFramesDto): Inputs.Base.Frame[]; /** * Turns a frame over: its normal points the other way and its Y axis with it, its origin and X * axis stay. * @param inputs - The frame to turn over * @returns A new frame * @group change * @shortname flip * @drawable true * @example * ```typescript * const underside = bitbybit.frame.flip({ frame: bitbybit.frame.zx({ origin: [0, 0, 0] }) }); * ``` */ flip(inputs: Inputs.Frame.FrameDto): Inputs.Base.Frame; /** * Turns each frame over, as `flip` turns one: its normal and Y axis point the other way, its * origin and X axis stay. * @param inputs - The frames to turn over * @returns New frames, in the same order * @group change * @shortname flip frames * @drawable true * @example * ```typescript * const tops = bitbybit.frame.grid({ countX: 2, countY: 2, spacingX: 3, spacingY: 3, centered: true }); * const bottoms = bitbybit.frame.flipFrames({ frames: tops }); * ``` */ flipFrames(inputs: Inputs.Frame.FramesDto): Inputs.Base.Frame[]; /** * Places a frame given in another frame's coordinates into the world: a frame within a frame. * * `child` is read as if `parent` were the world, so a `child` at the origin sits on `parent` * and one lifted along Z rises along the parent's normal. * @param inputs - The parent frame and the child frame given in its coordinates * @returns The child frame in world coordinates * @group frame in frame * @shortname frame to world * @drawable true * @example * ```typescript * const table = bitbybit.frame.zx({ origin: [0, 1, 0] }); * const onTable = bitbybit.frame.frameToWorld({ parent: table, child: bitbybit.frame.xy({ origin: [0.5, 0.2, 0] }) }); * ``` */ frameToWorld(inputs: Inputs.Frame.ChildFrameDto): Inputs.Base.Frame; /** * Places frames given in one parent frame's coordinates into the world, as `frameToWorld` * places one: every child sits on `parent` as it would sit on the world. * @param inputs - The parent frame and the frames given in its coordinates * @returns The frames in world coordinates, in the same order * @group frame in frame * @shortname frames to world * @drawable true * @example * ```typescript * const table = bitbybit.frame.zx({ origin: [0, 1, 0] }); * const spots = bitbybit.frame.grid({ countX: 3, countY: 2, spacingX: 0.4, spacingY: 0.4, centered: true }); * const onTable = bitbybit.frame.framesToWorld({ parent: table, children: spots }); * ``` */ framesToWorld(inputs: Inputs.Frame.ChildFramesDto): Inputs.Base.Frame[]; /** * Describes a frame given in world coordinates in another frame's coordinates, the reverse of * `frameToWorld`. * * The result is where `child` sits and how it turns as seen from `parent`, as if `parent` were * the world. * @param inputs - The parent frame and the child frame in world coordinates * @returns The child frame in the parent's coordinates * @group frame in frame * @shortname frame to local * @drawable true * @example * ```typescript * const table = bitbybit.frame.zx({ origin: [0, 1, 0] }); * const seenFromTable = bitbybit.frame.frameToLocal({ parent: table, child: bitbybit.frame.world() }); * ``` */ frameToLocal(inputs: Inputs.Frame.ChildFrameDto): Inputs.Base.Frame; /** * Describes frames given in world coordinates in one parent frame's coordinates, the reverse * of `framesToWorld`, as `frameToLocal` describes one. * @param inputs - The parent frame and the frames in world coordinates * @returns The frames in the parent's coordinates, in the same order * @group frame in frame * @shortname frames to local * @drawable true * @example * ```typescript * const table = bitbybit.frame.zx({ origin: [0, 1, 0] }); * const seen = bitbybit.frame.framesToLocal({ parent: table, children: [bitbybit.frame.world(), bitbybit.frame.yz({ origin: [2, 0, 0] })] }); * ``` */ framesToLocal(inputs: Inputs.Frame.ChildFramesDto): Inputs.Base.Frame[]; /** * Converts a point given in a frame's coordinates into world coordinates. * * `[1, 2, 3]` becomes the point 1 along the frame's X axis, 2 along its Y axis and 3 along its * normal, from its origin. * @param inputs - The frame and the point in its coordinates * @returns The point in world coordinates * @group coordinates * @shortname point to world * @drawable true * @example * ```typescript * const corner = bitbybit.frame.pointToWorld({ frame: bitbybit.frame.zx({ origin: [0, 2, 0] }), point: [1, 1, 0] }); * ``` */ pointToWorld(inputs: Inputs.Frame.FramePointDto): Inputs.Base.Point3; /** * Converts a point given in world coordinates into a frame's coordinates, the reverse of * `pointToWorld`. * * The third coordinate of the result is the point's signed distance from the frame's plane. * @param inputs - The frame and the point in world coordinates * @returns The point in the frame's coordinates * @group coordinates * @shortname point to local * @drawable true * @example * ```typescript * const local = bitbybit.frame.pointToLocal({ frame: bitbybit.frame.zx({ origin: [0, 2, 0] }), point: [1, 5, 1] }); * ``` */ pointToLocal(inputs: Inputs.Frame.FramePointDto): Inputs.Base.Point3; /** * Converts points given in a frame's coordinates into world coordinates, as `pointToWorld` does * for one. * @param inputs - The frame and the points in its coordinates * @returns The points in world coordinates, in the same order * @group coordinates * @shortname points to world * @drawable true * @example * ```typescript * const square = bitbybit.frame.pointsToWorld({ frame: bitbybit.frame.yz({ origin: [3, 0, 0] }), points: [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]] }); * ``` */ pointsToWorld(inputs: Inputs.Frame.FramePointsDto): Inputs.Base.Point3[]; /** * Converts points given in world coordinates into a frame's coordinates, as `pointToLocal` does * for one. * @param inputs - The frame and the points in world coordinates * @returns The points in the frame's coordinates, in the same order * @group coordinates * @shortname points to local * @drawable true * @example * ```typescript * const flat = bitbybit.frame.pointsToLocal({ frame: bitbybit.frame.yz({ origin: [3, 0, 0] }), points: [[3, 0, 0], [3, 1, 0], [3, 1, 1]] }); * ``` */ pointsToLocal(inputs: Inputs.Frame.FramePointsDto): Inputs.Base.Point3[]; /** * Turns a vector given along a frame's axes into one along the world axes; the frame's origin * plays no part. * @param inputs - The frame and the vector along its axes * @returns The vector along the world axes * @group coordinates * @shortname vector to world * @drawable false * @example * ```typescript * const up = bitbybit.frame.vectorToWorld({ frame: bitbybit.frame.zx({ origin: [0, 0, 0] }), vector: [0, 0, 1] }); * ``` */ vectorToWorld(inputs: Inputs.Frame.FrameVectorDto): Inputs.Base.Vector3; /** * Turns a vector given along the world axes into one along a frame's axes, the reverse of * `vectorToWorld`. * @param inputs - The frame and the vector along the world axes * @returns The vector along the frame's axes * @group coordinates * @shortname vector to local * @drawable false * @example * ```typescript * const local = bitbybit.frame.vectorToLocal({ frame: bitbybit.frame.zx({ origin: [0, 0, 0] }), vector: [0, 1, 0] }); * ``` */ vectorToLocal(inputs: Inputs.Frame.FrameVectorDto): Inputs.Base.Vector3; /** * Gives the transformation that moves anything from the world frame onto a frame. * * It takes the world origin to the frame's origin and the world axes to the frame's axes, and * comes as a list holding one matrix, the form every transformation input takes. * @param inputs - The frame * @returns The transformation onto the frame * @group matrices * @shortname to matrix * @drawable false * @example * ```typescript * const onFrame = bitbybit.frame.toMatrix({ frame: bitbybit.frame.zx({ origin: [0, 2, 0] }) }); * const moved = bitbybit.point.transformPoints({ points: [[1, 0, 0]], transformation: onFrame }); * ``` */ toMatrix(inputs: Inputs.Frame.FrameDto): Inputs.Base.TransformMatrixes; /** * Reads the frame a transformation puts the world frame on: where it moves the world origin * and where it turns the world X and Z axes. * * Scaling is dropped, a shear keeps the Z axis and squares X to it, and a mirror keeps X and Z * with the Y axis that follows from them. A perspective part throws. * @param inputs - The transformation * @returns A new frame * @group matrices * @shortname from matrix * @drawable true * @example * ```typescript * const turned = bitbybit.transforms.rotationCenterAxis({ center: [0, 0, 0], axis: [0, 1, 0], angle: 45 }); * const frame = bitbybit.frame.fromMatrix({ transformation: turned }); * ``` */ fromMatrix(inputs: Inputs.Frame.TransformationDto): Inputs.Base.Frame; /** * Gives the transformation that carries anything placed on one frame onto another, turning it * the same way. * * Left out, `from` is the world frame, which makes this `toMatrix` of `to`. The result is a list * holding one matrix. * @param inputs - The frame to move onto and the frame to move from * @returns The transformation from `from` onto `to` * @group matrices * @shortname matrix from to * @drawable false * @example * ```typescript * const from = bitbybit.frame.xy({ origin: [0, 0, 0] }); * const to = bitbybit.frame.zx({ origin: [0, 3, 0] }); * const carry = bitbybit.frame.matrixFromTo({ to, from }); * ``` */ matrixFromTo(inputs: Inputs.Frame.FromToDto): Inputs.Base.TransformMatrixes; /** * Lays out a rectangular grid of frames in a frame's plane, each turned the same way as that * frame. * * The frames come row by row, along X first. Left out, `frame` is the world frame, so the grid * lies in the XY plane. * @param inputs - The frame to follow, the counts and spacings, and whether to center the grid * @returns The frames of the grid * @group patterns * @shortname grid * @drawable true * @example * ```typescript * const spots = bitbybit.frame.grid({ frame: bitbybit.frame.zx({ origin: [0, 0, 0] }), countX: 4, countY: 3, spacingX: 2, spacingY: 2, centered: true }); * ``` */ grid(inputs: Inputs.Frame.GridDto): Inputs.Base.Frame[]; /** * Lays out a ring of frames around a frame's normal, in its plane. * * Each is `frame` turned by its angle about the normal and moved out by `radius` along its * turned X axis. A full turn spaces them evenly, a smaller `angle` puts one at each end, and a * larger one throws. Left out, `frame` is the world frame. * @param inputs - The frame to turn around, the count, radius, angles and whether frames turn * @returns The frames of the ring, in the direction of the angle * @group patterns * @shortname polar * @drawable true * @example * ```typescript * const bolts = bitbybit.frame.polar({ frame: bitbybit.frame.zx({ origin: [0, 0, 0] }), count: 8, radius: 5, angle: 360, startAngle: 0, rotate: true }); * ``` */ polar(inputs: Inputs.Frame.PolarDto): Inputs.Base.Frame[]; /** * Lays out a honeycomb of frames in a frame's plane, one at each hexagon's center, turned as * that frame is. * * The hexagons have corners toward the frame's Y axis and flat sides toward X. Rows run along X, * every second shifted by half a hexagon, and frames come row by row. Left out, `frame` is the * world frame. * @param inputs - The frame to follow, the counts, the hexagon size and whether to center it * @returns The frames of the honeycomb * @group patterns * @shortname hex grid * @drawable true * @example * ```typescript * const cells = bitbybit.frame.hexGrid({ frame: bitbybit.frame.zx({ origin: [0, 0, 0] }), countX: 5, countY: 4, radius: 1, centered: true }); * ``` */ hexGrid(inputs: Inputs.Frame.HexGridDto): Inputs.Base.Frame[]; private alongWidest; private towardFirstPoint; private translated; private offsetBy; private turned; private flipped; private combined; private withLargestPositive; private matrixBetween; private axesOf; private axesOfEach; private axisOf; private squared; private frameOf; private pointOf; private vectorOf; private pointsOf; private numberOf; private countOf; } 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; } type Point3 = Inputs.Base.Point3; declare const arcThroughThreePoints: (start: Point3, middle: Point3, end: Point3) => ThreePointArc | undefined; declare const pointsOnArc: (arc: ThreePointArc, start: Point3, end: Point3, segments: number) => Point3[]; declare function crc32(data: Uint8Array): number; 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; private generateHeader; private generateTables; private generateLineTypeTable; private generateStyleTable; private generateVportTable; private generateViewTable; private generateUcsTable; private generateAppidTable; private generateDimstyleTable; private generateBlocks; private generateLayerTable; private generateEntities; private generateSegmentEntity; private isLineSegment; private isArcSegment; private isCircleSegment; private isPolylineSegment; private isSplineSegment; private generateLineEntity; private generateCircleEntity; private generateArcEntity; private generatePolylineEntity; private generateSplineEntity; private isClosedPolyline; private getNextHandle; private convertColorToDxf; 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; } type Vec3 = Inputs.Base.Vector3; /** * The sine below which two directions count as parallel wherever a frame is squared: a direction * closer than this to its normal leaves the X axis to rounding. */ declare const PARALLEL_SINE = 1e-9; /** * A frame as the four vectors the maths reads: the origin and three unit axes at right angles, * with `y` the cross product of `z` and `x`. */ interface FrameAxes { readonly origin: Vec3; readonly x: Vec3; readonly y: Vec3; readonly z: Vec3; } /** Whether a value is three finite numbers. */ declare const isTriple: (value: unknown) => value is Vec3; /** Whether a value has the shape of a frame: an `origin`, a `normal` and a `direction`, three finite numbers each. */ declare const isFrameShaped: (value: unknown) => value is Inputs.Base.Frame; /** * A vector scaled to length 1, or undefined for one of no length. It is divided by its largest * component before it is measured, so no square overflows or underflows at any finite size. */ declare const unitOf: (vector: Vec3) => Vec3 | undefined; /** * The axes of an origin, a normal and a rough X direction: the normal scaled to length 1 and the * direction turned square to it. Gives the name of the part that cannot be squared instead: a * normal of no length, or a direction of no length or within `PARALLEL_SINE` of the normal. * * The direction is projected twice: a direction close to the normal loses most of its digits to * the first subtraction, and the second takes out what rounding left along the normal. */ declare const squareFrame: (origin: Vec3, normal: Vec3, direction: Vec3) => FrameAxes | "normal" | "direction"; declare const WORLD_AXES: FrameAxes; declare const vectorToWorld: (axes: FrameAxes, vector: Vec3) => Vec3; declare const pointToWorld: (axes: FrameAxes, point: Vec3) => Vec3; declare const vectorToLocal: (axes: FrameAxes, vector: Vec3) => Vec3; declare const pointToLocal: (axes: FrameAxes, point: Vec3) => Vec3; declare const composeAxes: (parent: FrameAxes, child: FrameAxes) => FrameAxes; declare const relativeAxes: (parent: FrameAxes, child: FrameAxes) => FrameAxes; declare const axesToMatrix: (axes: FrameAxes) => Inputs.Base.TransformMatrix; interface ThreePointArc { readonly center: Inputs.Base.Point3; readonly x: Inputs.Base.Vector3; readonly y: Inputs.Base.Vector3; readonly radius: number; readonly sweep: number; } interface CreasedMesh { readonly positions: Float32Array; readonly normals: Float32Array; readonly indices: Uint32Array; } interface MeshArrays { readonly positions: number[]; readonly indices: number[]; } interface HuffmanTable { readonly entries: Int32Array; readonly bits: number; } interface ZipEntry { readonly name: string; readonly method: number; readonly crc32: number; readonly compressedSize: number; readonly size: number; readonly localOffset: number; readonly encrypted: boolean; } interface RefinedSurfaceMesh { readonly positions: Inputs.Base.Point3[]; readonly triangles: number[]; } declare const MAX_CODE_BITS = 15; declare const SYMBOL_SHIFT = 4; declare const LENGTH_MASK = 15; declare const BYTE_BITS = 8; declare const REFILL_BELOW = 24; declare const STORED_BLOCK = 0; declare const FIXED_BLOCK = 1; declare const DYNAMIC_BLOCK = 2; declare const BLOCK_TYPE_BITS = 2; declare const END_OF_BLOCK = 256; declare const FIRST_LENGTH_SYMBOL = 257; declare const LITERAL_LENGTH_SYMBOLS = 288; declare const DISTANCE_SYMBOLS = 32; declare const FIXED_LITERAL_BITS: readonly [ 8, 9, 7, 8 ]; declare const FIXED_LITERAL_ENDS: readonly [ 144, 256, 280, 288 ]; declare const FIXED_DISTANCE_BITS = 5; declare const STORED_HEADER_BYTES = 4; declare const UINT16_MASK = 65535; declare const HLIT_BITS = 5; declare const HDIST_BITS = 5; declare const HCLEN_BITS = 4; declare const HLIT_BASE = 257; declare const HDIST_BASE = 1; declare const HCLEN_BASE = 4; declare const CODE_LENGTH_BITS = 3; declare const CODE_LENGTH_SYMBOLS = 19; declare const REPEAT_PREVIOUS = 16; declare const REPEAT_ZERO_SHORT = 17; declare const REPEAT_PREVIOUS_BITS = 2; declare const REPEAT_PREVIOUS_BASE = 3; declare const REPEAT_ZERO_SHORT_BITS = 3; declare const REPEAT_ZERO_SHORT_BASE = 3; declare const REPEAT_ZERO_LONG_BITS = 7; declare const REPEAT_ZERO_LONG_BASE = 11; declare const INITIAL_OUTPUT: number; declare const CODE_LENGTH_ORDER: Uint8Array; declare const LENGTH_BASE: Uint16Array; declare const LENGTH_EXTRA: Uint8Array; declare const DISTANCE_BASE: Uint16Array; declare const DISTANCE_EXTRA: Uint8Array; declare const STORED_LENGTH_BYTES = 2; declare function huffmanTable(lengths: ArrayLike): HuffmanTable; declare function inflateRaw(data: Uint8Array, expectedSize?: number): Uint8Array; declare const RIGID_TOLERANCE = 1e-7; declare const LINEAR_COLUMN_STARTS: readonly [ 0, 4, 8 ]; type Vec3 = Inputs.Base.Vector3; /** Whether a value is one column-major 4 x 4 matrix: sixteen finite numbers. */ declare const isTransformMatrix: (value: unknown) => value is Inputs.Base.TransformMatrix; /** The product of two column-major 4 x 4 matrices: `first` applied, then `second`. */ declare const followedBy: (first: readonly number[], second: readonly number[]) => Inputs.Base.TransformMatrix; /** The determinant of a column-major 4 x 4 matrix's rotation and scale part: negative when it mirrors, near zero when it flattens. */ declare const linearDeterminant: (matrix: readonly number[]) => number; /** * Whether a column-major 4 x 4 matrix only turns and moves: its rotation and scale part has columns * of length 1 and at right angles, within `tolerance` on their squared lengths and dot products, and * keeps its handedness. */ declare const isRigidMatrix: (matrix: readonly number[], tolerance?: number) => boolean; /** One column-major 4 x 4 matrix that applies a list of them first to last; the identity for an empty list. */ declare const composed: (matrices: readonly (readonly number[])[]) => Inputs.Base.TransformMatrix; /** * The eigenvalues of a symmetric 3 x 3 matrix, largest first, each with its unit eigenvector, by * cyclic Jacobi rotations; the vectors come out at right angles to each other. */ declare const symmetricEigen: (matrix: readonly (readonly number[])[]) => { value: number; vector: Vec3; }[]; declare const signedVolumeOf: (positions: ArrayLike, indices: ArrayLike, start?: number, end?: number) => number; /** * 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[]; declare const creasedMesh: (positions: ArrayLike, indices: ArrayLike, minSharpAngle: number) => CreasedMesh; declare const ICOSAHEDRON_POINTS: [ number, number, number ][]; declare const ICOSAHEDRON_FACES: [ number, number, number ][]; declare const icosphere: (detail: number) => MeshArrays; declare const frustum: (sides: number, bottomRadius: number, topRadius: number, height: number) => MeshArrays; type Point3 = Inputs.Base.Point3; declare const expandedKnots: (knots: readonly number[], multiplicities: readonly number[]) => number[]; declare const knotDomain: (degree: number, knots: readonly number[]) => [ number, number ]; declare const nurbsCurvePoint: (degree: number, points: readonly Point3[], weights: readonly number[] | undefined, knots: readonly number[], t: number) => Point3; declare const nurbsSurfacePoint: (degrees: readonly [ number, number ], net: readonly (readonly Point3[])[], weights: readonly (readonly number[])[] | undefined, knots: readonly [ readonly number[], readonly number[] ], u: number, v: number) => Point3; type Vec3 = Inputs.Base.Vector3; type Point3 = Inputs.Base.Point3; declare const pathTangents: (points: readonly Point3[], start?: Vec3, end?: Vec3) => Vec3[]; declare const transportedAxes: (points: readonly Point3[], tangents: readonly Vec3[], first: Vec3) => Vec3[]; declare const sweepMatrices: (points: readonly Point3[], tangents: readonly Vec3[], xAxes: readonly Vec3[]) => Inputs.Base.TransformMatrix[]; declare const roundedPath3: (points: readonly Point3[], radius: number, segmentsFor: (sweep: number) => number) => Point3[]; type Point2 = Inputs.Base.Point2; declare const signedArea2: (points: readonly Point2[]) => number; declare const wound2: (points: readonly Point2[], counterClockwise: boolean) => Point2[]; declare const isInsidePolygon2: (point: Point2, outline: readonly Point2[]) => boolean; declare const perimeter2: (points: readonly Point2[]) => number; declare const roundedCorners2: (points: readonly Point2[], radii: readonly number[], segmentsFor: (sweep: number) => number) => Point2[]; type Point2 = Inputs.Base.Point2; type Point3 = Inputs.Base.Point3; declare const refinedSurfaceMesh: (uv: readonly Point2[], positions: readonly Point3[], loops: readonly (readonly number[])[], pointAt: (u: number, v: number) => Point3) => RefinedSurfaceMesh; declare function newellNormal(positions: ArrayLike, loop: readonly number[]): [ number, number, number ]; declare function triangulateFace(positions: ArrayLike, loops: readonly (readonly number[])[]): number[]; type Vec2 = Inputs.Base.Vector2; type Vec3 = Inputs.Base.Vector3; declare const add2: (a: Vec2, b: Vec2) => Vec2; declare const subtract2: (a: Vec2, b: Vec2) => Vec2; declare const scale2: (a: Vec2, factor: number) => Vec2; declare const dot2: (a: Vec2, b: Vec2) => number; declare const cross2: (a: Vec2, b: Vec2) => number; declare const length2: (a: Vec2) => number; declare const leftOf2: (a: Vec2) => Vec2; declare const unit2Of: (a: Vec2) => Vec2 | undefined; declare const add3: (a: Vec3, b: Vec3) => Vec3; declare const subtract3: (a: Vec3, b: Vec3) => Vec3; declare const scale3: (a: Vec3, factor: number) => Vec3; declare const dot3: (a: Vec3, b: Vec3) => number; declare const cross3: (a: Vec3, b: Vec3) => Vec3; declare const length3: (a: Vec3) => number; declare const CRC32_POLYNOMIAL = 3988292384; declare const CRC32_ALL_ONES = 4294967295; declare const BYTE_MASK = 255; declare const BYTE_BITS = 8; declare const BYTE_VALUES = 256; declare const LOCAL_HEADER_SIGNATURE = 67324752; declare const CENTRAL_HEADER_SIGNATURE = 33639248; declare const END_OF_CENTRAL_SIGNATURE = 101010256; declare const END_OF_CENTRAL_SIZE = 22; declare const LONGEST_ARCHIVE_COMMENT = 65535; declare const ZIP64_COUNT = 65535; declare const ZIP64_SIZE = 4294967295; declare const END_ENTRY_COUNT = 10; declare const END_DIRECTORY_SIZE = 12; declare const END_DIRECTORY_OFFSET = 16; declare const CENTRAL_FLAGS = 8; declare const CENTRAL_METHOD = 10; declare const CENTRAL_CRC32 = 16; declare const CENTRAL_COMPRESSED_SIZE = 20; declare const CENTRAL_SIZE = 24; declare const CENTRAL_NAME_LENGTH = 28; declare const CENTRAL_EXTRA_LENGTH = 30; declare const CENTRAL_COMMENT_LENGTH = 32; declare const CENTRAL_LOCAL_OFFSET = 42; declare const CENTRAL_HEADER_SIZE = 46; declare const LOCAL_NAME_LENGTH = 26; declare const LOCAL_EXTRA_LENGTH = 28; declare const LOCAL_HEADER_SIZE = 30; declare const ENCRYPTED_FLAG = 1; declare const UTF8_NAME_FLAG = 2048; declare const STORED_METHOD = 0; declare const DEFLATED_METHOD = 8; declare const UINT16_BYTES = 2; declare const UINT32_BYTES = 4; declare function isZip(bytes: Uint8Array): boolean; declare function zipEntries(bytes: Uint8Array): ZipEntry[]; declare function zipEntryData(bytes: Uint8Array, entry: ZipEntry): Uint8Array; /** * 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; /** * Cuts a flat polygon, with any holes through it, into triangles. * * Every corner stays a corner of a triangle, so neighbouring polygons give a mesh closed along * the edges they share. The triangles face the way the outline turns, by the right-hand rule; * holes may run either way. * Example: a 4 by 4 square -> two triangles * @param inputs - The outline and its holes * @returns The triangles, each three points * @group polygon * @shortname triangulate polygon * @drawable false * @example * ```typescript * const triangles = bitbybit.mesh.triangulatePolygon({ points: [[0, 0, 0], [4, 0, 0], [4, 4, 0], [0, 4, 0]], holes: [[[1, 1, 0], [3, 1, 0], [3, 3, 0], [1, 3, 0]]] }); * ``` */ triangulatePolygon(inputs: Inputs.Mesh.PolygonWithHolesDto): Inputs.Base.Mesh3; /** * Measures the volume a closed triangle mesh encloses, with a sign: positive when its triangles * face outwards by the right-hand rule, negative when they all face inwards. * * A mesh that is not closed has no inside, and the number it gives means nothing. * Example: a unit cube facing outwards -> 1 * @param inputs - The mesh * @returns The enclosed volume in cubic model units * @group measure * @shortname signed volume * @drawable false * @example * ```typescript * const volume = bitbybit.mesh.signedVolume({ mesh: [[[0, 0, 0], [0, 1, 0], [1, 0, 0]], [[0, 0, 0], [1, 0, 0], [0, 0, 1]], [[0, 0, 0], [0, 0, 1], [0, 1, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1]]] }); * ``` */ signedVolume(inputs: Inputs.Mesh.MeshDto): number; } /** * 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[]; private getRegularHexagonVertices; /** * Lays out points along the circular arc through three points, from the first through the * second to the third. * * The arc is divided into `segments` equal steps between the given ends. Points on one line fix * no arc and come back as they are. * Example: [1,0,0], [0,1,0] and [-1,0,0] in 2 segments -> [[1,0,0], [0,1,0], [-1,0,0]] * @param inputs - The three points and the number of steps * @returns The points along the arc, its ends included * @group create * @shortname arc 3 points * @drawable true * @example * ```typescript * const points = bitbybit.point.arcThroughThreePoints({ start: [5, 0, 0], middle: [0, 5, 0], end: [-5, 0, 0], segments: 16 }); * ``` */ arcThroughThreePoints(inputs: Inputs.Point.ArcThroughThreePointsDto): Inputs.Base.Point3[]; } /** * 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; /** * Finds the unit normal of the plane a polyline encloses, read as a closed outline. * * Newell's method makes it hold for an outline that is not convex or not quite flat. It points * the way the outline turns by the right-hand rule; an outline with no area gives undefined. * Example: [[0,0,0], [4,0,0], [4,4,0], [0,4,0]] -> [0, 0, 1] * @param inputs - The polyline * @returns The unit normal, or undefined * @group polygon * @shortname polygon normal * @drawable false * @example * ```typescript * const normal = bitbybit.polyline.polygonNormal({ polyline: { points: [[0, 0, 0], [4, 0, 0], [4, 4, 0], [0, 4, 0]] } }); * ``` */ polygonNormal(inputs: Inputs.Polyline.PolylineDto): Inputs.Base.Vector3 | undefined; /** * Measures the area a polyline encloses, read as a closed outline in its own plane. * * The polyline need not repeat its first point at its end. An outline that is not quite flat * gives the area of its outline seen along its normal. * Example: [[0,0,0], [4,0,0], [4,4,0], [0,4,0]] -> 16 * @param inputs - The polyline * @returns The area in square model units * @group polygon * @shortname polygon area * @drawable false * @example * ```typescript * const area = bitbybit.polyline.polygonArea({ polyline: { points: [[0, 0, 0], [4, 0, 0], [4, 4, 0], [0, 4, 0]] } }); * ``` */ polygonArea(inputs: Inputs.Polyline.PolylineDto): number; private newellOf; } /** * 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; 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; private convertEscapeSequences; } /** * A model's geometry: everything `geometry` offers in the IFC worker, plus `toShapes`, `toDocument` * and `toStep`, which hand the model's recipe to OpenCascade, so circles stay circles and the * results measure, cut and export like any other shape. They need both the IFC and the OCCT workers. * @beta */ declare class IFCWGeometry extends IFCGeometry { private readonly occt; /** * Builds a model's elements as OpenCascade shapes, one per element in the order * `geometry.recipe` lists them, each placed where the model puts it, in the model's units. * * An element the kernel cannot build comes back as an empty compound unless `emptyWhenFailed` * is false; `geometry.unsupported` lists the elements the recipe leaves out. * @param inputs - The model, the elements, whether Z turns into Y, whether a failed element stops the build, and how meshes are built * @returns One shape per element * @group recipes * @shortname to shapes * @drawable true * @example * ```typescript * const shapes = await bitbybit.ifc.geometry.toShapes({ model }); * await bitbybit.draw.drawAnyAsync({ entity: shapes }); * ``` */ toShapes(inputs: Inputs.IFC.GeometryToShapesDto): Promise; /** * Builds a model's elements into an OpenCascade assembly document for STEP or glTF: a product * per element with its GlobalId and IFC type as properties, nested in its site, building and * storey, by IFC class unless `groupByClass` is false, one part per type placed many times. * * Millimetres unless STEP can state the model's unit; delete it with * `occt.assembly.manager.deleteDocument`. * @param inputs - The model, the elements, the top assembly's name, whether a failed element stops the build, how meshes are built, and whether storeys are grouped by class * @returns The document handle * @group recipes * @shortname to document * @drawable false * @example * ```typescript * const document = await bitbybit.ifc.geometry.toDocument({ model, name: "House" }); * const gltf = await bitbybit.occt.assembly.manager.exportDocumentToGltf({ document, fileName: "house.glb" }); * await bitbybit.occt.assembly.manager.deleteDocument({ document }); * ``` */ toDocument(inputs: Inputs.IFC.GeometryToDocumentDto): Promise; /** * Writes a model's elements as a STEP file of OpenCascade shapes, as `toDocument` builds them, * and gives back its bytes. * * Elements stored as triangle meshes are written as tessellated geometry unless `facetedMeshes` * is set. A model of a million mesh triangles writes some 280 MB of STEP and needs the 64-bit * kernel, or the elements written in parts. * @param inputs - The model, the elements, the top assembly's name, the file name, whether a failed element stops the export, how meshes are built, compression, download and whether storeys are grouped by class * @returns The STEP file's bytes * @group recipes * @shortname to step * @drawable false * @example * ```typescript * const step = await bitbybit.ifc.geometry.toStep({ model, name: "House", fileName: "house.step", tryDownload: true }); * console.log(step.length); * ``` */ toStep(inputs: Inputs.IFC.GeometryToStepDto): Promise; } /** * IFC building models as reached from a script: every method of the `ifc` worker, asynchronous, * with models living in the worker and passed around as references, plus `geometry.toShapes`, * `geometry.toDocument` and `geometry.toStep`, which build a model's elements with OpenCascade. * In Node, or anywhere without workers, the IFC package's `IFCService` has the same methods, * synchronous and with models as values; there those three are `geometry.recipe` handed to the * OpenCascade kernel's `recipes.build` or `recipes.buildDocument`. * Experimental, as the IFC library is. * @beta */ declare class IFCW extends IFCBitByBit { readonly geometry: IFCWGeometry; } /** * 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; } /** * Advanced modeling tools that do in one call what would take many steps: `text3d` builds text as * shapes from font outlines, and `patterns` lays a repeating pattern across faces. Both build their * results as shapes, which the rest of the library can transform, combine and draw like any other. */ declare class AdvancedAdv { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; text3d: Text3D; patterns: Patterns; } /** * Patterns laid out over each face's own UV parameter space, so the cells follow the curvature of the surface * rather than a flat grid projected onto it. `pyramidSimple` raises a four-sided pyramid on every cell of * such a grid. */ declare class FacePatterns { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; pyramidSimple: PyramidSimple; } /** * Covers faces with four-sided pyramids that follow the surface, one per cell of a U by V grid laid evenly * over each face's UV range. The create methods return a pyramid model; the getters read from it the compound * of all pyramids, the cells of each face with their points and triangles, and the polylines of the grid. The * cell getters take a list of cells, which `getAllPyramidCells` and its siblings return. */ declare class PyramidSimple { private readonly occWorkerManager; private readonly context; private readonly draw; /** * Raises a pyramid of the same height on every cell of a U by V grid over each face. * * Each face is split evenly across its UV range into `uNumber` by `vNumber` cells. A cell's apex sits * `height` model units from its center along the averaged surface normal, so a negative height points * against the normal. It computes only for members of the Silver and Gold plans. * @param inputs - The faces, the cell counts along U and V, the pyramid height and the drawing precision * @returns A pyramid model holding the compound of all pyramids and, per face, its cells and grid polylines * @group create * @shortname create simple pyramid * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ createPyramidSimple(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleDto): Promise>; /** * Raises a pyramid on every cell of a U by V grid over each face, with heights shaped by attractor * points. * * A cell whose center lies within an affector's radius gains between `affectMinHeight` for the farthest * and `affectMaxHeight` for the closest affected cell, eased and scaled by the affector's factor, on top * of `defaultHeight`; several affectors add up. It computes only for members of the Silver and Gold * plans. * @param inputs - The faces, cell counts, affectors with their radii and factors, height range and precision * @returns A pyramid model holding the compound of all pyramids and, per face, its cells and grid polylines * @group create * @shortname create simple pyramid affector * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ createPyramidSimpleAffectors(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleAffectorsDto): Promise>; /** * Draws a pyramid model in the scene with white faces and brown edges. * * The compound is meshed with the `precision` the model was created with and drawn with opaque white * faces under a new entity in the scene. * @param inputs - A pyramid model from one of the create methods * @returns A new PlayCanvas entity holding the drawn pyramids * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleData): Promise; /** * Returns the single compound that holds every pyramid on every face of a pyramid model. * @param inputs - A pyramid model from one of the create methods * @returns The compound of all pyramids * @group get shapes * @shortname get compound * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCompoundShape(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns the compound of the pyramids on one face of a pyramid model. * * Faces are counted from 0 in the order they were given to the create method. An index past the last face * throws. * @param inputs - A pyramid model and the 0-based face index * @returns The compound of the pyramids on that face * @group get shapes * @shortname get compound on face * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCompoundShapeOnFace(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns the pyramid of one cell on one face as a compound of its triangular sides. * * `uIndex` and `vIndex` count cells from 0 and must stay below the `uNumber` and `vNumber` the model was * created with. A face or cell index out of range throws. * @param inputs - A pyramid model, the 0-based face index and the cell's U and V indexes * @returns The compound of the cell's pyramid * @group get shapes * @shortname get compound cell on face * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCompoundShapeCellOnFace(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceCellIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns the cells of every face of a pyramid model as one flat list, face after face. * * Each cell holds its U and V index, its corner, center and apex points and its shapes; pass the list, or * part of it, to the getters that read from cells. * @param inputs - A pyramid model from one of the create methods * @returns The cells of all faces * @group get cells * @shortname get all cells * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Returns the cells of one face of a pyramid model. * * Cells are ordered by U index and then by V index within it. An index past the last face throws. * @param inputs - A pyramid model and the 0-based face index * @returns The cells of that face * @group get cells * @shortname get cells on face * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidCellsOnFace(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Returns the cells of one face of a pyramid model, the same list `getAllPyramidCellsOnFace` returns. * * Cells are ordered by U index and then by V index within it. An index past the last face throws. * @param inputs - A pyramid model and the 0-based face index * @returns The cells of that face * @group get cells * @shortname get cells on face * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidUCellsOnFace(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Returns the cells of one face that share a U index, a row of cells running along V. * * The cells come in V order, and a U index with no cells gives an empty list. An index past the last face * throws. * @param inputs - A pyramid model, the 0-based face index and the U index of the row * @returns The cells at that U index * @group get cells * @shortname get cells on face at u * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidUCellsOnFaceAtU(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceCellsUIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Returns the cells of one face that share a V index, a row of cells running along U. * * The cells come in U order, and a V index with no cells gives an empty list. An index past the last face * throws. * @param inputs - A pyramid model, the 0-based face index and the V index of the row * @returns The cells at that V index * @group get cells * @shortname get cells on face at v * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getAllPyramidUCellsOnFaceAtV(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceCellsVIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart[]; /** * Returns the cell at one U and V index on one face of a pyramid model. * * `uIndex` and `vIndex` count cells from 0 and must stay below the `uNumber` and `vNumber` the model was * created with. A face or cell index out of range throws. * @param inputs - A pyramid model, the 0-based face index and the cell's U and V indexes * @returns The cell with its points and shapes * @group get cell * @shortname get cell * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getCellOnIndex(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceCellIndexDto): Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleCellPart; /** * Returns the apex point of each given cell. * * The apex lies above the cell's center along the averaged surface normal, at the cell's pyramid height. * @param inputs - The cells to read * @returns One apex point per cell * @group get from cells * @shortname get top points * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getTopPointsOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.Base.Point3[]; /** * Returns the center of each given cell, the average of its four corner points. * * On a curved face this average can sit slightly off the surface. * @param inputs - The cells to read * @returns One center point per cell * @group get from cells * @shortname get center points * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCenterPointsOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.Base.Point3[]; /** * Returns the four corner points of each given cell. * * Corner 1 sits at the cell's own U and V step, corner 2 one step further along U, corner 3 one step * further along both and corner 4 one step further along V, so the corners go around the cell. * @param inputs - The cells to read * @returns Four corner points per cell * @group get from cells * @shortname get corner points of cells * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getCornerPointsOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.Base.Point3[][]; /** * Returns one chosen corner point of each given cell. * * `index` 0 to 3 picks corners 1 to 4, in the order `getCornerPointsOfCells` returns them; any other * index throws. * @param inputs - The cells and the 0-based corner index * @returns One corner point per cell * @group get from cells * @shortname get corner point of cells * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCornerPointOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsIndexDto): Inputs.Base.Point3[]; /** * Returns the surface normal stored at one chosen corner of each given cell. * * `index` 0 to 3 picks corners 1 to 4, in the order `getCornerPointsOfCells` returns them. Any other * index, or a cell without that normal, throws. * @param inputs - The cells and the 0-based corner index * @returns One normal per cell * @group get from cells * @shortname get corner normal of cells * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getCornerNormalOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsIndexDto): Inputs.Base.Point3[]; /** * Returns the surface normals stored at the corners of each given cell. * * The normals follow the corner order of `getCornerPointsOfCells`, and a corner without a stored normal * is left out of its cell's list. * @param inputs - The cells to read * @returns The corner normals of each cell * @group get from cells * @shortname get corner normals of cells * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable false */ getCornerNormalsOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.Base.Point3[][]; /** * Returns the pyramid of each given cell as a compound of its triangular sides. * @param inputs - The cells to read * @returns One compound per cell * @group get from cells * @shortname get compound shapes * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getCompoundShapesOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Returns one triangular side of each given cell's pyramid. * * `index` 0 to 3 picks the side standing on the cell edge from corner 1 to 2, from 2 to 3, from 3 to 4 or * from 4 to 1. A side whose two corners coincide, as where a face narrows to a point, is not built, and * asking for it throws, as does any other index. * @param inputs - The cells and the 0-based side index * @returns One triangular face per cell * @group get from cells * @shortname get face shapes * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getFaceShapesOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsIndexDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Returns the closed triangular outline of one side of each given cell's pyramid. * * `index` picks the side as in `getFaceShapesOfCells`. A side whose two corners coincide has no outline, * and asking for it throws, as does an index outside 0 to 3. * @param inputs - The cells and the 0-based side index * @returns One closed wire per cell * @group get from cells * @shortname get wire shapes * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getWireShapesOfCells(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelCellsIndexDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Returns the grid polyline at the start of a face's U range, running along V. * * It joins the `vNumber` plus one grid points that share the lowest U value. An index past the last face * throws. * @param inputs - A pyramid model and the 0-based face index * @returns A polyline wire * @group get from face * @shortname get start polyline wire u * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getStartPolylineWireU(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns the grid polyline at the end of a face's U range, running along V. * * It joins the `vNumber` plus one grid points that share the highest U value. An index past the last face * throws. * @param inputs - A pyramid model and the 0-based face index * @returns A polyline wire * @group get from face * @shortname get end polyline wire u * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getEndPolylineWireU(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns the grid polyline at the start of a face's V range, running along U. * * It joins the `uNumber` plus one grid points that share the lowest V value. An index past the last face * throws. * @param inputs - A pyramid model and the 0-based face index * @returns A polyline wire * @group get from face * @shortname get start polyline wire v * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getStartPolylineWireV(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns the grid polyline at the end of a face's V range, running along U. * * It joins the `uNumber` plus one grid points that share the highest V value. An index past the last face * throws. * @param inputs - A pyramid model and the 0-based face index * @returns A polyline wire * @group get from face * @shortname get end polyline wire v * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getEndPolylineWireV(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns every grid polyline of constant U on a face, each running along V, as one compound. * * There are `uNumber` plus one of them, one per grid line. An index past the last face throws. * @param inputs - A pyramid model and the 0-based face index * @returns A compound of polyline wires * @group get from face * @shortname get compound polyline wires u * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getPolylineWiresUCompound(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns every grid polyline of constant V on a face, each running along U, as one compound. * * There are `vNumber` plus one of them, one per grid line. An index past the last face throws. * @param inputs - A pyramid model and the 0-based face index * @returns A compound of polyline wires * @group get from face * @shortname get compound polyline wires v * @image https://bitbybit.dev/files/site/spec-cat/advanced/patterns/pyramid-simple.jpeg * @drawable true */ getPolylineWiresVCompound(inputs: Advanced.Patterns.FacePatterns.PyramidSimple.PyramidSimpleModelFaceIndexDto): Inputs.OCCT.TopoDSShapePointer; } /** * Repeating patterns turned into real shapes on the faces of a model, so textured and faceted surfaces come * out of one call instead of modelling every cell by hand. The patterns under `facePatterns` lay their cells * out in each face's own UV parameter space. 3D text lives beside it in `advanced.text3d`. */ declare class Patterns { private readonly occWorkerManager; private readonly context; private readonly draw; private readonly occt; facePatterns: FacePatterns; } /** * Turns a string into geometry: flat letter faces or extruded letter solids built from the outlines of a * font, either standing free in space or laid onto the surface of a face. Each create method returns a text * model, and the getters here read its whole compound, its characters, their centers and the faces left where * text was cut into a face. Repeating motifs on faces live beside it in `advanced.patterns`. */ declare class Text3D { private readonly occWorkerManager; private readonly context; private readonly draw; /** * Builds a text from one of the shipped fonts as flat letter faces or extruded letter solids. * * The letters are drawn on the XZ plane and extruded along Y by `height` in model units; the text is then * spun by `rotation` degrees about Y, Y is turned to `direction`, and the point picked by * `originAlignment` lands on `origin`. A `height` of 0 returns faces instead of solids. * @param inputs - The text, font, size, extrusion height and placement * @returns A text model holding the compound of all letters, one shape per character and their centers * @group create * @shortname create 3d text * @drawable true */ create(inputs: Advanced.Text3D.Text3DDto): Promise>; /** * Lays a text from one of the shipped fonts onto a face so that it follows the surface. * * The text is drawn in the face's UV space: `fontSize` is measured in the face's real U and V values, not * model units, and `originParamU` and `originParamV` place the anchor as fractions of the face's range. * `faceTextVar` decides whether you get the letters alone, raised letters sewn into the cut face, or the * face with the letters cut out. * @param inputs - The face, text, font, size, height, placement on the face and how the text meets it * @returns A text model holding the result as one shape, one shape per character and any cutout faces * @group create * @shortname create 3d text on face * @drawable true */ createTextOnFace(inputs: Advanced.Text3D.Text3DFaceDto): Promise>; /** * Lays several texts onto one face in a single result, each with its own font, size, placement and style. * * Each entry of `definitions` is placed as `createTextOnFace` places one text. The face is cut once by * every text set to `cutout` or `integratedExtrusion`, raised letters are sewn into that cut face, and * `separatedExtrusion` letters are added beside it as separate shapes. * @param inputs - The face and the list of text definitions to place on it * @returns A text model holding the combined result, the characters of every text and any cutout faces * @group create * @shortname create 3d texts on face * @drawable true */ createTextsOnFace(inputs: Advanced.Text3D.Texts3DFaceDto): Promise>; /** * Packs the settings of one text into a definition for `createTextsOnFace`. * * The inputs come back unchanged; collect several of them into the `definitions` list. * @param inputs - The text, font, size, height, placement on the face and how the text meets it * @returns The same definition * @group definitions * @shortname 3d text face def * @drawable false */ definition3dTextOnFace(inputs: Advanced.Text3D.Text3DFaceDefinitionDto): Advanced.Text3D.Text3DFaceDefinitionDto; /** * Draws a text model in the scene with white faces and brown edges. * * The model's compound is meshed with `precision` and drawn with opaque white faces under a new entity in * the scene. * @param inputs - A text model from one of the create methods * @param precision - Meshing precision; a smaller value gives a finer mesh * @returns A new PlayCanvas entity holding the drawn text * @group drawing * @shortname draw shape * @drawable false * @ignore true */ drawModel(inputs: Advanced.Text3D.Text3DData, precision?: number): Promise; /** * Returns the single shape that holds the whole result of a text model. * * For free-standing text it holds every letter; for text on a face it is what `faceTextVar` produced, * such as the face with the letters cut out or the sewn shell. * @param inputs - A text model from one of the create methods * @returns The shape of the whole result * @group get * @shortname compound shape * @drawable true */ getCompoundShape(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns the shape of one character of a text model. * * Spaces have no outline and get no shape, so the index counts only the characters that do. An index * outside that list throws. * @param inputs - A text model and the 0-based index of the character * @returns The character's faces, solids or shells as one compound * @group get * @shortname character shape * @drawable true */ getCharacterShape(inputs: Advanced.Text3D.Text3DLetterByIndexDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns the shape of every character of a text model that has an outline. * * Spaces have no outline and are skipped. Each shape is a compound of that character's faces, solids or * shells. * @param inputs - A text model from one of the create methods * @returns One shape per character * @group get * @shortname character shapes * @drawable true */ getCharacterShapes(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Returns the center of each character of a text model as a point. * * Extruded letters use the center of mass of their solids and flat letters that of their faces, listed in * the same order as the character shapes. Models from the methods that place several texts on a face * carry no centers, so nothing is returned for them. * @param inputs - A text model from one of the create methods * @returns One center point per character * @group get * @shortname character coordinates * @drawable true */ getCharacterCenterCoordinates(inputs: Advanced.Text3D.Text3DModelDto): Inputs.Base.Point3[]; /** * Returns the main face left after cutting the letters out of the face a text was placed on. * * Only text placed on a face with `cutout` or `integratedExtrusion` cuts the face. A model without cutout * faces throws. * @param inputs - A text model made on a face * @returns The face with letter-shaped holes * @group get from face * @shortname face cutout * @drawable true */ getFaceCutout(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer; /** * Returns every face left after cutting the letters out of the face, including the pieces inside letters. * * The main cutout comes first, followed by the pieces enclosed by characters, such as the inside of an O. * A model made without cutting a face throws. * @param inputs - A text model made on a face * @returns The main cutout face followed by the faces inside characters * @group get from face * @shortname get all coutout faces * @drawable true */ getAllFacesOfCutout(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Returns the pieces of the face that stay enclosed inside characters after the letters are cut out. * * These are the islands such as the inside of an O or an A; the main cutout face is left out. A model * made without cutting a face throws. * @param inputs - A text model made on a face * @returns The faces inside characters * @group get from face * @shortname get faces in characters * @drawable true */ getCutoutsInsideCharacters(inputs: Advanced.Text3D.Text3DModelDto): Inputs.OCCT.TopoDSShapePointer[]; /** * Returns how far the text advances along its line, as the font's spacing sets it at the chosen size. * * It is read from the font, so it includes the spacing after the last character and is in the units of * `fontSize`. `create` records it; text on a face records it only when built from a font URL, one text at * a time. * @param inputs - A text model from one of the create methods * @returns The advance width * @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 frame: Frame; readonly line: Line; readonly polyline: Polyline; readonly occt: OCCTW & OCCT; readonly advanced: AdvancedAdv; readonly things: ThingsAdv; readonly jscad: JSCAD; readonly manifold: ManifoldBitByBit; readonly ifc: IFCW; 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; }