TouchTerrain_for_CAGEO
TouchTerrain_for_CAGEO copied to clipboard
Misaligned Tiles
Hey Chris,
I seem to be getting misaligned tiles when generating.
Aligned bottom:

Aligned ridge (misaligned bottom):

My config:
"trlat": 47.88266953319475,# bottom left corner lat
"trlon": 10.707753906131003,# bottom left corner long
"bllat": 45.62561851186426, #top right corner lat
"bllon": 5.813401946902514,# top right corner long
"importedDEM": "./data.tif", # if not None, the raster file to use as DEM instead of using GEE (null in JSON)
"printres": 0.5, # resolution (horizontal) of 3D printer (= size of one pixel) in mm
"ntilesx": 9, # number of tiles in x and y
"ntilesy": 6,
"tilewidth": 100, # width of each tile in mm (<- !!!!!), tile height is calculated
"basethick": 15, # thickness (in mm) of printed base
"zscale": 1.0, # elevation (vertical) scaling
"fileformat": "STLb", # format of 3D model files: "obj" wavefront obj (ascii),"STLa" ascii STL or "STLb" binary STL
"tile_centered": False, # True-> all tiles are centered around 0/0, False, all tiles "fit together"
"zip_file_name": "alps", # base name of zipfile, .zip will be added
"CPU_cores_to_use" : 0, # 0 means all cores, None (null in JSON!) => don't use multiprocessing
"max_cells_for_memory_only" : 1000 * 1000, # if raster is bigger, use temp_files instead of memory
"no_bottom": False, # omit bottom triangles?
#"rot_degs": 0, # rotate by degrees ccw # CH disabled for now
"bottom_image": None, # 1 band greyscale image used for bottom relief
"ignore_leq": None, # set values <= this to NaN, so they are ignored
"lower_leq": None, # e.g. [0.0, 2.0] values <= 0.0 will be lowered by 2mm in the final model
"unprojected": False, # don't project to UTM, only usefull when using GEE for DEM rasters
"only": None,# list of tile index [x,y] with is the only tile to be processed. None means process all tiles (index is 1 based)
"poly_file": None, #"idaho.kml", #TT_poly_test.kml",
"smooth_borders": True, # smooth borders
logfile:
Log for creating 9 x 6 3D model tile(s) from data.tif
started: 16:25:38.556908
source raster upper left corner (x/y): 229110.0 5305650.0
source raster cells size 30.0 m (7769, 13815)
projection: WGS 84 / UTM zone 32N
z-scale: 1.3
basethickness: 15
fileformat: STLb
tile_centered: False
no_bottom: False
no_normals: True
ignore_leq: None
lower_leq: None
importedGPX: None
undefined GDAL value: None
tile_width: 100
tile_height: 56.23597538906985
source raster width 414450.0 m, cell size: 30.0 m, elev. min/max is 40.0 4809.0 m
source raster 3D print resolution would be 0.06514657980456026 mm
re-sampling data.tif :
(13815, 7769) 0.06514657980456026 mm 30.0 m 40.0 - 4809.0 m to
(1800, 1012) 0.5 mm 230.25 m 59.468372 - 4736.3257 m
print res is 0.5 mm
Cropping for nice fit of 9 (width) x 6 (height) tiles, removing: 0 columns, 4 rows
cropped (1800, 1012) to (1800, 1008)
cropping changed physical size from 100 mm x 84.33333333333333 mm
to 100.0 mm x 84.0 mm
map scale is 1 : 460500.0
Cells per tile (x/y) 200 x 168
using single-core only
9 x 6 tiles, tile size 100.00 x 84.00 mm
tile 1 1 : height: 191.6655 - 15.802115 mm , file size: 3 Mb
tile 1 2 : height: 183.84213 - 15.860547 mm , file size: 3 Mb
tile 1 3 : height: 191.79538 - 17.04288 mm , file size: 3 Mb
tile 1 4 : height: 195.88974 - 18.080755 mm , file size: 3 Mb
tile 1 5 : height: 291.8095 - 18.951483 mm , file size: 3 Mb
tile 1 6 : height: 225.69896 - 19.047348 mm , file size: 3 Mb
tile 2 1 : height: 206.6946 - 16.24718 mm , file size: 3 Mb
tile 2 2 : height: 216.4829 - 17.125134 mm , file size: 3 Mb
tile 2 3 : height: 318.2327 - 18.50724 mm , file size: 3 Mb
tile 2 4 : height: 368.91043 - 18.62294 mm , file size: 3 Mb
tile 2 5 : height: 366.321 - 19.982578 mm , file size: 3 Mb
tile 2 6 : height: 427.32034 - 21.141172 mm , file size: 3 Mb
tile 3 1 : height: 246.68542 - 17.778305 mm , file size: 3 Mb
tile 3 2 : height: 297.28238 - 17.79468 mm , file size: 3 Mb
tile 3 3 : height: 422.0 - 18.236658 mm , file size: 3 Mb
tile 3 4 : height: 369.37585 - 20.451563 mm , file size: 3 Mb
tile 3 5 : height: 365.57553 - 22.839916 mm , file size: 3 Mb
tile 3 6 : height: 454.22202 - 27.088457 mm , file size: 3 Mb
tile 4 1 : height: 197.90182 - 18.331402 mm , file size: 3 Mb
tile 4 2 : height: 257.0738 - 18.244726 mm , file size: 3 Mb
tile 4 3 : height: 427.58197 - 17.398708 mm , file size: 3 Mb
tile 4 4 : height: 528.4612 - 22.796164 mm , file size: 3 Mb
tile 4 5 : height: 477.08356 - 24.418552 mm , file size: 3 Mb
tile 4 6 : height: 845.9084 - 25.337296 mm , file size: 3 Mb
tile 5 1 : height: 282.0828 - 18.356377 mm , file size: 3 Mb
tile 5 2 : height: 286.19427 - 16.958464 mm , file size: 3 Mb
tile 5 3 : height: 393.76727 - 21.491447 mm , file size: 3 Mb
tile 5 4 : height: 470.08173 - 25.131504 mm , file size: 3 Mb
tile 5 5 : height: 310.43695 - 25.670383 mm , file size: 3 Mb
tile 5 6 : height: 191.5922 - 26.507986 mm , file size: 3 Mb
tile 6 1 : height: 342.41873 - 16.677013 mm , file size: 3 Mb
tile 6 2 : height: 355.72488 - 17.600143 mm , file size: 3 Mb
tile 6 3 : height: 350.1448 - 22.64892 mm , file size: 3 Mb
tile 6 4 : height: 453.6622 - 23.638344 mm , file size: 3 Mb
tile 6 5 : height: 191.46535 - 23.769928 mm , file size: 3 Mb
tile 6 6 : height: 173.82703 - 20.547045 mm , file size: 3 Mb
tile 7 1 : height: 384.13315 - 16.263924 mm , file size: 3 Mb
tile 7 2 : height: 391.51416 - 20.61398 mm , file size: 3 Mb
tile 7 3 : height: 419.2372 - 22.603453 mm , file size: 3 Mb
tile 7 4 : height: 564.86 - 22.121048 mm , file size: 3 Mb
tile 7 5 : height: 181.94656 - 23.711742 mm , file size: 3 Mb
tile 7 6 : height: 180.76138 - 21.588915 mm , file size: 3 Mb
tile 8 1 : height: 401.62704 - 18.00505 mm , file size: 3 Mb
tile 8 2 : height: 391.97302 - 21.087027 mm , file size: 3 Mb
tile 8 3 : height: 490.00018 - 22.85838 mm , file size: 3 Mb
tile 8 4 : height: 979.11 - 21.507284 mm , file size: 3 Mb
tile 8 5 : height: 266.41058 - 25.268267 mm , file size: 3 Mb
tile 8 6 : height: 182.18958 - 22.7939 mm , file size: 3 Mb
tile 9 1 : height: 645.9717 - 18.776098 mm , file size: 3 Mb
tile 9 2 : height: 656.80676 - 20.969414 mm , file size: 3 Mb
tile 9 3 : height: 740.87946 - 23.244572 mm , file size: 3 Mb
tile 9 4 : height: 633.40533 - 23.986706 mm , file size: 3 Mb
tile 9 5 : height: 596.34216 - 23.880842 mm , file size: 3 Mb
tile 9 6 : height: 59.468372 - 24.534832 mm , file size: 3 Mb
total size for all tiles: 177 Mb
processing finished: 16:26:05.614725
Any idea what could be causing this? Thanks for your help!
Well, I’m guessing there’s something going wrong with calculating the lowest overall elevation. From memory, I think I grit the elevation min() of all tiles and use that the bottom for all tiles. Does this all happen for say just 2 x 2 tiles?
On Apr 3, 2023, at 09:04, Luke Zirngibl @.@.>> wrote:
Hey Chris,
I seem to be getting misaligned tiles when generating.
[Screen Shot 2023-04-03 at 15 57 57]https://user-images.githubusercontent.com/8725920/229533087-ef1e6df3-05e9-486d-a86f-0ae17e692ff2.png
[Screen Shot 2023-04-03 at 16 02 43]https://user-images.githubusercontent.com/8725920/229533098-9e120801-36e0-409b-b4c9-1cdd904bab9b.png
My config:
"trlat": 47.88266953319475,# bottom left corner lat
"trlon": 10.707753906131003,# bottom left corner long
"bllat": 45.62561851186426, #top right corner lat
"bllon": 5.813401946902514,# top right corner long
"importedDEM": "./data.tif", # if not None, the raster file to use as DEM instead of using GEE (null in JSON)
"printres": 0.5, # resolution (horizontal) of 3D printer (= size of one pixel) in mm
"ntilesx": 9, # number of tiles in x and y
"ntilesy": 6,
"tilewidth": 100, # width of each tile in mm (<- !!!!!), tile height is calculated
"basethick": 15, # thickness (in mm) of printed base
"zscale": 1.0, # elevation (vertical) scaling
"fileformat": "STLb", # format of 3D model files: "obj" wavefront obj (ascii),"STLa" ascii STL or "STLb" binary STL
"tile_centered": False, # True-> all tiles are centered around 0/0, False, all tiles "fit together"
"zip_file_name": "Ikea-AlpsCH_9x6", # base name of zipfile, .zip will be added
"CPU_cores_to_use" : 0, # 0 means all cores, None (null in JSON!) => don't use multiprocessing
"max_cells_for_memory_only" : 1000 * 1000, # if raster is bigger, use temp_files instead of memory
"no_bottom": False, # omit bottom triangles?
#"rot_degs": 0, # rotate by degrees ccw # CH disabled for now
"bottom_image": None, # 1 band greyscale image used for bottom relief
"ignore_leq": None, # set values <= this to NaN, so they are ignored
"lower_leq": None, # e.g. [0.0, 2.0] values <= 0.0 will be lowered by 2mm in the final model
"unprojected": False, # don't project to UTM, only usefull when using GEE for DEM rasters
"only": None,# list of tile index [x,y] with is the only tile to be processed. None means process all tiles (index is 1 based)
"poly_file": None, #"idaho.kml", #TT_poly_test.kml",
"smooth_borders": True, # smooth borders
Any idea what could be causing this? Thanks for your help!
— Reply to this email directly, view it on GitHubhttps://github.com/ChHarding/TouchTerrain_for_CAGEO/issues/77, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEYDF5JBPC6TP3D6ACPVWVDW7LKILANCNFSM6AAAAAAWRL4URQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Chris Harding Associate Professor Department of Geological & Atmospheric Sciences Touchterrain.geol.iastate.eduhttp://Touchterrain.geol.iastate.edu
yeah, it seems like the less tiles i have, the less the severe the misalignment is (which would make sense if its related to the lowest elevation computations)
OK, I”m guessing I broke something then recently in that area when I added the min_elev setting. If I get some time tomorrow I’ll have a look.
On Apr 3, 2023, at 10:08, Luke Zirngibl @.@.>> wrote:
yeah, it seems like the less tiles i have, the less the severe the misalignment is (which would make sense if its related to the lowest elevation computations)
— Reply to this email directly, view it on GitHubhttps://github.com/ChHarding/TouchTerrain_for_CAGEO/issues/77#issuecomment-1494503824, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEYDF5J2MMOTK6VDBSEC5NTW7LRWVANCNFSM6AAAAAAWRL4URQ. You are receiving this because you commented.Message ID: @.***>
Chris Harding Associate Professor Department of Geological & Atmospheric Sciences Touchterrain.geol.iastate.eduhttp://Touchterrain.geol.iastate.edu
Luke,
I messed something up during the min_height parameter implementation (as I had suspected) and it should be fixed now. Thanks for telling me!
Hi Chris,
I still see this issue in the current online tool:
This is the settings I used: http://touchterrain.geol.iastate.edu/main?trlat=47.80589654394221&trlon=12.627906080560129&bllat=46.8171757058106&bllon=11.100806471185129&scale=1.00&DEM_name=USGS/SRTMGL1_003&tilewidth=200&printres=0.4&ntilesx=2&ntilesy=2&DEMresolution=115.47&basethick=1&zscale=1.0&fileformat=STLb&maptype=roadmap&gamma=1&transp=70&hsazi=315&hselev=45&map_lat=47.659555056153565&map_lon=11.049773151738673&map_zoom=8
Thanks for this great tool in any case Martin
Thanks, I'll investigate.
From: Martin van Driel Sent: Saturday, March 22, 2025 6:17 AM To: ChHarding/TouchTerrain_for_CAGEO Cc: Harding, Chris [EAC]; Comment Subject: Re: [ChHarding/TouchTerrain_for_CAGEO] Misaligned Tiles (Issue #77)
Hi Chris,I still see this issue in the current online tool:image.png (view on web)This is the settings I used: http://touchterrain.geol.iastate.edu/main?trlat=47.80589654394221&trlon=12.627906080560129&bllat=46.8171757058106&bllon=11.100806471185129&scale=1.00&DEM_name=USGS/SRTMGL1_003&tilewidth=200&printres=0.4&ntilesx=2&ntilesy=2&DEMresolution=115.47&basethick=1&zscale=1.0&fileformat=STLb&maptype=roadmap&gamma=1&transp=70&hsazi=315&hselev=45&map_lat=47.659555056153565&map_lon=11.049773151738673&map_zoom=8Thanks for this great tool in any caseMartin—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.[X]Message ID: @.>[X]martinvandriel left a comment (ChHarding/TouchTerrain_for_CAGEO#77)Hi Chris,I still see this issue in the current online tool:image.png (view on web)This is the settings I used: http://touchterrain.geol.iastate.edu/main?trlat=47.80589654394221&trlon=12.627906080560129&bllat=46.8171757058106&bllon=11.100806471185129&scale=1.00&DEM_name=USGS/SRTMGL1_003&tilewidth=200&printres=0.4&ntilesx=2&ntilesy=2&DEMresolution=115.47&basethick=1&zscale=1.0&fileformat=STLb&maptype=roadmap&gamma=1&transp=70&hsazi=315&hselev=45&map_lat=47.659555056153565&map_lon=11.049773151738673&map_zoom=8Thanks for this great tool in any caseMartin—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.[X]Message ID: @.>
Quick update: I did find the core issue for this (each tile was using a slightly different elevation offset) and I seem to have fixed it but I also noticed that there's an (new?) issue for tiles in that their simple 2 triangle bottom is either twice as wide or half as wide, so I'm looking int that now.
From: Martin van Driel Sent: Saturday, March 22, 2025 6:17 AM To: ChHarding/TouchTerrain_for_CAGEO Cc: Harding, Chris [EAC]; Comment Subject: Re: [ChHarding/TouchTerrain_for_CAGEO] Misaligned Tiles (Issue #77)
Hi Chris, I still see this issue in the current online tool: image.png (view on web) This is the settings I used: http://touchterrain.geol.iastate.edu/main?trlat=47.80589654394221&trlon=12.627906080560129&bllat=46.8171757058106&bllon=11.100806471185129&scale=1.00&DEM_name=USGS/SRTMGL1_003&tilewidth=200&printres=0.4&ntilesx=2&ntilesy=2&DEMresolution=115.47&basethick=1&zscale=1.0&fileformat=STLb&maptype=roadmap&gamma=1&transp=70&hsazi=315&hselev=45&map_lat=47.659555056153565&map_lon=11.049773151738673&map_zoom=8 Thanks for this great tool in any case Martin — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.[X]Message ID: @.> [X]martinvandriel left a comment (ChHarding/TouchTerrain_for_CAGEO#77) Hi Chris, I still see this issue in the current online tool: image.png (view on web) This is the settings I used: http://touchterrain.geol.iastate.edu/main?trlat=47.80589654394221&trlon=12.627906080560129&bllat=46.8171757058106&bllon=11.100806471185129&scale=1.00&DEM_name=USGS/SRTMGL1_003&tilewidth=200&printres=0.4&ntilesx=2&ntilesy=2&DEMresolution=115.47&basethick=1&zscale=1.0&fileformat=STLb&maptype=roadmap&gamma=1&transp=70&hsazi=315&hselev=45&map_lat=47.659555056153565&map_lon=11.049773151738673&map_zoom=8 Thanks for this great tool in any case Martin — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.[X]Message ID: @.>
Any update here? Otherwise I'd hack together some postprocessing to fix the files.
cheers, Martin
Martin, sorry, I did fix it and never encountered the issue with the bottom I mentioned earlier. So it should be good to go, if not let me know.
Perfect, thanks! I checked and it works with the example I linked above. Will try the bigger ones I was working on later and check in detail.
Cheers, Martin