← Back to Docs
  • index.html
  • Clayground
  • Clayground.Canvas3D
  • Line3dGeometry
  • Clayground 2025.2
  • Line3dGeometry QML Type

    Custom geometry for rendering 3D lines as box-shaped segments. More...

    Import Statement: import Clayground.Canvas3D

    Properties

    Detailed Description

    Line3dGeometry creates geometry for rendering lines in 3D space. Each line segment is rendered as a box-shaped tube connecting consecutive vertices, providing visible width in all viewing directions.

    This geometry is typically used internally by the Line3D component.

    Example usage:

    import QtQuick3D
    import Clayground.Canvas3D
    
    Model {
        geometry: Line3dGeometry {
            vertices: [
                Qt.vector3d(0, 0, 0),
                Qt.vector3d(100, 50, 0),
                Qt.vector3d(200, 0, 0)
            ]
            width: 5.0
            color: "blue"
        }
        materials: DefaultMaterial { diffuseColor: "blue" }
    }

    See also Line3D.

    Property Documentation

    color : color

    The color of the line.

    Defaults to white. Note that the actual rendered color depends on the material applied to the model using this geometry.


    vertices : list<vector3d>

    The list of 3D points defining the line path.

    Each consecutive pair of vertices defines a line segment. The line is rendered as connected box-shaped tubes through all vertices.


    width : real

    The width of the line in world units.

    Controls the thickness of the box-shaped line segments. Defaults to 1.0.