Skip to content

V2 API and Demo Coverage ​

Use this page as the index for the V2 public surface. The reference link is the canonical contract; the demo link shows the closest runnable example. “Facade exercised” means the demo uses MeshLine, which creates the low-level class internally. “Reference only” identifies an API that is documented but does not yet have a dedicated live demo.

The regular MeshLine façade and surface profile support the WebGPU and WebGL2 renderers. The root MeshLineCompute export requires WebGPU compute support and has no WebGL2 simulation fallback. The optional gpu-culling and gpu-path entries require native WebGPU and Three.js r183 or newer; their demos report the complete fallback when those features are unavailable.

Root package exports ​

ExportCanonical referenceRunnable coverageCoverage note
MeshLine (named and default)MeshLineBasic, SandboxPreferred entry point for screen lines and surfaces.
MeshLineComputeMeshLineComputeCompute CurvesExperimental WebGPU-only storage-buffer simulation façade; regular MeshLine remains the cross-backend path.
MeshLineGeometryMeshLineGeometryWaves, FollowFacade exercised; use the class directly only for low-level composition.
MeshLineNodeMaterialMeshLineNodeMaterialBasic, SandboxFacade exercised across color, gradient, dash, maps, and opacity. Basic also runs widthFn, gradientFn, opacityFn, dashFn, uvFn, and discardFn through the public facade.
MeshLineSurfaceGeometrySurface low-level APISurface, Variable TopologyFacade exercised; the topology gallery covers joins, caps, and reversals.
MeshLineSurfaceNodeMaterialSurface low-level APIMetallic Tube, Surface RoadFacade exercised with lighting, maps, roughness, and metalness.
MeshLinePickerGPU PickingLaser HeistExercises instanced, GPU-positioned lines that CPU raycasting cannot resolve.
MeshLinePickerHelperPicker debug helperLaser HeistThe picker-debug mode visualizes the pick pass.
lineCoordStroke coordinateMetallic TubeNormalized cross-section coordinate for TSL hooks; the tube normal is built from it.
circlePositionsPosition helpersBasicDirectly exercised.
squarePositionsPosition helpersSandboxSelect the square shape.
rectanglePositionsPosition helpersRice FieldUsed for the water-border paths.
sineWavePositionsPosition helpersSandboxSelect the sine-wave shape.
straightLinePosition helpersSandboxSelect the straight-line shape.
storagePositionsPosition helpersLorenz Trails, IsobarsWebGPU storage-buffer gpuPositionNode, with optional ring-buffer trails, closed loops, and dual-buffer morphing.
straightLineBetweenPosition helpersReference onlyCopy-paste examples cover tuples and Three.js vectors.

Stable-layout update APIs ​

These methods update an existing MeshLine; they are not constructor options.

MethodBest useReferenceRunnable coverage
setPositions(points, updateBounding?)Replace all point data while reusing compatible buffers.Updating geometry efficientlyWaves, Follow
setPositionRange(points, startPoint, options?)Patch one stable CPU-billboard span and upload its neighbor halo.MeshLineGeometry range updatesDraw Lines patches every active stroke follower each frame; surfaces and smoothed topology must use setPositions().
addVertexAttribute(name, components?) / addVertexAttributes(layout) / setVertexValues(name, values, startVertex?)Allocate separate or portable packed custom per-vertex data and bulk-update it.Vertex attributesDraw Lines, Follow, Flying Baguettes
addInstanceAttribute(name, components?) / addInstanceAttributes(layout) / setInstanceValues(name, values, startInstance?)Allocate separate or portable packed custom per-instance data and bulk-update it.Instance managementGPU Instancing rewrites only the rings that wrap each frame with post-upload bulk writes.
getVertexBufferUsage(options?) / validateVertexBufferBudget(options?)Inspect or enforce the eight-buffer portable WebGPU target before pipeline creation.Instance managementAPI regression coverage validates separate and interleaved vertex/instance layouts.
setInstanceValue(name, index, value)Make an occasional scalar instance edit.Instance managementGPU Instancing

Draw Lines also uploads each new stroke's colors as one contiguous setVertexValues() range, so the update APIs are visible in a running scene rather than a diagram.

V2 profiles and optional entry points ​

CapabilityImport / entryCanonical referenceRunnable coverage
World-space road/ribbon surfacesMeshLine or the two root surface classesWorld-Space SurfacesSurface, Surface Road, Metallic Tube, Variable Topology
Experimental WebGPU compute curvesroot MeshLineCompute exportMeshLineComputeCompute Curves
Native-WebGPU chunk cullingmakio-meshline/gpu-cullingGPU CullingGPU Culling; append ?culling=0 for the unculled baseline.
Experimental native-WebGPU point pathmakio-meshline/gpu-pathGPU PathGPU Path, Variable Topology
GPU picking and debug visualizationroot MeshLinePicker exportsGPU PickingLaser Heist
React Three Fiber wrapperroot package through a local R3F componentReact Three FiberStandalone R3F example; the wrapper covers current non-deprecated MeshLineConfigureOptions except autoResize.
Vue wrapperroot package through a local Vue componentVueStandalone Vue example; the wrapper omits autoResize and deprecated scalar dash aliases.

GPU Path demo switches ​

The experimental path demo uses query parameters so the compared workloads remain deterministic:

QueryEffect
?gpu=0Force the complete CPU MeshLine fallback.
?simplify=0Keep the native GPU path but disable local-space simplification.
?topology=variableEnable true over-limit miter bevel topology.
?topology=bevel or ?topology=roundSelect the requested true outer join.
&cap=square or &cap=roundSelect a non-butt open-path cap.

For behavioral changes from V1, start with Migrate to V2. For the reasoning and compatibility gates behind these profiles, see the V2 Design Contract.