LineDashedNodeMaterial
A node-based version of LineDashedMaterial, used for creating programmable dashed line effects for line-based geometries.
Core Advantages
Its primary advantage is the ability to programmatically control dash properties (like dash size, gap size, scale, and offset) using other nodes. This allows for dynamic and complex dashed line effects, such as patterns that change over time or based on spatial position, which is not possible with the standard LineDashedMaterial.
Common Uses
Creating selection boxes or dashed outlines
Representing hidden lines in engineering or architectural visualization
Visualizing dynamic paths or trajectories
Making UI elements with animated effects
How to adjust
Adjust standard properties like `color`, `linewidth`, `scale`, `dashSize`, and `gapSize` to change its appearance. Crucially, you must call `computeLineDistances()` on the line's geometry for the dashing effect to appear. For advanced control, use the node-specific properties: `dashSizeNode`, `gapSizeNode`, `dashScaleNode`, and `offsetNode`. By connecting other nodes (e.g., a `timer()` node for animation or a `positionGeometry` node for spatial variation) to these inputs, you can create dynamic dash patterns.
Code Examples
1<lineSegments>
2 <edgesGeometry>
3 <boxGeometry />
4 </edgesGeometry>
5 {/* A basic cyan dashed line material. Note: Line distances must be computed for the geometry. */}
6 <lineDashedNodeMaterial
7 color="cyan"
8 linewidth={1}
9 scale={1}
10 dashSize={0.1}
11 gapSize={0.05}
12 />
13</lineSegments>