Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
- AudioListener3D
- AudioStreamPlayer3D
- BoneAttachment3D
- Camera3D (1)
- CollisionObject3D (2)
- CollisionPolygon3D
- CollisionShape3D
- GridMap
- ImporterMeshInstance3D
- Joint3D (5)
- LightmapProbe
- Marker3D
- NavigationLink3D
- NavigationObstacle3D
- NavigationRegion3D
- OpenXRCompositionLayer (3)
- OpenXRHand
- Path3D
- PathFollow3D
- RayCast3D
- RemoteTransform3D
- ShapeCast3D
- Skeleton3D
- SkeletonModifier3D (7)
- SpringArm3D
- SpringBoneCollision3D (3)
- VehicleWheel3D
- VisualInstance3D (13)
- XRFaceModifier3D
- XRNode3D (2)
- XROrigin3D
- Decal
- FogVolume
- GPUParticlesAttractor3D (3)
- GPUParticlesCollision3D (4)
- GeometryInstance3D (7)
- Light3D (3)
- LightmapGI
- OccluderInstance3D
- OpenXRVisibilityMask
- ReflectionProbe
- RootMotionView
- VisibleOnScreenNotifier3D (1)
- VoxelGI
- CPUParticles3D
- CSGShape3D (2)
- GPUParticles3D
- Label3D
- MeshInstance3D (1)
- MultiMeshInstance3D
- SpriteBase3D (2)
Table of contents
-
var depth: float = 1.0 -
var material: Material -
var mode = MODE_DEPTH -
var path_continuous_u: bool -
var path_interval: float -
var path_interval_type: int -
var path_joined: bool -
var path_local: bool -
var path_node: NodePath -
var path_rotation: int -
var path_rotation_accurate: bool -
var path_simplify_angle: float -
var path_u_distance: float -
var polygon: PackedVector2Array = PackedVector2Array(0, 0, 0, 1, 1, 1, 1, 0) -
var smooth_faces: bool = false -
var spin_degrees: float -
var spin_sides: int -
const MODE_DEPTH = 0 enum Mode -
const MODE_SPIN = 1 enum Mode -
const MODE_PATH = 2 enum Mode -
const PATH_ROTATION_POLYGON = 0 enum PathRotation -
const PATH_ROTATION_PATH = 1 enum PathRotation -
const PATH_ROTATION_PATH_FOLLOW = 2 enum PathRotation -
const PATH_INTERVAL_DISTANCE = 0 enum PathIntervalType -
const PATH_INTERVAL_SUBDIVIDE = 1 enum PathIntervalType -
enum Mode -
enum PathRotation -
enum PathIntervalType
CSGPolygon3D #
is_instantiable, Node3D, Node, core, not_builtin_classes
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.
Members #
var depth: float = 1.0#
When mode is MODE_DEPTH, the depth of the extrusion.
var material: 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.
var mode = MODE_DEPTH#
The mode used to extrude the polygon.
var path_continuous_u: bool#
When mode is MODE_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.
var path_interval: float#
When mode is MODE_PATH, the path interval or ratio of path points to extrusions.
var path_interval_type: int#
When mode is MODE_PATH, this will determine if the interval should be by distance (PATH_INTERVAL_DISTANCE) or subdivision fractions (PATH_INTERVAL_SUBDIVIDE).
var path_joined: bool#
When mode is MODE_PATH, if true the ends of the path are joined, by adding an extrusion between the last and first points of the path.
var path_local: bool#
When mode is MODE_PATH, if true the Transform3D of the CSGPolygon3D is used as the starting point for the extrusions, not the Transform3D of the path_node.
var path_node: NodePath#
When mode is MODE_PATH, the location of the Path3D object used to extrude the polygon.
var path_rotation: int#
When mode is MODE_PATH, the path rotation method used to rotate the polygon as it is extruded.
var path_rotation_accurate: bool#
When mode is MODE_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.
var path_simplify_angle: float#
When mode is MODE_PATH, extrusions that are less than this angle, will be merged together to reduce polygon count.
var path_u_distance: float#
When mode is MODE_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.
var polygon: PackedVector2Array = PackedVector2Array(0, 0, 0, 1, 1, 1, 1, 0)#
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.
var smooth_faces: bool = false#
If true, applies smooth shading to the extrusions.
var spin_degrees: float#
When mode is MODE_SPIN, the total number of degrees the polygon is rotated when extruding.
var spin_sides: int#
When mode is MODE_SPIN, the number of extrusions made.
Methods #
Annotations #
Constants #
const MODE_DEPTH = 0 enum Mode#
The polygon shape is extruded along the negative Z axis.
const MODE_SPIN = 1 enum Mode#
The polygon shape is extruded by rotating it around the Y axis.
const MODE_PATH = 2 enum Mode#
The polygon shape is extruded along the Path3D specified in path_node.
const PATH_ROTATION_POLYGON = 0 enum PathRotation#
The polygon shape is not rotated.
Note: Requires the path Z coordinates to continually decrease to ensure viable shapes.
const PATH_ROTATION_PATH = 1 enum PathRotation#
The 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.
const PATH_ROTATION_PATH_FOLLOW = 2 enum PathRotation#
The polygon shape follows the path and its rotations around the path axis.
const PATH_INTERVAL_DISTANCE = 0 enum PathIntervalType#
When mode is set to MODE_PATH, path_interval will determine the distance, in meters, each interval of the path will extrude.
const PATH_INTERVAL_SUBDIVIDE = 1 enum PathIntervalType#
When mode is set to MODE_PATH, path_interval will subdivide the polygons along the path.
Constructors #
Enums #
Mode#
enum Mode {
MODE_DEPTH = 0,
MODE_SPIN = 1,
MODE_PATH = 2,
}PathRotation#
enum PathRotation {
PATH_ROTATION_POLYGON = 0,
PATH_ROTATION_PATH = 1,
PATH_ROTATION_PATH_FOLLOW = 2,
}PathIntervalType#
enum PathIntervalType {
PATH_INTERVAL_DISTANCE = 0,
PATH_INTERVAL_SUBDIVIDE = 1,
}