problems with IFC import

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

problems with IFC import

Post by Renato »

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
version 0.19 64 bit
version 0.19 64 bit
import ifc with 0.19.JPG (215.7 KiB) Viewed 2473 times
version 0.18 32 bit
version 0.18 32 bit
import ifc with 0.18 32bit.JPG (213.66 KiB) Viewed 2473 times
import with other program
import with other program
import ifc with p.JPG (214.77 KiB) Viewed 2473 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: problems with IFC import

Post by bernd »

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
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: problems with IFC import

Post by bernd »

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: 179
Joined: Fri Apr 24, 2015 10:14 am
Location: Italy (Tuscany)

Re: problems with IFC import

Post by Renato »

Ok
This is the file ifc
Attachments
strut uffici.ifc
(136.47 KiB) Downloaded 89 times
Last edited by Renato on Thu Apr 23, 2020 12:47 pm, edited 1 time in total.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: problems with IFC import

Post by bernd »

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

Re: problems with IFC import

Post by bernd »

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

Re: problems with IFC import

Post by hlg »

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

Re: problems with IFC import

Post by bernd »

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

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

Re: problems with IFC import

Post by bernd »

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: 179
Joined: Fri Apr 24, 2015 10:14 am
Location: Italy (Tuscany)

Re: problems with IFC import

Post by Renato »

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