跳至主要內容

TubeLine

小于 1 分钟

TubeLine

管线,继承自LineBase对象,拥有一切Thing属性及方法。

构造器

new VT.TubeLine({
    // 点位数组 [[x, y, z], [x, y, z]...]
    points: [],

    // 几何造型参数
    geometry: {
        // 半径
        radius: 0.5,
        // 分段
        radialSegments: 20,

        // 开始弧度
        startRad: 0,

        // 交叉半径
        cornerRadius: 0.5,
    },
    // 材质参数
    // 材质类型为 THREE.MeshStandardMaterial
    material: {

    }
})

属性成员

type

  • 类型:{String} 物体类型TubeLine, 不可改

needPoints

  • 类型:{Boolean} 是否需要控制点,不可更改,默认为true

line

  • 类型:{THREE.Line} 线对象

length

  • 类型:{Number} 线长度

points

  • 类型:{Array} 点位数组

方法

updatePoints

更新点位置

  • updatePoints(points)
  • 类型:{Function}
  • 参数:
    • points {Array} 点位置 [[x, y, z], [x, y, z]...]
  • 返回:无

updateGeometry

更新点位置

  • updateGeometry(geometry)
  • 类型:{Function}
  • 参数:
    • geometry {Object} 几何造型参数
  • 返回:无
{
    radius: 0.5,
    radialSegments: 20,
    startRad: 0,
    cornerRadius: 0.5,
}
上次编辑于:
贡献者: dashun