[fixed] IFC export with serializer has wrong placement

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:

Re: IFC export with serializer has wrong placement

Post by bernd »

I slowly start to think it is a problem in serialiser of ifcos. I know how to determine this.

I will come back with results.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export with serializer has wrong placement

Post by bernd »

the base is the file from this post ... viewtopic.php?t=77403&start=10#p674929

in export I added some lines of code to export the brep which will be used by the IfcOS serializer.

in this post will be the files for this code lines in exportIFC.py

Code: Select all

                            sh = obj.Shape.copy()
                            sh.Placement = obj.getGlobalPlacement()


One IFC ist the one exported from FC, the other was created newly by pure IfcOS and the use of the brep file.

cyl_copyGlobPlace_IfcOS.ifc
(6.18 KiB) Downloaded 79 times
cyl_copyGlobPlace_FC.ifc
(5.28 KiB) Downloaded 73 times
cyl_copyGlobPlace.brep
(1.6 KiB) Downloaded 86 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export with serializer has wrong placement

Post by bernd »

in this post will be the files for this code lines in exportIFC.py

Code: Select all

                            sh = obj.Shape.removeSplitter()


One IFC ist the one exported from FC, the other was created newly by pure IfcOS and the use of the brep file.

cyl_removeSplitter_IFCOS.ifc
(6.1 KiB) Downloaded 83 times
cyl_removeSplitter_FC.ifc
(5.2 KiB) Downloaded 87 times
cyl_removeSplitter.brep
(1.6 KiB) Downloaded 75 times
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export with serializer has wrong placement

Post by bernd »

- If the both brep are loaded into FreeCAD the cylinder are on the same place
- if the ifc exported from FreeCAD are loaded the cylinder are on different places
- if the ifc created with IfcOS are loaded the cylinder are on different places

It means both brep are on the same place but when from these breps IFCs are generated with the serializer these ifc are on totally different places. Seams a proble in serializer.

If we change the code to removeSplitter() we just bypass the problem in serializer of ifcos.

Very interesting if you compare the brep only the last two lines are different. I have no idea what this means ...

Code: Select all

$ diff cyl_removeSplitter.brep cyl_copyGlobPlace.brep
110c110
< -2 1 *
---
> -2 0 *
112c112
< +1 0
\ No newline at end of file
---
> +1 1
\ No newline at end of file
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export with serializer has wrong placement

Post by bernd »

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

Re: IFC export with serializer has wrong placement

Post by bernd »

- viewtopic.php?p=675456#p675456 says removeSplitter() moves the placement not to the vertexes but to the direct child shapes.

- https://github.com/IfcOpenShell/IfcOpen ... ssues/2992 confirms IfcOS has a problem if placement it applied to the outer level of a shape.

That is why removeSplitter() helps to get around this problem the time being this is not fixed in IfcOS


yorik wrote: Fri Apr 14, 2023 11:25 am We might still need to apply the global placement before removing splitters.
I will try and go for this if it works.
User avatar
bernd
Veteran
Posts: 12849
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: IFC export with serializer has wrong placement

Post by bernd »

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

Re: [fixed] IFC export with serializer has wrong placement

Post by bernd »

Post Reply