Skip to content

Commit

Permalink
improved ifc-testing
Browse files Browse the repository at this point in the history
still failing material-properties loading in net8.0
  • Loading branch information
WalchAndreas committed Jan 10, 2025
1 parent d273469 commit 8e84639
Show file tree
Hide file tree
Showing 4 changed files with 434 additions and 212 deletions.
12 changes: 7 additions & 5 deletions src/Aardvark.Data.Ifc/IFCParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Xbim.Common.Geometry;
using Xbim.Common.Metadata;
using Xbim.Common.XbimExtensions;
using Xbim.Geometry.Abstractions;
using Xbim.Ifc;
using Xbim.Ifc4.Interfaces;
using Xbim.Ifc4.UtilityResource;
Expand All @@ -19,7 +20,7 @@ public class IFCParser
{
static readonly XbimColourMap _colourMap = new XbimColourMap();

public static IFCData PreprocessIFC(string filePath, XbimEditorCredentials editor = null)
public static IFCData PreprocessIFC(string filePath, XbimEditorCredentials editor = null, XGeometryEngineVersion geometryEngine = XGeometryEngineVersion.V6, bool singleThreading = false)
{
Dict<IfcGloballyUniqueId, IFCContent> content = null;
Dictionary<string, IFCMaterial> materials = null;
Expand All @@ -31,10 +32,10 @@ public static IFCData PreprocessIFC(string filePath, XbimEditorCredentials edito

if (model.GeometryStore.IsEmpty)
{
var context = new Xbim3DModelContext(model);
context.MaxThreads = 1;
var context = new Xbim3DModelContext(model, engineVersion: geometryEngine);
if(singleThreading) context.MaxThreads = 1;
//upgrade to new geometry representation, uses the default 3D model
context.CreateContext(null, true, false); // THIS IS COSTLY!
context.CreateContext(null, true, false);
}

foreach (var modelReference in model.ReferencedModels)
Expand All @@ -45,7 +46,8 @@ public static IFCData PreprocessIFC(string filePath, XbimEditorCredentials edito
continue;
if (!modelReference.Model.GeometryStore.IsEmpty)
continue;
var context = new Xbim3DModelContext(modelReference.Model);
var context = new Xbim3DModelContext(modelReference.Model, engineVersion: geometryEngine);
if (singleThreading) context.MaxThreads = 1;
//upgrade to new geometry representation, uses the default 3D model
context.CreateContext(null, true, false);
}
Expand Down
Loading

0 comments on commit 8e84639

Please sign in to comment.