Error report IFC

This forum section is only for IFC-related issues
langk
Posts: 10
Joined: Sat Nov 09, 2019 11:39 am

Error report IFC

Post by langk »

I recently modelled a simple house in FreeCAD and exported it to IFC4. Then I checked the IFC file for errors. For the general improvement of the IFC export from FreeCAD, I list the found errors below.
I have taken the information on the causes of the errors from the current bSI IFC specification.
The errors are always formal propositions that have not been adhered to.
  • 1. IfcAxis2Placement2D.LocationIs2D and IfcAxis2Placement2D.RefDirIs2D
    IfcAxis2Placement provides position and orientation to place objects in a two-dimensional space. LocationIs2D and RefDirIs2D require a dimensionality 2.

    In my model both errors only occur with walls. The modelling of the affected walls does not differ. Lines were drawn and the wall tool were used. Walls of every level in the house are affected, some have doors, others don't.

    Both errors occur with IfcRectangleProfilDef.

    Here is an excerpt of the IFC:
    ifcaxis.PNG
    ifcaxis.PNG (26.91 KiB) Viewed 1861 times
    As you can see, IfcRectangleProfilDef refers to IfcAxis2Placement2D. 2D because IfcRectanglePRofilDef is given by X and Y only. IfcAxis2Placement in turn refers to #2594 and #2593, both with 3D coordinates. And that's where the mistake comes from. 2D is required, but 3D is given.
  • 2. IfcGeometricRepresentaionContext.North2D

    North2D requires that if TrueNorth is specified, it must have dimensionality 2. As can be seen in the lower IFC section, this is not the case. Instead of 2D, 3D is given.
    TrueNorth.png
    TrueNorth.png (8.21 KiB) Viewed 1861 times
  • 3. IfcGridAxis.WR1

    This error affects all my 4 fixed axes. The reason for it: also here a wrong dimensionality is indicated. WR1 requires a dimensionality of 2. (see IfcCartesianPoint)
    axis.PNG
    axis.PNG (26.89 KiB) Viewed 1861 times
The errors mentioned in No. 1,2 and 3 can easily be corrected by deleting the last coordinate. However, it should probably not be the usual approach.
  • 4. IfcOwnerHistory.CorrectChangeAction

    CorrectChangeAction means: if ChangeAction is enabled and LastModifiedDate is not defined, ChangeAction must be set to NotDefinied.
    But all objects get the change status .ADDED. which, in conjuction with the error, suggests that LastModifiedDate does not define. This would have to be corrected in the implementation.
    ownerhistory.png
    ownerhistory.png (4.82 KiB) Viewed 1861 times
  • 5. IfcRelConteainedInSpatialStructure.WR31 and IfcSpatialStructureElement.WR41

    These two erros affect the same element: space.
    The spaces are currently connected to the floors via the relation type IfcContainedInSpatialStructure. But according to the specification this is wrong. A spatial structural element (which a space is) may not be connected to another spatial structural element (e.g. floors) via IfcContainedInSpatialStructure. IfcRelAggregate is required for this purpose.
    Only components should use IfcContainedInSpatialStructure.
  • 6. Invalid 4-byte Unicode character

    This error refers to an adress that I entered into the site, especially to some letters that do not occur in Englisch.

Just for information my used FreeCAD version:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18733 (Git)
Build type: Release
Branch: master
Hash: 2637280c1d2cb48e7cd946fa9f2484467edd8b0c
Python version: 3.6.7
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
User avatar
hlg
Posts: 39
Joined: Fri Jul 12, 2019 10:11 am

Re: Error report IFC

Post by hlg »

I can confirm these errors and will created a pull request to fix 1-5: https://github.com/FreeCAD/FreeCAD/pull/2766.

I am not sure about 6. I think I have seen some discussion around IFC UTF8 encoding issues before and I know it is a bit peculiar. Maybe someone more familiar with it can have a look?
Last edited by hlg on Sun Dec 08, 2019 8:44 pm, edited 1 time in total.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error report IFC

Post by bernd »

damn IFC and utf8 ... and the move from Py2 to Py3 makes it even more a challange.

Would you post a simple example?

Have you tried 0.19 dev version.
User avatar
hlg
Posts: 39
Joined: Fri Jul 12, 2019 10:11 am

Re: Error report IFC

Post by hlg »

I think 0.19.18733 is the latest dev version, no?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error report IFC

Post by bernd »

hlg wrote: Sun Dec 08, 2019 8:44 pm I think 0.19.18733 is the latest dev version, no?
upps my misstake, I just saw 18 but it is 0.19 allready ... Nevermind guys ...

But an simple example would still be cool.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Error report IFC

Post by yorik »

This is indeed a defect in FreeCAD. We export almost all position vectors as 3D (3 coords). This works as there isn't apparently something in the schema that prevents it, and haven't seen any BIM app to have problems with that yet. But it's not correct indeed...

As for encoding, that too is annoying. IFC uses a very boring encoding. Normally, IfcOpenShell takes and gives utf8 and does itself all the conversion work. There might be some bug there too... Would be interesting to narrow down to exactly what works and what doesn't
langk
Posts: 10
Joined: Sat Nov 09, 2019 11:39 am

Re: Error report IFC

Post by langk »

Here is the street name i used: Kačićeva ul. 23 - It's a street in Zagreb, Croatia.
And here is the adress in IFC.
adressZagreb.PNG
adressZagreb.PNG (4.46 KiB) Viewed 1746 times

As you can see the letters č and ć are not readable. I also tested the Croatian letters dž, đ, š, ž and the German Ä, Ü, Ö. Not only they are not readable, they also result in an error while checking (invalid 4-byte unicode character).
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error report IFC

Post by bernd »

I swear this has been woriking ... I have spent on this hours over the years ... :twisted:

Realoading the ifc in FreeCAD but BIMCollabZoom does not read the file ...

Value in FreeCAD:
Funny character dž, đ, š, ž, Ä, Ü, Ö street

export FreeCAD:

Code: Select all

#24=IFCPOSTALADDRESS(.SITE.,'Site Address','',$,('Funny character d\X4\0000017E\X0\, \X4\00000111\X0\, \X4\00000161\X0\, \X4\0000017E\X0\, \X4\000000C4\X0\, \X4\000000DC\X0\, \X4\000000D6\X0\ street'),$,$,$,$,$);
character_project.ifc
(4.62 KiB) Downloaded 64 times
character_project.FCStd
(19.45 KiB) Downloaded 58 times

BIMCollabZoom:
screen.png
screen.png (6.38 KiB) Viewed 1731 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error report IFC

Post by bernd »

Attached the way Nemetschek Allplan does export this line ...

Code: Select all

#53= IFCPROPERTYSINGLEVALUE('Bauvorhaben Adresse',$,IFCTEXT('Funny character d\X2\017E\X0\, \X2\0111\X0\, \X2\0161\X0\, \X2\017E\X0\, \X2\00C4\X0\, \X2\00DC\X0\, \X2\00D6\X0\ street'),$);


BIMCollabZoom:
screen.png
screen.png (11.74 KiB) Viewed 1732 times
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error report IFC

Post by bernd »

Post Reply