<sk-cone-points-source>

← prev index next →

Scatters clones over the surface of a cone, cylinder, or frustum — the way to array copies up a tapering or straight tube, caps included.

Remarks

This is the cone/cylinder member of the points-source family: a points-source defines the set of positions at which a sk-cloner places copies of its content, so it lives as a child of a <sk-cloner> and the cloner's other child is the template that gets cloned at each point. Because the positions are generated procedurally in the shader (see ShaderFunctionPointsSource), a finely subdivided cone costs the same handful of parameters as a coarse one.

Key attributes. bottom-radius and top-radius set the two end radii: a top-radius of 0 gives a pointed cone, equal radii give a straight cylinder, and two different non-zero radii give a truncated cone (frustum). height sets how far it extends along the orientation axis. height-segments sets how many rings run up the side and rotation-segments how many points sit around each ring (the angular resolution). orientation is the axis the cone extends along — one of +x, -x, +y, -y, +z, -z. center offsets the shape from the origin. Only unique points are emitted — a single apex for a pointed cone, one centre per end cap, and no seam duplicates.

Related. For a rounded-capped tube use sk-capsule-points-source; for a full donut use sk-torus-points-source. Its flat end cap is a sk-disc-points-source, and for a filled volume use sk-grid-points-source. To scatter over an arbitrary object's surface rather than an analytic cone, see sk-mesh-surface-points-source. Its host is always a sk-cloner.

Serve these docs to run the live example. WebGPU needs a secure context — open this page via grunt serve rather than double-clicking the file. The Markup tab works from disk.

Attributes

AttributeTypeDefaultDescription
top-radius <number> 0 Radius at the top of the cone (0 for pointed cone).
bottom-radius <number> 1.0 Radius at the bottom/base of the cone.
height <number> 1.0 Height of the cone along orientation axis.
height-segments <number> 1 Number of segments along the height.
rotation-segments <number> 8 Number of segments around the circumference.
orientationanimatable <orientation-axis> ("+x" | "-x" | "+y" | "-y" | "+z" | "-z") "+y" Axis along which the cone extends.
center <3d-position> ([<number>, <number>, <number>]) [0, 0, 0] Geometric center of the cone (midpoint of its extent along the orientation axis).