Hi there,

i have a plane with holes. For this plane, I determine the coefficients using pcl::SACSegmentation<PointT>. I get the coefficients, for example: 0.506008 -0.862525 -0.00234344 -2.8741 , where they stand for ax + by + cz + d = 0 for the normal point equation of a plane.

I have been knocking my brain out, how to construct a new plane, at the same position as the old one is using these very coeffients.

I have basically determined the min and max positions of my plane (with holes) using pcl::getMinMax3D(*cloud_filtered, minPt, maxPt);

Then i take a point which I know lies on the plane (I get this from the SACSegmentaiton inliers).

PointT temp;

temp.x = cloud_filtered->points[inliers->indices.at(10)].x;

temp.y = cloud_filtered->points[inliers->indices.at(10)].y;

temp.z = cloud_filtered->points[inliers->indices.at(10)].z;

Then I go through all points within this range of min max and calcualte new x,y,z positions to solve the above plane equation for the new input points. I think this is where I go wrong, but I don't know how to do it right, even after a day of research on the topic plane equation.

for (float x=minPt.x; x<=maxPt.x; x+=0.5f)

{

for (float y=minPt.y; y<= maxPt.y; y+=0.5f)

{

for(float z=minPt.z; z <= maxPt.z ; z+=0.5f)

{

PointT point;

point.x = coefficients->values[2] * (x - temp.x);

point.y = coefficients->values[1] * (y - temp.y);

point.z = coefficients->values[0] * (z - temp.z);

myPlane->points.push_back (point);

}

}

}

The result is not even a 1 point thick plane (it is more like several points next to each other, red in upper screenshot) but even worse it is at a totally different position (blue in screenshot below, red with green outline is my original cloud with holes).

Can someone please push me into the right direction?

Thanks!