1 unstable release
0.1.0 | Jun 18, 2024 |
---|
#2007 in Algorithms
82KB
1.5K
SLoC
LAS+KML to STL
What does this library do?
This library take Lidar data like freely available data from the US Geolocical Survey and any number of KML files to create a 3d printable mesh of the terrain in the specified area.
So it's TouchTerrain but slower?
Yes. But also I couldn't get TouchTerrain to work, so this library just implements it in Rust with proper (ish) error handling and Much better documentation in the code. It also uses local LAS files instead of going through Google Earth explorer because google didn't reply to my request :(. In addition to local file 'support', It also has support for KML files as masks. More on this in KML section.
KML/Geo support
This library also lets you create masks for 3d data based off of KML files. You can import files containing Polygons, Trails, and Waypoints. Internally the KML files are turned into Geo types so you don't have to use KML files if you provide a valid Polygon, LineString, or Point. These masks can be used to select the portion of the data to turn into an STL and adjust height values using the mask. These features together let you print paths in different colors, or even split the trails into a separate object that can be slotted into the terrain model. (letting you print the object separately and hence use different colors even without a material switching printer)
Speed
This library is pretty slow. Straight up. Loading LAS data has not yet been implemented for multithreading and can take up to an hour if you want to load a whole country or something. However, processed height maps can be saved and loaded pretty quickly, allowing you to change STL setting with a fairly quick iteration time.
Coordinate Systems
This library uses UTM and normal Lat, Lon GPS decimal degrees. Be careful about what units various objects are, because all units use the same Structs. Please also check the units of your LAS input because while it's probably in UTM, it might be in some abomination conjured out of the ass of your local city officials. (Like California 2 SP83 survey feet). If you are unlucky enough to have data in a deprecated standard you can still load it as a height map, but then you need to convert the bounding coordinates to UTM. I recommend espg.io for this, as they support many deprecated systems. I have not tested the conversion method, so if you have issues, Las2Las can convert between coordinate systems of the raw LAZ/LAS files although it seems to be a port from MS Dos or something equally legacy.
What is the UTM zone parameter for?
UTM uses various zones to better project GPS coordinates, and honestly that all I know, I don't normally work with GEO data. I don't know if you can mix zones or if they must be constant, my data is only in one zone, so I never tested it. You can definitely look up what zone a coordinate is in however thanks to google.
Dependencies
~21–32MB
~394K SLoC