Export bolt to ifc

This forum section is only for IFC-related issues
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Export bolt to ifc

Post by bernd »

Nemetschek Allplan CAD we do drawings with lacks on bolts (it is optimized for concrete structures) and is not able to import step. Since in FreeCAD we do have lots of bolts I thought I export them to ifc and import them into Nemetschek Allplan CAD.

Something went wrong. Is it FreeCAD or IfcOpenShell?

bolt in FreeCAD
bolt1.png
bolt1.png (224.25 KiB) Viewed 3237 times
bolt exported to ifc and reimport into FreeCAD
bolt2.png
bolt2.png (221.53 KiB) Viewed 3237 times
freecad file
bolt.fcstd
(19.95 KiB) Downloaded 95 times
ifc file
bolt.ifc
(122.67 KiB) Downloaded 127 times
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Export bolt to ifc

Post by yorik »

I added some new code some time ago that did some simplification to the triangulation that occurs with that kind of shapes. Apparently it did some mess here :) I must rebuild my ifc++ now to test, but we might need to add some switch to disable the simplification when needed.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Export bolt to ifc

Post by bernd »

yorik wrote:I added some new code some time ago that did some simplification to the triangulation that occurs with that kind of shapes. Apparently it did some mess here :) I must rebuild my ifc++ now to test, but we might need to add some switch to disable the simplification when needed.
Ahh thanks, Is it possible to disable by python or by a small code change already? In the regard of a workaround?
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Export bolt to ifc

Post by yorik »

yes, just comment line 1193 in importIFC.py and uncomment all the commented lines above...
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Export bolt to ifc

Post by yorik »

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

Re: Export bolt to ifc

Post by bernd »

Just tested again with up to date FreeCAD and up to date ifcopenshell.

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6064 (Git)
Build type: Release
Branch: master
Hash: 6d237ed63ba5b55fa6001c0a5ac6bd44938aeb9c
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17


the bolt is even worse with classic triangulation ... :( see file bolt_classictriang.ifc

attaced an branch_pipe (file branch_pipe.FCStd). This one works quit well with the classic triangulation (pipe_classictriang.ifc) :D The new triangulation has an error for me you may interested in?

Code: Select all

Arch workbench activated
clones table: {}
[<Part::PartFeature>]
Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "C:\Daten\FreeCAD_0.16.6064_x64_dev_bin\FreeCAD_0.16.6064_x64_dev_bin\Mod\Arch\importIFC.py", line 877, in export
    representation,placement,shapetype = getRepresentation(ifcfile,context,obj,forcebrep=(brepflag or FORCEBREP))
  File "C:\Daten\FreeCAD_0.16.6064_x64_dev_bin\FreeCAD_0.16.6064_x64_dev_bin\Mod\Arch\importIFC.py", line 1199, in getRepresentation
    for fcface in fcsolid.Faces:
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'Faces'
Stack Trace: Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "C:\Daten\FreeCAD_0.16.6064_x64_dev_bin\FreeCAD_0.16.6064_x64_dev_bin\Mod\Arch\importIFC.py", line 877, in export
    representation,placement,shapetype = getRepresentation(ifcfile,context,obj,forcebrep=(brepflag or FORCEBREP))
  File "C:\Daten\FreeCAD_0.16.6064_x64_dev_bin\FreeCAD_0.16.6064_x64_dev_bin\Mod\Arch\importIFC.py", line 1199, in getRepresentation
    for fcface in fcsolid.Faces:
To Summarize:
------------------------------------
branch_pipe.FCStd
(18.39 KiB) Downloaded 92 times
classic triangulation works well
pipe_classictriang.ifc
(145.89 KiB) Downloaded 113 times
new triangulation has error
------------------------------------
bolt.FCStd see first post
classic triangulation is worse
bolt_classictriang.ifc
(165.46 KiB) Downloaded 112 times
new triangulation has only a few faces and only FreeCAD is able to view them (they do not show in neither IfcPlusPlus nor Solibri).
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Export bolt to ifc

Post by yorik »

Hmm I guess we need to extend the triangulaiton options to support the full Mesh options, like I did for Collada...

*Edit* but your object above exports and reimports correctly for me with classical triangulation (see attched). The new one however has a bug, I'm fixing that right now
Attachments
t1.ifc
(143.2 KiB) Downloaded 100 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Export bolt to ifc

Post by bernd »

yorik wrote:Hmm I guess we need to extend the triangulaiton options to support the full Mesh options, like I did for Collada...
would be cool. :)
yorik wrote:*Edit* but your object above exports and reimports correctly for me with classical triangulation (see attched). The new one however has a bug, I'm fixing that right now
Same for me. I posted the file because of the error on the new triangulation.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Export bolt to ifc

Post by yorik »

the new options are in. Preferennces -> ifc-> use DAE options (then in the DAE tab, set somethings that works for you...)
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Export bolt to ifc

Post by bernd »

for reference from a privat conversation ...
... triangulating shapes is anyway a bad solution. At some point, this is what we should go for:
http://www.buildingsmart-tech.org/ifc/I ... edbrep.htm

Since any surface in OCC can always be turned into a nurbs surface, this would give us 100% of fidelity.
But I'm a bit afraid of the headache it wil give to implement this :)
I'm also not sure many other app support it, I haven't found existing examples on the net so far...
Wow the nurbs stuff would be cool ...

But Triangulation is is what most product manufacturers do. See attached files.
Attachments
ancor.zip
(195.01 KiB) Downloaded 79 times
radiator.zip
(303.54 KiB) Downloaded 79 times
Post Reply