Viewer model aggregation - coordinating problem

In the Viewer, I am dynamically aggregating models from multiple BIM files. The process involves initializing the viewer and then using LoadDocument and LoadModel for each model chosen by the user. These models are primarily NVC files (the ones I used for testing) that share a coordinate system. For the most part, the models load dynamically and stitch together correctly.

However, there seems to be an issue with the coordinate system when loading the second model - not always, but in some cases (specifically in v6.3 - I have not tested previous versions). When this problem occurs, I observe the following:

  1. Clicking the 'home' icon in the viewer only shows the first loaded model centered on the screen while the rest appear off-screen.
  2. Selecting an element results in selecting something else (with an offset), or in some cases, nothing at all (indicating the clicked coordinates were interpreted incorrectly).

After several attempts, it appears that this issue arises when the first loaded model does not occupy the full size of the aggregated model (such as one floor of a building).

I have found a workaround where, after loading the models, if I 'hide' and 'show' them again, it resolves the clicking and AGGREGATED_SELECTION event issues.

This solution is not ideal as I would prefer to load the models in the background while the user navigates around the existing aggregated model-set. Having to hide/show after loading a new model would disrupt the user experience.

Is there a way to 'reset' the viewer's coordinate system similar to what happens when hiding/showing the models?

Any assistance in resolving this issue would be greatly appreciated.

Thank you, Bandu

Answer №1

It appears that a significant offset is causing a precision problem, leading to the camera displaying excessive 'jittering'.

To resolve this issue, we must rectify the large offset by manually adjusting all geometry closer to the origin. Alternatively, correcting the original Navisworks file can also address the problem.

Firstly, let's approximate the offset value...

Hold down the ALT key and click on any object to set a green dot as the pivot point. Then utilize viewer.navigation.getPivotPoint() to retrieve the x, y, z value. (more details: https://github.com/wallabyway/markupExt/issues/2)

You will observe an xyz value similar to this... Z.Vector3 {x: 1296285.515098644, y: 14995636.431742325, z: 364.26238179027337}

Next, impose the global offset adjustment using this value to relocate all models precisely towards 0,0,0. like so...

line 70:

var modelOptions = {
    sharedPropertyDbPath: doc.getPropertyDbPath(),
    globalOffset: {x:1296285.515098644, y: 14995636.431742325, z:0}
};
viewer.loadModel(svfUrl, modelOptions, onLoadModelSuccess);

`

This action counteracts the impact of the substantial offset. As a result, the geometry no longer flickers, and the camera movement does not exhibit 'jittering' caused by precision concerns.

Please let me know if this solution proves effective for you. Michael

ps. You can extract the precise global-offset from the auxiliary AECModelData.json file, for more information refer to blog: forge.autodesk.com/blog/add-revit-levels-and-2d-minimap-your-3d

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Generate a unique sequence not functioning

I'm attempting to generate a unique string composed of random characters, similar to the example found at this source. $(document).ready(function(){ $('#randomize').click(function() { var str = ""; var possibleChars = "michaeljo ...

What is the best way to reference the className within nested SCSS when working with Next.js and React.js?

I am working on customizing a navbar that includes a hamburger button. My goal is to change the style, specifically the bar color and the appearance of the hamburger button, upon tapping. I have already attempted using &:active and .activeBar in the SCSS f ...

NestJS: Specify the data type for @Body()

Consider the code snippet below: @Post() public async createPet(@Body() petDetails: PostPetDto): Promise<any> { } In this scenario, the type of @Bod() petDetails defaults to plain/any instead of the declared type of PostPetDto. What is the recommen ...

Ways to manage an element that has been loaded using the load query function

After implementing the query load function to update posts on the homepage, I was able to display the most up-to-date posts. However, a new issue arose: Whenever I updated all posts without refreshing the entire page, I needed a way to control the element ...

Discovering elements that are currently visible in an Angular list

Suppose there is a variable named users which represents an array We have the following ng-repeat statement: ng-repeat="user in users | filterUser: searchUser: assignedUsers: selectedDivision" After filtering the users using searchUser and selectedDivis ...

Is there a way to access a computed property within methods?

Currently, I am utilizing this particular package to implement infinite scrolling in Vue. In order to continuously add new elements during each scroll, I fetch JSON data from my API server and store it in a data object. Subsequently, I divide the array in ...

Restricting the size of uploaded files in WebApi

Here is a simple WebApi code snippet that allows for file uploads: [HttpPost] public async Task<bool> UploadSingleFile() { bool isSuccess = false; try { var streamProvider = new MultipartFormDataStreamProvider("D:\\") ...

The Next.js Image component is not compatible with an external URL as the image source

I've been struggling to use the image component in Next.js with an external URL as the source, but I keep encountering an error. I followed the instructions in the official Next.js documentation and updated the next.config.js file, but unfortunately, ...

No content appearing on React screen

I initialized a fresh react project using "npx create-react-app name". After removing unnecessary files, the application no longer displays anything. I've encountered issues with react-router and defining routes as well. index.html: <!DOCTYPE html ...

Extract data from Markit On Demand API using JavaScript and AJAX

I'm struggling to properly parse the response from the API. While I can retrieve the entire response, I am a bit lost on how to effectively parse it. Below is my code snippet: <!DOCTYPE> <html> <head> <style> img ...

The crosshair functionality in Zing Chart is causing a CPU leak

After enabling the crosshair feature on my chart, I noticed a significant issue when using Chrome 57 (and even with versions 58 and ZingChart 2.6.0). The CPU usage spikes above 25% when hovering over the chart to activate the crosshair. With two charts, th ...

Angular - ui-router states are not being detected

I'm currently working on a Spring and Angular JS web application project. The structure of the project is as follows:https://i.sstatic.net/xgB4o.png app.state.js (function() { 'use strict'; angular .module('ftnApp') .con ...

Is it possible to customize the MongoDB Collection before loading the web application by fetching data asynchronously using Promises?

I am currently working with MongoDB and NodeJS, trying to preload my Collection customers every time the site is loaded. The process involves emptying the collection, populating it with empty Documents, and then replacing them with real data fetched from a ...

How can I stop the body from scrolling to 100% height when the virtual keyboard is displayed?

My chat app has sticky header and footer elements. To handle the mobile virtual keyboard opening, I adjust the document's height using window.visualViewport.height. For example, if the browser's height is 1000px and the virtual keyboard takes up ...

Tips for accessing the FormControlName of the field that has been modified in Angular reactive forms

My reactive form consists of more than 10 form controls and I currently have a subscription set up on the valueChanges observable to detect any changes. While this solution works well, the output always includes the entire form value object, which includ ...

The integration of Zoom SDK with React and Node inevitably leads to encountering errors

I have been struggling to integrate zoomsdk into my react app and have followed all the steps mentioned here. The backend part is functioning properly, and I am receiving the signature response. However, when attempting to run the frontend portion, I encou ...

The peculiar formatting issue with the jQuery datepicker that arises when adding more months

When adjusting the numberOfMonths parameter to a higher value such as 6, I noticed that the datepicker display appears unusual with the background extending further than expected. Take a look at my demonstration on jsfiddle: http://jsfiddle.net/zw3z2vjh/ ...

Guide on how to initialize a variable in Express.js within a conditional statement in Node.js

Trying to create a variable based on a conditional statement, but even with simple code I am unable to retrieve the new variable. Here is my code: exports.productPatch = (req, res, next) => { const id = req.params.productId; const image = req.body.p ...

Exploring the Evolution of jsAjaxForm from jQuery Version 2.1.3 to Version 3.2.1

I'm in the process of upgrading to a higher version of jQuery (3.2.1) and encountering difficulties with updating the ajax file upload functionality using jsAjaxForm from jQuery v2.1.3. Is there a similar function that performs the same role as jaAjax ...

Dayjs is failing to retrieve the current system time

Hey everyone, I'm facing an issue with using Dayjs() and format to retrieve the current time in a specific format while running my Cypress tests. Despite using the correct code, I keep getting an old timestamp as the output: const presentDateTime = da ...