Solved

Cannot convert IFC file to 3D Tiles


Badge

I have tried to convert an IFC file to Cesium 3D Tiles with the Cesium 3D Tiles writer.

This results in one JSON file and one or more B3DM files (depending on the IFC file structure).

When I try to add the JSON and B3DM file(s) to Cesium ion, the model does not appear.

 

How can I fix this?

Is there another method to convert IFC files to 3D Tiles with FME?

icon

Best answer by daveatsafe 2 May 2022, 19:39

View original

12 replies

Userlevel 1
Badge +11

Hi @rohitramlakhan​, can you try zipping up your Cesium output containing the data folder and tileset.json before uploading to Cesium? You can then pick 3D Tiles for data type and it should correctly find your main json file and load successfully.

 

My zipped file looked something like this where the parent folder that I zipped contained just the data folder and the tileset.json:

output-zipped

Badge +6

Hi @rohitramlakhan​ , have you tried a recent build for FME 2022.0 beta? Just in the last few weeks we have made a lot of improvements to our Cesium writing including optimizations for the tile set structure, bug fixes, etc. See https://downloads.safe.com/fme/beta/whatsnew_2022_0.txt

Badge

Hi @rohitramlakhan​, can you try zipping up your Cesium output containing the data folder and tileset.json before uploading to Cesium? You can then pick 3D Tiles for data type and it should correctly find your main json file and load successfully.

 

My zipped file looked something like this where the parent folder that I zipped contained just the data folder and the tileset.json:

output-zipped

Hi,

 

I have tried zipping the Cesium output containing the data folder and tileset.json file, but it is the same. It only shows a bounding box and I cannot adjust the tileset location (see image below). data is the name of the zipped file containing the data folder with the b3dm files and the tileset.json file.

 

image

Badge

Hi @rohitramlakhan​ , have you tried a recent build for FME 2022.0 beta? Just in the last few weeks we have made a lot of improvements to our Cesium writing including optimizations for the tile set structure, bug fixes, etc. See https://downloads.safe.com/fme/beta/whatsnew_2022_0.txt

Hi,

 

I have installed the recent build of FME 2022.0 beta.

But when I try to convert the IFC file to 3D tiles in exactly the same manner as with the previous version, I now only get a tileset.json file and no b3dm files.

Badge +6

Hi @rohitramlakhan​ 

You will likely need to delete and re-add your Cesium writer after upgrading your FME. You should double check your writer settings as some of the writer parameters have changed in 2022.

 

Also make sure you set the coordinate system on the features before writing. One of the problems with IFC is that often the georeferencing is not set correctly or difficult to read depending on the CRS or local reference system used. If your data is not already in a specific CRS, but rather a local coordinate system, you will most likely need to use a LocalCoordinateSystemSetter to place the model in the correct position. If the IFC model has any geolocation info, it should be stored in attributes in the IfcSite feature type under RefLongitude, RefLatitude. You can use that for the origin of the local coordinate system. There may be a need for a rotation as well.

 

When reading from the IFC, its best to simplify your geometry before writing to Cesium. Use a GeometryPartExtractor, set the query to geometry name = Body. This will return just the geometries and not all the property sets. You can also use a GeometryPropertyExtractor with an empty XQuery statement to retrieve all geometry traits as attributes before the GeometryPartExtractor. See one of our BIM tutorials for examples of how to read from IFC and write to GIS: https://community.safe.com/s/article/bim-to-gis-basic-ifc-lod-100-to-lod-2-citygml

 

For a very simple test, you could also create a test 3d object with a Creator and try writing that out as Cesium to help isolate whether the problem is with your source data or with the Cesium writing.

 

If you still have trouble please file a case with support at:

https://community.safe.com/s/submit-case

 

We can then check to see if there might be an issue with your input data. Also, I believe we have updated our Cesium writer docs so it may be worth double checking those:

https://docs.safe.com/fme/2022.0/html/FME_Desktop_Documentation/FME_ReadersWriters/cesium3dtiles/cesium3dtiles.htm

 

This discussion is also worth a review if you haven't seen it yet: https://community.safe.com/s/question/0D54Q000080heOiSAI/fme-desktop-convert-ifc-to-cesium-3d-tiles

Badge

Hi @rohitramlakhan​ 

You will likely need to delete and re-add your Cesium writer after upgrading your FME. You should double check your writer settings as some of the writer parameters have changed in 2022.

 

Also make sure you set the coordinate system on the features before writing. One of the problems with IFC is that often the georeferencing is not set correctly or difficult to read depending on the CRS or local reference system used. If your data is not already in a specific CRS, but rather a local coordinate system, you will most likely need to use a LocalCoordinateSystemSetter to place the model in the correct position. If the IFC model has any geolocation info, it should be stored in attributes in the IfcSite feature type under RefLongitude, RefLatitude. You can use that for the origin of the local coordinate system. There may be a need for a rotation as well.

 

When reading from the IFC, its best to simplify your geometry before writing to Cesium. Use a GeometryPartExtractor, set the query to geometry name = Body. This will return just the geometries and not all the property sets. You can also use a GeometryPropertyExtractor with an empty XQuery statement to retrieve all geometry traits as attributes before the GeometryPartExtractor. See one of our BIM tutorials for examples of how to read from IFC and write to GIS: https://community.safe.com/s/article/bim-to-gis-basic-ifc-lod-100-to-lod-2-citygml

 

For a very simple test, you could also create a test 3d object with a Creator and try writing that out as Cesium to help isolate whether the problem is with your source data or with the Cesium writing.

 

If you still have trouble please file a case with support at:

https://community.safe.com/s/submit-case

 

We can then check to see if there might be an issue with your input data. Also, I believe we have updated our Cesium writer docs so it may be worth double checking those:

https://docs.safe.com/fme/2022.0/html/FME_Desktop_Documentation/FME_ReadersWriters/cesium3dtiles/cesium3dtiles.htm

 

This discussion is also worth a review if you haven't seen it yet: https://community.safe.com/s/question/0D54Q000080heOiSAI/fme-desktop-convert-ifc-to-cesium-3d-tiles

Hi,

 

I have tried all of your suggestions, but it still did not work.

I have filed a case at safe.

Thank you for your help.

Userlevel 2
Badge +17

Hi @rohitramlakhan​,

When writing to Cesium, FME automatically tries to reproject the data to Cesium's ECEF coordinate system.

If the IFC data contains a latitude and longitude reference, FME will create a custom coordinate system centered on that location, which is suitable for reprojection. However,  features read from the IFC file contain a mixture of geometries: 3D solids, 2D outlines (sometimes), and Null property sets. This mixture cannot be reprojected without some modification.

 

What I generally do with IFC data is to extract the property sets from the geometry and add them as attributes, using the GeometryPropertyExtractor with Prefix with Geometry Names set to 'Yes'. Next I extract only the 3D solid geometry using a GeometryPropertyExtractor with the following Geometry XQuery:

This part | Geometry Name | = | Body
AND
A parent of this part | Geometry Type | = | FMEAggregate

This will produce a simple 3D Solid geometry, suitable for use in most other applications.

 

Finally, I use an AttributeExposer to expose all the extracted attribute to Workbench. The easiest way to do this is to set Run - Enable Feature Caching from the menu, then run the workspace. Open the AttributeExposer, then click the Import button and choose From Feature Cache. This will expose all attributes on the cached features.

 

I am attaching a workspace where I have done this process for the IfcSpace features, to illustrate the result.

 

Screen Shot 2022-05-02 at 10.37.26 AM

Badge

Hi @rohitramlakhan​,

When writing to Cesium, FME automatically tries to reproject the data to Cesium's ECEF coordinate system.

If the IFC data contains a latitude and longitude reference, FME will create a custom coordinate system centered on that location, which is suitable for reprojection. However,  features read from the IFC file contain a mixture of geometries: 3D solids, 2D outlines (sometimes), and Null property sets. This mixture cannot be reprojected without some modification.

 

What I generally do with IFC data is to extract the property sets from the geometry and add them as attributes, using the GeometryPropertyExtractor with Prefix with Geometry Names set to 'Yes'. Next I extract only the 3D solid geometry using a GeometryPropertyExtractor with the following Geometry XQuery:

This part | Geometry Name | = | Body
AND
A parent of this part | Geometry Type | = | FMEAggregate

This will produce a simple 3D Solid geometry, suitable for use in most other applications.

 

Finally, I use an AttributeExposer to expose all the extracted attribute to Workbench. The easiest way to do this is to set Run - Enable Feature Caching from the menu, then run the workspace. Open the AttributeExposer, then click the Import button and choose From Feature Cache. This will expose all attributes on the cached features.

 

I am attaching a workspace where I have done this process for the IfcSpace features, to illustrate the result.

 

Screen Shot 2022-05-02 at 10.37.26 AM

Hi,

 

I tried your workflow.

And the program did run.

However, when I tried to load the file into Cesium the model did not show.

When I first zipped the model, it did show (see screenshot).

I can still however not adjust the tileset location.

Were you able to adjust the tileset location?

 

image 

 

Userlevel 2
Badge +17

Hi,

 

I tried your workflow.

And the program did run.

However, when I tried to load the file into Cesium the model did not show.

When I first zipped the model, it did show (see screenshot).

I can still however not adjust the tileset location.

Were you able to adjust the tileset location?

 

image 

 

Hi @rohitramlakhan​,

I did not try to adjust the location. FME will place the model based on the reference latitude and longitude in the IFC. Unfortunately, the apartment file seems to have an incorrect reference lat/long, which places it in Amersfoot, while the building address says it's supposed to be in Nijmegen.

If you know the proper lat/long of the building origin, you can add a LocalCoordinateSystemSetter transformer to override the lat/long read from the IFC file.

Badge +6

Hi @rohitramlakhan​,

In addition to Dave's suggestions above, I strongly recommend that you try downloading FME 2022.1 beta, since many of the Cesium writing enhancements are in 2022.1, not in 2022.0 - see ftp.safe.com/fmebuilds - try build 22575. Now that FME 2022.0 is released, the 2022.1 betas will be available soon at safe.com/downloads . But in the meantime I thought it would be useful for you to have access to a recent beta so you can test out the most up to date version of our Cesium writer.

Badge

Hi @rohitramlakhan​,

In addition to Dave's suggestions above, I strongly recommend that you try downloading FME 2022.1 beta, since many of the Cesium writing enhancements are in 2022.1, not in 2022.0 - see ftp.safe.com/fmebuilds - try build 22575. Now that FME 2022.0 is released, the 2022.1 betas will be available soon at safe.com/downloads . But in the meantime I thought it would be useful for you to have access to a recent beta so you can test out the most up to date version of our Cesium writer.

Hi,

 

The suggestions from Dave worked for me, but I will also download FME 2022.1 beta to check that out.

Thank you for your help.

Badge

Hi,

 

I tried your workflow.

And the program did run.

However, when I tried to load the file into Cesium the model did not show.

When I first zipped the model, it did show (see screenshot).

I can still however not adjust the tileset location.

Were you able to adjust the tileset location?

 

image 

 

Hi,

 

When I use the the LocalCoordinateSystemSetter, it works.

Thank you for your help.

Reply