如何使用各种 Forge Viewer 转换 [英] How to use the various Forge Viewer transforms

查看:29
本文介绍了如何使用各种 Forge Viewer 转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Below are the various transforms I have found so far using NOP_VIEWER.model.getData().

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

I'm using the transforms to bring a position into viewer space, and I haven't been able to find any good documentation describing what they all do. My hope here is that this question can help by providing some documentation of the role of these transforms and how/when to use them.

该模型最初来自 Revit.

The model originally comes from Revit.

  1. GlobalOffset(矢量 3)
  2. placementWithOffset (Matrix4) - 似乎只是作为矩阵的 GlobalOffset 的倒数?
  3. placementTransform (Matrix4) - 在我测试过的所有模型中都未定义,我已经看到一些提示,表明这是一个用户定义的矩阵.
  4. refPointTransform (Matrix4)
  1. GlobalOffset (Vector3)
  2. placementWithOffset (Matrix4) - seems to be just the inverse of GlobalOffset as a matrix?
  3. placementTransform (Matrix4) - undefined in all models I've tested, I've seen some hints that this is a user defined matrix.
  4. refPointTransform (Matrix4)

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

Also, there are some transforms in the NOP_VIEWER.model.getData().metadata. These may be Revit specific:

  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 矩阵的数据
  1. metadata.georeference.positionLL84 (Array[3]) - this is where the model's GPS coords are stored
  2. metadata.georeference.refPointLMV (Array[3]) - no idea what this is, and it has huge and seemingly random values on many models. For example, on my current model it is [-17746143.211481072, -6429345.318822183, 27.360225423452952]
  3. metadata.[custom values].angleToTrueNorth - I guess this is specifying whether the model is aligned to true or magnetic north?
  4. metadata.[custom values].refPointTransform - (Array[12]) - data used to create the refPointTransform matrix above

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

Can someone help by documenting what these transforms do?

相关:使用 GPS 坐标将自定义对象放入查看器空间

推荐答案

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

As an alternative solution, the Viewer works with extensions. The Autodesk.Geolocation extension provides a few methods to handle the data structure you mentioned:

加载扩展:

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

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

Or get already loaded extension:

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

然后使用方法转换坐标

geoExt.lmvToLonLat
geoExt.lonLatToLmv

这是一篇关于它的快速文章.

您可以 .activate() 扩展名以查看有关模型地理位置的其他信息.

You may .activate() the extension to see additional information on the model geo location.

这篇关于如何使用各种 Forge Viewer 转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆