geom

GeomLineGeom.Nodes.Line

Inherits: Node3D

C#: make one with the Geom.Nodes.Line() factory, then set and read its properties by name with Set and Get, or in the Inspector, where the node is GeomLine.

A line segment in 3D space.

From code

The code used to generate this page's thumbnail.

var line := GeomLine.new()
line.start = Vector3(-1.1, -0.6, 0)
line.end = Vector3(1.1, 0.6, 0)
line.end_cap = Geom.CAP_ROUND
line.thickness = 0.16
line.color = PINK
add_child(line)
var line = Geom.Nodes.Line();
line.Set("start", new Vector3(-1.1f, -0.6f, 0));
line.Set("end", new Vector3(1.1f, 0.6f, 0));
line.Set("end_cap", (int)Geom.LineEndCap.Round);
line.Set("thickness", 0.16f);
line.Set("color", PINK);
AddChild(line);

Properties

BlendMode blend_mode Geom.BLEND_TRANSPARENTGeom.BlendMode.Transparent
Color color Color(1, 1, 1, 1)
GeomDash dash null
Vector3 end Vector3(0.5, 0, 0)
LineEndCap end_cap Geom.CAP_ROUNDGeom.LineEndCap.Round
Resource fill null
Vector3 start Vector3(-0.5, 0, 0)
float thickness 0.05
ThicknessSpace thickness_space Geom.SPACE_WORLDGeom.ThicknessSpace.World

Enumerations

enum Geom.ThicknessSpace

Geom.SPACE_WORLDGeom.ThicknessSpace.World = 0
World units, the same as a node's position.
Geom.SPACE_VIEWPORT_PIXELSGeom.ThicknessSpace.ViewportPixels = 1
The viewport's pixels. Constant size on screen at any zoom.
Geom.SPACE_VIEWPORT_PERCENTGeom.ThicknessSpace.ViewportPercent = 2
Percent of the viewport's shorter side. Like CSS vmin.

enum Geom.LineEndCap

Geom.CAP_NONEGeom.LineEndCap.None = 0
Cut off exactly at an endpoint.
Geom.CAP_SQUAREGeom.LineEndCap.Square = 1
Extend by half the thickness at an endpoint.
Geom.CAP_ROUNDGeom.LineEndCap.Round = 2
Extend by half the thickness, rounded.

enum Geom.BlendMode

Geom.BLEND_OPAQUEGeom.BlendMode.Opaque = 0
Sorts by position. Hard edges: no anti-aliasing, and alpha is ignored.
Geom.BLEND_TRANSPARENTGeom.BlendMode.Transparent = 1
Standard alpha blending. The default.
Geom.BLEND_ADDITIVEGeom.BlendMode.Additive = 2
Adds this color to what is behind.
Geom.BLEND_MULTIPLYGeom.BlendMode.Multiply = 3
Multiplies what is behind by this color.
Geom.BLEND_SUBTRACTGeom.BlendMode.Subtract = 4
Subtracts this color from the background.
Geom.BLEND_TRANSPARENT_DEPTHGeom.BlendMode.TransparentDepth = 5
Transparent, but writes depth, so shapes with alpha 1 sort by position with anti-aliased edges. A translucent color behaves like Transparent.

Property descriptions

BlendMode blend_mode = Geom.BLEND_TRANSPARENTGeom.BlendMode.Transparent

How the shape blends with what is behind it.

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

Line color.

GeomDash dash = null

A dash pattern.

Vector3 end = Vector3(0.5, 0, 0)

End position.

LineEndCap end_cap = Geom.CAP_ROUNDGeom.LineEndCap.Round

How the ends are finished.

Resource fill = null

A gradient in place of color. Takes GeomFillLinear.

Vector3 start = Vector3(-0.5, 0, 0)

Start position.

float thickness = 0.05

Line width.

ThicknessSpace thickness_space = Geom.SPACE_WORLDGeom.ThicknessSpace.World

How thickness is measured.