Skip to main content
API Reference SwiftyNsdk

NsdkMeshingSession

A session for real-time 3D mesh generation from AR camera frames....

Declaration

final class NsdkMeshingSession

Summary

A session for real-time 3D mesh generation from AR camera frames. 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 can be individually queried and updated as the environment is scanned.


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 errors that have occurred within processes running inside this feature.
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: Feature status flags for any issues that have occurred
lastMeshUpdateTimeUInt64?
Gets the timestamp of the latest mesh update.
- Returns: The timestamp in milliseconds, or nil if no mesh data has been produced yet.
meshDataByIdMeshData?
Retrieves the mesh data for a specified chunk.
- Note: This method resets the updated flag for the specified chunk. Subsequent calls to
updatedMeshInfos() will only mark the chunk as updated if its mesh data has
changed since the mesh chunk's data was last retrieved.
- Parameter id: The ID of the mesh chunk to retrieve, obtained from updatedMeshInfos().
- Returns: The mesh data for the specified chunk, or nil if no chunk with the given ID exists.
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.
updatedMeshInfosMeshUpdateInfo?
Gets the ids of all chunks in the current mesh and their update status.
The returned information contains the ids and update status for all chunks currently
in the mesh. If a chunk's updated flag is true, the mesh chunk has been updated since
the last time its data was read with meshDataById(id:).
To retrieve the data for a specific chunk, call meshDataById(id:).
- Returns: A buffer containing updated mesh chunk ids, nil if there are no chunks.

Nested Types

Structs

NameTypeSummary
ConfigurationConfiguration
The type of configuration used by this session

Relationships

conforms to: NsdkFeatureSession