Open Pravesh-Jamgade opened 6 years ago
The code is split in 2 parts: ifc2off and off2citygml
The latter converts the OFF and OFFX files generated from the first step to a valid LOD3 CityGML file. Dependencies: CGAL
In ifc2off remove all references to CityGMLgrivySerializer. Use the .tmp output format to get off and offx. Then run the files through the second stage.
At no point are .obj files mentioned in this project.
I have installed all the dependencies necessary to run the project. can you provide step by step procedure to run your project and get citygml output. I had gone through the previous issues but that's not helping.Thank you!
You're not giving me any information to work with.
What happens if you run ifc2off to get .tmp output?
.obj file was resulted from IfcOpenshell,i mistaken it to off file 1.ifc2off i have build all the required dependencies. i have moved the files ( CityGMLSemantics.cpp, CityGMLSemantics.h, grivySerializer.cpp, grivySerializer.h ) from ifc3citygml/ifc2off to IfcOpenshell/src/grivy . Replace the ifcconvert/IfcConvert.cpp file with project ifc2citygml/ifc2off/IfcConvert.cpp file.And removed the CityGMLgrivySerializer.h reference. Then i build the IfcOpenshell/src/ifcconvert folder containing .cpp and .h files. this giving the few errors as shown in figure.
Are you using IfcOpenShell_CGAL instead of the original? See: https://github.com/tudelft3d/ifc2citygml/issues/3
No, im using IfcOpenShell only.
The 0.4.0 branch has the SurfaceStyle.h header. https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.4.0?files=1 Could you try that one?
yes I'm trying. from the image i sent above, did i do it correctly? i mean the files required for compiling.
The image shows you are missing the file ifcconvert/SurfaceStyle.h. The 0.4.0 branch contains this files. So you are either using an older (0.3.0.) or an newer (0.6.0) branch, because otherwise it would be able to find that file.
hello , it took me really long time to build the dependencies. All are set to implement the conversion. As you have instructed in the comment I followed the same procedure. But i have few errors with IfcConvert.cpp . Here the screenshot:
You missed step 3: Remove references to CityGMLgrivySerializer.h, Its not needed
I think you did not remove the #include "CityGMLgrivySerializer.h" at the top of the file.
The other error might be related to not remiving everything as well. But I would at least have to see the corresponding lines of code and relevant variable declarations.
hello, All of the steps I have followed and commented the CityGMLgrivySerializer.h I have the screenshot where I'm having trouble.
Could you add the following two lines to the GeometrySerializer class and try again: std::string semantics; void setCurrentSemantics(std::string sem) {semantics = sem;}
hey it did work. But still few errors are remain here.i tried to remove those error myself and I got pretty messed up. Ifcopenshell itself was showing errors again. if your having the working code can you post here?
I have commented the //#include "../ifcconvert/CityGMLgrivySerializer.h"
and also the object initialization of CityGMLgrivySerializer
Build error IntelliSense error
Hey , please first look at the following message:
IfcConvert.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl grivySerializer::ready(void)" (?ready@grivySerializer@@UEAA_NXZ)
5>
IfcConvert.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl grivySerializer::writeHeader(void)" (?writeHeader@grivySerializer@@UEAAXXZ)
5>IfcConvert.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl grivySerializer::writeTesselated(class IfcGeomObjects::IfcGeomObject const *)" (?writeTesselated@grivySerializer@@UEAAXPEBVIfcGeomObject@IfcGeomObjects@@@Z)
5>IfcConvert.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl grivySerializer::writeShapeModel(class IfcGeomObjects::IfcGeomShapeModelObject const *)" (?writeShapeModel@grivySerializer@@UEAAXPEBVIfcGeomShapeModelObject@IfcGeomObjects@@@Z)
5>IfcConvert.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl grivySerializer::setUnitNameAndMagnitude(class std::basic_string<char,struct std::char_traits
,class std::allocator > const &,float)" (?setUnitNameAndMagnitude@grivySerializer@@UEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@M@Z)
5>IfcConvert.obj : error LNK2019: unresolved external symbol "class std::basic_string<char,struct std::char_traits
5>IfcConvert.obj : error LNK2019: unresolved external symbol "class std::vector<class std::map<int,class std::map<class std::basic_string<char,struct std::char_traits
Hmm I believe the setUnitNameAndMagnitude function was added to ifcopenshell in a later revision.. I do not have the code running on my machine, but I can gather more source files which might be useful to you. Ill have to do that later. Remind me if I do not post anything within 12h.
Hey, If you see in the error it says "Unresolved external errors" for all of the methods in grivySerializer.h file even though the header file is included in the IfcConvert.cpp file.
An unresolved symbol is one that you've declared somewhere but never defined. Usually, it means you've #included some third party library's header file but not told the linker where to find the corresponding .obj files for the library---from definition
is it the case with files inside "grivy" folder created inside the "ifcopenshell/src" ? and linker don't know where to find the .obj files created for "grivy" folder files.
hey, you got something?? According to the error message, it seems to be the linker problem as it is not able to find symbols. I think grivy folder containing cpp and header files didn't get compiled and that's why the linker may not be able to identify the symbols created with IfcConvert.obj .So should I try to compile grivy folder separately?
src.zip Here is everything except the bimserver dlls which I removed. It apparently is based on a late 0.3.0 version I guess a version that is not on github.. In the grivy folder there also is a grivyproject, I think you can just ignore that one.
I used your files...not working still same errors.Now I'm replacing my src by urs.Hope it may work. Also, do I need to compile grivy folder separately before I can use it in the project? https://github.com/tudelft3d/ifc2citygml/issues/4#issuecomment-407652077
with additions of your grivy folder files:
*I don't have added Collada support.
I think you know have the same information I have. The source I provided is exactly what I used in the past so building the solution in there should work (after perhaps fixing opencascade dependencies)
ifcopenshell --version? OpenCascade is working correctly.
Tell me when I did created folder grivy inside which I have added .h and .cpp files. The grivy folder should be get compiled or I have to do it by myself.
I build it successfully! Still I'm confused how to used it as I did made few changes that might be wrong. I did removed CityGMLgrivySerializer.h which caused me to remove:(As u instructed in here ) And now when I run exe file I see these: Here the option citygml would not work as I did remove the references to CityGMLgrivySerializer.h
Need little help! Again.Thanks! Tell me the procedure to convert ifc to off.
I did give the try: without options as I didnt find the off format option: **input : sample.ifc
output : sample.obj sample.mtl **
hey I got it. I successfully created OFF and OFFx file. Actually, I was using wrong ifc file. Ifc file was not for building. Now, please guide me with the conversion of OFF to citygml ?
Great to here! This part should be easier. So off to CityGML is based on CGAL. The library was already much more stable at the time I used it so I expect it to work with newer version, but I used v 4.1.
Steps: Make CGAL (I can't remember how, I just followed the instructions) and create a project add the files and link to CGAL. KeepSemantics contains the main(). After having build the exe there are several input paramaeters to run the exe (closing distance, LoDs etc), you'd have to read the main I think to learn what to input..
Here is a known working input fileset: ifcopenhouse.zip
Here is the msvc proj file: nef_3_construction.zip Perhaps it contains more files as I evaluated many different techniques for solving the problem. But you only need the ones on github.
Another example file with input, intermediate and output files.
hello, I'm facing the problems with cgal installation, specially with qt5. can u tell me why we qt5? Only qt creator installation will be sufficient or I need to install complete qt package?
i build the cgal. I'm little bit confused! After compiling the off2citygml project, where should I link it in cgal project. Like last tym in case of ifc2off, we link ifc2off to IfcConvert project of Ifcopenshell.
Hey, can you provide the working code from your system. It seems that few files are missing from off2citygml. like, PrimitiveShape.cpp ,ExteriorGenerator.cpp ,GrowPolyhe.h and My_nef_polhedron.h , My_SNC_index_item.h file. Please tell me where in the CGAL I should link. Or do I have to link it to the KeepSemantics.cpp in off2citygml.
hello, I have been facing little problems with second part of installation.Please guide me!
For missing files please read my previous post with instructions properly. As for linking I think most or all cgal headers are in stdafx.h. There are also some boost headers like in FileIO.h
Create new solution, create new project, add files, include external/library headers. I don't know whether cgal is statically or dynamically linked.
It worked.it did read the input file and give the msg "Done Reading". Took 45 min. At the end program terminated with "unhandelled exception" msg indicating towards cgal file.
How was the memory usage? I remember there was a memory leak in the nef part of cgal that was just patched at the time probably released in the version after the one I used. Which Cgal version are you using? And try ifcopenhouse as input since it is small. The processing time seems normal. My thesis rapport should have the processing times for several input files.
hey, here the screenshot of the error:
I'm using qt5 5.11.1, cgal - 4.13.
I am not familiar with this exception. I'd recommend debugging it as usual using breakpoints and Google. Are you using one of the datasets that is known to work?
yess. im using your given input files
I have created the project and linked all the necessary libraries.
hey, can you give me your input sequence. May be im not giving the correct input commands.
Hey,
I tried debugging and found location where the message I get " CGAL::Uncertain_conversion_exception at memory location
"
see in the screenshot:
At line 166, normally program runs and reads the OFF file. But in the output window,it shows the above message. Still program continues. The error remain unhandelled. I think that may cause the application stop later in the execution process . exception later in the process execution:
I use try-catch around the suspected code:
These gives me:
microsoft c++ exception:
int cdecl main(int,char * ptr64 * __ptr64 const)`
NEED HELP !
I managed to put "CGAL::Uncertain_conversion_exception" into the google machine which told me it is an warning we can ignore. You've added a throw exception statement and now the code throws an exception? Hmm. Use catch(...) to catch everything and don't throw yourself, but the problem does not appear to be here. Try getting the call stack from the point where the actual exception is thrown.
For input sequence I would start without closing so '0' and only LoD3, not sure whether there were other options..
you mean I can simple ignore and "CGAL::Uncertain_conversion_exception" and its not the main cause of crashing application.
ok. I got it. But do you have the any idea why it keeps crashing? I tried gatting call stack for actual exception. I found it was comming from file
FileIO.h
and method is
CGAL::OFF_to_nef_3(offSStream, nefPolyhe);
Again I continued as you instructed to set offset = 0, then it did aborted with
CGAL_precondition
message inside of the KeepSemantics.cpp at the execution of
CGAL::Timer T.stop()
method.
hey, I followed your instructions for input sequences and generated the lod1 and lod2 for ifcopenhouse.ifc file. Although I didn't understand , why we set offset = 0,otherwise it wont work. The other files https://github.com/tudelft3d/ifc2citygml/issues/4#issuecomment-408675685 you sent me in past is failed to give gml files. Also, LOD3 and LO4 is not generating on ifcopenhouse.ifc In case of Ifcopenhouse.ifc, After concluding the total elapsed time, it starts again reading for off file and failed in middle with the same assertion error that we encountered in the past.
Thanks for the help till now, i really appreciate your help.
It is not possible to generate lod 1 and 2 without lod 3. The output file just doesn't contain lod3 in the filename. The LoD4 rooms are also in the same file as the LoD3 exterior. I think you just didn't see the file.
We use 0mm on ifcopenhouse because this input is topology correct, thus does not contain holes/gaps in the geometry. The closing distance is the size of the holes that will be fixed.
I have installed all the dependencies on ubuntu and successfully converted the .ifc file to .obj . I need help for converting .obj to .citygml .Thank you!