Search code examples
node.js3dautodesk-forgeautodesk-viewerautodesk-model-derivative

Understanding the coordinate systems transformation and references of Revit elements after upload to Forge platform


I have recently uploaded a Revit model to Forge platform. The model defines a Survey point (N/S: 0, E/W: 0) a Base Project point (N/S: 149443, E/W: 371248, Angle to True North: 41.43°)), and a model room. The model room contains an element with a coordinate (N/S: 149326, E/W: 380492)

I am trying to make sense of how these points inside the model get transformed and translated after upload to Forge platform.

I used this function (viewerApp.getCurrentViewer().model.getData().bbox) to to obtain the bounding box of the model in Forge Viewer, and found these:

min: (X: 1229.5841064453125, Y: 471.1938171386719, Z: -0.5249344110488892), and

max: (X: 1284.9295654296875, Y: 527.90869140625, Z: 13.123359680175781)

Additionally, I made these initial assumptions:

  1. Unit assumption: 1 point in northing & easting coordinate provided in Revit model translates directly to a point in X & Y of Forge Viewer.
  2. Origin assumption: I assumed that the origin of the Forge Viewer lies in (0, 0, 0) point in the Viewer API. Additionally the viewer uses the model's Survey Point or the Project Base point as the origin.
  3. The element of the Revit model would fall inside the Forge Viewer model's bounding box

However, the information of the bounding box (with X & Y ranging from 1229-1284 & 471-527 respectively) does not seem to contain the coordinate of the element defined inside the room model if it were on survey point (with the element's X & Y at 149326 & 380492 with respect to survey point), or if it were on project base point (with element's X & Y at -117 & 9444 with respect to project base point).

Also, referring to this question, it might be that the model coordinate might be offset by a global offset obtainable by this command: (viewerApp.getCurrentViewer().model.getData().globalOffset). However, when I run this command (0, 0, 0) is returned. Suppose if the offset is somehow correct, it seems the unit scaling of Northing/Easting to Forge's X/Y is different than my assumption.

I wish to ask which part of the assumptions I made above is faulty?

  • If my unit assumption is an issue, how is the Northing/Easting unit converted to Forge Viewer's X & Y unit?
  • If my origin assumption is faulty in addition to the first assumption, how does Forge set the origin in the viewer? If the origin is based on the Revit model, does the set origin refer to the model's Survey point/Project Base point?
  • Is there any additional transformation done to the Revit model and its elements while the Model Derivative API performs the model translation?

I'm using Forge Viewer API v6, Model Derivative API v2, and using Node.JS as the server for the Forge Viewer API


Solution

  • If I understood right, it seems that you placed your Revit model using Project Coordinates, but only the project address property is extracted.

    As mentioned on the other answer you pointed out, the models are centered around the origin and the globalOffset indicates this value.

    You may need to adjust the bounding box with the units of the model, I would suggest checking this answer.