Draws a cone or frustum — a shape with a base tapering to a point or a smaller top — for spires, funnels, and spotlight volumes.
Declarative element:
<sk-cone>
Global: available as sk.Cone inside a scene <script>.
This is a member of the AbstractMeshNode geometry-primitive family: a
solid, renderable shape you position, paint, and animate like any scene node. It is
the shape to reach for whenever you need a pointed spire, a truncated funnel, or a
spotlight-cone volume.
Key attributes. A cone is defined by two radii — bottom-radius at the base and
top-radius at the top — both animatable, so the shape can morph live. top-radius="0"
gives a classic pointed cone; a non-zero top-radius truncates it into a frustum
(funnel); equal radii would be a plain tube (use sk-cylinder for that).
height (also animatable) is the length along the orientation axis (+x, -x,
+y, -y, +z, -z), which picks base-to-tip direction. rotation-segments
(minimum 3) sets how many facets go around the circumference — raise it for a smooth
cone; height-segments subdivides along the length.
Related. Give it appearance with a sk-surface-paint (fills the faces) or
an sk-edge-paint (draws the wireframe), each naming a sk-plain-material.
It is closely kin to sk-cylinder (a cone with equal radii) and sk-sphere,
and, like every mesh, can supply clone positions to a sk-cloner.
constructor(config?: { topRadius?: number; bottomRadius?: number; height?: number; heightSegments?: number; rotationSegments?: number; orientation?: AxisOrientation; cullMode?: CullMode; overlay?: boolean; overlayOccludedOpacity?: number; id?: string; x?: number; y?: number; z?: number; h?: number; p?: number; b?: number; quaternion?: Quaternion; sx?: number; sy?: number; sz?: number; s?: number; class?: string; style?: string })
Inherited from: AbstractMeshNode, RenderableNode, SceneNode, SkenraAnimatable
— see those pages for inherited members.
| Property | Type | Default | Description | Declared by |
|---|---|---|---|---|
topRadiusanimatable |
number |
0 |
Gets the radius at the top of the cone. | Cone |
bottomRadiusanimatable |
number |
1 |
Gets the radius at the bottom/base of the cone. | Cone |
heightanimatable |
number |
1 |
Gets the height of the cone along its orientation axis. | Cone |
heightSegments |
number |
1 |
Gets the number of segments along the height of the cone. | Cone |
rotationSegments |
number |
8 |
Gets the number of segments around the circumference of the cone. | Cone |
orientation |
AxisOrientation |
"+y" |
Gets the axis along which the cone extends. | Cone |
cullMode |
CullMode |
— | Alias for defaultCullMode under the name of the reflected |
AbstractMeshNode |
overlay |
boolean |
false |
Whether this node renders as an overlay with depth-aware translucency. | RenderableNode |
overlayOccludedOpacity |
number |
0.3 |
Alpha multiplier for overlay fragments occluded by scene geometry. | RenderableNode |
idconfig-only |
string |
— | Unique identifier for the node, reflected to the host id attribute. |
SceneNodeConfig |
xanimatable |
number |
0 |
Gets the X position component. | SceneNode |
yanimatable |
number |
0 |
Gets the Y position component. | SceneNode |
zanimatable |
number |
0 |
Gets the Z position component. | SceneNode |
hanimatable |
number |
0 |
Gets the heading (Y-axis) rotation in radians. | SceneNode |
panimatable |
number |
0 |
Gets the pitch (X-axis) rotation in radians. | SceneNode |
banimatable |
number |
0 |
Gets the bank (Z-axis) rotation in radians. | SceneNode |
quaternionanimatable |
Quaternion |
— | Gets the rotation as a quaternion. | SceneNode |
sxanimatable |
number |
1 |
Gets the X-axis scale factor. | SceneNode |
syanimatable |
number |
1 |
Gets the Y-axis scale factor. | SceneNode |
szanimatable |
number |
1 |
Gets the Z-axis scale factor. | SceneNode |
sconfig-only |
number |
— | Uniform scale factor for all axes (overrides sx, sy, sz if provided) | SceneNodeConfig |
classconfig-only |
string |
— | Standard HTML class applied to the node host at construction |
SceneNodeConfig |
styleconfig-only |
string |
— | Standard inline style applied to the node host at construction |
SceneNodeConfig |
| Property | Type | Default | Description | Declared by |
|---|---|---|---|---|
topRadiusBasebase value |
number |
— | Gets the base (non-animated) value of topRadius. | Cone |
bottomRadiusBasebase value |
number |
— | Gets the base (non-animated) value of bottomRadius. | Cone |
heightBasebase value |
number |
— | Gets the base (non-animated) value of height. | Cone |
castShadowanimatable |
boolean |
true |
Gets whether this mesh casts shadows. | AbstractMeshNode |
defaultCullMode |
CullMode |
"back" |
Gets the default face culling mode for surface paints on this mesh. | AbstractMeshNode |
geometryread-only |
{ vertices: Float32Array<ArrayBufferLike>; normals: Float32Array<ArrayBufferLike>; uvs: Float32Array<ArrayBufferLike> | null; indices: Uint32Array<ArrayBufferLike>; edgeIndices: Uint32Array<ArrayBufferLike>; } |
— | Gets an object containing all geometry data for the mesh. | AbstractMeshNode |
pointsSourceread-only |
PointsSource |
— | Returns a PointsSource for use with Cloner. | AbstractMeshNode |
verticesread-only |
Float32Array<ArrayBufferLike> |
— | Gets the vertex positions of the mesh. | AbstractMeshNode |
normalsread-only |
Float32Array<ArrayBufferLike> |
— | Gets the vertex normals of the mesh. | AbstractMeshNode |
indicesread-only |
Uint32Array<ArrayBufferLike> |
— | Gets the triangle indices of the mesh. | AbstractMeshNode |
edgeIndicesread-only |
Uint32Array<ArrayBufferLike> |
— | Gets the edge indices of the mesh for wireframe rendering. | AbstractMeshNode |
uvsread-only |
Float32Array<ArrayBufferLike> | null |
— | Gets the per-vertex texture coordinates of the mesh. | AbstractMeshNode |
pointConstraintsread-only |
readonly PointConstraint[] |
[] |
Read-only view of the attached point constraints, exposed via the | AbstractMeshNode |
triangleCountread-only |
number |
— | The number of faces (triangles) this mesh emits — the exclusive upper bound | AbstractMeshNode |
hRad |
number |
0 |
Gets the heading (Y-axis) rotation in radians. | SceneNode |
pRad |
number |
0 |
Gets the pitch (X-axis) rotation in radians. | SceneNode |
bRad |
number |
0 |
Gets the bank (Z-axis) rotation in radians. | SceneNode |
hDeg |
number |
0 |
Gets the heading (Y-axis) rotation in degrees. | SceneNode |
pDeg |
number |
0 |
Gets the pitch (X-axis) rotation in degrees. | SceneNode |
bDeg |
number |
0 |
Gets the bank (Z-axis) rotation in degrees. | SceneNode |
xBasebase value |
number |
— | Gets the base (non-animated) value of X position. | SceneNode |
yBasebase value |
number |
— | Gets the base (non-animated) value of Y position. | SceneNode |
zBasebase value |
number |
— | Gets the base (non-animated) value of Z position. | SceneNode |
hBasebase value |
number |
0 |
Gets the base (non-animated) value of heading (Y-axis rotation). | SceneNode |
pBasebase value |
number |
0 |
Gets the base (non-animated) value of pitch (X-axis rotation). | SceneNode |
bBasebase value |
number |
0 |
Gets the base (non-animated) value of bank (Z-axis rotation). | SceneNode |
quaternionBasebase value |
Quaternion |
— | Gets the base (non-animated) quaternion rotation. | SceneNode |
sxBasebase value |
number |
— | Gets the base (non-animated) value of X-axis scale. | SceneNode |
syBasebase value |
number |
— | Gets the base (non-animated) value of Y-axis scale. | SceneNode |
szBasebase value |
number |
— | Gets the base (non-animated) value of Z-axis scale. | SceneNode |
draggable |
boolean |
false |
Gets whether this node can be dragged. | SceneNode |
parentread-only |
SceneNode | null |
— | The parent node in the scene graph, or null at the root. |
SceneNode |
sceneread-only |
any |
— | Gets the Scene this node belongs to, if any. | SceneNode |
posread-only |
Point3D |
— | Gets the world-space position of this node. | SceneNode |
matrixread-only |
Float32Array<ArrayBufferLike> |
— | Gets the computed 4x4 transformation matrix. | SceneNode |
animationsread-only |
SkenraAnimation[] |
— | Public getter for the animations affecting this target. | SkenraAnimatable |
| Method | Description | Declared by |
|---|---|---|
addPointConstraint(constraint: PointConstraint): void |
Add a PointConstraint to this mesh. |
AbstractMeshNode |
removePointConstraint(constraint: PointConstraint): boolean |
Remove a PointConstraint from this mesh. |
AbstractMeshNode |
resolveSelectionName(name: string): ResolvedSelection |
Resolves a mesh-local selection name against this mesh's registry. |
AbstractMeshNode |
resolveSelectionRef(ref: string): ResolvedSelection |
Resolves a #id selection reference against the scene, validating that the |
AbstractMeshNode |
getPredefinedSelections(): SelectionRegistryEntry[] |
The per-primitive predefined selections (documented defaults derived from the | AbstractMeshNode |
getBoundsInSpace(targetSpaceMatrix: Float32Array): { minX: number; maxX: number; minY: number; maxY: number; minZ: number; maxZ: number; } | null |
Computes the axis-aligned bounding box (AABB) of this mesh in a target coordinate space. | AbstractMeshNode |
getWorldBoundingSphere(): BoundingSphere | null |
Computes the world-space bounding sphere of this mesh. | AbstractMeshNode |
addMaterialPaint(material: Material, paintTarget: PaintTarget, options?: any): Paint |
Applies a material to this node for a specific paint target. | SceneNode |
getPaints(): ReadonlyMap<PaintTarget, Paint> |
— | SceneNode |
getOwnPaints(): readonly Paint[] |
Gets only the paints directly applied to this node (not inherited). | SceneNode |
removePaint(paint: Paint): void |
Removes a paint from this node. | SceneNode |
getWorldPosition(): number[] |
Returns this node’s origin in world space. | SceneNode |
getWorldMatrix(): Float32Array<ArrayBufferLike> |
Returns this node’s world transform — its local transform composed with all ancestor transforms. | SceneNode |
setViewportPosition(camera: AbstractCamera, x: number, y: number, z: number = 0.5): boolean |
Sets the node's local translation so that it appears at the specified viewport position. | SceneNode |
getViewportPosition(camera?: AbstractCamera): [number, number, number] | null |
Returns the node's current world position projected to viewport CSS pixel coordinates. | SceneNode |
setNDCPosition(camera: AbstractCamera, ndcX: number, ndcY: number, ndcZ: number = 0.5): boolean |
Sets the node's local translation so that it appears at the specified NDC position in the viewport. | SceneNode |
animate(firstArg: TypedKeyframe<this>[] | TypedPropertyIndexedKeyframes<this> | Record<string, any> | globalThis.Keyframe[] | globalThis.PropertyIndexedKeyframes | null, secondArg?: number | KeyframeAnimationOptions | globalThis.KeyframeAnimationOptions): SkenraAnimation & Animation |
Creates a new SkenraAnimation for this target per Web Animations API. | SkenraAnimatable |
removeAnimation(animation: SkenraAnimation): boolean |
Removes a specific animation from this object. | SkenraAnimatable |
constrain(type: K, config: ConstraintConfigMap[K]): ConstraintReturnMap[K] |
Creates a constraint on this Animatable using a fluent API. | SkenraAnimatable |
// Create a standard pointed cone (default)
const cone = new Cone({ id: 'my-cone' });
// Create a frustum (truncated cone) for spotlight visualization
const frustum = new Cone({ id: 'spotlight-frustum',
topRadius: 0.5,
bottomRadius: 2,
height: 5,
rotationSegments: 16
});
// Create a tall spire with many segments
const spire = new Cone({ id: 'spire',
topRadius: 0,
bottomRadius: 1,
height: 10,
heightSegments: 20,
rotationSegments: 12
});
// Create a horizontal cone along negative X-axis
const horizontalCone = new Cone({ id: 'horizontal',
topRadius: 0,
bottomRadius: 1,
height: 2,
orientation: '-x'
});
// Modify cone properties after construction
cone.topRadius = 0.5; // Convert to frustum
cone.height = 3; // Make taller
cone.rotationSegments = 32; // Increase smoothness