Esempio n. 1
0
        /// <summary>
        /// Export a mesh of the zero-crossing dense surfaces from the reconstruction volume.
        /// </summary>
        /// <param name="voxelStep">
        /// The step value in voxels for sampling points to use in the volume when exporting
        /// a mesh, which determines the final resolution of the mesh. Use higher values for
        /// lower resolution meshes. voxelStep must be greater than 0 and smaller than the smallest
        ///  volume axis voxel resolution. Default is 1.
        /// </param>
        /// <returns>Returns the mesh object created by Kinect Fusion.</returns>
        /// <exception cref="ArgumentException">
        /// Thrown when the <paramref name="voxelStep"/> parameter is out of range.
        /// </exception>
        /// <exception cref="OutOfMemoryException">
        /// Thrown if the CPU memory required for mesh calculation could not be allocated.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// Thrown when the Kinect Runtime could not be accessed, the device is not connected,
        /// a GPU memory allocation failed or the call failed for an unknown reason.
        /// </exception>
        public Mesh CalculateMesh(int voxelStep)
        {
            INuiFusionMesh mesh = null;

            uint step = ExceptionHelper.CastAndThrowIfOutOfUintRange(voxelStep);

            ExceptionHelper.ThrowIfFailed(volume.CalculateMesh(step, out mesh));

            return(new Mesh(mesh));
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the Mesh class.
 /// </summary>
 /// <param name="mesh">The mesh interface to be encapsulated.</param>
 internal Mesh(INuiFusionMesh mesh)
 {
     this.mesh = mesh;
 }
Esempio n. 3
0
File: Mesh.cs Progetto: hh54188/King
 /// <summary>
 /// Initializes a new instance of the Mesh class.
 /// </summary>
 /// <param name="mesh">The mesh interface to be encapsulated.</param>
 internal Mesh(INuiFusionMesh mesh)
 {
     this.mesh = mesh;
 }