Skip to main content
←API Reference ←com.nianticspatial.nsdk.mesh

MeshingSession

↳ extends SessionBase

Declaration​

class MeshingSession

Summary​

A session for real-time 3D mesh generation from AR data. 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.


Properties​

NameTypeSummary
ardkHandleLong
-
meshUpdatesFlow<MeshingUpdateInfo?>
Flow of mesh updates.
The Flow emits [MeshingUpdateInfo] whenever the mesh update timestamp changes,
indicating that mesh chunks have been updated. The value may be null if there
are no chunks available.
Warning: Do not use this Flow together with manually calling [getUpdatedInfos].
The Flow internally polls this method, and mixing manual calls with the Flow can
cause updates to desynchronize. This happens because calling [getData] resets the
updated flag for mesh chunks, so depending on which side calls [getData] first, the
other side may miss updates or receive stale data. Use either the Flow API or the
manual polling methods, but not both.
pollingIntervalMsLong
-

Functions​

NameTypeSummary
configurevoid
Configures the meshing feature with the specified settings.
> Note: 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.
featureStatusFeatureStatus
Reports errors that have occurred with 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.
getDataMeshData?
Gets the data for a single mesh chunk.
Calling this function will reset the updated flag for the mesh chunk; i.e. after
calling this function, future calls of [getUpdatedInfos] will only mark the
chunk with id as having updated if its mesh data has changed since the call to
this function.
getLastUpdateTimeLong?
Gets the timestamp of the latest mesh update.
getUpdatedInfosMeshingUpdateInfo?
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 [getData].
onDestroyvoid
-
onInitvoid
-
startvoid
Starts the meshing feature.
The feature will begin processing input data and building a mesh according to the
configuration.
stopvoid
Stops the meshing feature.
> Note: This will clear the mesh data.