C#: make one with the Geom.Nodes.Torus() factory, then set and read its properties
by name with Set and Get, or in the Inspector, where the node
is GeomTorus.
A solid torus in 3D space.
From code
The code used to generate this page's thumbnail.
var torus := GeomTorus.new()
torus.radius = 0.95
torus.thickness = 0.34
torus.color = AMBER
torus.blend_mode = Geom.BLEND_OPAQUE
add_child(torus) var torus = Geom.Nodes.Torus();
torus.Set("radius", 0.95f);
torus.Set("thickness", 0.34f);
torus.Set("color", AMBER);
torus.Set("blend_mode", (int)Geom.BlendMode.Opaque);
AddChild(torus); Properties
| BlendMode | blend_mode | Geom.BLEND_OPAQUEGeom.BlendMode.Opaque |
| Color | color | Color(1, 1, 1, 1) |
| int | primitive_detail | 24 |
| float | radius | 0.5 |
| float | shading | 0.75 |
| float | thickness | 0.2 |
Enumerations
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_OPAQUEGeom.BlendMode.Opaque
How the solid blends with what is behind it. Opaque, and Transparent Depth with an opaque color, sort by position; the rest draw in call order.
Color color = Color(1, 1, 1, 1)
Color.
int primitive_detail = 24
Segments around the ring. More is rounder and costs more vertices.
float radius = 0.5
Center to the middle of the tube, in world units.
float shading = 0.75
How strongly the solid is shaded, 0 flat to 1 full.
float thickness = 0.2
Tube diameter.