Skip to content

CreateContext fails inconsistently across machines for small extruded profiles #570

@A-Shawqi

Description

@A-Shawqi

Hello,

I have a few IFC files that process fine and generate wexBIM successfully on my local development Windows 11 machine, but fail on other machines with the same XBIM version. The geometry engine throws an error when processing IfcExtrudedAreaSolid entities that have profiles with very small coordinates.

The failure happens during CreateContext() when processing some IfcExtrudedAreaSolid entities that have very small profile coordinates (sub-millimeter values). On the local dev machine, this works fine, but on other machines, it throws an exception and stops the whole geometry creation and doesn't gerate wexBIM.

I’ve uploaded a sample IFC file that reproduces the issue on some machines:

XBIM-Issue-Sample.ifc

There are two example problematic entities in the file: #2173596 and #2182386.

Environment

Failing machines:

  • Windows 11 and Windows Server 2022
  • .NET 6.0

XBIM Assembly Versions

  • Xbim.Geometry.Abstractions: 6.0.0.0
  • Xbim.Geometry.Engine.Interop: 6.0.0.0
  • Xbim.Common: 6.0.0.0
  • Xbim.ModelGeometry.Scene: 6.0.0.0
  • Xbim.Tessellator: 6.0.0.0

Full Stack Trace From Log

System.Exception: General Error Creating IfcExtrudedAreaSolid, #2173596
   at Xbim.Geometry.XbimGeometryCreator.Create(IIfcGeometricRepresentationItem geomRep, 
      IIfcAxis2Placement3D objectLocation, ILogger __unnamed002) 
      in E:\build_os\_work\6\s\Xbim.Geometry.Engine\XbimGeometryCreator.cpp:line 352
   at Xbim.ModelGeometry.Scene.Xbim3DModelContext.<>c__DisplayClass42_0.<WriteShapeGeometries>b__0(Int32 shapeId)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass44_0`2.<PartitionerForEachWorker>b__1(...)
--- End of stack trace from previous location ---
   ...
Xbim.Common.Exceptions.XbimException: Processing halted due to model error, see logs
 ---> System.AggregateException: One or more errors occurred.
      (General Error Creating IfcExtrudedAreaSolid, #2173596)

Problematic IFC Geometry

Looking at the IFC data, the failing entity uses a profile with very small coordinate values (around 0.0002–0.0004 meters):

#9=IFCDIRECTION((0.,0.,1.));
#2173596=IFCEXTRUDEDAREASOLID(#2173592,#2173595,#9,0.10000000000000323);
#2173592=IFCARBITRARYCLOSEDPROFILEDEF(.AREA.,'WALL SKIRTING 100',#2173591);
#2173591=IFCINDEXEDPOLYCURVE(#2173590,$,.F.);
#2173590=IFCCARTESIANPOINTLIST2D(
  ((-0.00044555529947738125,-0.00022277764973369045),
   ( 0.00022277764974193906,-0.00022277764973369045),
   ( 0.00022277764974299011, 0.00044555529947703089),
   (-0.00044555529947738125,-0.00022277764973369045))
);
#2173595=IFCAXIS2PLACEMENT3D(#2173593,#9,#2173594);
#2173593=IFCCARTESIANPOINT((0.00041523525350357888,0.6766566561126065,0.));
#2173594=IFCDIRECTION((0.12132557005372908,0.99261276742299553,0.));

The profile ends up being a very small triangular / near-degenerate shape.

What I Already Tried

  • Forcing single-threaded execution (context.MaxThreads = 1) → still fails
  • Trying V5 engine mode using AddGeometryServices(builder=>builder.SetVersion(Xbim.Geometry.Abstractions.XGeometryEngineVersion.V5))→ still fails
  • Double-checked that both machines use the same XBIM NuGet packages versions

Questions

  1. Is there a minimum coordinate size or profile area that the geometry engine requires?

  2. It’s strange that some machine handles this fine, while other machines don’t, Any idea what could be the reason?

  3. Is there a way to configure CreateContext() to skip problematic shapes and continue processing the rest of the model instead of throwing and stopping everything?

  4. Could this be related to Visual C++ runtime, OpenCASCADE, or native dependency differences between the machines?

  5. Are there any known workarounds for IFC files that contain extremely small geometry like this?

Any guidance would be really appreciated. Happy to provide more details if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions