A 3D mesh describing face topology used in face-tracking AR sessions.


class ARFaceGeometry : NSObject


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

When you obtain a face geometry from an ARFaceAnchor object in a face-tracking AR session, the model conforms to match the dimensions, shape, and current expression of the detected face. You can also create a face mesh using a dictionary of named blend shape coefficients, which provides a detailed, but more efficient, description of the face’s current expression.

In an AR session, you can use this model as the basis for overlaying content that follows the shape of the user’s face—for example, to apply virtual makeup or tattoos. You can also use this model to create occlusion geometry, which hides other virtual content behind the 3D shape of the detected face in the camera image.


Accessing Mesh Data

var vertices: [vector_float3]

An array of vertex positions for each point in the face mesh.

var textureCoordinates: [vector_float2]

An array of texture coordinate values for each point in the face mesh.

var triangleCount: Int

The number of triangles described by the triangleIndices buffer.

var triangleIndices: [Int16]

An array of indices describing the triangle mesh formed by the face geometry's vertex data.

Creating a Mesh from Blend Shapes

init?(blendShapes: [ARFaceAnchor.BlendShapeLocation : NSNumber])

Creates a face geometry matching the facial expression described in the specified dictionary.


Inherits From

See Also

Using Face Geometry

var geometry: ARFaceGeometry

A coarse triangle mesh representing the topology of the detected face.

class ARSCNFaceGeometry

A SceneKit representation of face topology for use with face information provided by an AR session.