xBimTeam / XbimGeometry

XbimGeometry contains the CLR interop libraries and the c++ engine used to compute the 3D geometry of models.
https://xbimteam.github.io/
Other
249 stars 126 forks source link

NET 6+ cross platform support #390

Open florius0 opened 1 year ago

florius0 commented 1 year ago

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.

bekraft commented 1 year ago

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

florius0 commented 1 year ago

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

bekraft commented 1 year ago

No, the native cpp code of XbimGeometry (OpenCascade wrapper) is not portable due to the usage of CLR and interop calls.

florius0 commented 1 year ago

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?

zhoub commented 1 year ago

Hi,

Any new progress on this ?

SteveLockley commented 1 year ago

Hi Zhoub, we have been working on this, there will be a release very shortly, I will post some dates in a few days

zhoub commented 1 year ago

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 !

florius0 commented 1 year ago

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

andyward commented 1 year ago

Not quite ready but you can track the progress over at feature/netcore branch.

cameronhaddad commented 1 year ago

Hi, Just looking for an update on the status of the removing the windows dependency.

Achao365 commented 11 months ago

Hi Zhoub, we have been working on this, there will be a release very shortly, I will post some dates in a few days

Hello SteveLockley, when do you plan to release it?

meinig-arts commented 9 months ago

Hi, we are using NuGet-Packages

(among others) in an ifc-importer for a desktop application. The importer is written for .NET Framework 4.7.2, but now we have to move it to .NET 6. According to NuGet, both aforementioned packages are currently only available for .NET Framework. This prevents us from porting to .NET 6.0. Are there any plans if and when these packages will be officially available also for .NET 6?

I also found there are packages

NuGet reports them as "compatible" to .NET 6. Can they be used as a replacement?

martin1cerny commented 9 months ago

Evergine packages are not created by us. They never even talked to us. We have a private .NET 6.0 build with some substantial changes. Would you like to test them?

meinig-arts commented 9 months ago

Hello martin1cerny, thank you for replying. You asked if we would like to test private .NET 6.0 builds. It depends on when you plan to release those packages as official .NET 6-compatible packages via NuGet. If it is only a matter of a couple of weeks we would wait and take the easy way - just pulling in the packages from NuGet once they are released. If you are not sure or can foresee that it will take longer, well, OK, why not testing the private builds? Where do we find them and, do we need to build them on our own?

nd2403 commented 7 months ago

Hello @martin1cerny, is there publicly available .NET 6.0 version of Xbim.Ifc and Xbim.Ifc4 package? We only found the packages with .NET 4.5. If not, can we get an access to your private .NET 6.0 build (mentioned in the comment above)? If the project has any dependencies then please share those as well.

nd2403 commented 5 months ago

Hello @andyward,

Could you please answer to my question in the comment above. I am in need of a Xbim.Ifc and Xbim.Ifc4 package compatible with .NEt 6.0 as soon as possible. Hopefully you can help me with this.

Best regards, Nadja Dardagan

andyward commented 5 months ago

Hi Nadja, please can you email me from the account that needs access (my xbim email is on my github profile). I can then invite you to the v6 preview repository with the .net6 packages.

Andy

maxplex commented 5 months ago

We have a private .NET 6.0 build with some substantial changes. Would you like to test them?

Andy, if the private build is still available I'm keen to test it

andyward commented 5 months ago

@maxplex If you email me (check my profile page) I can invite you to the preview repo.

meinig-arts commented 5 months ago

I also would like to test private build. Is this OK for you?

Muniz1994 commented 1 month ago

Hi @andyward I'm going to send an email as well. I'm playing with a Godot integration and would be awesome to test the .NET 6 packages 😄