Certain IFC file is not properly imported in V0.19?

This forum section is only for IFC-related issues
Post Reply
User avatar
Roy_043
Veteran
Posts: 8552
Joined: Thu Dec 27, 2018 12:28 pm

Certain IFC file is not properly imported in V0.19?

Post by Roy_043 »

An IFC file posted in another topic is not properly imported in V0.19. The window solids are missing.

V0.19 (problem):

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18540 (Git)
Build type: Release
Branch: master
Hash: fa5d34508bb3e82437acbdbdba1e4c533e0c1c30
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
V0.18 (OK):

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 32-bit
Version: 0.18.16093 +38 (Git)
Build type: Release
Branch: (HEAD detached at 0.18.3)
Hash: 3129ae4296e40ed20e7b3d460b86e6969acbe1c3
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Dutch/Netherlands (nl_NL)
Attachments
Windows_Opening-Hinge_Favorol-Papaux_FP-PVC_1V.ifc
(158.49 KiB) Downloaded 63 times
User avatar
Roy_043
Veteran
Posts: 8552
Joined: Thu Dec 27, 2018 12:28 pm

Re: Certain IFC file is not properly imported in V0.19?

Post by Roy_043 »

There is also an issue in V0.18.
If you explode the window until you have solids, you will see that there are 6 solids that appear to be glass. I think that 4 of those are actually seals that should go around the glass and the window frame.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Certain IFC file is not properly imported in V0.19?

Post by bernd »

it works if the shape is imported only ...

make a new document and run ... do not forget to set the path to the file ...

Code: Select all

import ifcopenshell, os, Part
from ifcopenshell import geom
settings = ifcopenshell.geom.settings()
settings.set(settings.USE_BREP_DATA,True)
settings.set(settings.SEW_SHELLS,True)
settings.set(settings.USE_WORLD_COORDS,True)

ifcfile = '/home/hugo/Desktop/Windows_Opening-Hinge_Favorol-Papaux_FP-PVC_1V.ifc'
f = ifcopenshell.open(ifcfile)
f.by_type('IfcProject')
p = f.by_id(3629)
r = p.Representation
print(p, '\n', r)
cr = ifcopenshell.geom.create_shape(settings, p)
brep = cr.geometry.brep_data
shape = Part.Shape()
shape.importBrepFromString(brep)
Part.show(shape)


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

Re: Certain IFC file is not properly imported in V0.19?

Post by bernd »

but

Code: Select all

>>> 
>>> shape.isValid()
False
>>> 
thus it is not imported, because only valid shapes are imported.
User avatar
Roy_043
Veteran
Posts: 8552
Joined: Thu Dec 27, 2018 12:28 pm

Re: Certain IFC file is not properly imported in V0.19?

Post by Roy_043 »

@bernd: Thank you for your analysis.

Retesting the V0.19 import I now see there is actually an error message in the Report view:
Failed to rebuild a valid solid for object Window

Apparently an IFC (this one created in ArchiCAD) can contain invalid solids. I do not know what is better: Rejecting an object for such a reason (V0.19), or importing it anyway (V0.18). In this case the imported window can be exploded into solids, which the user might then check with Part CheckGeometry. After deleting the bad solids (related to glazing and seals?) the remaining solids (related to the frame) would still be usable. But for a bigger project this would probably not be feasible.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Certain IFC file is not properly imported in V0.19?

Post by bernd »

Roy_043 wrote: Mon Oct 21, 2019 8:09 am Apparently an IFC (this one created in ArchiCAD) can contain invalid solids.
any IFC can contain lots of invalid solids ... IfcOpenShell and IfcPlusPlus have very much improved to create valid data even from bad ifc data. It very much depends on the one behind the keybord also. If bad geometry in the CAD is accepted than the ifc export from the CAD will contain these bad geometry. A window is not a good example for this, because normally the geometry is costructed by the CAD.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Certain IFC file is not properly imported in V0.19?

Post by bernd »

Roy_043 wrote: Mon Oct 21, 2019 8:09 am I do not know what is better: Rejecting an object for such a reason (V0.19), or importing it anyway (V0.18).
We may should import it anyway, or make it an option.
User avatar
yorik
Founder
Posts: 13664
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Certain IFC file is not properly imported in V0.19?

Post by yorik »

bernd wrote: Mon Oct 21, 2019 8:57 am I do not know what is better: Rejecting an object for such a reason (V0.19), or importing it anyway (V0.18).

We may should import it anyway, or make it an option.
Yes I agree, we should make that optional. Working on it now! *EDIT* git commit 7767103f9c
User avatar
Roy_043
Veteran
Posts: 8552
Joined: Thu Dec 27, 2018 12:28 pm

Re: Certain IFC file is not properly imported in V0.19?

Post by Roy_043 »

@yorik: That was fast! Thank you.
Post Reply