geom

GeomPolyline

Inherits: Node3D

A path in 3D space. No dash slot: a dash pattern needs arc length along the whole path, which a polyline does not know until every segment is measured.

Drawing it

The code behind the picture above.

GeomDraw.matrix = Transform3D.IDENTITY
var path := GeomPolylinePath.new()
GeomDraw.polyline_join = Geom.JOIN_ROUND
GeomDraw.thickness = 0.15
GeomDraw.color = VIOLET
for i in 25:
	var u := i / 24.0
	path.add_point(Vector3(-1.2 + u * 2.4, sin(u * TAU) * 0.6, cos(u * TAU) * 0.3))
GeomDraw.polyline(path, false)

Properties

BlendMode blend_mode Geom.BLEND_TRANSPARENT
bool closed false
Color color Color(1, 1, 1, 1)
PolylineJoin join Geom.JOIN_MITER
PackedVector3Array points PackedVector3Array()
float thickness 0.05
ThicknessSpace thickness_space Geom.SPACE_METERS

Enumerations

enum Geom.ThicknessSpace

Geom.SPACE_METERS = 0
Thickness in world units; shrinks on screen with distance.
Geom.SPACE_PIXELS = 1
Thickness in screen pixels; constant on-screen size.
Geom.SPACE_VIEWPORT = 2
A fraction of the viewport: 100 span its shorter side, so 1 is one percent of it and about 11 pixels at 1080p. The same idea as CSS vmin. Radii and sizes here are whole-ish numbers; strokes come out below 1, and a stroke that should stay a fixed pixel width wants SPACE_PIXELS instead.

enum Geom.PolylineJoin

Geom.JOIN_SIMPLE = 0
Corners at plain half-width; the outside of a corner pinches inward.
Geom.JOIN_MITER = 1
Corners extended to where the edges meet, clamped on sharp turns.
Geom.JOIN_ROUND = 2
As simple, with a disc laid over each joint.
Geom.JOIN_BEVEL = 3
The outside of a corner cut off square.

enum Geom.BlendMode

Geom.BLEND_OPAQUE = 0
Writes depth and sorts against other geometry; hard edges, no fade.
Geom.BLEND_TRANSPARENT = 1
Standard alpha compositing. The default.
Geom.BLEND_ADDITIVE = 2
Brightens what is behind. Good for glows.
Geom.BLEND_MULTIPLY = 3
Darkens what is behind. Good for tints.
Geom.BLEND_SUBTRACT = 4
Subtracts this color from the background.
Geom.BLEND_TRANSPARENT_DEPTH = 5
Transparent, but writing depth so shapes occlude by position.

Property descriptions

BlendMode blend_mode = Geom.BLEND_TRANSPARENT

How the shape combines with what is behind it. Transparent Depth is the one that also writes depth, so shapes occlude each other by position rather than by the order they were drawn.

bool closed = false

Join the last point back to the first.

Color color = Color(1, 1, 1, 1)

Fill color, or the wall's color for an outline.

PolylineJoin join = Geom.JOIN_MITER

How corners are shaped: Simple, Miter, or Round.

PackedVector3Array points = PackedVector3Array()

Points local to this node. Editable as an array in the inspector. The path, in the node's own space. Fewer than two points draws nothing.

float thickness = 0.05

How wide the strip is drawn.

ThicknessSpace thickness_space = Geom.SPACE_METERS

Whether thickness is measured in meters, in pixels, or in viewport units. Meters are world units and shrink with distance; pixels hold their size on screen however far away the camera is. The node's scale multiplies it either way.