IFC Viewer on mobile?

Hello,
Does anyone have a good workflow for getting IFC models onto mobile devices (iOS/Android) WITHOUT having to go through a cloud service (ie.: email the file or share via OneDrive and open directly on device)?
All the ones I have found seem to do processing "on the cloud" at some point and/or require uploading the models to a specific project structure on a cloud service.

duncanJanF

Comments

  • @vinnividivicci If you can compile IfcConvert for ARM, (well, the hard part is probably compiling the deps really), then I think you can use IfcConvert to give you a format that is easier to feed into a 3D viewer lib on a phone. Ping @aothms who might know how plausible ARM support is.

    I also notice assimp supports Android / iOS. Maybe this is the way to go, but I don't know how good their IFC support is.

    vinnividivicciCGR
  • @Moult said:
    @vinnividivicci If you can compile IfcConvert for ARM, (well, the hard part is probably compiling the deps really),

    It builds fine for aarch64, though I have never tested these binaries on an actual arm device: https://copr.fedorainfracloud.org/coprs/bpostle/IfcOpenShell/build/1771565/

    vinnividivicci
  • Thanks for your input guys! I'm currently leaning towards the simple solution of exporting from Blender directly to glTF (although there seems to be ways to go from IFC straight into glTF using IfcOpenShell and other librairies...), which can basically be viewed anywhere and is an open standard.

    Will report back with a demo and a workflow example once it's more streamlined.

    duncan
  • @vinnividivicci yeah use IfcConvert which can output glTF directly :) It's not documented on the main IfcOpenShell website, which is very outdated, but it's there!

    vinnividivicci
  • Update on this, I've been using the glTF Viewer app on iOS to view the GLB files produced by IfcConvert. More recently, I discovered a free app called BIM2XR that can convert and open IFC files directly in iOS.

  • Yes, once that project matures a little more and fully supports IFC4 it will be a game changer!

    Moultagviegas
  • By the way, this is a great way for non-coders to contribute - create simple IFC files from various software, and try to load it in IFC.js - if it doesn't load, create a new issue / bug here: https://github.com/agviegas/IFC.js - share your file, as well as open the web inspector in your browser when you load the file (hotkey is usually F12 on most browsers) so it'll show you the relevant errors for debugging. Here's an example of an issue: https://github.com/agviegas/IFC.js/issues/22

    That will greatly help the developer target real-world usecases.

    paulleeCGRJesusbill
  • What's it using under the hood? Is it a full new implementation of a library for reading IFC files?

  • @duncan said:
    What's it using under the hood? Is it a full new implementation of a library for reading IFC files?

    My understanding is that it's completely written in Javascript, so your browser is doing all the work, no server-side conversion.

    In other news, I found this: https://www.opencascade.com/products/cad-assistant/
    It has an Android and iOS app. Unfortunately, the iOS app has not been updated since 2018 and therefore still requires files to be "side-loaded" via iTunes. This method works but is not practical for sending models to someone on a remote construction site. The Android app is up-to-date but did not want to open an IFC4 file I tested it with... it was able to open a 2x3 file from an attachment though.

    Maybe we could get the OCC guys to update the iOS app? Pretty please? 😎

  • Hey! To clarify a little on this topic: IFC.js has been written entirely in JavaScript. Chevrotain.js is being used to create a completely new IFC parser in JS and the result is mapped with Three.js geometry. Even tough my initial intention was to create an IFC Loader for Three.js, this is completely compatible with the JS ecosystem, f. e. React Native. It doesn't depend on servers, everything is done client side. Don't hesitate to ask me anything regarding this, or send me any files you would like to have implemented as soon as possible. 🙂

    Moultvinnividiviccistephen_lbitacovir
  • @agviegas if you're looking for files to test with there is a list here: https://wiki.osarch.org/index.php?title=AEC_Open_Data_directory

    agviegas
  • Please let me know what I can improve on BIM2XR to make it interesting.

  • Hi @miriam BIM2XR is not libre software or opensource software as far as I can tell. Are you thinking of putting it under a free software or OSI license?

    bitacovir
  • Hi, if use IFC.js and React Native, is it possible to view BIM file that is stored locally in mobile (offline mode). Thanks.

    Eric

  • @eric said:
    Hi, if use IFC.js and React Native, is it possible to view BIM file that is stored locally in mobile (offline mode). Thanks.

    Eric

    Yes, React Native is compatible with Three.js and maps WebGL to native mobile 3d.

  • Hi, have a query from the client, is there any size limitation of the BIM model that can be viewed in IFC.js? esp in mobile. Many Thanks.

  • edited December 2021

    @eric said:
    Hi, have a query from the client, is there any size limitation of the BIM model that can be viewed in IFC.js? esp in mobile. Many Thanks.

    There is a size limitation, just as any software has a size limitation 😆 That's what happens when you have limited RAM memory. As for the maximum size of IFC we have ever opened, I think it's about 800mb. But you have to keep 2 things in mind:

    1. One of the biggest issues we are facing is memory consumption. We have drastically reduced it recently and will keep reducing it, but the main limitation will be the RAM memory of the devices where you plan to see the BIM model. I'm not sure about the metrics, but I think that right now we consume something like 30% more than BIMvision. Our goal is to reach that consumption level.

    2. IFC.js is not magic. It can't make 200mb IFC models run smoothly in smartphones, because those devices were not designed to support that amount of computation. If your task involves displaying big models in small devices, you need to rely on backend rendering and real-time streaming through internet. This has nothing to do with IFC.js; it's just the hardware that we have nowadays.

    If you find that IFC.js doesn't support what you are looking for yet, I suggest you to create a glTF from the IFC model and try to optimize it enough so it can be displayed in your target device using Three.js.

    Cyrilbrunopostlevpajic
  • Hello everyone,

    I've been exploring ways to render IFC files natively on iOS using its frameworks. I've come across discussions about using ifc.js or the Autodesk Viewer on iOS. However, I'm wondering if these solutions are simply utilizing a WebView rather than native frameworks like Metal for Swift. Has anyone else had this concern?

    I've also tried compiling for iOS using Assimp, following numerous tutorials, but I've never been successful. I recently stumbled upon this framework: https://github.com/ctreffs/SwiftAssimp.git. Does anyone have experience with it or know if it might be a solution for rendering IFC natively on iOS?

    I apologize if I've misunderstood anything; I'm still a beginner in this area. Any guidance or suggestions would be greatly appreciated.

  • @jussch given the potentially lower computing power of iOS devices, it probably makes sense to preprocess the files into more optimal formats for loading regardless of how you choose to render it in the end (whether using a web view or other tech). After a quick search online I came across https://developer.apple.com/scenekit/ which seems to work with Collada (IfcConvert can convert IFC --> DAE). Then, you can use the IDs of objects to correlate to IFC objects (say in JSON or XML).

    Here's an example guide preprocessing to DAE which maintains IDs: https://xeokit.notion.site/Converting-IFC-Models-to-XKT-using-3rd-Party-Open-Source-Tools-c373e48bc4094ff5b6e5c5700ff580ee (that tutorial is for Xeokit which uses XKT - which might be worth looking at too if you want to use a web view).

    jussch
  • There is CAD Assistant from opencascade.com which although dated seem to run fine on a 5th gen iPad Pro running iPadOS 16.3. It is a bit weird where to put the files so that the app finds them.

  • @Moult Thank you for the insights. Is it possible to use IfcConvert directly on iOS, or must files be preprocessed on a server? I’d like users to read IFC files from their devices without server-side processing. Any advice?

  • @jussch IfcConvert is built for Apple ARM (M1, M2, etc), so I guess in theory it can run on iOS? I know nothing about building software for iOS though :) https://blenderbim.org/docs-python/ifcconvert/installation.html

  • @Moult Thanks for the tip :) It works from my Mac terminal to convert an ifc file to a dae file. And I can now render dae files in my iOS app. However, the download is a Unix executable which means I can't use it from Swift (at least not on iOS). I'd really like to stick to the idea of running everything locally, since my ifc files won't be that big for now. Is there any way to convert the ifc files directly in iOS?

  • @jussch : You could turn IfcConvert into a library (I assume it is just calling IfcOpenShell internally), and then create a Swift binding for it. Then you can simply call the conversion from IFC to DAE (or better GLTF / GLB) from your Swift app.

    Moult
  • @jussch : Here is the IfcConvert source code: https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.7.0/src/ifcconvert/IfcConvert.cpp
    You can just throw out what you don't need, and keep only what is important for you.
    One more thing regarding licensing: IfcOpenShell (and IfcConvert) is under the LGPL, which means you should build it into a separate shared library, and link to it dynamically. This is technically not a problem, both iOS and Android support it.

    Moult
  • @jussch if you manage to get it working, it would be super cool if you could write a guide or some tips about how you managed it so that we can add it to the official documentation so that others can do it too!

    Owura_qu
  • So thank you for your answers! I have been sick and will now try to implement these things. My biggest concern right now is how I would call a function from the (from me generated) library in my client (Swift). So help there would be appreciated. Other than that, it seems like this is a legit way to do this! Thank you very much!

  • @kisg I am having a hard time understanding how to compile it to a dylib dynamic library. If i try to do so with cmake i will get many errors until the build process eventually stops and says that there are too many errors emitted. The following if my CMakeLists.txt:

    cmake_minimum_required(VERSION 3.10) project(IfcConvertLibrary) add_library(IfcConvertLib SHARED /Users/myname/IfcOpenShell-0.7.0/src/ifcconvert/IfcConvert.cpp)
    After having an error with Boost (which i have resolved) i now get errors about 'thread_local' and about deprecated C++. Like the following:

    /Users/myname/IfcOpenShell-0.7.0/src/ifcconvert/../serializers/../ifcgeom_schema_agnostic/../ifcparse/../ifcparse/IfcParse.h:157:32: error: definition or redeclaration of 'string' not allowed inside a function static my_thread_local std::string s;

    or

    /Users/myname/IfcOpenShell-0.7.0/src/ifcconvert/../serializers/../ifcgeom_schema_agnostic/../ifcparse/IfcFile.h:166:19: warning: default member initializer for non-static data member is a C++11 extension [-Wc++11-extensions] bool batch_mode_ = false;
    Can anyone help resolve this? Seems like a newbie making some mistakes... Again sorry if this is a stupid question. I am new to this!

    Thank you in advance :=)

Sign In or Register to comment.