Main Content

activeVoxels

Return information about active voxels

Since R2024a

    Description

    voxelStruct = activeVoxels(mTSDF) returns the IDs, centers, distance values, and sizes of active voxels for each mesh in the truncated signed distance field (TSDF). Active voxels are voxels that contain computed distance values.

    voxelStruct = activeVoxels(mTSDF,id) specifies the mesh IDs of the meshes from which to get the active voxel information.

    Input Arguments

    collapse all

    Truncated signed distance field for 3-D meshes, specified as a meshtsdf object.

    Example: meshtsdf(meshes,TruncationDistance=5) creates a TSDF for the specified meshes with a truncation distance of 5 meters.

    ID of mesh from which to get active voxels information, specified as a nonnegative integer or N-element vector of nonnegative integers. N is the total number of meshes from which to get active voxel information.

    Example: voxInfo = activeVoxels(tsdf,2) gets the active voxel information from the mesh with an ID of 2 in the TSDF.

    Example: voxInfo = activeVoxels(tsdf,[1 2 3]) gets the active voxel information from meshes with IDs 1, 2, and 3 in the TSDF.

    Output Arguments

    collapse all

    Active voxel information for each mesh in the TSDF, returned as a structure or N-element array of structures. Each structure represents the active voxel information for each mesh in the TSDF, and contains these fields:

    • ID — ID of the mesh in the TSDF.

    • Centers — Center positions of each active voxel as an M-by-3. Each row represents an xyz location.

    • Distances — Computed distance values of each active voxel as an M-element column vector.

    • Sizes — Sizes of each active voxel as an M-element column vector.

    M is the number of active voxels for the mesh.

    If you specify id as a vector of nonnegative integers, then N is equal to the length of id. If you do not specify mesh IDs, then N is equal to the total number of meshes in mTSDF.

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Version History

    Introduced in R2024a

    See Also

    |