pcl icon indicating copy to clipboard operation
pcl copied to clipboard

Replace pcl::visualization::createPlane and pcl::visualization::PCLVisualizer::addPlane overloads by default arguments

Open SergioRAgostinho opened this issue 7 years ago • 6 comments

The code is pretty similar and can be probably reduced by simply making a change to its signature with default initializers.

bool addPlane (const pcl::ModelCoefficients &coefficients, 
               double x = 0,
               double y = 0,
               double z = 0,
               const std::string &id = "plane",
               int viewport = 0);

and

PCL_EXPORTS vtkSmartPointer<vtkDataSet> 
createPlane (const pcl::ModelCoefficients &coefficients, double x = 0, double y = 0, double z = 0);

pcl::visualization::PCLVisualizer::addPlane method:

pcl::visualization::createPlane method:

SergioRAgostinho avatar Jul 18 '16 13:07 SergioRAgostinho

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

stale[bot] avatar May 19 '20 07:05 stale[bot]

Hello, Could i work on this one?

theoniko avatar Jan 07 '22 19:01 theoniko

Hello, Could i work on this one?

Yes, please go ahead.

larshg avatar Jan 08 '22 08:01 larshg

Would it be possible to explain me from which math calculations are calculations of coefficients createPlane coming from? For example for a plane given by the equation a x + b y + c z + d = 0 , the vector n = ( a , b , c ) is a normal(SetNormal function in code). The magnitude of a vector is the square root of the sum of squares of its components (local variable norm_sqr after sqrt function)

theoniko avatar Jan 23 '22 07:01 theoniko

Would it be possible to explain me from which math calculations are calculations of coefficients createPlane coming from? For example for a plane given by the equation a x + b y + c z + d = 0 , the vector n = ( a , b , c ) is a normal(SetNormal function in code). The magnitude of a vector is the square root of the sum of squares of its components (local variable norm_sqr after sqrt function)

I am not totally sure what you want to know? It seems like the vector length is computed because it is not assumed that the normal vector (a, b, c) is a unit vector/normalized vector, but could have any length. Maybe this helps?

mvieth avatar Jan 23 '22 14:01 mvieth

My actual goal was to understand the maths equations that the two createPlane represent so as to be able to merge them in one function as suggested in this issue.

theoniko avatar Feb 05 '22 14:02 theoniko