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

IFC validation error due boolean operations inside 'SolidModel' IfcShapeRepresentation #517

Open
MichaelBuehler opened this issue Aug 14, 2023 · 0 comments

Comments

@MichaelBuehler
Copy link

I get an validation error by xBIM on IfcShapeRepresentation with RepresentationIdentifier='SolidModel' containing boolean operations.

Assemblies and versions affected:

Xbim.Essentials 5.1.341 (and earlier)

Steps (or code) to reproduce the issue:

var solidRepresentation = model.Instances.New();
solidRepresentation.ContextOfItems = ..
solidRepresentation.RepresentationType = "SolidModel"
solidRepresentation.RepresentationIdentifier = "Body";
..
solidRepresentation.Items.Add(ifcExtrudedAreaSolid); //OK
solidRepresentation.Items.Add(ifcBooleanClippingResult); //Validation error
..
var res = solidRepresentation.Validate(); //res.Count() > 0

Minimal file to reproduce the issue:

TestModel.zip

Expected behavior:

No validation error related to IfcShapeRepresentation.CorrectItemsForType due boolean operations inside solid model

Actual behavior or exception details:

Validation error

Additional Details

The IFC Standard allows by Representation Identifier 'SolidModel':

But on "SolidModel", the xBIM validation counts only objects with IIfcSolidModel interface
Functions.cs method ifcShapeRepresentationTypes Line 446
case "SolidModel":
Count = Items.Count(x => x is IIfcSolidModel)
break;

This excludes IfcBooleanClippingResult since this class has no IIfcSolidModel interface.
One way to fix would be that the validation counts the missing items, but in long term maybe it is more secure to adjust/add new interface.
Items.Count(x => x is IIfcSolidModel) + Items.Count(x => x is IIfcBooleanClippingResult);

Maybe counting is missing other items, like CSG.

Issue appears in IFC 2.3 and 4.x

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

1 participant