wolph / numpy-stl

Simple library to make working with STL files (and 3D objects in general) fast and easy.
http://numpy-stl.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
628 stars 107 forks source link

Can we check if two different stl files are overlapping each other #211

Closed arslan437 closed 1 year ago

arslan437 commented 1 year ago

Hi WoLph

I want to place multiple stl file to one stl file. I am loading the files individually than translating them close to each other. Currently I am translating the stl files based on bounding box. But I want to pack more stl files into less space. Is there any way I can check if the two stl files overlap each other after translating the one file close to other one.

wolph commented 1 year ago

I would personally create an octree or kd-tree per mesh and use those to test if there's overlap between the two. Because they are trees the search will be logarithmic in time complexity.

That's at least the fastest way I can think of...