XbimGeometry icon indicating copy to clipboard operation
XbimGeometry copied to clipboard

The rotation of somes elements are not applied

Open Sim3d opened this issue 4 years ago • 6 comments

Hi!

When I load a IFC file (RotatedRoofElements.zip) in the xbim Xplorer (built from source) two roof elements are not rotated as supposed to be. You can see the roof element below:

RotatedRoof

Do you have an idea of what can cause the problem?

Thanks!

Simon

Note:

  1. The IFC file is attached.
  2. The "xbim Xplorer" tool Assemblies are:

Xbim.Common 5.1.0.0 5.1.323.0 Xbim.Geometry.Engine.Interop 5.1.0.0 5.1.403.0 Xbim.Ifc 5.1.0.0 5.1.323.0 Xbim.Ifc2x3 5.1.0.0 5.1.323.0 Xbim.Ifc4 5.1.0.0 5.1.323.0 Xbim.IO.Esent 5.1.0.0 5.1.0.322 Xbim.IO.MemoryModel 5.1.0.0 5.1.323.0 Xbim.ModelGeometry.Scene 5.1.0.1 5.1.403.0 Xbim.Presentation 5.1.0.0 5.1.0.0 Xbim.Tessellator 5.1.0.0 5.1.323.0

Sim3d avatar Jan 21 '21 16:01 Sim3d

Confirmed this is an issue, but it is caused by invalid IFC. This definition is invalid: #79=IFCAXIS2PLACEMENT3D(#80,$,#81);.

IFC documentation states:

Either both, Axis and RefDirection are not given and therefore defaulted, or both shall be given.

But #79 only defines RefDirection without Axis direction (second attribute). This is incomplete definition of placement. We could assume that Axis is simply [0,0,1], but that might be wrong in many cases.

Here is the minimal file: roof_and_wall.zip Here is the file fixed: roof_and_wall_fixed.zip

image

image

martin1cerny avatar Jan 22 '21 08:01 martin1cerny

Thanks for the quick answer Martin!

When I look the definition of the IfcAxis2Placement3D, the RefDirection parameter is optional and the "Attribute definitions" documentation says:

If Axis and/or RefDirection is omitted, these directions are taken from the geometric coordinate system.

So in that case, you can probably fallback on the IfcDirection of the WorldCoordinateSystem (IfcAxis2Placement) given by the IfcGeometricRepresentationContext

#18 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'Model', 3, 1.E-5, #19, #23);
#19 = IFCAXIS2PLACEMENT3D(#20, #21, #22);
#21 = IFCDIRECTION((0., 0., 1.)); <====

https://standards.buildingsmart.org/IFC/RELEASE/IFC2x2/FINAL/HTML/ifcrepresentationresource/lexical/ifcgeometricrepresentationcontext.html

But maybe i'm wrong?

Sim3d avatar Jan 22 '21 15:01 Sim3d

There is a WHERE rule AxisAndRefDirProvision which says:

Either both, Axis and RefDirection are not given and therefore defaulted, or both shall be given.

And your file is breaking this rule. Therefore it would fail in IFC schema validation.

martin1cerny avatar Jan 22 '21 16:01 martin1cerny

Oh! I see! The IFC documentation is tricky sometimes, sorry.

I tried to load the file into Solibri, Navisworks 2019 and SimpleBIM and all softwares displays the roof element correctly, a rotation is applied as expected... So, would you have any idea of ​​a workaround to apply a rotation on the element like other BIM software?

Thanks!

Sim3d avatar Jan 26 '21 14:01 Sim3d

Yes, this is a simple fallback. We will address it when we get to do some work on geometry engine.

martin1cerny avatar Jan 26 '21 16:01 martin1cerny

Did you have the time to add the simple fallback?

Sim3d avatar Mar 29 '21 19:03 Sim3d