質問

I need to compute the minimal enclosing sphere of a set of points in 3D, which is already enclosed by a oriented bounding box (OBB).

Is my assumption correct that the sphere can be derived from the OBB as follows?

sphere_radius = 0.5 * obb_diagonal
sphere_center = obb_center

If not,

  • why?
  • can the OBB used at all?
役に立ちましたか?

解決

Assuming that the oriented bounding box may be arbitrarily oriented, then it's not guaranteed that you can construct a minimum bounding sphere directly from the oriented bounding box.

As a counterexample, consider a cubic bounding box from (-1,-1,-1) to (1,1,1), containing the six points at the centre of the cube's faces: (1,0,0), (-1,0,0), (0,1,0), (0,-1,0), (0,0,1), (0,0,-1).

The minimal bounding sphere for this set of points would be a ball of radius 1, centred on (0,0,0). The ball constructed by your suggested algorithm would be a ball of radius 1.7(ish) centred on the origin.

Instead, you will want to use an algorithm to find the minimal bounding sphere. There exist algorithms to do this in linear time (see this question for pointers on where to look. 'Miniball' is a good search keyword.)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top