1. calculateMinDistance
计算两个构件之间的最小距离。
1.1. 参数说明:
名称 | 说明 | 类型 | 是否必填 | 示例 |
---|---|---|---|---|
componentKey | 构件key | 字符串 string | 是 | "M123_456" |
componentKey2 | 第二个构件key | 字符串 string | 是 | "M123_456" |
返回值说明 | 类型 | 示例 |
---|---|---|
返回结果的对象 | object | NULL |
object.start | THREE.Vector3 | NULL |
object.end | THREE.Vector3 | NULL |
object.minDistance | Number | NULL |
1.2. 调用方式:
/**
* 计算两个构件之间的最小距离,返回的信息包括:
* start :起点坐标
* end : 终点坐标
* minDistance : 最小距离
* @method calculateMinDistance
* @param {string} componentKey 构件key
* @param {string} componentKey2 第二个构件key
* @return {Object} - 最小距离信息
*/
viewer3D.calculateMinDistance({
x: 0,
y: 0
});