How to measure the surrounding space is sufficient before placing the 3D object using ARKit

Using ARKit, we are trying to place the 3D Models. ARKit provides ARWorldTrackingConfiguration.PlaneDetection API which is used to detect the surface and once the surface has been detected it tries to place the 3D models. Currently in ARKit there is no specific API's available for us to measure the space and confirm whether the 3D model will fit in the given space. For eg. if we are trying place a table on a particular surface it should be able measure the space and confirm to the user whether the 3D will fit in that given space.

Would like to know whether ARKit provides such API or combination of API's which can be used to measure the space, before placing the 3D objects. Any inputs on this will be helpful.

Replies

Could the `extent` property of `ARWorldMap` be useful here: https://developer.apple.com/documentation/arkit/arworldmap/2968211-extent

ARPlaneAnchor's extent property gives you the width and height of each detected plane (https://developer.apple.com/documentation/arkit/arplaneanchor/2882055-extent). You can use that to compare with the 3D model's dimensions to see if it fits on the surface.