Height Gaps Between Adjacent CityGML Objects After 3D Tiles Conversion

Hi Mark.
I may have a similar issue: Self made 3D tiles terrain, precision problem at edges problem - #8 by Marco13

Of course, my issue may be unrelated as I’m manually creating my gltf files and tilesets so take everything I say with a grain of salt…

I have a self-made 3d tileset terrain generation pipeline which I tried to explain in the other thread. As Marco mentioned, there are a lot of instruments involved in the process and there might be an error or bug introduced in any step… Being that said, I’m trying to bring/snap edge vertices between 2 neighbour tiles together, in world coordinates. I expect to get a smooth output.
I’ve made tons of tests, like “theoretical values calculated vs. actual values generated” which means what is expected numerically vs. what is generated at the end of my pipeline… I can say that the generated tileset edge vertices values are consistent with my theoritical calculations (see logs below), however there is always an offset like difference between the edges when rendering.

Let me share some of my logs here that supports my findings:
Below is the output of my gltf tile generation script, that calculates what 2 neighbour edge vertices should have as world positions. The values are mathematically calculated vertex positions at the edges. After this step, I’m generating the glTF mesh accordingly. Units are meters (ECEF), Dist is euclidean distance, which is => np.linalg.norm(v1_world - v2_world)

The log format is:


mesh1VertexID <-> (corresponding) mesh2VertexID | Dist: Euclidean distance | vertex1_worldposition_xyz | vertex2_worldposition_xyz
...
Vertex 2825↔ 2842 Dist=0.000381 - [ 4216956.54676819 -3870190.02490234  2798999.42675781] - [ 4216956.54638672 -3870190.02490234  2798999.42675781]
Vertex 2827↔ 2844 Dist=0.000008 - [ 4216972.90526581 -3870166.22460938  2799010.28417969] - [ 4216972.90527344 -3870166.22460938  2799010.28417969]
Vertex 2833↔ 2847 Dist=0.000214 - [ 4216991.23117065 -3870144.2421875   2799022.44824219] - [ 4216991.23095703 -3870144.2421875   2799022.44824219]
Vertex 2838↔ 2852 Dist=0.000008 - [ 4217009.1674881  -3870121.89941406  2799034.35351562] - [ 4217009.16748047 -3870121.89941406  2799034.35351562]
Vertex 2842↔ 2857 Dist=0.000034 - [ 4217027.35452652 -3870099.78808594  2799046.42480469] - [ 4217027.35449219 -3870099.78808594  2799046.42480469]
Vertex 2847↔ 2861 Dist=0.000163 - [ 4217046.40641308 -3870078.47607422  2799059.0703125 ] - [ 4217046.40625    -3870078.47607422  2799059.0703125 ]
Vertex 2850↔ 2865 Dist=0.000550 - [ 4217065.36578417 -3870057.07861328  2799071.65527344] - [ 4217065.36523438 -3870057.07861328  2799071.65527344]
Vertex 2854↔ 2869 Dist=0.000019 - [ 4217084.37794876 -3870035.72998047  2799084.27441406] - [ 4217084.37792969 -3870035.72998047  2799084.27441406]
Vertex 2859↔ 2872 Dist=0.000259 - [ 4217101.18482971 -3870012.34375     2799095.4296875 ] - [ 4217101.18457031 -3870012.34375     2799095.4296875 ]
Vertex 2866↔ 2879 Dist=0.000458 - [ 4217117.85299683 -3869988.82910156  2799106.49316406] - [ 4217117.85253906 -3869988.82910156  2799106.49316406]
Vertex 2871↔ 2882 Dist=0.000053 - [ 4217132.49419403 -3869963.44189453  2799116.2109375 ] - [ 4217132.49414062 -3869963.44189453  2799116.2109375 ]
Vertex 2875↔ 2886 Dist=0.000626 - [ 4217142.8238678  -3869934.07177734  2799123.06738281] - [ 4217142.82324219 -3869934.07177734  2799123.06738281]
Vertex 2877↔ 2889 Dist=0.000214 - [ 4217150.45974731 -3869902.21289062  2799128.13574219] - [ 4217150.45996094 -3869902.21289062  2799128.13574219]
Vertex 2882↔ 2896 Dist=0.000160 - [ 4217156.24007416 -3869868.63964844  2799131.97265625] - [ 4217156.24023438 -3869868.63964844  2799131.97265625]
Vertex 2890↔ 2899 Dist=0.000191 - [ 4217161.32050323 -3869834.42041016  2799135.34472656] - [ 4217161.3203125  -3869834.42041016  2799135.34472656]
Vertex 2896↔ 2903 Dist=0.000008 - [ 4217166.35448456 -3869800.15820312  2799138.68554688] - [ 4217166.35449219 -3869800.15820312  2799138.68554688]
Vertex 2902↔ 2910 Dist=0.000397 - [ 4217170.84024048 -3869765.39013672  2799141.66308594] - [ 4217170.83984375 -3869765.39013672  2799141.66308594]
Vertex 2906↔ 2913 Dist=0.000130 - [ 4217176.48131561 -3869731.68945312  2799145.40722656] - [ 4217176.48144531 -3869731.68945312  2799145.40722656]
Vertex 2913↔ 2917 Dist=0.000145 - [ 4217182.61733246 -3869698.44580078  2799149.48046875] - [ 4217182.6171875  -3869698.44580078  2799149.48046875]
Vertex 2916↔ 2924 Dist=0.000076 - [ 4217189.09660339 -3869665.52001953  2799153.78125   ] - [ 4217189.09667969 -3869665.52001953  2799153.78125   ]
Vertex 2918↔ 2927 Dist=0.000549 - [ 4217197.42437744 -3869634.30126953  2799159.30859375] - [ 4217197.42382812 -3869634.30126953  2799159.30859375]
Vertex 2921↔ 2930 Dist=0.000458 - [ 4217207.8119812  -3869604.98583984  2799166.203125  ] - [ 4217207.81152344 -3869604.98583984  2799166.203125  ]
Vertex 2927↔ 2934 Dist=0.000290 - [ 4217219.57939148 -3869576.9453125   2799174.01367188] - [ 4217219.57910156 -3869576.9453125   2799174.01367188]
Vertex 2930↔ 2938 Dist=0.000671 - [ 4217231.76922607 -3869549.29492188  2799182.10546875] - [ 4217231.76855469 -3869549.29492188  2799182.10546875]
Vertex 2936↔ 2942 Dist=0.000000 - [ 4217244.12402344 -3869521.796875    2799190.30566406] - [ 4217244.12402344 -3869521.796875    2799190.30566406]
Vertex 2941↔ 2944 Dist=0.000565 - [ 4217256.6900177  -3869494.49365234  2799198.64648438] - [ 4217256.68945312 -3869494.49365234  2799198.64648438]
Vertex 2946↔ 2947 Dist=0.000565 - [ 4217269.18318176 -3869467.12353516  2799206.93847656] - [ 4217269.18261719 -3869467.12353516  2799206.93847656]
Vertex 2949↔ 2952 Dist=0.000397 - [ 4217280.26992798 -3869438.45458984  2799214.296875  ] - [ 4217280.26953125 -3869438.45458984  2799214.296875  ]
Vertex 2954↔ 2957 Dist=0.000381 - [ 4217290.07557678 -3869408.60205078  2799220.80566406] - [ 4217290.07519531 -3869408.60205078  2799220.80566406]
Vertex 2958↔ 2960 Dist=0.000458 - [ 4217300.03952026 -3869378.89599609  2799227.41894531] - [ 4217300.0390625  -3869378.89599609  2799227.41894531]
Vertex 2961↔ 2962 Dist=0.000046 - [ 4217311.86528015 -3869350.91015625  2799235.26855469] - [ 4217311.86523438 -3869350.91015625  2799235.26855469]
Vertex 2964↔ 2965 Dist=0.000153 - [ 4217324.64175415 -3869323.80175781  2799243.74902344] - [ 4217324.64160156 -3869323.80175781  2799243.74902344]
Vertex 2969↔ 2969 Dist=0.000549 - [ 4217337.32574463 -3869296.60839844  2799252.16796875] - [ 4217337.32519531 -3869296.60839844  2799252.16796875]
Vertex 2972↔ 2971 Dist=0.000488 - [ 4217350.73583984 -3869270.0859375   2799261.06933594] - [ 4217350.73535156 -3869270.0859375   2799261.06933594]
Vertex 2975↔ 2974 Dist=0.000092 - [ 4217364.1524353  -3869243.56933594  2799269.97460938] - [ 4217364.15234375 -3869243.56933594  2799269.97460938]
Vertex 2977↔ 2976 Dist=0.000122 - [ 4217377.7208252  -3869217.19287109  2799278.98046875] - [ 4217377.72070312 -3869217.19287109  2799278.98046875]
Vertex 3611↔ 2978 Dist=0.000153 - [ 4217393.38882446 -3869192.75585938  2799289.37988281] - [ 4217393.38867188 -3869192.75585938  2799289.37988281]

Below is the output of validation script, which reads the previously generated gltf files and compare the edge vertices world positions.

...
Vertex 2825↔ 2842 Dist=0.000381 - [ 4216956.54676819 -3870190.02490234  2798999.42675781] - [ 4216956.54638672 -3870190.02490234  2798999.42675781]
Vertex 2827↔ 2844 Dist=0.000008 - [ 4216972.90526581 -3870166.22460938  2799010.28417969] - [ 4216972.90527344 -3870166.22460938  2799010.28417969]
Vertex 2833↔ 2847 Dist=0.000214 - [ 4216991.23117065 -3870144.2421875   2799022.44824219] - [ 4216991.23095703 -3870144.2421875   2799022.44824219]
Vertex 2838↔ 2852 Dist=0.000008 - [ 4217009.1674881  -3870121.89941406  2799034.35351562] - [ 4217009.16748047 -3870121.89941406  2799034.35351562]
Vertex 2842↔ 2857 Dist=0.000034 - [ 4217027.35452652 -3870099.78808594  2799046.42480469] - [ 4217027.35449219 -3870099.78808594  2799046.42480469]
Vertex 2847↔ 2861 Dist=0.000163 - [ 4217046.40641308 -3870078.47607422  2799059.0703125 ] - [ 4217046.40625    -3870078.47607422  2799059.0703125 ]
Vertex 2850↔ 2865 Dist=0.000550 - [ 4217065.36578417 -3870057.07861328  2799071.65527344] - [ 4217065.36523438 -3870057.07861328  2799071.65527344]
Vertex 2854↔ 2869 Dist=0.000019 - [ 4217084.37794876 -3870035.72998047  2799084.27441406] - [ 4217084.37792969 -3870035.72998047  2799084.27441406]
Vertex 2859↔ 2872 Dist=0.000259 - [ 4217101.18482971 -3870012.34375     2799095.4296875 ] - [ 4217101.18457031 -3870012.34375     2799095.4296875 ]
Vertex 2866↔ 2879 Dist=0.000458 - [ 4217117.85299683 -3869988.82910156  2799106.49316406] - [ 4217117.85253906 -3869988.82910156  2799106.49316406]
Vertex 2871↔ 2882 Dist=0.000053 - [ 4217132.49419403 -3869963.44189453  2799116.2109375 ] - [ 4217132.49414062 -3869963.44189453  2799116.2109375 ]
Vertex 2875↔ 2886 Dist=0.000626 - [ 4217142.8238678  -3869934.07177734  2799123.06738281] - [ 4217142.82324219 -3869934.07177734  2799123.06738281]
Vertex 2877↔ 2889 Dist=0.000214 - [ 4217150.45974731 -3869902.21289062  2799128.13574219] - [ 4217150.45996094 -3869902.21289062  2799128.13574219]
Vertex 2882↔ 2896 Dist=0.000160 - [ 4217156.24007416 -3869868.63964844  2799131.97265625] - [ 4217156.24023438 -3869868.63964844  2799131.97265625]
Vertex 2890↔ 2899 Dist=0.000191 - [ 4217161.32050323 -3869834.42041016  2799135.34472656] - [ 4217161.3203125  -3869834.42041016  2799135.34472656]
Vertex 2896↔ 2903 Dist=0.000008 - [ 4217166.35448456 -3869800.15820312  2799138.68554688] - [ 4217166.35449219 -3869800.15820312  2799138.68554688]
Vertex 2902↔ 2910 Dist=0.000397 - [ 4217170.84024048 -3869765.39013672  2799141.66308594] - [ 4217170.83984375 -3869765.39013672  2799141.66308594]
Vertex 2906↔ 2913 Dist=0.000130 - [ 4217176.48131561 -3869731.68945312  2799145.40722656] - [ 4217176.48144531 -3869731.68945312  2799145.40722656]
Vertex 2913↔ 2917 Dist=0.000145 - [ 4217182.61733246 -3869698.44580078  2799149.48046875] - [ 4217182.6171875  -3869698.44580078  2799149.48046875]
Vertex 2916↔ 2924 Dist=0.000076 - [ 4217189.09660339 -3869665.52001953  2799153.78125   ] - [ 4217189.09667969 -3869665.52001953  2799153.78125   ]
Vertex 2918↔ 2927 Dist=0.000549 - [ 4217197.42437744 -3869634.30126953  2799159.30859375] - [ 4217197.42382812 -3869634.30126953  2799159.30859375]
Vertex 2921↔ 2930 Dist=0.000458 - [ 4217207.8119812  -3869604.98583984  2799166.203125  ] - [ 4217207.81152344 -3869604.98583984  2799166.203125  ]
Vertex 2927↔ 2934 Dist=0.000290 - [ 4217219.57939148 -3869576.9453125   2799174.01367188] - [ 4217219.57910156 -3869576.9453125   2799174.01367188]
Vertex 2930↔ 2938 Dist=0.000671 - [ 4217231.76922607 -3869549.29492188  2799182.10546875] - [ 4217231.76855469 -3869549.29492188  2799182.10546875]
Vertex 2936↔ 2942 Dist=0.000000 - [ 4217244.12402344 -3869521.796875    2799190.30566406] - [ 4217244.12402344 -3869521.796875    2799190.30566406]
Vertex 2941↔ 2944 Dist=0.000565 - [ 4217256.6900177  -3869494.49365234  2799198.64648438] - [ 4217256.68945312 -3869494.49365234  2799198.64648438]
Vertex 2946↔ 2947 Dist=0.000565 - [ 4217269.18318176 -3869467.12353516  2799206.93847656] - [ 4217269.18261719 -3869467.12353516  2799206.93847656]
Vertex 2949↔ 2952 Dist=0.000397 - [ 4217280.26992798 -3869438.45458984  2799214.296875  ] - [ 4217280.26953125 -3869438.45458984  2799214.296875  ]
Vertex 2954↔ 2957 Dist=0.000381 - [ 4217290.07557678 -3869408.60205078  2799220.80566406] - [ 4217290.07519531 -3869408.60205078  2799220.80566406]
Vertex 2958↔ 2960 Dist=0.000458 - [ 4217300.03952026 -3869378.89599609  2799227.41894531] - [ 4217300.0390625  -3869378.89599609  2799227.41894531]
Vertex 2961↔ 2962 Dist=0.000046 - [ 4217311.86528015 -3869350.91015625  2799235.26855469] - [ 4217311.86523438 -3869350.91015625  2799235.26855469]
Vertex 2964↔ 2965 Dist=0.000153 - [ 4217324.64175415 -3869323.80175781  2799243.74902344] - [ 4217324.64160156 -3869323.80175781  2799243.74902344]
Vertex 2969↔ 2969 Dist=0.000549 - [ 4217337.32574463 -3869296.60839844  2799252.16796875] - [ 4217337.32519531 -3869296.60839844  2799252.16796875]
Vertex 2972↔ 2971 Dist=0.000488 - [ 4217350.73583984 -3869270.0859375   2799261.06933594] - [ 4217350.73535156 -3869270.0859375   2799261.06933594]
Vertex 2975↔ 2974 Dist=0.000092 - [ 4217364.1524353  -3869243.56933594  2799269.97460938] - [ 4217364.15234375 -3869243.56933594  2799269.97460938]
Vertex 2977↔ 2976 Dist=0.000122 - [ 4217377.7208252  -3869217.19287109  2799278.98046875] - [ 4217377.72070312 -3869217.19287109  2799278.98046875]
Vertex 3611↔ 2978 Dist=0.000153 - [ 4217393.38882446 -3869192.75585938  2799289.37988281] - [ 4217393.38867188 -3869192.75585938  2799289.37988281]

If you compare the values in a text comparison tool, you will see the values are identical, which means I’m able to store the correct world positions as I calculated and read them back. The distances are so small, almost millimeter level (0.001)

Despite being theoretical vs. actual values are so close, when rendering there is almost an offset like displacement between the edges. Say it is like ~10cm through the whole edge. The distance being so alarms my anomaly senses and makes me think it may not be related to floating point precision errors, because in that case the distance between the edges would be random instead of ‘offset like’ distance.

Below are some visual feedbacks from Unreal Engine 5.2, Cesium for unreal version 2.10.0:

The cube is 0.1 scaled, which means 10 cm each edge:

I’m attaching the tileset:
yunus_3dtiles.zip (7.4 MB)

The feedbacks I shared may boost your debugging in case there is a general problem, this is why I shared a lot of stuff above. In that case, at the end my problem will also be resolved :slight_smile: Though it may be completely unrelated and most probably I have some problems in my pipeline…