blosm
blosm copied to clipboard
Slow import with larger terrain
Currently importing OSM data (even small datasets of a couple of MB), projected onto a larger terrain object takes very long.
Internally BHV trees are used to cast rays from an object to the terrain. Maybe KD-Trees could work faster in this case? I used KD-Trees for very efficient lookups within millions of 3d points in the past.
https://docs.blender.org/api/blender_python_api_2_78c_release/mathutils.kdtree.html
Which function from the KD-Tree API would you use to find if a point is located on the terrain?
KD-Trees allow to find points close to a coordinate (https://docs.blender.org/api/blender_python_api_current/mathutils.kdtree.html#mathutils.kdtree.KDTree.find_n). Once you have these points/faces you can calculate the face intersections using https://docs.blender.org/api/blender_python_api_current/mathutils.geometry.html#mathutils.geometry.intersect_ray_tri