Class Argos::UniformAreaSampler
ClassList > Argos > UniformAreaSampler
Area-weighted surface sampler. More...
#include <UniformAreaSampler.h>
Inherits the following classes: Argos::ISurfaceSampler
Public Functions
| Type | Name |
|---|---|
| UniformAreaSampler (std::size_t pointCount) |
|
| double | computeMeshSurfaceArea (const Mesh & mesh) const Compute the total surface area of the mesh (fan triangulation). |
| std::vector< std::size_t > | distributePointsOverFaces (const Mesh & mesh, double totalArea) const Distribute the total point count across faces by area. |
| virtual std::string | name () override const Short identifier of the sampler including its parameter. |
| virtual PointCloud | sample (const Mesh & mesh) override Sample m_pointCount points distributed proportionally to each face's area. |
| void | sampleFaceSurface (const Mesh & mesh, const Face & face, std::size_t pointCount, PointCloud & cloud) const Sample a polygonal face by triangulating it and sampling each sub-triangle. |
| void | sampleTriangleSurface (const Vector3D< double > & A, const Vector3D< double > & B, const Vector3D< double > & C, std::size_t pointCount, PointCloud & cloud) const Generate barycentric random points inside a triangle. |
Public Functions inherited from Argos::ISurfaceSampler
| Type | Name |
|---|---|
| virtual std::string | name () const = 0 Short identifier of the strategy. |
| virtual PointCloud | sample (const Mesh & mesh) = 0 Sample a point cloud from a mesh. |
| virtual | ~ISurfaceSampler () = default |
Detailed Description
Distributes a fixed total number of points across the mesh proportionally to each face's surface area. Larger faces receive more samples.
Public Functions Documentation
function UniformAreaSampler
Parameters:
pointCountTotal number of points to sample.
function computeMeshSurfaceArea
Compute the total surface area of the mesh (fan triangulation).
Parameters:
meshInput mesh.
Returns:
Total surface area.
function distributePointsOverFaces
Distribute the total point count across faces by area.
std::vector< std::size_t > Argos::UniformAreaSampler::distributePointsOverFaces (
const Mesh & mesh,
double totalArea
) const
Parameters:
meshInput mesh.totalAreaPre-computed total surface area.
Returns:
Per-face point allocation.
function name
Short identifier of the sampler including its parameter.
Returns:
"(UniformAreaSampler-pc<n>)".
Implements Argos::ISurfaceSampler::name
function sample
Sample m_pointCount points distributed proportionally to each face's area.
Parameters:
meshInput mesh.
Returns:
Point cloud with m_pointCount points.
Implements Argos::ISurfaceSampler::sample
function sampleFaceSurface
Sample a polygonal face by triangulating it and sampling each sub-triangle.
void Argos::UniformAreaSampler::sampleFaceSurface (
const Mesh & mesh,
const Face & face,
std::size_t pointCount,
PointCloud & cloud
) const
Parameters:
meshMesh containing the face.faceFace to sample.pointCountNumber of points to distribute over the face.cloudOutput point cloud.
function sampleTriangleSurface
Generate barycentric random points inside a triangle.
void Argos::UniformAreaSampler::sampleTriangleSurface (
const Vector3D < double > & A,
const Vector3D < double > & B,
const Vector3D < double > & C,
std::size_t pointCount,
PointCloud & cloud
) const
Parameters:
ATriangle vertices.pointCountNumber of points to generate.cloudOutput point cloud (points are appended).
The documentation for this class was generated from the following file include/algos/mesh_to_pointcloud/UniformAreaSampler.h