ChHarding / TouchTerrain_for_CAGEO

Touch Terrain: A python app to create 3D printable terrain models (STL/OBJ) from only elevation data (via Google Earth Engine) or from a local geotiff. Has been used for CNC terrain models. Runs as a web app (http://touchterrain.org), as .py file (standalone.py) or as jupyter notebook. Docker image: https://github.com/ChHarding/TouchTerrain_jupyter_docker
http://touchterrain.geol.iastate.edu
191 stars 44 forks source link

How to get a consistent scale across multiple polygon maps? #71

Closed tueboesen closed 1 year ago

tueboesen commented 1 year ago

I am trying to combine Touch Terrain with geo-countries, (which gives me Polygons and MultiPolygons for all countries in the world). My overall hobby project is essentially to combine these two in order to produce maps sorta similar to this.

One conceptual issue I am having though is how do I get a consistent scaling of all countries? Unfortunately it does not seem like there is a scaling parameter from what I can see. I should be able to get a similar result by using tilewidth, but I am unsure how exactly bllat, bllon, trlat, and trlon gets calculated for a polygon and what exactly tilewidth is in such a case?

Cheers

ChHarding commented 1 year ago

There may be a solution in the near future. Another user requested an option to set the (xy) scale manually instead of setting a build area width/height. I’ve looked at that briefly and it should not be too complicated to do, eventually …

BTW if you do this you will need to override the projection (see projection parameter here: https://github.com/ChHarding/TouchTerrain_for_CAGEO#processing-parameters)

Setting it to Web Mercator (EPSG 3857) will horrendously distort towards the poles but that may not be your concern. Better world wide projections, Like Robinson, exist but I don’t know if Google Earth Engine supports those …)

I’ll keep you posted ...

On Mar 5, 2023, at 09:41, Tue @.**@.>> wrote:

I am trying to combine Touch Terrain with geo-countries, (which gives me Polygons and MultiPolygons for all countries in the world). My overall hobby project is essentially to combine these two in order to produce maps sorta similar to thishttps://i.etsystatic.com/10250157/r/il/ea8cdc/3520666568/il_1140xN.3520666568_1h46.jpg.

One conceptual issue I am having though is how do I get a consistent scaling of all countries? Unfortunately it does not seem like there is a scaling parameter from what I can see. I should be able to get a similar result by using tilewidth, but I am unsure how exactly bllat, bllon, trlat, and trlon gets calculated for a polygon and what exactly tilewidth is in such a case?

Cheers

— Reply to this email directly, view it on GitHubhttps://github.com/ChHarding/TouchTerrain_for_CAGEO/issues/71, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEYDF5ODOQE6EIJWCMVF2VLW2SX3BANCNFSM6AAAAAAVQHQIPI. 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

tueboesen commented 1 year ago

Okay I am not in any hurry with my project so I will keep an eye on the development of this project for now. Thank you very much for developing all of this and making it so easily available.

ChHarding commented 1 year ago

I've implemented a tilewidth_scale option that calculates a new tilewidth (i.e. buildplate width) from that (in mm). I tested it with online data and it seems to work, but the final scale is a bit off (I requested 1:100,000 and the final output was 1:104,000) This has to do with trying to compensate for distortions but the compensation is pretty simplistic. For your case you should definitively use projection=3857 (Web Mercator), otherwise your pieces won't fit. You should test this with adjacent countries that have a large latitude difference like China's border with Mongolia and with Mynamar. BTW feedback from a similar project (printing US states) suggests that you will probably have to shrink the STLs a bit otherwise the fit is too tight. You could do this with something like meshmixer or, if you use Cura you can set a negative value for horizontal expansion (maybe 0.5 mm?) https://the3dprinterbee.com/cura-horizontal-expansion/ Let me know how things turn out!

tueboesen commented 1 year ago

This looks very promising, I will let you know how it turns out.