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

    Renders a 3D line as connected box segments using GPU instancing. More...

    Import Statement: import Clayground.Canvas3D

    Properties

    Detailed Description

    BoxLine3D creates thick, visible lines by rendering box-shaped segments between consecutive positions. This approach produces lines that look good from any viewing angle, unlike screen-space line rendering.

    Uses GPU instancing for efficient rendering.

    Example usage:

    import Clayground.Canvas3D
    
    BoxLine3D {
        positions: [
            Qt.vector3d(0, 0, 0),
            Qt.vector3d(100, 50, 0),
            Qt.vector3d(200, 0, 0)
        ]
        width: 5.0
        color: "green"
    }

    See also Line3D and LineInstancing.

    Property Documentation

    color : color

    The color of the line.

    Defaults to blue.


    material : Material

    The material used for rendering.

    Defaults to a DefaultMaterial with diffuseColor set to color.


    positions : vector3d

    List of 3D positions defining the line path.


    width : real

    The width of the box-shaped line segments.

    Defaults to 1.