ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
PCV.cpp File Reference
#include "PCV.h"
#include "PCVContext.h"
#include <QString>
#include <assert.h>
#include <string.h>
#include <algorithm>
#include <vector>
Include dependency graph for PCV.cpp:

Go to the source code of this file.

Functions

static int gcd (int num1, int num2)
 
static bool SampleSphere (unsigned N, std::vector< CCVector3 > &dirs)
 Sample points on the unit sphere. More...
 

Function Documentation

◆ gcd()

static int gcd ( int  num1,
int  num2 
)
static

Definition at line 29 of file PCV.cpp.

Referenced by SampleSphere().

◆ SampleSphere()

static bool SampleSphere ( unsigned  N,
std::vector< CCVector3 > &  dirs 
)
static

Sample points on the unit sphere.

Transcripted from MATLAB's script "partsphere.m" by Paul Leopardi, 2003-10-13, for UNSW School of Mathematics.

As points are sampled on the unit sphere, they can also be considered as directions. WARNING: returned array is on the user responsibilty!

Parameters
Nnumber of desired sampled directions
[out]dirsset of N points
Returns
success

Definition at line 47 of file PCV.cpp.

References cloudViewer::utility::ceil(), cloudViewer::utility::floor(), gcd(), M_PI, max(), and offset.

Referenced by PCV::GenerateRays().