I am trying to work with your IFC to OBJ converter but I have some problems.
I converted a simple IFC wall into an OBJ file but when I tried to open it with a Qt Viewer … nothing.
I tried with 2 other viewers (GLC Player and LynX3DViewerLite) and the result was the same : loading error.
With Blender, it works fine ! I can import my OBJ and see it.
I tried to export my OBJ into a new OBJ with Blender and my 3 other viewers loaded it.
It is not possible to load your OBJ in another viewer than Blender ?
That's unfortunate. The .obj format was chosen because it is one of the simplest formats around, which can be imported by a lot of application. I only verified the IfcObj output to work with both Blender and Autodesk 3ds Max.
It would be interesting to see what the reason behind the malfunctioning is. There are several options in the .obj format, but there is currently no way to configure IfcObj. One can specify faces using positive or negative vertex indices (IfcObj uses negative). One can specify normals and uv-coords (IfcObj exports only normals). One can group objects by group or by object (IfcObj uses group). One can use normal smoothing (IfcObj does). Do you have an idea whether any of these options could be the problem, maybe you can check with your viewers what options they support. Also it would help to know what are the differences between the .obj file by IfcObj and by Blender?
Kind regards,
Thomas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can now load all obj converted files in my viewers with no error but I still have another problem.
On very simple examples with just a wall or a cube, everything is fine (conversion OK, loading OK, printing OK).
On complicated examples with several elements or big structures, the obj file seems to be OK but my viewers don't print what they should (Blender too, it is not a viewer problem) : I have just one wall (with acad2010_walls.ifc), one bar (with geometrygym_great_court_roof.ifc), or a big mess (with acad2010_objects.ifc).
Any idea ?
Thank you for your support.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Positive vertex indices are on file-wide basis, so you should keep track of how many vertices already exist in the file. I am currently not able to test this, but something like this should do the trick:
Hi !
I am trying to work with your IFC to OBJ converter but I have some problems.
I converted a simple IFC wall into an OBJ file but when I tried to open it with a Qt Viewer … nothing.
I tried with 2 other viewers (GLC Player and LynX3DViewerLite) and the result was the same : loading error.
With Blender, it works fine ! I can import my OBJ and see it.
I tried to export my OBJ into a new OBJ with Blender and my 3 other viewers loaded it.
It is not possible to load your OBJ in another viewer than Blender ?
Tank you for your help !
The IFC Wall :
http://ssi.wikidot.com/local-files/2012-blog-posts/120510%20wall%20standard%20case.ifc
Hi,
That's unfortunate. The .obj format was chosen because it is one of the simplest formats around, which can be imported by a lot of application. I only verified the IfcObj output to work with both Blender and Autodesk 3ds Max.
It would be interesting to see what the reason behind the malfunctioning is. There are several options in the .obj format, but there is currently no way to configure IfcObj. One can specify faces using positive or negative vertex indices (IfcObj uses negative). One can specify normals and uv-coords (IfcObj exports only normals). One can group objects by group or by object (IfcObj uses group). One can use normal smoothing (IfcObj does). Do you have an idea whether any of these options could be the problem, maybe you can check with your viewers what options they support. Also it would help to know what are the differences between the .obj file by IfcObj and by Blender?
Kind regards,
Thomas
Relative indices (negatives) seems to be the problem.
I made some change in your code to fix this in IfcObj.cpp line 96 :
I can now load all obj converted files in my viewers with no error but I still have another problem.
On very simple examples with just a wall or a cube, everything is fine (conversion OK, loading OK, printing OK).
On complicated examples with several elements or big structures, the obj file seems to be OK but my viewers don't print what they should (Blender too, it is not a viewer problem) : I have just one wall (with acad2010_walls.ifc), one bar (with geometrygym_great_court_roof.ifc), or a big mess (with acad2010_objects.ifc).
Any idea ?
Thank you for your support.
Hi,
Positive vertex indices are on file-wide basis, so you should keep track of how many vertices already exist in the file. I am currently not able to test this, but something like this should do the trick:
Kind regards,
Thomas
Hi,
Whoops, obviously vcount_start should be of type int, not const int…
Kind regards,
Thomas
Ok everything is fine now, thank you :)