Vesica piscis value ( 1,73205 ... ) returned for the boundingRadius of a sphere ModelEntity

Hi

I create a ModelEntity with radius equals 1. When I ask for the radius of a sphere with this sentence:

let radius = sphere.visualBounds(relativeTo: elemento).boundingRadius

radius takes value 1,73205...

Doc says about this var boundingRadius :

The radius of a bounding sphere that encompasses the bounding box. (Undefined if empty.)

https://developer.apple.com/documentation/realitykit/boundingbox

Hence, I think it should be 1 because the sphere I created is with a radius equals 1, why returned value is 1,73205 ?

Diving this value I realize it is Vesica Piscis value https://en.wikipedia.org/wiki/Vesica_piscis

Answered by Graphics and Games Engineer in 740759022

The bounding box of the sphere entity with a radius 1 is most likely a 2x2x2 box, which would require a bounding sphere with a radius sqrt(3) to fully contain it.

Accepted Answer

The bounding box of the sphere entity with a radius 1 is most likely a 2x2x2 box, which would require a bounding sphere with a radius sqrt(3) to fully contain it.

Vesica piscis value ( 1,73205 ... ) returned for the boundingRadius of a sphere ModelEntity
 
 
Q