Custom geometry for 3D boxes with edge rendering support. More...
| Import Statement: | import Clayground.Canvas3D |
Box3DGeometry provides the geometry data for rendering 3D boxes with customizable dimensions, face scaling, and edge rendering. It is typically used internally by the Box3D QML component.
The geometry is centered on the X and Z axes, with the origin at the bottom center (Y=0 is the floor).
Example usage:
import QtQuick3D import Clayground.Canvas3D Model { geometry: Box3DGeometry { size: Qt.vector3d(2, 3, 2) showEdges: true edgeThickness: 0.05 } materials: DefaultMaterial { diffuseColor: "red" } }
See also Box3D.
edgeColorFactor : real |
Darkening factor for edge colors.
A value between 0 and 1 that determines how dark the edges appear relative to the base color. Lower values create darker edges. Defaults to 0.4.
edgeMask : int |
Bitmask controlling which edges are visible.
Use the EdgeFlags enum values combined with bitwise OR to select specific edges. Defaults to AllEdges.
| Constant | Description |
|---|---|
Box3DGeometry.AllEdges | Show all edges (0xFF) |
Box3DGeometry.TopEdges | Show only top face edges |
Box3DGeometry.BottomEdges | Show only bottom face edges |
Box3DGeometry.FrontEdges | Show only front face edges |
Box3DGeometry.BackEdges | Show only back face edges |
Box3DGeometry.LeftEdges | Show only left face edges |
Box3DGeometry.RightEdges | Show only right face edges |
edgeThickness : real |
The thickness of edge lines in normalized units.
Controls how thick the edge lines appear. Defaults to 0.03.
faceScale : vector2d |
Scale factor applied to the selected face.
When scaledFace is set to a specific face, this vector determines how much that face is scaled in its local X and Y dimensions. Useful for creating pyramids, trapezoids, and other non-uniform shapes.
Defaults to (1, 1).
scaledFace : enumeration |
Which face of the box should be scaled.
| Constant | Description |
|---|---|
Box3DGeometry.NoFace | No face scaling (default) |
Box3DGeometry.TopFace | Scale the top face |
Box3DGeometry.BottomFace | Scale the bottom face |
Box3DGeometry.FrontFace | Scale the front face |
Box3DGeometry.BackFace | Scale the back face |
Box3DGeometry.LeftFace | Scale the left face |
Box3DGeometry.RightFace | Scale the right face |
showEdges : bool |
Whether to render edge lines on the box.
When true, dark lines are drawn along the edges of the box for a cartoon-style appearance. Defaults to true.
size : vector3d |
The dimensions of the box as a 3D vector (width, height, depth).
Defaults to (1, 1, 1).