different geometry in SVF and SVF2 - autodesk-forge

We have an IFC file that is converted in SVF and SVF2.
We noticed that the same beam has different geometry in both formats (see picture
The SVF2 geometry is wrong (the beam is rotated or mirrored).
I will send the IFC to forge (dot) help (at) autodesk (dot) com

SVF2 barely reduces the number of geometry instances for this model:
SVF: 18015 geometries
SVF2: 17037 geometries
Since SVF2 loads every geometry individually via a websocket, it takes much longer if the number of instances isn't much smaller compared to SVF.
Add an extra querying string disableWebSocket=true to your website URL e.g. http://localhost:8000?disableWebSocket=true

Related

SVF2 format retrieves missing or incorrect data from Model Derivative on IFC and RVT

This question is connected another issue which I've posted before here: Inconsistent data.
When models are uploaded with SVF2 format, Model Derivative brings wrong data like (IfcGUID on externalId field or names on externalId field instead of real external id) or msising data like (names without [Revit ID], missing properties). But from viewer with SELECTION_CHANGED_EVENT right data and structure can be seen without any issue.
When the models are uploaded with older version SVF format there are no problems.
What could be the real issue here, should we not use SVF2 yet ?
Actually I don't think it's "wrong datas". With SVF2, the metadata endpoint will provide SVF2 data according to this SVF2 Metadata
So I guess it's normal you have some differences between your SVF and SVF2 data.
For the viewer part, I know you can change some parameters to specify whether you're working with SVF or SVF2 : Viewer initializer options
Hope it will help

Forge Viewer shows different data from Model Derivative data on IFC file

This is a process that I've always used. First I call the bulk data from model derivative for further structuring. But this time the derivative data is confusing. Because when I use getProperties from viewer it shows external id with expected format(0/0/0/145/79) but when the same element is called from derivative api, on the field of external id, ifcGUID (11h5ts$FhghhDGbOs) is written.
In short I can not get external id of element from derivative Api but it can be found from viewer.
What could cause to such confusion ?
Today I have uploaded the model with SVF format instead of SVF2 and it looks like everything is working fine and as expected. But I think this topic needs further investigation.

Forge is normalising obj file's coordinates

I am using forge to view obj file, but it is normalising the obj file's coordinates w.r.t centre of the screen. Due to which at a later point in time when I am rendering the custom THREE.js objects at original coordinate they are very very far apart from the model.
I am seeking one of the two solutions
Either I get a forge api to transform the custom object's coordinates the same way forge did for initial model, or
Forge displays the model in the correct position without normalising the coordinates but focuses camera to the model on initial load of the screen.
Forge typically moves 3D designs to the origin (to avoid floating point precision issues) but it stores the original offset in the globalOffset property in the model metadata. You could either:
Take the globalOffset value into account when inserting the custom three.js objects, or
Load the model with globalOffset set to an empty vector (new THREE.Vector3(0.0, 0.0, 0.0)), as explained in https://forge.autodesk.com/blog/multi-model-refresher.

Is it possible to load only one specific object from the model(document) when initializing the document in the Forge viewer?

We would like to know if it possible to initialize the viewer to only render an specific object id.
There is a tutorial to extract geometry from a model, but it involves using the derivative to convert geometry to OBJ.
https://forge.autodesk.com/en/docs/model-derivative/v2/tutorials/extract-geometry-from-source-file/
The idea is to create a catalog of objects based on the elements in a model (document). We usually work with Revit files.
Viewer works with dbIds (or nodeIds which are equivalent to objectIds) and may load bubbles (geometry constructs) selectively based on - see live sample here
viewer.loadModel(svfUrl,{ids:[dbIds...]})

Values for volume, area and length in Autodesk Forge Model Derivative API

I'm using Forge to extract data from Revit models (transformed to .nwc). I call
GET /modelderivative/v2/designdata/{urn}/metadata/{guid}/properties
to get all properties of my model. The problem is that for some reason values for volume, area and length for all Revit objects are now in the format "0.009 ft^3", while before they all were just numbers. What can be the reason for this? Is this an API change or the model is saved with some special parameters, etc.?
Yes, this is a change because previously you could not tell the unit of any of the values. Now it's showing the values as you find them in the Viewer as well.