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

查看:481
本文介绍了如何使用各种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 (数组[3])-这是模型的GPS坐标存储位置
  2. metadata.georeference.refPointLMV (Array [3])-不知道这是什么,并且在许多模型中它都有巨大且看似随机的值.例如,在我当前的模型上是[-17746143.211481072, -6429345.318822183, 27.360225423452952]
  3. 元数据.[自定义值] .angleToTrueNorth -我想这是在指定模型是对准真北还是磁北?
  4. 元数据.[自定义值] .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天全站免登陆