【问题标题】:How to use the various Forge Viewer transforms如何使用各种 Forge Viewer 转换
【发布时间】:2020-05-11 11:52:42
【问题描述】:

以下是迄今为止我使用NOP_VIEWER.model.getData() 发现的各种转换。

我正在使用变换将位置带入查看器空间,但我找不到任何好的文档来描述它们的作用。我希望这个问题可以通过提供一些关于这些转换的作用以及如何/何时使用它们的文档来提供帮助。

模型最初来自 Revit。

  1. GlobalOffset (Vector3)
  2. placementWithOffset (Matrix4) - 似乎只是 GlobalOffset 作为矩阵的倒数?
  3. placementTransform (Matrix4) - 在我测试过的所有模型中都未定义,我看到一些提示表明这是用户定义的矩阵。
  4. refPointTransform (Matrix4)

另外,NOP_VIEWER.model.getData().metadata 中有一些转换。这些可能是 Revit 特定的:

  1. metadata.georeference.positionLL84 (Array[3]) - 这是存储模型 GPS 坐标的位置
  2. metadata.georeference.refPointLMV (Array[3]) - 不知道这是什么,它在许多模型上都有巨大且看似随机的值。例如,在我当前的模型上,它是[-17746143.211481072, -6429345.318822183, 27.360225423452952]
  3. metadata.[custom values].angleToTrueNorth - 我猜这是指定模型是与真北对齐还是与磁北对齐?
  4. metadata.[custom values].refPointTransform - (Array[12]) - 用于创建上述refPointTransform 矩阵的数据

有人可以帮助记录这些转换的作用吗?

相关:Place a custom object into viewer space using GPS coords

【问题讨论】:

    标签: autodesk-forge autodesk-viewer


    【解决方案1】:

    作为替代解决方案,查看器与扩展一起使用。 Autodesk.Geolocation 扩展提供了一些方法来处理您提到的数据结构:

    加载扩展:

    let geoExt;
    NOP_VIEWER.loadExtension('Autodesk.Geolocation').then((e) => {geoExt = e});
    

    或者获取已经加载的扩展:

    let geoExt = NOP_VIEWER.getLoadedExtensions()['Autodesk.Geolocation']
    

    然后使用方法转换坐标

    geoExt.lmvToLonLat
    geoExt.lonLatToLmv
    

    这是quick article on it

    您可以.activate() 扩展程序以查看有关模型地理位置的更多信息。

    【讨论】:

    • 谢谢你,我已经在使用我链接的另一个问题中描述的 GeoLocation 扩展。我要做的第一件事是const pos = geoExt.lonLatToLmv(lon,lat,alt)。但是我仍然需要申请globalOffsetRefPointTransform 才能将pos 带入查看器空间。
    猜你喜欢
    • 2020-06-09
    • 2020-10-21
    • 2021-09-21
    • 2018-05-14
    • 2018-03-26
    • 2021-08-27
    • 2019-04-29
    • 2019-10-26
    • 2016-12-18
    相关资源
    最近更新 更多