(geometry)Rotating Calipers / Oriented Minimum Bounding Box?

Are there any implementations for, rotating calipers algorithm or any oriented minimum bounding box here in Julia? I could whip one up if not, but preferably one of you wizards has one out there somewhere.

I whipped up the naive versions using the following references:

Code is here: https://gist.github.com/caseykneale/6038bc92bbc38d7c7a2752e88ab84513

Kinda slow, some of that’s due to the algorithms(not SOTA’s), but also trying to use GeometryBasics.jl made my code a little clunky. I like some of the primitives but sometimes you just need linear algebra :man_shrugging: .

Might be a fun test case for optimization though… Seems to work, but I bet there’s a 1 off error in there somewhere.

here’s a faster version not using GeometryBasics

Doubt anyones following along but figured if someone else finds this thread they might appreciate it.

3 Likes