Skip to main content
API Reference NSDK

NSDKMeshingSession

A session for real-time 3D mesh generation from AR camera frames, with Combine publisher support....

Declaration

final class NSDKMeshingSession

Summary

A session for real-time 3D mesh generation from AR camera frames, with Combine publisher support. The meshing feature provides capabilities for processing AR session data and generating a triangle mesh representation of the physical environment in real-time. The mesh is divided into chunks that are individually tracked as they are inserted, updated, or removed. meshUpdates emits each frame a non-empty batch of chunk changes is available, driven by NSDKSession.update() while the session is active. Subscribe to it with Combine:

meshingSession.meshUpdates
.sink { updates in ... }
.store(in: &cancellables)

Properties

NameTypeSummary
let meshUpdatesPassthroughSubject<[NSDKMeshingSession.MeshChunkUpdate], Never>
Emits incremental mesh updates each frame new changes are available.
Each emission contains a non-empty array of chunk insertions, updates, and removals
since the previous frame. Frames with no mesh changes produce no emission.

Methods

NameTypeSummary
configurevoid
Configures the meshing feature with the specified settings.
- Attention: If this method is called while meshing is running, the meshing feature will
restart with the new configuration, and any mesh data that has been produced will
be lost.
- Parameter config: An object that defines the meshing behavior.
- Throws: NSDKError.invalidArgument if the configuration is invalid.
Check NSDK's C logs for more information.
featureStatusNSDKFeatureStatus
Reports the current status of the meshing session.
Check this periodically to see if any errors have occurred with processes running
inside this feature. Once an error has been flagged, it will remain flagged until the
culprit process has been run again and completed successfully.
- Returns: A flag indicating the current status of the meshing session.
startvoid
Starts the meshing feature.
The feature will begin processing AR frame data and building a mesh according to the
currently applied configuration.
stopvoid
Stops the meshing feature.
- Note: This will clear previously generated mesh data.

Nested Types

Structs

NameTypeSummary
ConfigurationConfiguration
The type of configuration used by this session

Enums

NameTypeSummary
MeshChunkUpdateMeshChunkUpdate
Describes a change to a specific mesh chunk.
Each case represents how a chunk identified by id should be handled:
- insert: A new chunk should be added.
- update: An existing chunk has new mesh data.
- remove: A chunk should be removed.

Relationships

conforms to: NSDKFeatureSession