From 8d179dc9bd66873fe11765aa9fe235e4a5a44326 Mon Sep 17 00:00:00 2001 From: Tom Simons Date: Tue, 12 Sep 2023 14:11:04 +0200 Subject: [PATCH] Clipping now happens before simplification, this fixes a rare issue where large spikes will cause the TileBakeTool to never finish simplifying --- TileBakeLibrary/CityJSONToTileConverter.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/TileBakeLibrary/CityJSONToTileConverter.cs b/TileBakeLibrary/CityJSONToTileConverter.cs index e194d60..6f5500a 100644 --- a/TileBakeLibrary/CityJSONToTileConverter.cs +++ b/TileBakeLibrary/CityJSONToTileConverter.cs @@ -466,7 +466,12 @@ private List CityJSONParseProcess(CityJSON cityJson) } WriteParsingStatusToConsole(skipped, done, parsing, simplifying, tiling); - if (subObject.maxVerticesPerSquareMeter > 0) + if (clipSpikes) + { + subObject.ClipSpikes(spikeCeiling, spikeFloor); + } + + if (subObject.maxVerticesPerSquareMeter > 0) { Interlocked.Increment(ref simplifying); WriteParsingStatusToConsole(skipped, done, parsing, simplifying, tiling); @@ -479,10 +484,6 @@ private List CityJSONParseProcess(CityJSON cityJson) //Always merge based on VertexNormalCombination.normalAngleComparisonThreshold subObject.MergeSimilarVertices(); } - if (clipSpikes) - { - subObject.ClipSpikes(spikeCeiling, spikeFloor); - } if (TilingMethod == "TILED") {