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
255 stars 128 forks source link

Unable to find any Geometric Representation contexts with Context Type, model is not being shown. #427

Open GiGiHsbcad opened 1 year ago

GiGiHsbcad commented 1 year ago

Opening the IFC model is not showing the model. There are 709000 entities in the model but nothing is rendered. When we open it up with the DLL, nothing is shown, and as a test, I loaded this in the viewer: image

Also here, nothing was shown.

Info message in XBim viewer: ==== 11:21 INFO Xbim.ModelGeometry.Scene.Xbim3DModelContext GeomScene: Xbim3DModelContext [Unable to find any Geometric Representation contexts with Context Type = model and Context Identifier = , using available Context Types 'Body'. NB This does not comply with IFC 2x2 or greater]

Assemblies and versions affected:

Assembly of the viewer is visible in the image above.

Minimal file to reproduce the issue:

IFC model attached

Expected behavior:

A visible model like the for example in BimVision: image

Actual behavior or exception details:

Nothing is shown in the model and in the code.

Additional Details

Test.zip

Optional, details of the root cause if known. Delete this section if you have no additional details to add.

RoVaDePi commented 11 months ago

There are arguments for Xbim3DModelContext that allow you to specify the representation yourself, let me know if you can get it working using those

andyward commented 11 months ago

Actually this seems unrelated to the slightly invalid IFCGEOMETRICREPRESENTATIONCONTEXT. The issue here is that the RepresentationType of 'UnitedSweptSolid' on the IFCSHAPEREPRESENTATION is not a valid value.

image

See the standards for a list of accepted values.

We actually make a check that the supplied Representation type is a valid Body Representation and skip over geometry where it's not. That's implemented here : https://github.com/xBimTeam/XbimGeometry/blob/c1c22812601d0bd506c5f9230b731d0ab0c6e08a/Xbim.ModelGeometry.Scene/Extensions/IIfcRepresentationExtensions.cs#L28C19-L28C19

If you change all instances of the UnitedSweptSolid to SweptSolid in the model it displays fine. You could do this in code very easily.

image

While we could relax the checks (to work off a 'blacklist' of unsupported types rather than a 'whitelist') this would need a lot of testing to ensure we don't break something.

If you have access to the original model, I'd check the tool where this has come from (3D3S?) and see if there's an update. This has come from a pretty old version of IfcOpenShell (0.5.0-dev is ~2017) so likely the software itself is relatively old.