Skip to content

Intermact API Reference / @intermact/render-three / buildStrokeGeometry

Function: buildStrokeGeometry()

buildStrokeGeometry(path, width, revealStart?, revealEnd?, revealOpts?): BufferGeometry

Defined in: stroke.ts:31

Stroke geometry as a world-unit ribbon (design.md §15). A polyline is expanded to a triangle ribbon of the given world-unit width, with vertex offsets along averaged segment normals. Trim (revealStart/revealEnd, §15) is applied by slicing each contour by arc length before ribboning, which makes Create stroke reveal smooth without per-frame shader work.

Constant-screen-width ("px") strokes are approximated by passing a width already converted to world units by the viewport; a dedicated screen-space shader path is deferred (noted in the M3 implementation log).

Parameters

path

SampledPath2D

width

number

revealStart?

number = 0

revealEnd?

number = 1

revealOpts?

StrokeRevealOptions

Returns

BufferGeometry

Intermact v1.0 — 文档覆盖 Phase-1 / Phase-2 / Phase-3(全阶段)