Class

ARPlaneGeometry

A 3D mesh describing the shape of a detected plane in world-tracking AR sessions.

Declaration

@interface ARPlaneGeometry : NSObject

Overview

This class provides the estimated general shape of a detected plane, in the form of a detailed 3D mesh appropriate for use with various rendering technologies or for exporting 3D assets. (For a quick way to visualize a plane geometry using SceneKit, see the ARSCNPlaneGeometry class.)

Unlike the ARPlaneAnchor center and extent properties, which estimate only a rectangular area for a detected plane, a plane anchor's geometry property provides a more detailed estimate of the 2D area covered by that plane. For example, if ARKit detects a circular tabletop, the resulting ARPlaneGeometry objects roughly match the general shape of the table. As the session continues to run, ARKit provides updated plane anchors whose associated geometry refines the estimated shape of the plane.

You can use this model to more precisely place 3D content that should appear only on a detected flat surface. For example, to ensure that virtual objects don't fall off the edge of a table. You can also use this model to create occlusion geometry, which hides other virtual content behind the detected surface in the camera image.

The shape of a plane geometry is always convex. That is, the boundary polygon for a plane geometry is a minimal convex hull enclosing all points that ARKit recognizes or estimates are part of the plane.

Topics

Accessing Mesh Data

vertices

A buffer of vertex positions for each point in the plane mesh.

vertexCount

The number of elements in the vertices buffer.

textureCoordinates

A buffer of texture coordinate values for each point in the plane mesh.

textureCoordinateCount

The number of elements in the textureCoordinates buffer.

triangleIndices

A buffer of indices describing the triangle mesh formed by the plane geometry's vertex data.

triangleCount

The number of triangles described by the triangleIndices buffer.

Finding Boundary Points

boundaryVertices

A buffer of vertex positions for each point along the plane's boundary.

boundaryVertexCount

The number of elements in the boundaryVertices buffer.

Relationships

Inherits From

Conforms To

See Also

Geometry

geometry

A coarse triangle mesh representing the general shape of the detected plane.

ARSCNPlaneGeometry

A SceneKit representation of the 2D shape of a plane, for use with plane detection results in an AR session.