@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.
@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.
@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.
@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!
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 :=)
@kisg Hi, although this has been a while, would you be so kind to roughly explain to me how i would bind it to Swift or turn it into a library that would work on iOS build-targets?
Login or Register to reply.