Skip to content

Line

Generates a straight line segment between two endpoints.

Category: Shapes Menu path: Shapes > Line

Ports

PortTypeDirectionDescription
outshapeoutputLine shape data (open path)

Parameters

ParamTypeDefaultDescription
p1vec2(-100, 0)First endpoint in local-space pixels
p2vec2(100, 0)Second endpoint in local-space pixels

Expose Channels

When enabled (E button on node header), adds input ports that override params via edge connections:

PortTypeOverrides
p1_invec2p1
p2_invec2p2

How It Works

Generates an open (unclosed) path with two points, forming a straight line segment in local space. Since the path is open, only DrawShape's stroke settings will produce visible output -- fill has no effect on open paths. The shape is pure geometry data (no GPU allocation) and must be rasterized via DrawShape to produce a visible image.

Usage Examples

Basic: Draw a line

Line -> Transform2D -> DrawShape -> Output. Set DrawShape's stroke color and stroke width to make the line visible.

Animated connector

Keyframe p1 and p2 to animate a line moving between two positions. Or connect VectorMath outputs to the p1_in / p2_in expose channels.

Trail backbone

Line -> ResampleShape -> ShapeAttributes -> DrawShape. Resample the line into many points, then use ShapeAttributes with a Noise field to vary color or opacity along the line's length.

Tips

  • Lines are open paths -- only stroke rendering applies. Set a stroke width and color in DrawShape.
  • Shapes are centered at the origin. Use Transform2D for all positioning and rotation.
  • Both endpoints are keyframeable as vec2 values, allowing independent animation of each end.
  • For multi-segment lines or curves, use EditableShape with the pen tool instead.