Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug option raise exception #16

Open
picaosgeo opened this issue May 28, 2024 · 4 comments
Open

Debug option raise exception #16

picaosgeo opened this issue May 28, 2024 · 4 comments

Comments

@picaosgeo
Copy link

Hello,

I tried to convert an ifc file using mago-3d-tiler, but the tiles were not outputting, so I used the debug option.
However, when I run the program, I get the following exception error.

ExecutionException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke
“org.lwjgl.assimp.AIScene.mRootNode()” because “ aiScene” is null

The error seems to be about aiScene, but the error did not occur in the glb file conversion.
Ifc,fbx,shp will result in an exception error.

Test data can be downloaded from the following URL:
https://drive.google.com/file/d/1IzBTdZlaJs7V3U8JVXjBpEBOdklOKgVy/view?usp=sharing

PS C:\work\3ddb\mago3dtiler> docker run --rm -v "${PWD}/workspace:/workspace" gaia3d/mago-3d-tiler --debug -it ifc -i /workspace/ifc -o /workspace/output -l /workspace/log.log
>>
[INFO][09:49:28][mago.Mago3DTilerMain(printStart:73)]::
┳┳┓┏┓┏┓┏┓  ┏┓┳┓  ┏┳┓┳┓ ┏┓┳┓
┃┃┃┣┫┃┓┃┃   ┫┃┃   ┃ ┃┃ ┣ ┣┫
┛ ┗┛┗┗┛┗┛  ┗┛┻┛   ┻ ┻┗┛┗┛┛┗
3d-tiler(dev-version) by Gaia3D, Inc.
----------------------------------------
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:319)]::========================================
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:320)]::inputPath: /workspace/ifc
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:321)]::outputPath: /workspace/output
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:322)]::inputFormat: IFC
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:323)]::outputFormat: B3DM
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:324)]::terrainPath: null
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:325)]::instancePath: /workspace/ifc/instance.dae
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:326)]::logPath: /workspace/log.log
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:327)]::crs: null
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:328)]::proj: null
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:329)]::tileCount: 0
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:330)]::fileCount: 0
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:331)]::pointLimit: 65536
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:332)]::pointScale: 2
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:333)]::pointSkip: 4
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:334)]::nodeLimit: -1
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:335)]::minLod: 0
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:336)]::maxLod: 3
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:337)]::debug: true
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:338)]::debugLod: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:339)]::glb: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:340)]::classicTransformMatrix: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:341)]::multiThreadCount: 7
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:342)]::recursive: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:343)]::yUpAxis: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:344)]::refineAdd: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:345)]::flipCoordinate: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:346)]::zeroOrigin: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:347)]::autoUpAxis: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:348)]::ignoreTextures: false
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:349)]::nameColumn: name
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:350)]::heightColumn: height
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:351)]::altitudeColumn: altitude
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:352)]::absoluteAltitude: 0.0
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:353)]::minimumHeight: 1.0
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:354)]::skirtHeight: 4.0
[DEBUG][09:49:28][mago.GlobalOptions(printDebugOptions:355)]::========================================
[INFO][09:49:28][mago.Mago3DTiler(execute:23)]::Starting process flow: BatchedProcessModel
[INFO][09:49:28][process.TilingPipeline(startPreProcesses:64)]::[Pre] Start the pre-processing.
[INFO][09:49:28][process.TilingPipeline(startPreProcesses:68)]::[Pre] Loading all files.
[INFO][09:49:28][process.TilingPipeline(startPreProcesses:70)]::[Pre] Finished loading all files
[ERROR][09:49:28][process.TilingPipeline(executeThread:197)]::Failed to execute thread.
java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.lwjgl.assimp.AIScene.mRootNode()" because "aiScene" is null    
        at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:?]
        at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:?]
        at com.gaia3d.process.TilingPipeline.executeThread(TilingPipeline.java:193) [classes/:?]
        at com.gaia3d.process.TilingPipeline.startPreProcesses(TilingPipeline.java:102) [classes/:?]
        at com.gaia3d.process.TilingPipeline.process(TilingPipeline.java:50) [classes/:?]
        at com.gaia3d.command.BatchedProcessModel.run(BatchedProcessModel.java:64) [classes/:?]
        at com.gaia3d.command.mago.Mago3DTiler.execute(Mago3DTiler.java:24) [classes/:?]
        at com.gaia3d.command.mago.Mago3DTilerMain.main(Mago3DTilerMain.java:55) [classes/:?]
Caused by: java.lang.NullPointerException: Cannot invoke "org.lwjgl.assimp.AIScene.mRootNode()" because "aiScene" is null
        at com.gaia3d.converter.assimp.AssimpConverter.convertScene(AssimpConverter.java:171) ~[classes/:?]
        at com.gaia3d.converter.assimp.AssimpConverter.load(AssimpConverter.java:65) ~[classes/:?]
        at com.gaia3d.converter.BatchedFileLoader.loadScene(BatchedFileLoader.java:35) ~[classes/:?]
        at com.gaia3d.converter.BatchedFileLoader.loadTileInfo(BatchedFileLoader.java:111) ~[classes/:?]
        at com.gaia3d.process.TilingPipeline.lambda$startPreProcesses$0(TilingPipeline.java:80) ~[classes/:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:?]
        at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
        at java.lang.Thread.run(Unknown Source) ~[?:?]
Exception in thread "main" java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.lwjgl.assimp.AIScene.mRootNode()" because "aiScene" is null
        at com.gaia3d.process.TilingPipeline.executeThread(TilingPipeline.java:198)
        at com.gaia3d.process.TilingPipeline.startPreProcesses(TilingPipeline.java:102)
        at com.gaia3d.process.TilingPipeline.process(TilingPipeline.java:50)
        at com.gaia3d.command.BatchedProcessModel.run(BatchedProcessModel.java:64)
        at com.gaia3d.command.mago.Mago3DTiler.execute(Mago3DTiler.java:24)
        at com.gaia3d.command.mago.Mago3DTilerMain.main(Mago3DTilerMain.java:55)
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.lwjgl.assimp.AIScene.mRootNode()" because "aiScene" is null
        at java.base/java.util.concurrent.FutureTask.report(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.get(Unknown Source)
        at com.gaia3d.process.TilingPipeline.executeThread(TilingPipeline.java:193)
        ... 5 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.lwjgl.assimp.AIScene.mRootNode()" because "aiScene" is null
        at com.gaia3d.converter.assimp.AssimpConverter.convertScene(AssimpConverter.java:171)
        at com.gaia3d.converter.assimp.AssimpConverter.load(AssimpConverter.java:65)
        at com.gaia3d.converter.BatchedFileLoader.loadScene(BatchedFileLoader.java:35)
        at com.gaia3d.converter.BatchedFileLoader.loadTileInfo(BatchedFileLoader.java:111)
        at com.gaia3d.process.TilingPipeline.lambda$startPreProcesses$0(TilingPipeline.java:80)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
@znkim
Copy link
Contributor

znkim commented May 29, 2024

Hello, @picaosgeo

I have checked the file you provided and the data is confirmed to be IFC4.
Unfortunately, mago 3DTiler does not yet support the IFC4 format.

We are converting the IFC data using the assimp porting library, but the assimp library only supports IFC2x3 yet.
So if you need to convert IFC data, you will have to convert it to IFC2x3 first.

Additionally, we are trying to find a way to support IFC4 conversion.
If you have any open-source library recommendations or thoughts on this, please comment.

Thank you.

@picaosgeo
Copy link
Author

Hello, @znkim znkim

Thank you for your quick response.

I understood that the IFC4 format is not yet supported.
Until a supported version of IFC4 is available, for IFC I will use the IFC4->IFCConverter->glb->mago3d Tiler->3DTiles conversion.
And I will try to find a library for IFC4.

By the way, the zip file in the attached URL also contains FBX files.
For the FBX as well, I get the same error and cannot convert to 3dtiles.

The command parameters were as follows.

PS C:\work\3ddb\mago3dtiler> docker run --rm -v "${PWD}/workspace:/workspace" gaia3d/mago-3d-tiler --debug -it fbx -i /workspace/fbx -o /workspace/output -crs 6674 -l /workspace/fbx.log

Do you have any insight into the FBX conversion?

@sdson
Copy link
Contributor

sdson commented May 29, 2024

Hello @picaosgeo,

We recently managed to open the FBX file you provided. We have seen that it is a huge building with detailed terrain around it. Now we have started debugging to optimize the resources in order to convert this large FBX file. We believe that we will have results soon.

Thank you for testing the 'Mago3D Tiler'.

@sdson
Copy link
Contributor

sdson commented Jun 18, 2024

Hello @picaosgeo,

Finally, we have managed to convert the FBX file to 3dTiles. However, there are several issues. The most notable one is that the vertices have global positions instead of local positions. Having global positions implies a loss of precision.

Example of a vertex position from the FBX file:
x = -45616.9765625
y = -143439.984375
z = 37.82545471191406
Here, x, y, z directly contain the CRS 6674 coordinates.
onCesium
![onCesium_int2](https://github.com/Gaia3D/mago-3d-tiler/assets/78
onCesium_int2
44
onCesium_int3
420/015d0046-125d-4369-99c6-74929e9862bd)
onCesium_int

It can be seen in the captured images that small objects such as chairs, hangers, or the wheels of the chairs do not maintain their geometry intact and are deformed.
We recommend modeling in local coordinates and then adding a KML file to place it on the globe.
Alternatively, you can model in local coordinates and place the model through the transformation matrix of the RootNode of the scene in GLTF files, for example.

On the other hand, the file you provided is very large and generates a GLB file of about 500MB, which is too much for data traffic from a server.
We recommend splitting the 3D model into several smaller models.
Additionally, most of the objects are merged into one large mesh, making it impossible to select the objects individually. In total, there are 37 meshes in the entire building.
It has been observed that all objects using the same material are merged into one mesh, which is a good practice for rendering, but it prevents the 3DTile from containing information about individual objects.
The Mago3DTiler merges all objects using the same material into one mesh without losing the identity of the objects by using a "BATCH_ID" identifier for each vertex.

Even so, the FBX file you provided can be converted on computers with a lot of memory.
We are currently trying to get Mago3DTiler to split large files.

Thank you for all and see you soon.


Additionally, note that the same thing happens when opening the file with Blender.

fbxInBlender_chairs

fbxInBlender

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants