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 132 forks source link

Non Planar causing nullRef exception when constructing XbimFace #258

Closed jonasdmentia closed 4 years ago

jonasdmentia commented 4 years ago

I've encounter a crash in Xbim3DModelContext.CreateContext() when for certain files and have managed to track it down to XbimWire::Init() where it constructs an XbimFace from the wire. The wire is expected to be planar, but if it isn't it logs an error in the constructor and doesn't initialize the private 'pFace' property. As a result, when using that XbimFace instance with ShapeFix_Wire on the next line the native code gets a NULL reference to TopoDS_Face and eventually crashes when it tries to use it.

This occurs on HEAD of master (commit 1dae92e9328665c4bed3379043d22c93f87fa8d7).

PR incoming :)

jonasdmentia commented 4 years ago

Not sure, but this might help with #184 and/or #190.

andyward commented 4 years ago

Looks to have been fixed separately in https://github.com/xBimTeam/XbimGeometry/commit/10d34b53b447d331f4d47e4c5f72080c56f6cf2e