[英]the distance between two points of the object , using IFCviewerAPI
我想通過點擊計算 object 的兩點之間的距離。 我使用 IFCviewerAPI。
此解決方案通常適用於 Three.js,因此它適用於任何 Three.js 應用程序,包括 web-ifc-three 和 web-ifc-viewer(如您的情況)。
首先,您將在 3D 空間 (x, y, z) 中找到兩個點的 position,假設有兩個 pointA 和 pointB 每個都有 (x, y, z) 值
Math.pow(Math.pow( (pointB.x - pointA.x), 2) + Math.pow( (pointB.y - pointA.y),2) + Math.pow( (pointB.z - pointA.z),2), 0.5)
雖然此解決方案是超級基本的,但您需要知道在將此代碼擴展到多個點時可能會發現性能問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.