MeshLib Documentation
Loading...
Searching...
No Matches
MR::Cuda Namespace Reference

Classes

class  FastWindingNumber
 
class  PointsToMeshProjector
 Computes the closest point on mesh to each of given points on GPU. It caches data that necessary for computing. More...
 

Functions

MRCUDA_API bool isCudaAvailable (int *driverVersion=nullptr, int *runtimeVersion=nullptr, int *computeMajor=nullptr, int *computeMinor=nullptr)
 
MRCUDA_API size_t getCudaAvailableMemory ()
 
MRCUDA_API DistanceMap distanceMapFromContours (const MR::Polyline2 &polyline, const ContourToDistanceMapParams &params)
 Computes distance of 2d contours according to ContourToDistanceMapParams (works correctly only when withSign==false)
 
MRCUDA_API size_t distanceMapFromContoursHeapBytes (const MR::Polyline2 &polyline, const ContourToDistanceMapParams &params)
 Computes memory consumption of distanceMapFromContours function.
 
MRCUDA_API DistanceMap computeDistanceMap (const MR::Mesh &mesh, const MR::MeshToDistanceMapParams &params, ProgressCallback cb={}, std::vector< MR::MeshTriPoint > *outSamples=nullptr)
 
MRCUDA_API size_t computeDistanceMapHeapBytes (const MR::Mesh &mesh, const MR::MeshToDistanceMapParams &params, bool needOutSamples=false)
 Computes memory consumption of computeDistanceMap function.
 
MRCUDA_API Expected< MR::SimpleVolumeMinMax > pointsToDistanceVolume (const PointCloud &cloud, const MR::PointsToDistanceVolumeParams &params)
 makes SimpleVolume filled with signed distances to points with normals
 
MRCUDA_API VertScalars computeSkyViewFactor (const Mesh &terrain, const VertCoords &samples, const VertBitSet &validSamples, const std::vector< MR::SkyPatch > &skyPatches, BitSet *outSkyRays=nullptr, std::vector< MR::MeshIntersectionResult > *outIntersections=nullptr)
 
MRCUDA_API BitSet findSkyRays (const Mesh &terrain, const VertCoords &samples, const VertBitSet &validSamples, const std::vector< MR::SkyPatch > &skyPatches, std::vector< MR::MeshIntersectionResult > *outIntersections=nullptr)
 
MRCUDA_API void negatePicture (MR::Image &image)
 

Function Documentation

◆ computeDistanceMap()

MRCUDA_API DistanceMap MR::Cuda::computeDistanceMap ( const MR::Mesh & mesh,
const MR::MeshToDistanceMapParams & params,
ProgressCallback cb = {},
std::vector< MR::MeshTriPoint > * outSamples = nullptr )

computes distance (height) map for given projection parameters using float-precision for finding ray-mesh intersections, which is faster but less reliable

◆ computeDistanceMapHeapBytes()

MRCUDA_API size_t MR::Cuda::computeDistanceMapHeapBytes ( const MR::Mesh & mesh,
const MR::MeshToDistanceMapParams & params,
bool needOutSamples = false )

Computes memory consumption of computeDistanceMap function.

◆ computeSkyViewFactor()

MRCUDA_API VertScalars MR::Cuda::computeSkyViewFactor ( const Mesh & terrain,
const VertCoords & samples,
const VertBitSet & validSamples,
const std::vector< MR::SkyPatch > & skyPatches,
BitSet * outSkyRays = nullptr,
std::vector< MR::MeshIntersectionResult > * outIntersections = nullptr )
nodiscard

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

◆ distanceMapFromContours()

MRCUDA_API DistanceMap MR::Cuda::distanceMapFromContours ( const MR::Polyline2 & polyline,
const ContourToDistanceMapParams & params )

Computes distance of 2d contours according to ContourToDistanceMapParams (works correctly only when withSign==false)

◆ distanceMapFromContoursHeapBytes()

MRCUDA_API size_t MR::Cuda::distanceMapFromContoursHeapBytes ( const MR::Polyline2 & polyline,
const ContourToDistanceMapParams & params )

Computes memory consumption of distanceMapFromContours function.

◆ findSkyRays()

MRCUDA_API BitSet MR::Cuda::findSkyRays ( const Mesh & terrain,
const VertCoords & samples,
const VertBitSet & validSamples,
const std::vector< MR::SkyPatch > & skyPatches,
std::vector< MR::MeshIntersectionResult > * outIntersections = nullptr )
nodiscard

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

◆ getCudaAvailableMemory()

MRCUDA_API size_t MR::Cuda::getCudaAvailableMemory ( )

◆ isCudaAvailable()

MRCUDA_API bool MR::Cuda::isCudaAvailable ( int * driverVersion = nullptr,
int * runtimeVersion = nullptr,
int * computeMajor = nullptr,
int * computeMinor = nullptr )

◆ negatePicture()

MRCUDA_API void MR::Cuda::negatePicture ( MR::Image & image)

◆ pointsToDistanceVolume()

MRCUDA_API Expected< MR::SimpleVolumeMinMax > MR::Cuda::pointsToDistanceVolume ( const PointCloud & cloud,
const MR::PointsToDistanceVolumeParams & params )

makes SimpleVolume filled with signed distances to points with normals