Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On Azure (winx64) deployed it generates gltf with missing geometry #491

Open
rubit0 opened this issue Jul 30, 2024 · 1 comment
Open

On Azure (winx64) deployed it generates gltf with missing geometry #491

rubit0 opened this issue Jul 30, 2024 · 1 comment

Comments

@rubit0
Copy link

rubit0 commented Jul 30, 2024

I made a asp.net (dotnet 8) web app to convert a ifc file to gltf but when deployed to azure (standard winx64 dotnet appservice plan) it generates a gltf with missing geometry. I tried all sort of combinations, self-contained single file, x64, x86, and the default dotnet 8 runtime.

bim2go_backend_3d-problem

There are no errors and I exhausted all possible deployment configuration options.
I'm using the latest stable releases:

<PackageReference Include="Xbim.Essentials" Version="6.0.445" />
<PackageReference Include="Xbim.Geometry" Version="5.1.541" />
<PackageReference Include="Xbim.Gltf.IO" Version="5.1.120" />

This is the main code snipped that generates the gltf:

public static byte[] CreateGltf(Stream ifcFileStream)
{
    using var ifcStore = IfcStore.Open(ifcFileStream,
        Xbim.IO.StorageType.Ifc,
        Xbim.Common.Step21.XbimSchemaVersion.Ifc2X3,
        Xbim.IO.XbimModelType.MemoryModel);

    var context3DModel = new Xbim3DModelContext(ifcStore);
    context3DModel.CreateContext(null, false);
    var sceneBuilder = new Builder();
    var gltf = sceneBuilder.BuildInstancedScene(ifcStore, XbimMatrix3D.Identity, new List<Type>
        {
            typeof(IIfcSpace),
            typeof(IIfcFeatureElement)
        });

    using (var memoryStream = new MemoryStream())
    {
        Interface.SaveModel(gltf, memoryStream);
        return memoryStream.ToArray();
    }
}

I would love to find out how to fix this issue, in theory there should be no difference between my dotnet runtime and the one on azure. Could this be a floating point precision issue?

@andyward
Copy link
Member

andyward commented Aug 7, 2024

Very strange. We've used Xbim.Geometry 5.1 & 6 extensively in azure app services (winx86 and winx64) and not seen this kind of 'partial' failure. Azure issues are usually all or nothing (environmental etc) rather than this kind of thing. However we're not using gltf which may add another layer of complexity.

Things to check:

  • Is it 100% repeatable? Is it always the same elements missing?
  • Does it occur with other models, or just this one?
  • Have you tried setting the number of threads to 1? (i.e. Xbim3DModelContext.MaxThreads = 1)
  • Have you managed to get any logs from the Geometry Engine (using an ILogger)
  • Have you tried generating wexbim rather than glTF to establish if it's a core GE issue vs gltf export
  • Have you tried stripping the model down to a the affected walls & openings?

It looks like it's failing to cut the openings (a boolean operation in OpenCascade). That might point at a few things including:

  • Precision (as you mention) - try adjusting the precision on ModelFactors
  • wrong / incompatible VC/Windows runtime (Kudu may be able to tell you what's installed)
  • a threading issue
  • potentially an endian edge case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants