blosm icon indicating copy to clipboard operation
blosm copied to clipboard

Slow import with larger terrain

Open der-On opened this issue 6 years ago • 2 comments

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

der-On avatar Nov 02 '18 22:11 der-On

Which function from the KD-Tree API would you use to find if a point is located on the terrain?

vvoovv avatar Nov 02 '18 23:11 vvoovv

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

der-On avatar Nov 03 '18 06:11 der-On