Hi @kharel.valtingojer welcome to the community and thanks for exploring our newly released tech, and great question also!
What happens during the tiling process is the 3D model from Revit is transformed from its local coordinate system into a geographic coordinate system so it can be accurately positioned on the globe. This is why the coordinates are different to what you see in Revit. Some of these conversions can also introduce minor distortion (eg. applying curvature of the earth).
At a high level, what you’ll need to do is to apply the same transformation that happens when generating and loading the 3D Tiles, to the coordinates you’ve extracted from Revit/XBim.
There are two main ways you can geolocate your model, and the approach you’re using will change how you’d calculate the coordinates.
Internal Origin export / Tileset Location Editor in Cesium ion
If you’re exporting with internal origin only, the 3D Tiles are not automatically located on the globe. Instead you’re likely manually placing them at a lat/lon/height determined by you in the Cesium ion Tileset Location Editor.
If using this approach, you should be able to take a coordinate from Revit relative to its internal origin, and apply a custom transformation matrix that converts from the local coordinates to the geographic ones. If using CesiumJS, Cesium.Transforms.eastNorthUpToFixedFrame
could help here.
Shared Coordinates with EPSG Code
If you’re supplying an EPSG Code during export so that Cesium ion automatically places the model at the correct location on earth, then some curvature of the earth and other transformations will be applied meaning the above approach won’t be accurate enough.
What you’ll need to do is perform the exact same coordinate transform that Cesium ion is performing during tiling. This woul mean using proj to convert from Revit shared coordinates into geographic ones.
I can make further suggestions if you can let me know which geolocation method you’re using, and which Cesium runtime you’re using (eg. CesiumJS, Cesium for Unreal, Cesium for Unity, etc)