problems with IFC import

This forum section is only for IFC-related issues
Renato
Posts: 58
Joined: Fri Apr 24, 2015 10:14 am
Location: Italy (Tuscany)

problems with IFC import

Postby Renato » Tue Jan 07, 2020 10:12 am

Good morning
I tried to import an IFC file into Freecad but the results are not good

With Freecad 0.18 32 bitThe file is imported but some parts are not visible (for example the columns)

With Freecad 0.19 I have an error message and the file is not imported (the program crashes)

I tried to import the same file on another program (pCon Planner) and the file is imported correctly.

The versions i use:

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 32-bit
Version: 0.18.4 (GitTag)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 2.7.14
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: Italian/Italy (it_IT)

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19127 (Git)
Build type: Release
Branch: master
Hash: ec18f070d13b195d946c3d955d8c21b2e60550e2
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
Attachments
import ifc with 0.19.JPG
version 0.19 64 bit
import ifc with 0.19.JPG (215.7 KiB) Viewed 423 times
import ifc with 0.18 32bit.JPG
version 0.18 32 bit
import ifc with 0.18 32bit.JPG (213.66 KiB) Viewed 423 times
import ifc with p.JPG
import with other program
import ifc with p.JPG (214.77 KiB) Viewed 423 times
User avatar
bernd
Posts: 9045
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: problems with IFC import

Postby bernd » Tue Jan 07, 2020 10:53 am

It seams some geographical values are zero and thus a zero devision makes the programm crash.

Without the file it is nearly impossible to debug this.
User avatar
bernd
Posts: 9045
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: problems with IFC import

Postby bernd » Tue Jan 07, 2020 10:59 am

If you can not post the file for some restrictions ...

Close FreeCAD. In FreeCAD 0.19 in Mod/Arch/importIFC.py comment these lines ... https://github.com/FreeCAD/FreeCAD/blob ... #L839-L842

like this

Code: Select all

                """
                if modelRC and modelRC.TrueNorth:
                    obj.Declination = -math.degrees(math.atan(modelRC.TrueNorth.DirectionRatios[0] / modelRC.TrueNorth.DirectionRatios[1]))
                    if(FreeCAD.GuiUp):
                        obj.ViewObject.CompassRotation.Value = obj.Declination
                """
restart FreeCAD and import the file.
Renato
Posts: 58
Joined: Fri Apr 24, 2015 10:14 am
Location: Italy (Tuscany)

Re: problems with IFC import

Postby Renato » Tue Jan 07, 2020 3:17 pm

Ok
This is the file ifc
Attachments
struttura uffici.ifc
This is the file
(137.49 KiB) Downloaded 15 times
User avatar
bernd
Posts: 9045
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: problems with IFC import

Postby bernd » Tue Jan 07, 2020 3:39 pm

User avatar
bernd
Posts: 9045
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: problems with IFC import

Postby bernd » Tue Jan 07, 2020 4:39 pm

BTW: welcome back after 4.5 years forum break.
hlg
Posts: 23
Joined: Fri Jul 12, 2019 10:11 am

Re: problems with IFC import

Postby hlg » Tue Jan 07, 2020 7:03 pm

I think the fix could be improved: https://github.com/FreeCAD/FreeCAD/comm ... t-36696448. Shall I make a pull request?
User avatar
bernd
Posts: 9045
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: problems with IFC import

Postby bernd » Tue Jan 07, 2020 8:09 pm

great. I did not dig into the details just fixed the division by zero problem.

go for a PR :)
User avatar
bernd
Posts: 9045
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: problems with IFC import

Postby bernd » Tue Jan 07, 2020 8:13 pm

may be even add the value informations you gave as a comment on the commit as some comment in the source code in the PR.
Renato
Posts: 58
Joined: Fri Apr 24, 2015 10:14 am
Location: Italy (Tuscany)

Re: problems with IFC import

Postby Renato » Wed Jan 08, 2020 8:59 am

thank you
But sorry I didn't understand anything …
How does Freecad work to open this file correctly?