Hello!

I am creating module for working with IFC files using IfcPlusPlus according to this documentation and I have some questions.

  1. What does this mean?

You'll need to install the external library on your machine to get the .a library files. See the library's official documentation for specific instructions on how to do this for your operation system. We've included the installation commands for Linux below, for reference.

If I understood correctly ".a" files are static libraries for Linux and for Windows it should be .lib files? Or no? I'm working on Windows and this is confusing.

  1. In this docs in register_types it says to use register_<module_name>_types and unregister_<module_name>_types methods but scons cant build project and says "modules\register_module_types.gen.cpp(108): error C3861: initialize_ifcppg_module: identifier not found". And another docs (about summator) suggest using initialize_<module_name>_module and uninitialize_<module_name>_modulemethods and it works for me - Godot builds succesfull and I can use my custom class. What is the difference between these methods and can I do this?

  2. I downloaded the library and built it with Visual Studio into IfcPlusPlus.lib file and placed it to mymodule/libs folder, but when I try to include it in the project scons building is terminated with errors.

[100%] scons: *** [bin\godot.windows.editor.x86_64.exe] Error 1181
scons: building terminated because of errors.

I used next commands:

env.Append(LIBPATH=["libs"])
env.Append(LIBS=["IfcPlusPlus"])

Has anyone encountered this or can explain me a possible reason?

Thanks in advance!

    It seems SCons think that my lib name should be with suffix .windows.editor.x86_64. I just rename it and it seems to be building now. It's strange because here a similar problem has been described and it should already be fixed.

    Now I have another question: can any compiled C++ library be used with Godot or not? After calling a certain function from IfcPlusPlus Godot breaks.

      O3ZY
      I'm struggling with this too, I have stumbled over an issue with a class called e.g. Object, which seems to confuse godot.

      But there can be so many reasons why godot breaks. In your case, how does it break? Do you have an error message? Do you have a stack trace? A process dump perhaps?

      • O3ZY replied to this.

        O3ZY I'm interested in possibly importing IFC into Godot. Are you making a module, or GDExtension? Are you trying to read the IFC directly into Godot (rather than converting it into glTF, and letting Godot load that)?

        • O3ZY replied to this.

          ariess It's just breaks without anything message after calling geometry_converter->setCsgEps(1.5e-9);. I tried to replicate LoadFileExample from here (this line from main()).

          I don't have any stack trace or dump and I don't know how to get it. I have superficial knowledge of C++. It would be great if you could explain to me how to do this 🦊

            Haystack I tried to make both a module and a GDExtension plugin and it seemed to me that there wasn’t much difference between these methods, except that the plugin was easier to share.

            Haystack Are you trying to read the IFC directly into Godot?

            Yes, I'm trying to load IFC files in runtime.

            Haystack There is also the opportunity to create an independent application from Godot, which will open IFC files and convert them into some of your own formats and then load them into Godot. But for this method, you will need to separately assemble the program for the required platform, and there may probably be unexpected restrictions somewhere (for example in UWP).

            O3ZY
            From your first post I assume that you are on Windows. I don't know Windows. From a brief google search I find that you may want to search for 'Windows crash dump'.

            On Linux it's easy: execute coredumpctl -1 dump > x.core, then run gdb <path-to-executable> x.core.

            Btw, core/crash dumps are not specific to C++, any executable can crash and dump a core file.

            O3ZY

            After calling a certain function from IfcPlusPlus Godot breaks.

            This may simply be a bug in IfcPlusPlus. I've used IfcPlusPlus for some previous (non Godot) projects, and I've seen it crash on problematic IFC geometry. (e.g. polygon loops that are not perfectly closed).

            To determine if this is an IfcPlusPlus bug, or your-code bug, try reading the IFC file into the IfcPlusPlus sample app.

            • O3ZY replied to this.

              Haystack I used example.ifc from their repository (what works in example project) and some of my files and in all cases it crashes in the same place.

              I was a little mistaken, the crash occurs in this line: shared_ptr<GeometryConverter> geometry_converter(new GeometryConverter(ifc_model));, not in geometry_converter->setCsgEps(1.5e-9);. Looks like need to look in GeometryConverter class.