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
260 stars 131 forks source link

Stack overflow while getting geometry #412

Open GVladislavG opened 1 year ago

GVladislavG commented 1 year ago

Hello, team! There is a problem in attached IFC-file.

m_3DMdlContext = new Xbim3DModelContext(m_model);
m_3DMdlContext.MaxThreads = 1;
m_3DMdlContext.CreateContext();

There is Stack overflow exception while executing m_3DMdlContext.CreateContext().

Thanks! StackOverflow.zip

Belrius commented 1 year ago

Most likely the same as I'm getting.

https://github.com/xBimTeam/XbimGeometry/issues/281 See also https://github.com/xBimTeam/XbimGeometry/issues/336

I've downloaded the source and have it building. Am attempting to connect it up with my app and debug now.

https://github.com/xBimTeam/XbimGeometry/issues/244 is helpful in getting the source building.

Belrius commented 1 year ago

Surprisingly, for me, the same file doesn't cause a crash in XBim explorer. That seems to indicate that it's a problem introduced after my xbim explorer was built as I'm using the latest nuget packages.

Have you tried your case in Xbim Explorer?

Belrius commented 1 year ago

I've done some debugging for my case here https://github.com/xBimTeam/XbimGeometry/issues/281#issuecomment-1386566556 Not sure if it can help your case. I haven't downloaded and run your test case.

Belrius commented 1 year ago

@GVladislavG It looks to me like your is hitting a similar issue to mine, with a zero direction causing a standard construction error exception. Difference is that yours is with a facetedBrep (ID 228549) and mine was with a IFCPolygonalFaceSet. But the same idea.

Once again, this loads fine in my version of xBim Xplorer image

@andyward any chance you could take a peek at this and at my more detailed dive at https://github.com/xBimTeam/XbimGeometry/issues/281#issuecomment-1386566556 ?

@GVladislavG If possible a minimal replicable case would help as your IFC is > 50mb in size and no fun to debug :).

andyward commented 1 year ago

Looping @SteveLockley in on this as he's active on GE right now and hopefully picking these up. As noted on 281, with this model I found it working on:

but broken on: