Builds a 2D orthographic drawing of a 3D
SceneModel — wireframes, filled
silhouettes, and section cut-aways — by projecting source
geometry onto one face of its AABB (or an arbitrary
DrawingProjectionRay) and emitting the result as a
new SceneModel the host can render
in the same view as the source.
The output mirrors the source SceneModel's hierarchy
(one SceneObject per source
SceneObject, one SceneMesh per
source SceneMesh) and carries per-mesh colour from the
source, so the projection reads as a technical-drawing
"view" of the model that picks back to its source 1-to-1.
Two output styles share the same pipeline:
Wireframe — projected crease/boundary edges as
LinesPrimitive meshes. Optional hidden-line elimination
(via the hle submodule) drops edges occluded by other
source meshes from the projection direction.
Solid fill — per-source-mesh filled silhouettes as
TrianglesPrimitive meshes, with hidden-surface removal
built in: each pixel's "frontmost" owner is rasterised
into a depth buffer, then per-owner masks are contour-
traced and triangulated (see the fills submodule).
Both styles can be emitted together or individually. Both
derive from the same depth buffer when both HLE and fills
are requested, so wireframe edges sit pixel-aligned on top
of the fill silhouettes.
Per-style chrome — translucent backing panel, frame border,
and an optional title cartouche — rounds out the
technical-drawing look (see the chrome submodule).
The caller owns both SceneModels. sourceModel is read-only;
targetModel is populated in-place with geometry, meshes, and
objects representing the projection. Source and target may live
in the same Scene or in different ones —
the function reads world orientation and collision data from
sourceModel.scene and writes only to targetModel.
SceneObject ids in the output follow the pattern
"{sourceObjectId}__{targetModel.id}", with the target id
folded in so projecting the same source into multiple targets
produces distinct, Scene-globally unique ids. A pick on any
emitted geometry maps back to its source by stripping
"__" + pickedObject.model.id.
Returns targetModel on success. On failure (missing source
geometry, a createGeometry / createMesh error from the
target, or a mid-projection target teardown), returns an
SDKResult error and leaves any
partial state on the target for the caller to handle.
Builds a 2D orthographic drawing of a 3D SceneModel — wireframes, filled silhouettes, and section cut-aways — by projecting source geometry onto one face of its AABB (or an arbitrary DrawingProjectionRay) and emitting the result as a new SceneModel the host can render in the same view as the source.
The output mirrors the source SceneModel's hierarchy (one SceneObject per source SceneObject, one SceneMesh per source SceneMesh) and carries per-mesh colour from the source, so the projection reads as a technical-drawing "view" of the model that picks back to its source 1-to-1.
Two output styles share the same pipeline:
LinesPrimitivemeshes. Optional hidden-line elimination (via thehlesubmodule) drops edges occluded by other source meshes from the projection direction.TrianglesPrimitivemeshes, with hidden-surface removal built in: each pixel's "frontmost" owner is rasterised into a depth buffer, then per-owner masks are contour- traced and triangulated (see thefillssubmodule).Both styles can be emitted together or individually. Both derive from the same depth buffer when both HLE and fills are requested, so wireframe edges sit pixel-aligned on top of the fill silhouettes.
Per-style chrome — translucent backing panel, frame border, and an optional title cartouche — rounds out the technical-drawing look (see the
chromesubmodule).The caller owns both SceneModels.
sourceModelis read-only;targetModelis populated in-place with geometry, meshes, and objects representing the projection. Source and target may live in the same Scene or in different ones — the function reads world orientation and collision data fromsourceModel.sceneand writes only totargetModel.SceneObject ids in the output follow the pattern
"{sourceObjectId}__{targetModel.id}", with the target id folded in so projecting the same source into multiple targets produces distinct, Scene-globally unique ids. A pick on any emitted geometry maps back to its source by stripping"__" + pickedObject.model.id.Returns
targetModelon success. On failure (missing source geometry, acreateGeometry/createMesherror from the target, or a mid-projection target teardown), returns an SDKResult error and leaves any partial state on the target for the caller to handle.See @xeokit/sdk/studio/systems/drawings for end-to-end usage examples.