Skip to content

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

See 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

inline explicit Argos::UniformAreaSampler::UniformAreaSampler (
    std::size_t pointCount
) 

Parameters:

  • pointCount Total number of points to sample.

function computeMeshSurfaceArea

Compute the total surface area of the mesh (fan triangulation).

double Argos::UniformAreaSampler::computeMeshSurfaceArea (
    const  Mesh & mesh
) const

Parameters:

  • mesh Input 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:

  • mesh Input mesh.
  • totalArea Pre-computed total surface area.

Returns:

Per-face point allocation.


function name

Short identifier of the sampler including its parameter.

inline virtual std::string Argos::UniformAreaSampler::name () override const

Returns:

"(UniformAreaSampler-pc<n>)".

Implements Argos::ISurfaceSampler::name


function sample

Sample m_pointCount points distributed proportionally to each face's area.

virtual PointCloud Argos::UniformAreaSampler::sample (
    const  Mesh & mesh
) override

Parameters:

  • mesh Input 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:

  • mesh Mesh containing the face.
  • face Face to sample.
  • pointCount Number of points to distribute over the face.
  • cloud Output 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:

  • A Triangle vertices.
  • pointCount Number of points to generate.
  • cloud Output point cloud (points are appended).


The documentation for this class was generated from the following file include/algos/mesh_to_pointcloud/UniformAreaSampler.h