MeshLib Rust Docs
Loading...
Searching...
No Matches
meshlib::cuda Namespace Reference

Classes

struct  ComputePointsToDistanceVolume
struct  ComputeToolDistance
struct  DeviceInfo
struct  FastWindingNumber
struct  PointsProjector
struct  PointsToMeshProjector

Functions

auto get_device_info () -> meshlib::Owned< meshlib::expected_MR_Cuda_DeviceInfo_std_string >
auto is_cuda_available (driverVersion:Option<&mut core::ffi::c_int >, runtimeVersion:Option<&mut core::ffi::c_int >, computeMajor:Option<&mut core::ffi::c_int >, computeMinor:Option<&mut core::ffi::c_int >) -> bool
auto get_cuda_available_memory () -> usize
auto get_cuda_safe_memory_limit () -> usize
auto max_buffer_size (availableBytes:usize, elementCount:usize, elementBytes:usize) -> usize
auto max_buffer_size_aligned_by_block_mr_vector2i (availableBytes:usize, blockDims:&meshlib::Vector2i, elementBytes:usize) -> usize
auto max_buffer_size_aligned_by_block_mr_vector3i (availableBytes:usize, blockDims:&meshlib::Vector3i, elementBytes:usize) -> usize
auto distance_map_from_contours (polyline:&meshlib::Polyline2, params:&meshlib::ContourToDistanceMapParams) -> meshlib::Owned< meshlib::expected_MR_DistanceMap_std_string >
auto distance_map_from_contours_heap_bytes (polyline:&meshlib::Polyline2, params:&meshlib::ContourToDistanceMapParams) -> usize
auto compute_distance_map (mesh:&meshlib::Mesh, params:&meshlib::MeshToDistanceMapParams, cb:Option<&meshlib::std_function_bool_from_float >, outSamples:Option<&mut meshlib::std_vector_MR_MeshTriPoint >) -> meshlib::Owned< meshlib::expected_MR_DistanceMap_std_string >
auto compute_distance_map_heap_bytes (mesh:&meshlib::Mesh, params:&meshlib::MeshToDistanceMapParams, needOutSamples:Option< bool >) -> usize
auto find_projection_on_points (pointCloud:&meshlib::PointCloud, points:&meshlib::VertCoords, settings:Option<&meshlib::FindProjectionOnPointsSettings >) -> meshlib::Owned< meshlib::expected_std_vector_MR_PointsProjectionResult_std_string >
auto find_projection_on_points_heap_bytes (pointCloud:&meshlib::PointCloud, pointsCount:usize) -> usize
auto points_to_distance_volume (cloud:&meshlib::PointCloud, params:&meshlib::PointsToDistanceVolumeParams) -> meshlib::Owned< meshlib::expected_MR_SimpleVolumeMinMax_std_string >
auto points_to_distance_volume_by_parts (cloud:&meshlib::PointCloud, params:&meshlib::PointsToDistanceVolumeParams, addPart:&meshlib::std_function_expected_void_std_string_from_const_MR_SimpleVolumeMinMax_ref_int, layerOverlap:core::ffi::c_int) -> meshlib::Owned< meshlib::expected_void_std_string >
auto points_to_distance_volume_memory (cloud:&meshlib::PointCloud, dims:&meshlib::Vector3i, ptNormals:Option<&meshlib::VertCoords >) -> usize
auto compute_sky_view_factor (terrain:&meshlib::Mesh, samples:&meshlib::VertCoords, validSamples:&meshlib::VertBitSet, skyPatches:&meshlib::std_vector_MR_SkyPatch, outSkyRays:Option<&mut meshlib::BitSet >, outIntersections:Option<&mut meshlib::std_vector_MR_MeshIntersectionResult >) -> meshlib::Owned< meshlib::VertScalars >
auto find_sky_rays (terrain:&meshlib::Mesh, samples:&meshlib::VertCoords, validSamples:&meshlib::VertBitSet, skyPatches:&meshlib::std_vector_MR_SkyPatch, outIntersections:Option<&mut meshlib::std_vector_MR_MeshIntersectionResult >) -> meshlib::Owned< meshlib::BitSet >
auto negate_picture (image:&mut meshlib::Image) -> meshlib::Owned< meshlib::expected_void_std_string >
void load_mr_cuda_dll ()

Function Documentation

◆ compute_distance_map()

auto meshlib::cuda::compute_distance_map ( mesh:&meshlib::Mesh ,
params:&meshlib::MeshToDistanceMapParams ,
cb:Option<&meshlib::std_function_bool_from_float > ,
outSamples:Option<&mut meshlib::std_vector_MR_MeshTriPoint >  ) -> meshlib::Owned< meshlib::expected_MR_DistanceMap_std_string >

computes distance (height) map for given projection parameters using float-precision for finding ray-mesh intersections, which is faster but less reliable Generated from function MR::Cuda::computeDistanceMap.

Calls MR_Cuda_computeDistanceMap().

◆ compute_distance_map_heap_bytes()

auto meshlib::cuda::compute_distance_map_heap_bytes ( mesh:&meshlib::Mesh ,
params:&meshlib::MeshToDistanceMapParams ,
needOutSamples:Option< bool >  ) -> usize

Computes memory consumption of computeDistanceMap function Generated from function MR::Cuda::computeDistanceMapHeapBytes.

Calls MR_Cuda_computeDistanceMapHeapBytes().

◆ compute_sky_view_factor()

auto meshlib::cuda::compute_sky_view_factor ( terrain:&meshlib::Mesh ,
samples:&meshlib::VertCoords ,
validSamples:&meshlib::VertBitSet ,
skyPatches:&meshlib::std_vector_MR_SkyPatch ,
outSkyRays:Option<&mut meshlib::BitSet > ,
outIntersections:Option<&mut meshlib::std_vector_MR_MeshIntersectionResult >  ) -> meshlib::Owned< meshlib::VertScalars >

computes relative radiation in each valid sample point by emitting rays from that point in the sky: the radiation is 1.0f if all rays reach the sky not hitting the terrain; the radiation is 0.0f if all rays do not reach the sky because they are intercepted by the terrain;

Parameters
outSkyRays- optional output bitset where for every valid sample i its rays are stored at indices [i*numPatches; (i+1)*numPatches), 0s for occluded rays (hitting the terrain) and 1s for the ones which don't hit anything and reach the sky
outIntersections- optional output vector of MeshIntersectionResult for every valid sample point Generated from function MR::Cuda::computeSkyViewFactor.

Calls MR_Cuda_computeSkyViewFactor().

◆ distance_map_from_contours()

auto meshlib::cuda::distance_map_from_contours ( polyline:&meshlib::Polyline2 ,
params:&meshlib::ContourToDistanceMapParams  ) -> meshlib::Owned< meshlib::expected_MR_DistanceMap_std_string >

Computes distance of 2d contours according to ContourToDistanceMapParams (works correctly only when withSign==false) Generated from function MR::Cuda::distanceMapFromContours.

Calls MR_Cuda_distanceMapFromContours().

◆ distance_map_from_contours_heap_bytes()

auto meshlib::cuda::distance_map_from_contours_heap_bytes ( polyline:&meshlib::Polyline2 ,
params:&meshlib::ContourToDistanceMapParams  ) -> usize

Computes memory consumption of distanceMapFromContours function Generated from function MR::Cuda::distanceMapFromContoursHeapBytes.

Calls MR_Cuda_distanceMapFromContoursHeapBytes().

◆ find_projection_on_points()

auto meshlib::cuda::find_projection_on_points ( pointCloud:&meshlib::PointCloud ,
points:&meshlib::VertCoords ,
settings:Option<&meshlib::FindProjectionOnPointsSettings >  ) -> meshlib::Owned< meshlib::expected_std_vector_MR_PointsProjectionResult_std_string >

computes the closest points on point cloud to given points Generated from function MR::Cuda::findProjectionOnPoints.

Calls MR_Cuda_findProjectionOnPoints().

◆ find_projection_on_points_heap_bytes()

auto meshlib::cuda::find_projection_on_points_heap_bytes ( pointCloud:&meshlib::PointCloud ,
pointsCount:usize  ) -> usize

returns the minimal amount of free GPU memory required for MR::Cuda::findProjectionOnPoints Generated from function MR::Cuda::findProjectionOnPointsHeapBytes.

Calls MR_Cuda_findProjectionOnPointsHeapBytes().

◆ find_sky_rays()

auto meshlib::cuda::find_sky_rays ( terrain:&meshlib::Mesh ,
samples:&meshlib::VertCoords ,
validSamples:&meshlib::VertBitSet ,
skyPatches:&meshlib::std_vector_MR_SkyPatch ,
outIntersections:Option<&mut meshlib::std_vector_MR_MeshIntersectionResult >  ) -> meshlib::Owned< meshlib::BitSet >

In each valid sample point tests the rays from that point in the sky;

Returns
bitset where for every valid sample i its rays are stored at indices [i*numPatches; (i+1)*numPatches), 0s for occluded rays (hitting the terrain) and 1s for the ones which don't hit anything and reach the sky
Parameters
outIntersections- optional output vector of MeshIntersectionResult for every valid sample point Generated from function MR::Cuda::findSkyRays.

Calls MR_Cuda_findSkyRays().

◆ get_cuda_available_memory()

auto meshlib::cuda::get_cuda_available_memory ( ) -> usize

Returns available GPU memory in bytes Generated from function MR::Cuda::getCudaAvailableMemory.

Calls MR_Cuda_getCudaAvailableMemory().

◆ get_cuda_safe_memory_limit()

auto meshlib::cuda::get_cuda_safe_memory_limit ( ) -> usize

Returns maximum safe amount of free GPU memory that will be used for dynamic-sized buffers Generated from function MR::Cuda::getCudaSafeMemoryLimit.

Calls MR_Cuda_getCudaSafeMemoryLimit().

◆ get_device_info()

auto meshlib::cuda::get_device_info ( ) -> meshlib::Owned< meshlib::expected_MR_Cuda_DeviceInfo_std_string >

Returns an error if CUDA is not available Generated from function MR::Cuda::getDeviceInfo.

Calls MR_Cuda_getDeviceInfo().

◆ is_cuda_available()

auto meshlib::cuda::is_cuda_available ( driverVersion:Option<&mut core::ffi::c_int > ,
runtimeVersion:Option<&mut core::ffi::c_int > ,
computeMajor:Option<&mut core::ffi::c_int > ,
computeMinor:Option<&mut core::ffi::c_int >  ) -> bool

Returns true if Cuda is present on this GPU optional out maximum driver supported version optional out current runtime version optional out compute capability major version optional out compute capability minor version Generated from function MR::Cuda::isCudaAvailable.

Calls MR_Cuda_isCudaAvailable().

Deprecated
Use getRuntimeInfo

◆ load_mr_cuda_dll()

void meshlib::cuda::load_mr_cuda_dll ( )

call this function to load MRCuda shared library Generated from function MR::Cuda::loadMRCudaDll.

Calls MR_Cuda_loadMRCudaDll().

◆ max_buffer_size()

auto meshlib::cuda::max_buffer_size ( availableBytes:usize ,
elementCount:usize ,
elementBytes:usize  ) -> usize

Returns maximum buffer size in elements that can be allocated with given memory limit Generated from function MR::Cuda::maxBufferSize.

Calls MR_Cuda_maxBufferSize().

◆ max_buffer_size_aligned_by_block_mr_vector2i()

auto meshlib::cuda::max_buffer_size_aligned_by_block_mr_vector2i ( availableBytes:usize ,
blockDims:&meshlib::Vector2i ,
elementBytes:usize  ) -> usize

Returns maximum buffer size in elements that can be allocated with given memory limit The size is aligned to the block dimensions Generated from function MR::Cuda::maxBufferSizeAlignedByBlock.

Calls MR_Cuda_maxBufferSizeAlignedByBlock_MR_Vector2i().

◆ max_buffer_size_aligned_by_block_mr_vector3i()

auto meshlib::cuda::max_buffer_size_aligned_by_block_mr_vector3i ( availableBytes:usize ,
blockDims:&meshlib::Vector3i ,
elementBytes:usize  ) -> usize

Generated from function MR::Cuda::maxBufferSizeAlignedByBlock.

Calls MR_Cuda_maxBufferSizeAlignedByBlock_MR_Vector3i().

◆ negate_picture()

auto meshlib::cuda::negate_picture ( image:&mut meshlib::Image ) -> meshlib::Owned< meshlib::expected_void_std_string >

This function inverts Color value (255 - value in each channel except alpha) Generated from function MR::Cuda::negatePicture.

Calls MR_Cuda_negatePicture().

◆ points_to_distance_volume()

auto meshlib::cuda::points_to_distance_volume ( cloud:&meshlib::PointCloud ,
params:&meshlib::PointsToDistanceVolumeParams  ) -> meshlib::Owned< meshlib::expected_MR_SimpleVolumeMinMax_std_string >

makes SimpleVolume filled with signed distances to points with normals Generated from function MR::Cuda::pointsToDistanceVolume.

Calls MR_Cuda_pointsToDistanceVolume().

◆ points_to_distance_volume_by_parts()

auto meshlib::cuda::points_to_distance_volume_by_parts ( cloud:&meshlib::PointCloud ,
params:&meshlib::PointsToDistanceVolumeParams ,
addPart:&meshlib::std_function_expected_void_std_string_from_const_MR_SimpleVolumeMinMax_ref_int ,
layerOverlap:core::ffi::c_int  ) -> meshlib::Owned< meshlib::expected_void_std_string >

makes SimpleVolume filled with signed distances to points with normals populate the volume by parts to the given callback Generated from function MR::Cuda::pointsToDistanceVolumeByParts.

Calls MR_Cuda_pointsToDistanceVolumeByParts().

◆ points_to_distance_volume_memory()

auto meshlib::cuda::points_to_distance_volume_memory ( cloud:&meshlib::PointCloud ,
dims:&meshlib::Vector3i ,
ptNormals:Option<&meshlib::VertCoords >  ) -> usize

returns the minimal amount of free GPU memory required to build a distance volume with given dimensions Generated from function MR::Cuda::pointsToDistanceVolumeMemory.

Calls MR_Cuda_pointsToDistanceVolumeMemory().