TechnicalDrawings
OBC Component that creates and manages TechnicalDrawing instances.
Extends
Implements
Constructors
new TechnicalDrawings()
new TechnicalDrawings(
components):TechnicalDrawings
A TechnicalDrawing is a 2D drawing plane that lives in 3D world space. It contains projection lines and dimension annotations (layer 1 geometry) framed by one or more orthographic DrawingViewports.
The drawing's container (a THREE.Group) can be freely transformed in the
3D world — all viewports and geometry move together as a single unit.
Parameters
| Parameter | Type |
|---|---|
components | Components |
Returns
Overrides
Component.constructor
Example
const techDrawings = components.get(TechnicalDrawings);
const drawing = techDrawings.create(world);
// Add layer-1 geometry to the drawing
const lines = new THREE.LineSegments(geometry, material);
lines.layers.set(1);
drawing.three.add(lines);
// Add viewports
const vp = drawing.viewports.create({ left: -1, right: 5, top: 1, bottom: -4 });
Properties
enabled
enabled:
boolean=true
Overrides
list
readonlylist:DataMap<string,TechnicalDrawing>
All active drawings, keyed by their UUID.
onDisposed
readonlyonDisposed:Event<unknown>
Implementation of
systems
readonlysystems:DataMap<Function,AnnotationSystem<any>>
Global system instances keyed by their constructor. Register a system with use; inspect or iterate here for UI purposes.
uuid
staticreadonlyuuid:"5c7d3b9a-4e8f-4a2b-9c1d-0e3f2a5b7c8d"
A unique identifier for the component. This UUID is used to register the component within the Components system.
Methods
create()
create(
world):TechnicalDrawing
Creates a new TechnicalDrawing hosted in the given world.
The drawing's Three.js group is added to the world's scene and its lifecycle is tied to the world — it is automatically removed when the world is disposed. Three.js rendering layer 1 is enabled on the world camera so that annotation geometry is visible in the 3D view. Both perspective and orthographic cameras are configured when using OrthoPerspectiveCamera.
To hide the drawing from the 3D view without removing it from the world,
either set drawing.three.visible = false or disable layer 1 on the
world camera: world.camera.three.layers.disable(1).
Parameters
| Parameter | Type | Description |
|---|---|---|
world | World | The world that will host this drawing. |
Returns
The newly created drawing.
dispose()
dispose():
void
Returns
void
Implementation of
isConfigurable()
isConfigurable():
this is Configurable<any, any>
Whether is component is Configurable.
Returns
this is Configurable<any, any>
Inherited from
isDisposeable()
isDisposeable():
this is Disposable
Whether is component is Disposable.
Returns
this is Disposable
Inherited from
isHideable()
isHideable():
this is Hideable
Whether is component is Hideable.
Returns
this is Hideable
Inherited from
isResizeable()
isResizeable():
this is Resizeable
Whether is component is Resizeable.
Returns
this is Resizeable
Inherited from
isSerializable()
isSerializable():
this is Serializable<any, Record<string, any>>
Whether is component is Serializable.
Returns
this is Serializable<any, Record<string, any>>
Inherited from
isUpdateable()
isUpdateable():
this is Updateable
Whether is component is Updateable.
Returns
this is Updateable
Inherited from
use()
use<
T>(SystemClass):T
Returns the global singleton instance of the given system, creating it if it
does not yet exist. The system constructor must accept Components as its
only argument (new-style global systems). Safe to call multiple times — always
returns the same instance.
const dims = techDrawings.use(OBC.LinearAnnotations);
dims.styles.set("default", { ... });
Type parameters
| Type parameter |
|---|
T extends AnnotationSystem<any> |
Parameters
| Parameter | Type |
|---|---|
SystemClass | Object |
Returns
T