XbimGeometry
XbimGeometry copied to clipboard
NET 6+ cross platform support
Hi, I'm looking for a cross-platform IFC libraries, and based on tests that I've done, yours seems to be the best in terms of performance.
However, if my understanding is correct, xbim library family supports full IFC entities tesslation only on Windows because of OpenCascade I assume.
But OpenCascade docs says that since v7 there is cross-platform support
Compared to the previous (6.x) releases of Open CASCADE Technology, OCCT 7.x has a complete set of CMake scripts and projects, so that there is no need to use WOK anymore. Moreover, CMake gives you a powerful configuration tool, which allows to control many aspects of OCCT deployment. At the same time this tool is quite intuitive, which is a significant advantage over the legacy WOK utilities.
Also, based on some issues here I've come to understanding that there is an effort to make Xbim library family cross-platform, but a cross-platform version is not done yet (tried on macOS, dotnet run ...
just crashes with an exit code and no other info). Is there a roadmap perhaps?
I presume as of now the main factor that makes XbimGeometry
windows-only is Xbim.Geometry.Engine
which seems to be just OpenCascade in msvcpp project.
If it is true, is there a way to just swap it with cross-platform OpenCascade?
PS Sorry if I've got some of .net versioning stuff wrong, as a Unity dev regular .net is beyond my expertise.
Hi @florius0,
it's a little bit more complex than just compiling on another platform (I'm also using macOS now). There's an open issue #248 already covering a portion of your question.
The problem in short: XbimGeometry uses a customized compile & and runtime of Microsoft called CLR/CLI interop which supports to run unmanaged (cpp native code like OpenCascade) within an managed runtime environment like .NET. It's only supported on Win machines and it's limited to Net Framework and NetApp31 compile environments. As MS stated before, there's no plan to extend support onto .NET5+ - so no cross platform.
The solution would be. a complete redesign of the binding between .NET and native code. There are options (i.e. P/Invoke platform calls with external binding). I've started some research and work, but stopped somehow, since it's a bunch of work. On the other hand it would push Xbim to a new universe... So, @SteveLockley are there any plans related to this issue?
Cheers, Bernold
It's great to hear that there was some research done on that matter. In unity we have direct bindings to unmanaged code just with special attributes, but I'm not sure that it is available for regular .net
So if I understood you correctly, XbimGeometry c++ code is portable by itself and the issue is with the binding only?
If it is so there is a class that is supported on .net 5+. A brief example. Will it be possible to switch to that approach?/
PS Unity way is somewhat similar, but I dont know whats underneath
No, the native cpp code of XbimGeometry (OpenCascade wrapper) is not portable due to the usage of CLR and interop calls.
Yeah I see now, and given the size of the codebase updating it to support other platforms is no easy task. I could try running it inside docker container though
Or perhaps try to port it myself. Would you mind trying to estimate a percentage of c++ code that should be changed in order to support modern dotnet unmanaged calls?
Hi,
Any new progress on this ?
Hi Zhoub, we have been working on this, there will be a release very shortly, I will post some dates in a few days
Hi Zhoub, we have been working on this, there will be a release very shortly, I will post some dates in a few days
Thanks a lot ! Looking forward !
Hi!
How is it going?
we have been working on this, there will be a release very shortly, I will post some dates in a few days
Not quite ready but you can track the progress over at feature/netcore branch.