Table of Contents

Class CsgPolygon3D

Namespace
Godot
Assembly
GodotSharp.dll

An array of 2D points is extruded to quickly and easily create a variety of 3D meshes. See also CsgMesh3D for using 3D meshes as CSG nodes.

Note: CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a MeshInstance3D with a PrimitiveMesh. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay.

[GodotClassName("CSGPolygon3D")]
public class CsgPolygon3D : CsgPrimitive3D, IDisposable
Inheritance
CsgPolygon3D
Implements
Inherited Members

Constructors

CsgPolygon3D()

public CsgPolygon3D()

Properties

Depth

When Mode is Depth, the depth of the extrusion.

public float Depth { get; set; }

Property Value

float

Material

Material to use for the resulting mesh. The UV maps the top half of the material to the extruded shape (U along the length of the extrusions and V around the outline of the Polygon), the bottom-left quarter to the front end face, and the bottom-right quarter to the back end face.

public Material Material { get; set; }

Property Value

Material

Mode

The Mode used to extrude the Polygon.

public CsgPolygon3D.ModeEnum Mode { get; set; }

Property Value

CsgPolygon3D.ModeEnum

PathContinuousU

When Mode is Path, by default, the top half of the Material is stretched along the entire length of the extruded shape. If false the top half of the material is repeated every step of the extrusion.

public bool PathContinuousU { get; set; }

Property Value

bool

PathInterval

When Mode is Path, the path interval or ratio of path points to extrusions.

public float PathInterval { get; set; }

Property Value

float

PathIntervalType

When Mode is Path, this will determine if the interval should be by distance (Distance) or subdivision fractions (Subdivide).

public CsgPolygon3D.PathIntervalTypeEnum PathIntervalType { get; set; }

Property Value

CsgPolygon3D.PathIntervalTypeEnum

PathJoined

When Mode is Path, if true the ends of the path are joined, by adding an extrusion between the last and first points of the path.

public bool PathJoined { get; set; }

Property Value

bool

PathLocal

When Mode is Path, if true the Transform3D of the CsgPolygon3D is used as the starting point for the extrusions, not the Transform3D of the PathNode.

public bool PathLocal { get; set; }

Property Value

bool

PathNode

When Mode is Path, the location of the Path3D object used to extrude the Polygon.

public NodePath PathNode { get; set; }

Property Value

NodePath

PathRotation

When Mode is Path, the path rotation method used to rotate the Polygon as it is extruded.

public CsgPolygon3D.PathRotationEnum PathRotation { get; set; }

Property Value

CsgPolygon3D.PathRotationEnum

PathSimplifyAngle

When Mode is Path, extrusions that are less than this angle, will be merged together to reduce polygon count.

public float PathSimplifyAngle { get; set; }

Property Value

float

PathUDistance

When Mode is Path, this is the distance along the path, in meters, the texture coordinates will tile. When set to 0, texture coordinates will match geometry exactly with no tiling.

public float PathUDistance { get; set; }

Property Value

float

Polygon

The point array that defines the 2D polygon that is extruded. This can be a convex or concave polygon with 3 or more points. The polygon must not have any intersecting edges. Otherwise, triangulation will fail and no mesh will be generated.

Note: If only 1 or 2 points are defined in Polygon, no mesh will be generated.

public Vector2[] Polygon { get; set; }

Property Value

Vector2[]

SmoothFaces

If true, applies smooth shading to the extrusions.

public bool SmoothFaces { get; set; }

Property Value

bool

SpinDegrees

When Mode is Spin, the total number of degrees the Polygon is rotated when extruding.

public float SpinDegrees { get; set; }

Property Value

float

SpinSides

When Mode is Spin, the number of extrusions made.

public int SpinSides { get; set; }

Property Value

int

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool