@thatopen/components
Enumerations
| Enumeration | Description |
|---|---|
| RendererMode | The mode of the renderer. If MANUAL, the renderer will be updated on command. If AUTO, the renderer will render on every update tick. |
Classes
| Class | Description |
|---|---|
| AngleAnnotations | Global drawing system that manages angle dimension annotations across all TechnicalDrawing instances. |
| AnnotationSystem | Abstract base for all annotation sub-systems operating on a TechnicalDrawing. |
| AsyncEvent | Simple event handler by Jason Kleban. Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to this, you will need to declare the callback as an arrow function. |
| BCFTopics | BCFTopics manages Building Collaboration Format (BCF) data the engine. It provides functionality for importing, exporting, and manipulating BCF data. 📕 Tutorial. 📘 API. |
| Base | Base class of the library. Useful for finding out the interfaces something implements. |
| BaseCamera | Abstract class representing a camera in a 3D world. All cameras should use this class as a base. |
| BaseRenderer | Abstract class representing a renderer for a 3D world. All renderers should use this class as a base. |
| BaseScene | Abstract class representing a base scene in the application. All scenes should use this class as a base. |
| BaseWorldItem | One of the elements that make a world. It can be either a scene, a camera or a renderer. |
| BlockAnnotations | Global drawing system that manages block insertions across all TechnicalDrawing instances. |
| BoundingBoxer | An implementation of bounding box utilities that works for fragments. 📕 Tutorial. 📘 API. |
| CalloutAnnotations | Global drawing system that manages callout annotations across all TechnicalDrawing instances. |
| Classifier | The Classifier component is responsible for grouping items from different models based on criteria. 📕 Tutorial. 📘 API. |
| Clipper | A lightweight component to easily create, delete and handle clipping planes. 📕 Tutorial. 📘 API. |
| Comment | Represents a comment in a BCF Topic. |
| Component | Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the Components instance. |
| Components | The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks. |
| ConfigManager | A tool to manage all the configuration from the app centrally. 📘 API. |
| DataMap | A class that extends the built-in Map class and provides additional events for item set, update, delete, and clear operations. |
| DataSet | A class that extends the built-in Set class and provides additional functionality. It triggers events when items are added, deleted, or the set is cleared. |
| Disposer | A tool to safely remove meshes, geometries, materials and other items from memory to prevent memory leaks. 📘 API. |
| DrawingAnnotations | Flat annotation store for a TechnicalDrawing, keyed by UUID. |
| DrawingLayers | Manages the named layers of a TechnicalDrawing. |
| DrawingViewport | Represents a framed orthographic window into a TechnicalDrawing. |
| DrawingViewportHelper | Visualises the bounds of a DrawingViewport as a rectangle in the 3D scene. |
| DrawingViewports | Manages the viewports of a TechnicalDrawing. |
| DxfExporter | Serializes TechnicalDrawing content to DXF format (AC1015 / AutoCAD R2000). |
| DxfManager | Manages DXF import and export for technical drawings. |
| EdgeProjector | Component that generates 2D edge projections from fragment model items. |
| Event | Simple event handler by Jason Kleban. Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to this, you will need to declare the callback as an arrow function. |
| EventManager | Simple class to easily toggle and reset event lists. |
| FastModelPicker | A fast model picker that uses color coding to identify fragment models under the mouse cursor. This is much faster than raycasting for simple model identification. |
| FastModelPickers | A component that manages a FastModelPicker for each world and automatically disposes it when its corresponding world is disposed. |
| FinderQuery | Represents a finder query for retrieving items based on specified parameters. This class encapsulates the query logic, caching mechanism, and result management. |
| FirstPersonMode | A NavigationMode that allows first person navigation, simulating FPS video games. |
| FragmentsManager | Component to load, delete and manage fragments efficiently. 📕 Tutorial. 📘 API. Before calling FragmentsManager.init, you need a URL for the fragments worker. The recommended way to get it is FragmentsManager.getWorker, which fetches the version-matched worker from unpkg. |
| Grids | A component that manages grid instances. Each grid is associated with a unique world. 📕 Tutorial. 📘 API. |
| Hider | A component that manages visibility of fragments within a 3D scene. It extends the base Component class and provides methods to control fragment visibility and isolation. 📕 Tutorial. 📘 API. |
| IDSSpecification | Represents a single specification from the Information Delivery Specification (IDS) standard. |
| IDSSpecifications | Component that manages Information Delivery Specification (IDS) data. It provides functionality for importing, exporting, and manipulating IDS data. 📕 Tutorial. 📘 API. |
| IfcFragmentSettings | Configuration of the IFC-fragment conversion. |
| IfcLoader | The IfcLoader component is responsible of converting IFC files into Fragments. 📕 Tutorial. 📘 API. |
| ItemsFinder | Manages and executes queries to find items within models based on specified criteria. This class provides functionalities to create, store, and execute FinderQuery instances, allowing for efficient retrieval of items that match given query parameters. 📕 Tutorial. 📘 API. |
| LeaderAnnotations | Global drawing system that manages leader (arrow + text) annotations across all TechnicalDrawing instances. |
| LinearAnnotations | Global drawing system that manages linear dimension annotations across all TechnicalDrawing instances. |
| MeasurementUtils | Utility component for performing measurements on 3D meshes by providing methods for measuring distances between edges and faces. 📘 API. |
| ModelIdMapUtils | Utility class for manipulating and managing ModelIdMap objects. A ModelIdMap is a mapping of model identifiers (strings) to sets of local IDs (numbers). This class provides methods for joining, intersecting, cloning, adding, removing, and comparing ModelIdMap objects, as well as converting between ModelIdMap and plain JavaScript objects. |
| Mouse | A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the raycaster, even if it has been transformed through CSS or doesn't occupy the whole screen. |
| OrbitMode | A NavigationMode that allows 3D navigation and panning like in many 3D and CAD softwares. |
| OrthoPerspectiveCamera | A flexible camera that uses yomotsu's cameracontrols to control the camera in 2D and 3D. It supports multiple navigation modes, such as 2D floor plan navigation, first person and 3D orbit. This class extends the SimpleCamera class and adds additional functionality for managing different camera projections and navigation modes. 📕 Tutorial. 📘 API. |
| PlanMode | A NavigationMode that allows to navigate floorplans in 2D, like many BIM tools. |
| ProjectionManager | Object to control the CameraProjection of the OrthoPerspectiveCamera. |
| Raycasters | A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 Tutorial. 📘 API. |
| ShadowedScene | A scene that supports efficient cast shadows. 📕 Tutorial. 📘 API. |
| SimpleCamera | A basic camera that uses yomotsu's cameracontrols to control the camera in 2D and 3D. Check out it's API to find out what features it offers. |
| SimpleGrid | An infinite grid. Created by fyrestar and translated to typescript by dkaraush. |
| SimplePlane | Each of the clipping planes created by the clipper. |
| SimpleRaycaster | A simple raycaster that allows to easily get items from the scene using the mouse and touch events. |
| SimpleRenderer | A basic renderer capable of rendering Objec3Ds. |
| SimpleScene | A basic 3D scene to add objects hierarchically, and easily dispose them when you are finished with it. |
| SimpleWorld | A class representing a simple world in a 3D environment. It extends the Base class and implements the World interface. |
| SlopeAnnotations | Global drawing system that manages slope annotations across all TechnicalDrawing instances. |
| TechnicalDrawing | A single technical drawing — the core spatial aggregate. |
| TechnicalDrawingHelper | Visualises a TechnicalDrawing's projection volume in the 3D scene and exposes three gizmo anchors for interactive control. |
| TechnicalDrawings | OBC Component that creates and manages TechnicalDrawing instances. |
| VertexPicker | A class that provides functionality for picking vertices in a 3D scene. |
| Viewpoint | Represents a BCF compliant viewpoint from BuildingSMART. The Viewpoint class provides methods for managing and interacting with viewpoints. It includes functionality for setting viewpoint properties, updating the camera, applying color to components, and serializing the viewpoint for export. |
| Views | The Views class is responsible for managing and interacting with a collection of 2D sections. It provides methods for creating, opening, closing, and managing views, as well as generating views from specific configurations such as IFC storeys or bounding boxes. 📕 Tutorial. 📘 API. |
| Worlds | A class representing a collection of worlds within a game engine. It manages the creation, deletion, and update of worlds. 📕 Tutorial. 📘 API. |
Interfaces
| Interface | Description |
|---|---|
| AddClassificationConfig | Configuration options for adding a classification. |
| AnnotationEntry | A single annotation entry stored in DrawingAnnotations, bundling the owning system, the annotation data, and its Three.js group. |
| AxisGizmoLike | Minimal interface for a translate-only gizmo that can be configured and attached to one of the helper's control handles. |
| BCFTopicsConfig | Configuration settings for managing BCF topics. This interface defines the properties and their meanings used to control the behavior of exporting and importing BCF topics. |
| BCFViewpoint | Represents a Building Collaboration Format (BCF) viewpoint. This interface is compliant with the BCF API specifications. |
| BaseAnnotationStyle | Minimum style contract shared by every annotation system. |
| BlockDefinition | The geometry content of a named block. At least one of lines or mesh must be provided. |
| BlockInsertion | A single placed instance of a named block definition. |
| BlockStyle | Style for a BlockAnnotations system. |
| CalloutAnnotation | The committed data for a single callout annotation. |
| CalloutAnnotationStyle | Visual appearance of a callout annotation. |
| CameraControllable | Whether a camera uses the Camera Controls library. |
| ClassificationGroupData | Represents the data structure for a classification group. |
| ClassificationGroupQuery | Represents a query for a classification group. |
| ClassifyItemRelationsConfig | Configuration interface for classifying item by relation values. |
| Configurable | Whether this component supports to be configured. |
| CreateElevationViewsConfig | Configuration options for creating views from bounding boxes. |
| CreateViewConfig | Configuration options for creating views from a plane. |
| CreateViewFromIfcStoreysConfig | Configuration options for creating a view from IFC storeys. |
| Createable | Whether this component supports create and destroy operations. This generally applies for components that work with instances, such as clipping planes or dimensions. |
| DimensionUnit | Defines how a measured value (in drawing-space metres) is converted to a display string. |
| Disposable | Whether this component has to be manually destroyed once you are done with it to prevent memory leaks. This also ensures that the DOM events created by that component will be cleaned up. |
| DrawingIntersection | Result of a successful raycast against a TechnicalDrawing. |
| DrawingLayer | A named organizational layer on a TechnicalDrawing. |
| DrawingSystemDescriptor | "Type bag" descriptor that fully parameterises an annotation system. |
| DrawingViewportConfig | Configuration to create a DrawingViewport. |
| DxfDrawingEntry | One drawing with one or more viewport placements to export. |
| DxfPaperOptions | Paper sheet dimensions for paper-space export. |
| DxfTextOptions | Optional text formatting overrides for DxfWriteContext.writeText. |
| DxfViewportEntry | One viewport placement within a drawing entry. |
| DxfWriteContext | Write-context passed to custom system exporters registered via |
| DxfExporter.registerSystemExporter. | |
| EdgeProjectionResult | Result of an edge projection, containing visible/hidden geometries and a mapping from group indices to model item identifiers. |
| Eventable | Whether it has events or not. |
| Hideable | Whether the geometric representation of this component can be hidden or shown in the Three.js scene. |
| LeaderAnnotation | The committed data for a single leader annotation. |
| LeaderAnnotationStyle | Visual appearance of a leader annotation. |
| LinearAnnotation | The committed data for a single linear annotation. |
| LinearAnnotationStyle | Visual appearance of a linear annotation. Registered by name on the component. |
| MeasureEdge | Represents an edge measurement result. |
| NavigationMode | An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc). |
| Progress | Basic type to describe the progress of any kind of process. |
| QueryTestConfig | Configuration for testing queries. |
| RemoveClassifierItemsConfig | Configuration options for removing items from a classifier. |
| Resizeable | Whether this component can be resized. The meaning of this can vary depending on the component: resizing a Renderer component could mean changing its resolution, whereas resizing a Mesh would change its scale. |
| SerializedFinderQuery | Represents a serialized query for an item finder. |
| SerializedQueryParameters | Represents the serialized query parameters used for item finding. |
| ShadowedSceneConfig | Configuration interface for the ShadowedScene. Defines properties for directional and ambient lights, as well as shadows. |
| SimpleGridConfig | Configuration interface for the SimpleGrid. |
| SimpleSceneConfig | Configuration interface for the SimpleScene. |
| SlopeAnnotation | A single committed slope annotation. |
| SlopeAnnotationStyle | Visual appearance of a slope annotation. |
| Transitionable | Whether this component manages its interaction through an explicit state machine. |
| Updateable | Whether this component should be updated each frame. |
| VertexPickerConfig | Configuration interface for the VertexPicker component. |
| ViewpointBitmap | Represents a bitmap image associated with a viewpoint. This interface is compliant with the BCF API specifications. |
| ViewpointCamera | Represents the properties of a camera viewpoint in a 3D space. This interface is compliant with the BCF API specifications. |
| ViewpointClippingPlane | Represents a clipping plane in a viewpoint, defined by its location and direction. This interface is compliant with the BCF API specifications. |
| ViewpointColoring | Represents the coloring information for a viewpoint, including the color and associated components. This interface is compliant with the BCF API specifications. |
| ViewpointComponent | Represents a component within a viewpoint, typically used in Building Information Modeling (BIM) workflows. This interface is compliant with the BCF API specifications. |
| ViewpointComponents | Represents the components of a viewpoint in the BCF API. This interface is compliant with the BCF API specifications. |
| ViewpointLine | Represents a line defined by a start and end point in a viewpoint. This interface is compliant with the BCF API specifications. |
| ViewpointSnapshot | Represents a snapshot of a viewpoint, including its type and data. This interface is compliant with the BCF API specifications. |
| ViewpointVector | Represents a 3D vector with x, y, and z coordinates. |
| ViewpointVisibility | Represents the visibility settings for a viewpoint. This interface is compliant with the BCF API specifications. |
| WithUi | Whether it has a UI or not. |
| World | Represents a 3D world with meshes, scene, camera, renderer, and other properties. |
Type Aliases
| Type alias | Description |
|---|---|
| AngleAnnotationData | Editable fields of AngleAnnotation — everything except the uuid. |
| BlockInsertionData | Editable fields of BlockInsertion — everything except the uuid. |
| CalloutAnnotationData | Editable fields of CalloutAnnotation — everything except uuid. |
| CameraProjection | The projection system of the camera. |
| ClassifierIntersectionInput | Represents the input structure for a classifier intersection operation. Defines a record where the keys are classification names and the values are arrays of group names within those classifications. |
| EnclosureBuilder | Defines a closed shape (cloud, rectangle, circle, etc.) that forms the body of a callout annotation. |
| IDSCheckResult | The result of a check performed by an IDSFacet test. |
| LeaderAnnotationData | Editable fields of LeaderAnnotation — everything except uuid. |
| LineTickBuilder | A function that produces tick mark geometry at one endpoint of a dimension or leader line. |
| LinearAnnotationData | Editable fields of LinearAnnotation — everything except the uuid. |
| MeshTickBuilder | A function that produces filled tick mark geometry (triangles) at one endpoint. |
| ModelIdMap | Mapping of model identifiers to a collection of numbers representing localIds. |
| NavModeID | The extensible list of supported navigation modes. |
| QueryResultAggregation | Represents the type of aggregation used in a query result. inclusive: Equivalent to OR. exclusive: Equivalent to AND. |
| SlopeAnnotationData | Editable fields of SlopeAnnotation — everything except the uuid. |
| SlopeFormat | How the slope value is displayed in the text label. |
| ViewpointOrthogonalCamera | Represents an orthogonal camera viewpoint, extending the base ViewpointCamera type. This interface is compliant with the BCF API specifications. |
| ViewpointPerspectiveCamera | Represents a perspective camera viewpoint compliant with the BCF API specifications. Extends the ViewpointCamera type and includes additional properties specific to perspective cameras. |
Variables
| Variable | Description |
|---|---|
| CircleEnclosure | Elliptical enclosure — an ellipse approximated with line segments centred on center. |
| CloudEnclosure | Revision-cloud enclosure — a bumpy rectangle centred on center. |
| RectEnclosure | Rectangular enclosure — a plain axis-aligned rectangle centred on center. |
| Units | Built-in DimensionUnit presets. |
Functions
| Function | Description |
|---|---|
| ArrowTick | Closed arrowhead tick — two wing lines plus a base line connecting them. |
| DiagonalTick | Diagonal slash tick (architectural style). |
| DotTick | Dot tick — a small circle drawn with line segments at the endpoint. |
| FilledArrowTick | Filled arrowhead tick (solid triangle, requires a THREE.Mesh). |
| FilledCircleTick | Filled circle tick (solid disc, requires a THREE.Mesh). |
| FilledSquareTick | Filled square tick (solid square, requires a THREE.Mesh). |
| NoTick | No tick — dimension line ends cleanly at the extension lines. |
| OpenArrowTick | Open-V arrowhead tick — two lines from the tip to the wing points, no base. |
| angleDimensionMachine | Pure state transition function for the angle dimension tool. |
| buildAnglePositions | Builds the flat vertex positions for a single committed angle dimension. |
| buildAnglePreviewPositions | Builds vertex positions for the live preview during positioningArc. |
| buildCalloutPositions | Builds the flat vertex positions for a committed callout annotation. |
| buildCalloutPreviewPositions | Builds vertex positions for the live preview during interactive placement. |
| buildDimensionPositions | Builds the flat vertex positions (x,y,z triplets) for a single committed linear dimension. |
| buildDimensions | Builds an array of LinearAnnotations from consecutive point pairs, all sharing the same perpendicular offset. |
| buildLeaderPositions | Builds the flat vertex positions for a committed leader annotation. |
| buildLeaderPreviewPositions | Builds vertex positions for the live preview. |
| buildPreviewPositions | Builds the flat vertex positions for a live dimension preview. |
| buildSlopePositions | Builds the LineSegments position array for a committed slope annotation. |
| calloutAnnotationMachine | Pure state transition function for the callout annotation tool. |
| computeAlignmentMatrix | Computes a local-to-world transformation matrix that maps a technical drawing's local coordinate system onto a target plane in 3D world space. |
| computeAngle | Returns the angle in radians between the two rays defined by the dimension. |
| computeBisectorAngle | Returns the angle (in radians, in the XZ plane) of the bisector ray between the two measured rays. |
| computeOffset | Computes the signed offset from a cursor position to the measurement axis defined by the first and last points. |
| formatSlope | Converts a slope ratio to a human-readable string. |
| getAngleTickEndpoints | Returns the tip position and inward tangent direction for each tick endpoint of an angle dimension arc. |
| getDimensionTickEndpoints | Returns the tip position and inward direction for each tick endpoint of a linear dimension. |
| getSlopeTip | Returns the tip position of a slope annotation in drawing local space. |
| leaderAnnotationMachine | Pure state transition function for the leader annotation tool. |
| linearDimensionMachine | Pure state transition function for the linear dimension tool. |