reckfellENGINE

CsgPolygon3D

Extrudes a 2D polygon shape to create a 3D mesh.

On this page
class CsgPolygon3DReckfellSharpInherits CsgPrimitive3D

Extrudes a 2D polygon shape to create a 3D mesh.

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.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

CsgPolygon3DConstructor
# CsgPolygon3D
C#
public CsgPolygon3D();

Properties17

DepthProperty
# Depth
C#
public float Depth { get; set; }

When CsgPolygon3D.Mode is CsgPolygon3D.ModeEnum.Depth, the depth of the extrusion.

MaterialProperty
# Material
C#
public Material Material { get; set; }

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 CsgPolygon3D.Polygon), the bottom-left quarter to the front end face, and the bottom-right quarter to the back end face.

ModeProperty
# Mode
C#
public CsgPolygon3D.ModeEnum Mode { get; set; }

The CsgPolygon3D.Mode used to extrude the CsgPolygon3D.Polygon.

PathContinuousUProperty
# PathContinuousU
C#
public bool PathContinuousU { get; set; }

When CsgPolygon3D.Mode is CsgPolygon3D.ModeEnum.Path, by default, the top half of the CsgPolygon3D.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.

PathEntityProperty
# PathEntity
C#
public EntityPath PathEntity { get; set; }

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

PathIntervalProperty
# PathInterval
C#
public float PathInterval { get; set; }

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

PathIntervalTypeProperty
# PathIntervalType
C#
public CsgPolygon3D.PathIntervalTypeEnum PathIntervalType { get; set; }

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

PathJoinedProperty
# PathJoined
C#
public bool PathJoined { get; set; }

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

PathLocalProperty
# PathLocal
C#
public bool PathLocal { get; set; }

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

PathRotationProperty
# PathRotation
C#
public CsgPolygon3D.PathRotationEnum PathRotation { get; set; }

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

PathRotationAccurateProperty
# PathRotationAccurate
C#
public bool PathRotationAccurate { get; set; }

When CsgPolygon3D.Mode is CsgPolygon3D.ModeEnum.Path, if true the polygon will be rotated according to the proper tangent of the path at the sampled points. If false an approximation is used, which decreases in accuracy as the number of subdivisions decreases.

PathSimplifyAngleProperty
# PathSimplifyAngle
C#
public float PathSimplifyAngle { get; set; }

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

PathUDistanceProperty
# PathUDistance
C#
public float PathUDistance { get; set; }

When CsgPolygon3D.Mode is CsgPolygon3D.ModeEnum.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.

PolygonProperty
# Polygon
C#
public Vector2[] Polygon { get; set; }

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 CsgPolygon3D.Polygon, no mesh will be generated.

SmoothFacesProperty
# SmoothFaces
C#
public bool SmoothFaces { get; set; }

If true, applies smooth shading to the extrusions.

SpinDegreesProperty
# SpinDegrees
C#
public float SpinDegrees { get; set; }

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

SpinSidesProperty
# SpinSides
C#
public int SpinSides { get; set; }

When CsgPolygon3D.Mode is CsgPolygon3D.ModeEnum.Spin, the number of extrusions made.

Methods35

GetDepthfloat
# GetDepth
C#
public float GetDepth();
Returns float
GetMaterialMaterial
# GetMaterial
C#
public Material GetMaterial();
Returns Material
GetModeCsgPolygon3D.ModeEnum
# GetMode
C#
public CsgPolygon3D.ModeEnum GetMode();
Returns CsgPolygon3D.ModeEnum
GetPathEntityEntityPath
# GetPathEntity
C#
public EntityPath GetPathEntity();
Returns EntityPath
GetPathIntervalfloat
# GetPathInterval
C#
public float GetPathInterval();
Returns float
GetPathIntervalTypeCsgPolygon3D.PathIntervalTypeEnum
# GetPathIntervalType
C#
public CsgPolygon3D.PathIntervalTypeEnum GetPathIntervalType();
Returns CsgPolygon3D.PathIntervalTypeEnum
GetPathRotationCsgPolygon3D.PathRotationEnum
# GetPathRotation
C#
public CsgPolygon3D.PathRotationEnum GetPathRotation();
Returns CsgPolygon3D.PathRotationEnum
GetPathRotationAccuratebool
# GetPathRotationAccurate
C#
public bool GetPathRotationAccurate();
Returns bool
GetPathSimplifyAnglefloat
# GetPathSimplifyAngle
C#
public float GetPathSimplifyAngle();
Returns float
GetPathUDistancefloat
# GetPathUDistance
C#
public float GetPathUDistance();
Returns float
GetPolygonVector2[]
# GetPolygon
C#
public Vector2[] GetPolygon();
Returns Vector2[]
GetSmoothFacesbool
# GetSmoothFaces
C#
public bool GetSmoothFaces();
Returns bool
GetSpinDegreesfloat
# GetSpinDegrees
C#
public float GetSpinDegrees();
Returns float
GetSpinSidesint
# GetSpinSides
C#
public int GetSpinSides();
Returns int
IsPathContinuousUbool
# IsPathContinuousU
C#
public bool IsPathContinuousU();
Returns bool
IsPathJoinedbool
# IsPathJoined
C#
public bool IsPathJoined();
Returns bool
IsPathLocalbool
# IsPathLocal
C#
public bool IsPathLocal();
Returns bool
SetDepthvoid
# SetDepth
C#
public void SetDepth(float depth);
Parameters
NameTypeDefault
depthfloat—
SetMaterialvoid
# SetMaterial
C#
public void SetMaterial(Material material);
Parameters
NameTypeDefault
materialMaterial—
SetModevoid
# SetMode
C#
public void SetMode(CsgPolygon3D.ModeEnum mode);
Parameters
NameTypeDefault
modeCsgPolygon3D.ModeEnum—
SetPathContinuousUvoid
# SetPathContinuousU
C#
public void SetPathContinuousU(bool enable);
Parameters
NameTypeDefault
enablebool—
SetPathEntityvoid
# SetPathEntity
C#
public void SetPathEntity(EntityPath path);
Parameters
NameTypeDefault
pathEntityPath—
SetPathIntervalvoid
# SetPathInterval
C#
public void SetPathInterval(float interval);
Parameters
NameTypeDefault
intervalfloat—
SetPathIntervalTypevoid
# SetPathIntervalType
C#
public void SetPathIntervalType(CsgPolygon3D.PathIntervalTypeEnum intervalType);
Parameters
NameTypeDefault
intervalTypeCsgPolygon3D.PathIntervalTypeEnum—
SetPathJoinedvoid
# SetPathJoined
C#
public void SetPathJoined(bool enable);
Parameters
NameTypeDefault
enablebool—
SetPathLocalvoid
# SetPathLocal
C#
public void SetPathLocal(bool enable);
Parameters
NameTypeDefault
enablebool—
SetPathRotationvoid
# SetPathRotation
C#
public void SetPathRotation(CsgPolygon3D.PathRotationEnum pathRotation);
Parameters
NameTypeDefault
pathRotationCsgPolygon3D.PathRotationEnum—
SetPathRotationAccuratevoid
# SetPathRotationAccurate
C#
public void SetPathRotationAccurate(bool enable);
Parameters
NameTypeDefault
enablebool—
SetPathSimplifyAnglevoid
# SetPathSimplifyAngle
C#
public void SetPathSimplifyAngle(float degrees);
Parameters
NameTypeDefault
degreesfloat—
SetPathUDistancevoid
# SetPathUDistance
C#
public void SetPathUDistance(float distance);
Parameters
NameTypeDefault
distancefloat—
SetPolygon2 overloads
# SetPolygon · 1/2
C#
public void SetPolygon(Vector2[] polygon);
Parameters
NameTypeDefault
polygonVector2[]—
# SetPolygon · 2/2
C#
public void SetPolygon(ReadOnlySpan<Vector2> polygon);
Parameters
NameTypeDefault
polygonReadOnlySpan<Vector2>—
SetSmoothFacesvoid
# SetSmoothFaces
C#
public void SetSmoothFaces(bool smoothFaces);
Parameters
NameTypeDefault
smoothFacesbool—
SetSpinDegreesvoid
# SetSpinDegrees
C#
public void SetSpinDegrees(float degrees);
Parameters
NameTypeDefault
degreesfloat—
SetSpinSidesvoid
# SetSpinSides
C#
public void SetSpinSides(int spinSides);
Parameters
NameTypeDefault
spinSidesint—

CsgPolygon3D.ModeEnum

ValueDescription
Depth = 0

The CsgPolygon3D.Polygon shape is extruded along the negative Z axis.

Path = 2

The CsgPolygon3D.Polygon shape is extruded along the Path3D specified in path_node.

Spin = 1

The CsgPolygon3D.Polygon shape is extruded by rotating it around the Y axis.

CsgPolygon3D.PathIntervalTypeEnum

ValueDescription
Distance = 0

When CsgPolygon3D.Mode is set to CsgPolygon3D.ModeEnum.Path, CsgPolygon3D.PathInterval will determine the distance, in meters, each interval of the path will extrude.

Subdivide = 1

When CsgPolygon3D.Mode is set to CsgPolygon3D.ModeEnum.Path, CsgPolygon3D.PathInterval will subdivide the polygons along the path.

CsgPolygon3D.PathRotationEnum

ValueDescription
Path = 1

The CsgPolygon3D.Polygon shape is rotated along the path, but it is not rotated around the path axis. Note: Requires the path Z coordinates to continually decrease to ensure viable shapes.

PathFollow = 2

The CsgPolygon3D.Polygon shape follows the path and its rotations around the path axis.

Polygon = 0

The CsgPolygon3D.Polygon shape is not rotated. Note: Requires the path Z coordinates to continually decrease to ensure viable shapes.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.