Documentation / @ripl/3d / Mesh
Class: Mesh ​
Defined in: 3d/src/elements/mesh.ts:51
A mesh built from an explicit list of faces.
The escape hatch for geometry no primitive covers — imported models, procedurally generated surfaces, hand-built assemblies. The faces live outside element state and are only read, because computeFaces fires on every cache invalidation; call setFaces to replace them.
Example ​
const mesh = createMesh({
faces: [{ vertices: [[0, 0, 0], [1, 0, 0], [0, 1, 0]] }],
fill: '#4488cc',
});Extends ​
Constructors ​
Constructor ​
new Mesh(
options?):Mesh
Defined in: 3d/src/elements/mesh.ts:65
Parameters ​
| Parameter | Type |
|---|---|
options? | MeshOptions |
Returns ​
Mesh
Overrides ​
Properties ​
| Property | Modifier | Type | Default value | Description | Inherited from | Defined in |
|---|---|---|---|---|---|---|
abstract | public | boolean | false | When true, the element skips transform and drawing-state application during Element.render; used by containers such as Group. | Shape3D.abstract | core/src/core/element.ts:339 |
classList | readonly | Set<string> | undefined | Set of CSS-like class names used for querying and selection. | Shape3D.classList | core/src/core/element.ts:336 |
context? | protected | Context<Element, Record<string, unknown>> | undefined | - | Shape3D.context | core/src/core/element.ts:326 |
data | public | unknown | undefined | Arbitrary user data bound to the element, typically the datum backing a data-driven visual. | Shape3D.data | core/src/core/element.ts:348 |
id | public | string | undefined | Unique identifier for this element, defaulting to type:uniqueId when not supplied. | Shape3D.id | core/src/core/element.ts:330 |
interpolators | protected | ElementInterpolators<TState> | undefined | - | Shape3D.interpolators | core/src/core/element.ts:327 |
parent? | public | Group<ElementEventMap> | undefined | The parent Group this element is attached to, or undefined when detached. | Shape3D.parent | core/src/core/element.ts:345 |
pointerEvents | public | ElementPointerEvents | 'all' | Controls which parts of the element respond to pointer hit testing. See ElementPointerEvents. | Shape3D.pointerEvents | core/src/core/element.ts:342 |
state | protected | MeshState | undefined | - | Shape3D.state | core/src/core/element.ts:325 |
type | readonly | string | undefined | The element type name (e.g. circle, rect, group). | Shape3D.type | core/src/core/element.ts:333 |
defaultKey | readonly | typeof defaultKey | undefined | The key under which resources are retained when no explicit key is provided. | Shape3D.defaultKey | core/src/core/disposer.ts:11 |
Accessors ​
_boundsCacheable ​
Get Signature ​
get
protected_boundsCacheable():boolean
Defined in: 3d/src/core/shape.ts:589
Whether this element's bounding boxes may be cached against its own state version. Groups opt out; their box composes from children whose changes are not visible in the group's own state.
Returns ​
boolean
Inherited from ​
$anyDirty ​
Get Signature ​
get $anyDirty():
boolean
Defined in: core/src/core/element.ts:361
Whether this element or any ancestor Group is dirty. Provided for subtree-level render skipping; the path cache uses Element.$dirty (own) because paths are authored in local space.
Returns ​
boolean
Inherited from ​
$dirty ​
Get Signature ​
get $dirty():
boolean
Defined in: core/src/core/element.ts:351
Whether an own state value has changed since the last render cycle. Drives per-element path-cache invalidation and is reset after each render cycle.
Returns ​
boolean
Inherited from ​
$events ​
Get Signature ​
get $events(): keyof
TEventMap[]
Defined in: core/src/core/element.ts:371
The event types an element can emit. See EventBus.$events.
Returns ​
keyof TEventMap[]
Inherited from ​
$state ​
Get Signature ​
get $state():
Readonly<TState>
Defined in: core/src/core/element.ts:366
A shallow copy of the element's own set state values, without inherited or computed resolution. Intended for inspection and serialization (e.g. devtools); mutating the returned object has no effect on the element.
Returns ​
Readonly<TState>
Inherited from ​
$touched ​
Get Signature ​
get $touched():
boolean
Defined in: core/src/core/element.ts:356
Whether a state value was set since the last render cycle (the element was addressed), whether or not the value changed, so a real change also sets this. Reset after each render cycle.
Returns ​
boolean
Inherited from ​
direction ​
Get Signature ​
get direction():
TState["direction"]
Defined in: core/src/core/element.ts:393
Text directionality used when rendering text, mirroring the canvas direction drawing-state property (inherit, ltr, or rtl).
Returns ​
TState["direction"]
Set Signature ​
set direction(
value):void
Defined in: core/src/core/element.ts:397
Parameters ​
| Parameter | Type |
|---|---|
value | TState["direction"] |
Returns ​
void
Inherited from ​
faces ​
Get Signature ​
get faces():
Face3D[]
Defined in: 3d/src/elements/mesh.ts:61
The faces this mesh is built from.
Returns ​
Face3D[]
fill ​
Get Signature ​
get fill():
TState["fill"]
Defined in: core/src/core/element.ts:402
Fill style (color or gradient) painted inside the element, mirroring the canvas fillStyle drawing-state property.
Returns ​
TState["fill"]
Set Signature ​
set fill(
value):void
Defined in: core/src/core/element.ts:406
Parameters ​
| Parameter | Type |
|---|---|
value | TState["fill"] |
Returns ​
void
Inherited from ​
filter ​
Get Signature ​
get filter():
TState["filter"]
Defined in: core/src/core/element.ts:411
Filter effects applied to the element, mirroring the canvas filter drawing-state property.
Returns ​
TState["filter"]
Set Signature ​
set filter(
value):void
Defined in: core/src/core/element.ts:415
Parameters ​
| Parameter | Type |
|---|---|
value | TState["filter"] |
Returns ​
void
Inherited from ​
font ​
Get Signature ​
get font():
TState["font"]
Defined in: core/src/core/element.ts:420
Font used for text rendering, mirroring the canvas font drawing-state property.
Returns ​
TState["font"]
Set Signature ​
set font(
value):void
Defined in: core/src/core/element.ts:424
Parameters ​
| Parameter | Type |
|---|---|
value | TState["font"] |
Returns ​
void
Inherited from ​
globalCompositeOperation ​
Get Signature ​
get globalCompositeOperation():
TState["globalCompositeOperation"]
Defined in: core/src/core/element.ts:438
Compositing/blend mode used to draw the element, mirroring the canvas globalCompositeOperation drawing-state property.
Returns ​
TState["globalCompositeOperation"]
Set Signature ​
set globalCompositeOperation(
value):void
Defined in: core/src/core/element.ts:442
Parameters ​
| Parameter | Type |
|---|---|
value | TState["globalCompositeOperation"] |
Returns ​
void
Inherited from ​
Shape3D.globalCompositeOperation
lineCap ​
Get Signature ​
get lineCap():
TState["lineCap"]
Defined in: core/src/core/element.ts:447
Cap style drawn at the ends of stroked lines, mirroring the canvas lineCap drawing-state property (butt, round, or square).
Returns ​
TState["lineCap"]
Set Signature ​
set lineCap(
value):void
Defined in: core/src/core/element.ts:451
Parameters ​
| Parameter | Type |
|---|---|
value | TState["lineCap"] |
Returns ​
void
Inherited from ​
lineDash ​
Get Signature ​
get lineDash():
TState["lineDash"]
Defined in: core/src/core/element.ts:456
Dash pattern for stroked lines, mirroring the canvas line-dash array set via setLineDash.
Returns ​
TState["lineDash"]
Set Signature ​
set lineDash(
value):void
Defined in: core/src/core/element.ts:460
Parameters ​
| Parameter | Type |
|---|---|
value | TState["lineDash"] |
Returns ​
void
Inherited from ​
lineDashOffset ​
Get Signature ​
get lineDashOffset():
TState["lineDashOffset"]
Defined in: core/src/core/element.ts:465
Offset into the line-dash pattern, mirroring the canvas lineDashOffset drawing-state property.
Returns ​
TState["lineDashOffset"]
Set Signature ​
set lineDashOffset(
value):void
Defined in: core/src/core/element.ts:469
Parameters ​
| Parameter | Type |
|---|---|
value | TState["lineDashOffset"] |
Returns ​
void
Inherited from ​
lineJoin ​
Get Signature ​
get lineJoin():
TState["lineJoin"]
Defined in: core/src/core/element.ts:474
Join style drawn where stroked segments meet, mirroring the canvas lineJoin drawing-state property (bevel, miter, or round).
Returns ​
TState["lineJoin"]
Set Signature ​
set lineJoin(
value):void
Defined in: core/src/core/element.ts:478
Parameters ​
| Parameter | Type |
|---|---|
value | TState["lineJoin"] |
Returns ​
void
Inherited from ​
lineWidth ​
Get Signature ​
get lineWidth():
TState["lineWidth"]
Defined in: core/src/core/element.ts:483
Width of stroked lines in pixels, mirroring the canvas lineWidth drawing-state property.
Returns ​
TState["lineWidth"]
Set Signature ​
set lineWidth(
value):void
Defined in: core/src/core/element.ts:487
Parameters ​
| Parameter | Type |
|---|---|
value | TState["lineWidth"] |
Returns ​
void
Inherited from ​
material ​
Get Signature ​
get material():
TState["material"]
Defined in: 3d/src/core/shape.ts:407
How the surface responds to light.
Read as a plain value rather than observed, so assign a new object to change it — mutating the existing one in place will not repaint.
Returns ​
TState["material"]
Set Signature ​
set material(
value):void
Defined in: 3d/src/core/shape.ts:411
Parameters ​
| Parameter | Type |
|---|---|
value | TState["material"] |
Returns ​
void
Inherited from ​
miterLimit ​
Get Signature ​
get miterLimit():
TState["miterLimit"]
Defined in: core/src/core/element.ts:492
Miter length limit for miter line joins, mirroring the canvas miterLimit drawing-state property.
Returns ​
TState["miterLimit"]
Set Signature ​
set miterLimit(
value):void
Defined in: core/src/core/element.ts:496
Parameters ​
| Parameter | Type |
|---|---|
value | TState["miterLimit"] |
Returns ​
void
Inherited from ​
opacity ​
Get Signature ​
get opacity():
TState["opacity"]
Defined in: core/src/core/element.ts:429
Opacity of the element from 0 (transparent) to 1 (opaque), mapping to the canvas globalAlpha drawing-state property.
Returns ​
TState["opacity"]
Set Signature ​
set opacity(
value):void
Defined in: core/src/core/element.ts:433
Parameters ​
| Parameter | Type |
|---|---|
value | TState["opacity"] |
Returns ​
void
Inherited from ​
revision ​
Get Signature ​
get revision():
number
Defined in: 3d/src/elements/mesh.ts:56
A counter bumped whenever the face list is replaced.
Returns ​
number
rotation ​
Get Signature ​
get rotation():
TState["rotation"]
Defined in: core/src/core/element.ts:609
Rotation applied to the element during rendering, in radians or as a CSS-like angle string.
Returns ​
TState["rotation"]
Set Signature ​
set rotation(
value):void
Defined in: core/src/core/element.ts:613
Parameters ​
| Parameter | Type |
|---|---|
value | TState["rotation"] |
Returns ​
void
Inherited from ​
rotationX ​
Get Signature ​
get rotationX():
TState["rotationX"]
Defined in: 3d/src/core/shape.ts:332
The rotation around the X axis, in radians.
Returns ​
TState["rotationX"]
Set Signature ​
set rotationX(
value):void
Defined in: 3d/src/core/shape.ts:336
Parameters ​
| Parameter | Type |
|---|---|
value | TState["rotationX"] |
Returns ​
void
Inherited from ​
rotationY ​
Get Signature ​
get rotationY():
TState["rotationY"]
Defined in: 3d/src/core/shape.ts:341
The rotation around the Y axis, in radians.
Returns ​
TState["rotationY"]
Set Signature ​
set rotationY(
value):void
Defined in: 3d/src/core/shape.ts:345
Parameters ​
| Parameter | Type |
|---|---|
value | TState["rotationY"] |
Returns ​
void
Inherited from ​
rotationZ ​
Get Signature ​
get rotationZ():
TState["rotationZ"]
Defined in: 3d/src/core/shape.ts:350
The rotation around the Z axis, in radians.
Returns ​
TState["rotationZ"]
Set Signature ​
set rotationZ(
value):void
Defined in: 3d/src/core/shape.ts:354
Parameters ​
| Parameter | Type |
|---|---|
value | TState["rotationZ"] |
Returns ​
void
Inherited from ​
scale ​
Get Signature ​
get scale():
TState["scaleX"]
Defined in: 3d/src/core/shape.ts:391
The uniform scale, when all three axes agree.
Reads back the X scale, so a shape scaled non-uniformly reports only that axis. Writing sets all three.
Returns ​
TState["scaleX"]
Set Signature ​
set scale(
value):void
Defined in: 3d/src/core/shape.ts:395
Parameters ​
| Parameter | Type |
|---|---|
value | TState["scaleX"] |
Returns ​
void
Inherited from ​
scaleX ​
Get Signature ​
get scaleX():
TState["scaleX"]
Defined in: 3d/src/core/shape.ts:359
The scale along the X axis.
Returns ​
TState["scaleX"]
Set Signature ​
set scaleX(
value):void
Defined in: 3d/src/core/shape.ts:363
Parameters ​
| Parameter | Type |
|---|---|
value | TState["scaleX"] |
Returns ​
void
Inherited from ​
scaleY ​
Get Signature ​
get scaleY():
TState["scaleY"]
Defined in: 3d/src/core/shape.ts:368
The scale along the Y axis.
Returns ​
TState["scaleY"]
Set Signature ​
set scaleY(
value):void
Defined in: 3d/src/core/shape.ts:372
Parameters ​
| Parameter | Type |
|---|---|
value | TState["scaleY"] |
Returns ​
void
Inherited from ​
scaleZ ​
Get Signature ​
get scaleZ():
TState["scaleZ"]
Defined in: 3d/src/core/shape.ts:377
The scale along the Z axis.
Returns ​
TState["scaleZ"]
Set Signature ​
set scaleZ(
value):void
Defined in: 3d/src/core/shape.ts:381
Parameters ​
| Parameter | Type |
|---|---|
value | TState["scaleZ"] |
Returns ​
void
Inherited from ​
shadowBlur ​
Get Signature ​
get shadowBlur():
TState["shadowBlur"]
Defined in: core/src/core/element.ts:501
Blur radius applied to the element's shadow, mirroring the canvas shadowBlur drawing-state property.
Returns ​
TState["shadowBlur"]
Set Signature ​
set shadowBlur(
value):void
Defined in: core/src/core/element.ts:505
Parameters ​
| Parameter | Type |
|---|---|
value | TState["shadowBlur"] |
Returns ​
void
Inherited from ​
shadowColor ​
Get Signature ​
get shadowColor():
TState["shadowColor"]
Defined in: core/src/core/element.ts:510
Color of the element's shadow, mirroring the canvas shadowColor drawing-state property.
Returns ​
TState["shadowColor"]
Set Signature ​
set shadowColor(
value):void
Defined in: core/src/core/element.ts:514
Parameters ​
| Parameter | Type |
|---|---|
value | TState["shadowColor"] |
Returns ​
void
Inherited from ​
shadowOffsetX ​
Get Signature ​
get shadowOffsetX():
TState["shadowOffsetX"]
Defined in: core/src/core/element.ts:519
Horizontal offset of the element's shadow, mirroring the canvas shadowOffsetX drawing-state property.
Returns ​
TState["shadowOffsetX"]
Set Signature ​
set shadowOffsetX(
value):void
Defined in: core/src/core/element.ts:523
Parameters ​
| Parameter | Type |
|---|---|
value | TState["shadowOffsetX"] |
Returns ​
void
Inherited from ​
shadowOffsetY ​
Get Signature ​
get shadowOffsetY():
TState["shadowOffsetY"]
Defined in: core/src/core/element.ts:528
Vertical offset of the element's shadow, mirroring the canvas shadowOffsetY drawing-state property.
Returns ​
TState["shadowOffsetY"]
Set Signature ​
set shadowOffsetY(
value):void
Defined in: core/src/core/element.ts:532
Parameters ​
| Parameter | Type |
|---|---|
value | TState["shadowOffsetY"] |
Returns ​
void
Inherited from ​
stroke ​
Get Signature ​
get stroke():
TState["stroke"]
Defined in: core/src/core/element.ts:537
Stroke style (color or gradient) painted along the element's outline, mirroring the canvas strokeStyle drawing-state property.
Returns ​
TState["stroke"]
Set Signature ​
set stroke(
value):void
Defined in: core/src/core/element.ts:541
Parameters ​
| Parameter | Type |
|---|---|
value | TState["stroke"] |
Returns ​
void
Inherited from ​
textAlign ​
Get Signature ​
get textAlign():
TState["textAlign"]
Defined in: core/src/core/element.ts:546
Horizontal alignment of rendered text, mirroring the canvas textAlign drawing-state property.
Returns ​
TState["textAlign"]
Set Signature ​
set textAlign(
value):void
Defined in: core/src/core/element.ts:550
Parameters ​
| Parameter | Type |
|---|---|
value | TState["textAlign"] |
Returns ​
void
Inherited from ​
textBaseline ​
Get Signature ​
get textBaseline():
TState["textBaseline"]
Defined in: core/src/core/element.ts:555
Vertical baseline of rendered text, mirroring the canvas textBaseline drawing-state property.
Returns ​
TState["textBaseline"]
Set Signature ​
set textBaseline(
value):void
Defined in: core/src/core/element.ts:559
Parameters ​
| Parameter | Type |
|---|---|
value | TState["textBaseline"] |
Returns ​
void
Inherited from ​
transformOriginX ​
Get Signature ​
get transformOriginX():
TState["transformOriginX"]
Defined in: core/src/core/element.ts:618
Horizontal origin about which transforms are applied, as a pixel value or percentage string.
Returns ​
TState["transformOriginX"]
Set Signature ​
set transformOriginX(
value):void
Defined in: core/src/core/element.ts:622
Parameters ​
| Parameter | Type |
|---|---|
value | TState["transformOriginX"] |
Returns ​
void
Inherited from ​
transformOriginY ​
Get Signature ​
get transformOriginY():
TState["transformOriginY"]
Defined in: core/src/core/element.ts:627
Vertical origin about which transforms are applied, as a pixel value or percentage string.
Returns ​
TState["transformOriginY"]
Set Signature ​
set transformOriginY(
value):void
Defined in: core/src/core/element.ts:631
Parameters ​
| Parameter | Type |
|---|---|
value | TState["transformOriginY"] |
Returns ​
void
Inherited from ​
transformScaleX ​
Get Signature ​
get transformScaleX():
TState["transformScaleX"]
Defined in: core/src/core/element.ts:591
Horizontal scale factor applied to the element during rendering (1 is unscaled).
Returns ​
TState["transformScaleX"]
Set Signature ​
set transformScaleX(
value):void
Defined in: core/src/core/element.ts:595
Parameters ​
| Parameter | Type |
|---|---|
value | TState["transformScaleX"] |
Returns ​
void
Inherited from ​
transformScaleY ​
Get Signature ​
get transformScaleY():
TState["transformScaleY"]
Defined in: core/src/core/element.ts:600
Vertical scale factor applied to the element during rendering (1 is unscaled).
Returns ​
TState["transformScaleY"]
Set Signature ​
set transformScaleY(
value):void
Defined in: core/src/core/element.ts:604
Parameters ​
| Parameter | Type |
|---|---|
value | TState["transformScaleY"] |
Returns ​
void
Inherited from ​
translateX ​
Get Signature ​
get translateX():
TState["translateX"]
Defined in: core/src/core/element.ts:573
Horizontal translation applied to the element during rendering, in pixels.
Returns ​
TState["translateX"]
Set Signature ​
set translateX(
value):void
Defined in: core/src/core/element.ts:577
Parameters ​
| Parameter | Type |
|---|---|
value | TState["translateX"] |
Returns ​
void
Inherited from ​
translateY ​
Get Signature ​
get translateY():
TState["translateY"]
Defined in: core/src/core/element.ts:582
Vertical translation applied to the element during rendering, in pixels.
Returns ​
TState["translateY"]
Set Signature ​
set translateY(
value):void
Defined in: core/src/core/element.ts:586
Parameters ​
| Parameter | Type |
|---|---|
value | TState["translateY"] |
Returns ​
void
Inherited from ​
x ​
Get Signature ​
get x():
TState["x"]
Defined in: 3d/src/core/shape.ts:305
The X position of the shape's origin in world space.
Returns ​
TState["x"]
Set Signature ​
set x(
value):void
Defined in: 3d/src/core/shape.ts:309
Parameters ​
| Parameter | Type |
|---|---|
value | TState["x"] |
Returns ​
void
Inherited from ​
y ​
Get Signature ​
get y():
TState["y"]
Defined in: 3d/src/core/shape.ts:314
The Y position of the shape's origin in world space.
Returns ​
TState["y"]
Set Signature ​
set y(
value):void
Defined in: 3d/src/core/shape.ts:318
Parameters ​
| Parameter | Type |
|---|---|
value | TState["y"] |
Returns ​
void
Inherited from ​
z ​
Get Signature ​
get z():
TState["z"]
Defined in: 3d/src/core/shape.ts:323
The Z position of the shape's origin in world space.
Returns ​
TState["z"]
Set Signature ​
set z(
value):void
Defined in: 3d/src/core/shape.ts:327
Parameters ​
| Parameter | Type |
|---|---|
value | TState["z"] |
Returns ​
void
Inherited from ​
zIndex ​
Get Signature ​
get zIndex():
number
Defined in: 3d/src/core/shape.ts:421
The stacking order, derived from the depth of the shape's nearest projected face — the one the painter's algorithm draws last. Not settable on 3D shapes, and not what hit testing ranks by: Context3D casts a ray and ranks by the distance to the geometry itself, which no per-shape scalar can reproduce for interleaved parts.
Returns ​
number
Set Signature ​
set zIndex(
_value):void
Defined in: 3d/src/core/shape.ts:425
Effective stacking order of the element, combining its own z-index with its parent Group's. Higher values render on top.
Parameters ​
| Parameter | Type |
|---|---|
_value | number |
Returns ​
void
Inherited from ​
Methods ​
$reset() ​
$reset():
void
Defined in: core/src/core/element.ts:1019
Resets this element's per-render-cycle change flags (Element.$dirty and Element.$touched). Called automatically at the end of each render cycle, by an element's own Element.render for leaves, and by the scene/renderer at each group pop and for the root. Consumers do not normally call this directly.
Returns ​
void
Inherited from ​
clone() ​
clone():
Element<MeshState,ElementEventMap>
Defined in: core/src/core/element.ts:762
Creates a shallow clone of this element with the same id, classes, and state.
Returns ​
Element<MeshState, ElementEventMap>
Inherited from ​
closest() ​
closest<
TElement>(selector):TElement|undefined
Defined in: core/src/core/element.ts:776
Returns the closest ancestor (including this element) matching the CSS-like selector, or undefined.
Type Parameters ​
| Type Parameter | Default type |
|---|---|
TElement extends Element<Partial<BaseState>, ElementEventMap> | Element<Partial<BaseState>, ElementEventMap> |
Parameters ​
| Parameter | Type |
|---|---|
selector | string |
Returns ​
TElement | undefined
Inherited from ​
computeFaces() ​
protectedcomputeFaces():Face3D[]
Defined in: 3d/src/elements/mesh.ts:86
Returns ​
Face3D[]
Overrides ​
destroy() ​
destroy():
void
Defined in: core/src/core/element.ts:1025
Detaches the element from its parent Group and tears down its event subscriptions.
Returns ​
void
Inherited from ​
dispose() ​
protecteddispose(key?):void
Defined in: core/src/core/disposer.ts:25
Disposes all resources under the given key, or all resources if no key is provided.
Parameters ​
| Parameter | Type |
|---|---|
key? | PropertyKey |
Returns ​
void
Inherited from ​
emit() ​
Call Signature ​
emit<
TEvent>(event):TEvent
Defined in: core/src/core/event-bus.ts:185
Emits an event, invoking all matching handlers and bubbling to the parent if applicable. Handlers for the event's own type run first, then EVENT_WILDCARD subscriptions.
Type Parameters ​
| Type Parameter | Default type |
|---|---|
TEvent extends Event<undefined> | Event<undefined> |
Parameters ​
| Parameter | Type |
|---|---|
event | TEvent |
Returns ​
TEvent
Inherited from ​
Call Signature ​
emit<
TEvent>(type,data):Event<ElementEventMap[TEvent]>
Defined in: core/src/core/event-bus.ts:186
Emits an event, invoking all matching handlers and bubbling to the parent if applicable. Handlers for the event's own type run first, then EVENT_WILDCARD subscriptions.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof ElementEventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
data | ElementEventMap[TEvent] |
Returns ​
Event<ElementEventMap[TEvent]>
Inherited from ​
getBoundingBox() ​
getBoundingBox(
local?):Box
Defined in: core/src/core/element.ts:871
Returns this element's bounding box: the on-screen (world) box by default, or the raw local box when local is true. The world box applies this element's own and every ancestor group's transform (mirroring the DOM's getBoundingClientRect); a rotated element yields a conservative axis-aligned box.
Parameters ​
| Parameter | Type | Default value | Description |
|---|---|---|---|
local | boolean | false | when true, returns the untransformed authored geometry instead of the world box. |
Returns ​
Inherited from ​
getComputedValue() ​
getComputedValue<
TKey>(key):MeshState[TKey]
Defined in: core/src/core/element.ts:723
Resolves a state value against the parent chain (own value, else the nearest ancestor's), the effective value an element renders with. Used where the resolved value is needed without a live context, such as computing a transition's start value.
Type Parameters ​
| Type Parameter |
|---|
TKey extends keyof MeshState |
Parameters ​
| Parameter | Type | Description |
|---|---|---|
key | TKey | The state property to resolve. |
Returns ​
MeshState[TKey]
The element's own value for key, or the nearest ancestor's when unset, else undefined.
Inherited from ​
getDepth() ​
getDepth(
context):number
Defined in: 3d/src/core/shape.ts:584
Returns the projected depth of this shape's origin in the given 3D context.
Parameters ​
| Parameter | Type |
|---|---|
context | Context3D |
Returns ​
number
Inherited from ​
getModelMatrix() ​
protectedgetModelMatrix():Matrix4
Defined in: 3d/src/core/shape.ts:492
Returns ​
Inherited from ​
getParentMatrix3D() ​
protectedgetParentMatrix3D():Matrix4|null
Defined in: 3d/src/core/shape.ts:504
Returns ​
Matrix4 | null
Inherited from ​
getStateValue() ​
protectedgetStateValue<TKey>(key):MeshState[TKey]
Defined in: core/src/core/element.ts:686
Reads this element's own state value (no inheritance). Inherited paint now cascades through the render tree: a group applies its paint at its boundary (Context.pushGroup) and descendants pick it up from the context's copied state, so property getters return own values only, mirroring how the browser resolves computed style at paint time. Use Element.getComputedValue when the effective (inheritance-resolved) value is required outside a render pass (e.g. animation start values).
Type Parameters ​
| Type Parameter |
|---|
TKey extends keyof MeshState |
Parameters ​
| Parameter | Type |
|---|---|
key | TKey |
Returns ​
MeshState[TKey]
Inherited from ​
getWorldTransform() ​
getWorldTransform():
Matrix|null
Defined in: core/src/core/element.ts:805
The element's world transform (own and every ancestor's transform composed root-first), or null when the composition is the identity. Cached against the parent chain's state versions, so static scenes skip the matrix rebuild; any state change (or reparent) along the chain recomputes. A chain node whose transform origin resolves against an uncacheable box (a group with a string origin) bypasses the cache entirely.
Returns ​
Matrix | null
Inherited from ​
has() ​
has(
type):boolean
Defined in: core/src/core/event-bus.ts:123
Returns whether there are any listeners registered for the given event type. Wildcard subscriptions (EVENT_WILDCARD) are not listeners for any concrete type, so a bus observed only through the wildcard still reports false here.
Parameters ​
| Parameter | Type |
|---|---|
type | keyof ElementEventMap |
Returns ​
boolean
Inherited from ​
interpolate() ​
interpolate(
newState,interpolators?):Interpolator<void>
Defined in: 3d/src/core/shape.ts:476
Creates an interpolator that transitions from the current state towards the target state, invalidating this shape's cached geometry on every tick.
The base tick writes straight to the state bag, which is the one path that bypasses Shape3D's setStateValue override — the face cache's only invalidation hook. Without this a transition on a geometry property (size, radius, segments, …) finished with the new state value but the mesh still built from the old one.
Parameters ​
| Parameter | Type |
|---|---|
newState | Partial<ElementInterpolationState<TState>> |
interpolators | ElementInterpolators<TState> |
Returns ​
Interpolator<void>
Inherited from ​
intersectsWith() ​
intersectsWith(
x,y,options?):boolean
Defined in: 3d/src/core/shape.ts:884
Tests whether a point hits this shape, by casting the pointer ray through its triangles.
A projected silhouette reports a hit anywhere inside a shape's outline — through the hole of a torus, between the blades of a fan, across the bore of a casing — so the geometry itself is what decides here. pointerEvents: 'none' still suppresses the hit; 'fill' and 'stroke' have no meaning for a solid and are treated as 'all'.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate in logical space (CSS pixels relative to the context's top-left), the same space pointer event payloads report. |
y | number | Y coordinate in logical space (CSS pixels relative to the context's top-left). |
options? | Partial<ElementIntersectionOptions> | Hit-testing options, such as whether the test originates from a pointer event. |
Returns ​
boolean
Whether the pointer ray meets the shape's geometry.
Inherited from ​
matches() ​
matches(
selector):boolean
Defined in: core/src/core/element.ts:771
Tests whether this element matches the CSS-like selector.
Parameters ​
| Parameter | Type |
|---|---|
selector | string |
Returns ​
boolean
Inherited from ​
off() ​
off<
TEvent>(type,handler):void
Defined in: core/src/core/event-bus.ts:144
Removes a previously registered handler for the given event type.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof ElementEventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
handler | EventHandler<ElementEventMap[TEvent]> |
Returns ​
void
Inherited from ​
on() ​
on<
TEvent>(event,handler,options?):Disposable
Defined in: core/src/core/element.ts:744
Subscribes a handler to an element event, returning a disposable subscription.
Overrides EventBus.on to additionally invalidate the Context's tracked-element cache for interaction events, keeping hit testing accurate as listeners are added and removed.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof ElementEventMap |
Parameters ​
| Parameter | Type | Description |
|---|---|---|
event | TEvent | The event name to listen for. |
handler | EventHandler<ElementEventMap[TEvent]> | Callback invoked when the event is emitted. |
options? | EventSubscriptionOptions | Optional subscription options (e.g. self-only filtering). |
Returns ​
A disposable used to remove the subscription.
Inherited from ​
once() ​
once<
TEvent>(type,handler,options?):Disposable
Defined in: core/src/core/event-bus.ts:159
Subscribes a handler that is automatically removed after it fires once.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof ElementEventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
handler | EventHandler<ElementEventMap[TEvent]> |
options? | EventSubscriptionOptions |
Returns ​
Inherited from ​
raycast() ​
raycast(
ray,options?):Intersection3D|null
Defined in: 3d/src/core/shape.ts:539
Intersects a world-space ray with this shape's geometry.
intersectsWith answers only whether the pointer is over the shape; this reports where the ray met it, on which face, and at what texture coordinate. It also works before the shape has rendered, and against any ray rather than one through a pointer position.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
ray | Ray | The world-space ray to cast. |
options? | Raycast3DOptions | Whether to accept back-facing hits. |
Returns ​
Intersection3D | null
The nearest intersection, or null when the ray misses.
Inherited from ​
raycastDistance() ​
raycastDistance(
x,y):number|null
Defined in: 3d/src/core/shape.ts:843
The distance along the pointer ray at which this shape is hit, or null when it is missed.
intersectsWith can only answer whether a shape was hit, and a scene painted with a global depth sort needs to know which hit is nearest to say which shape the pointer is really on. Context3D ranks its hits with this; the result is memoized per pointer position, so asking twice costs one raycast.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate in logical space (CSS pixels relative to the context's top-left). |
y | number | Y coordinate in logical space (CSS pixels relative to the context's top-left). |
Returns ​
number | null
The world-space distance to the nearest hit, or null when the shape is missed or has not rendered.
Inherited from ​
render() ​
render(
context):void
Defined in: 3d/src/core/shape.ts:630
Renders this element by applying transforms and context state, then invoking the optional callback.
Parameters ​
| Parameter | Type |
|---|---|
context | Context |
Returns ​
void
Inherited from ​
retain() ​
protectedretain(value,key?):void
Defined in: core/src/core/disposer.ts:14
Registers a disposable resource under an optional key for later cleanup.
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
value | Disposable | undefined |
key | PropertyKey | Disposer.defaultKey |
Returns ​
void
Inherited from ​
setFaces() ​
setFaces(
faces):void
Defined in: 3d/src/elements/mesh.ts:81
Replaces the face list, invalidating the cached geometry.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
faces | Face3D[] | The new faces, held by reference. |
Returns ​
void
setStateValue() ​
protectedsetStateValue<TKey>(key,value):void
Defined in: 3d/src/core/shape.ts:457
Sets a state value, marking the element Element.$touched. When the value differs from the current one it is written, the element is marked Element.$dirty, and an updated event is emitted; setting a primitive value equal to the current one is a no-op beyond $touched (no write, no $dirty, no event). Reference-equal objects and arrays always take the full path, since in-place mutation makes them indistinguishable from a changed value.
Type Parameters ​
| Type Parameter |
|---|
TKey extends keyof MeshState |
Parameters ​
| Parameter | Type |
|---|---|
key | TKey |
value | MeshState[TKey] |
Returns ​
void
Inherited from ​
transformVertices() ​
protectedtransformVertices(vertices,matrix?):Vector3[]
Defined in: 3d/src/core/shape.ts:522
Parameters ​
| Parameter | Type |
|---|---|
vertices | Vector3[] |
matrix? | Matrix4 |
Returns ​
Vector3[]