Calculation of point to plane distance
-
- Posts: 19
- Joined: Tue Oct 28, 2014 5:53 am
Calculation of point to plane distance
How can I use CC to do some calculation of point to plane distance?
Re: Calculation of point to plane distance
In CC a plane is in fact a mesh. So you can use the 'Cloud to Mesh' distances computation tool (http://www.cloudcompare.org/doc/wiki/in ... h_Distance).
And programatically you can also use internal methods to comptute real point/plane distances (in CC_CORE_LIB, see the DistanceComputationTools class).
And programatically you can also use internal methods to comptute real point/plane distances (in CC_CORE_LIB, see the DistanceComputationTools class).
Daniel, CloudCompare admin
-
- Posts: 19
- Joined: Tue Oct 28, 2014 5:53 am
Re: Calculation of point to plane distance
I have checked the DistanceComputationTool.
In my application,I use ccPlane::Fit(cloud, &rms) to get an average plane.How can I use this plane to caculante the distance from one point to this plane.I couldn't find the ax+by+cz+d=0;[a,b,c,d] in the ccplane;
In my application,I use ccPlane::Fit(cloud, &rms) to get an average plane.How can I use this plane to caculante the distance from one point to this plane.I couldn't find the ax+by+cz+d=0;[a,b,c,d] in the ccplane;
Re: Calculation of point to plane distance
The coefficients of the plane equation are rather easy to retrieve:
- the 3 first coefficients (a,b and c) are simply the plane normal (a=N.x, etc.)
- the last coefficient (d) is equal to the dot product of any point belonging to the plane with the plane normal vector. In effect you can use the cloud gravity center (you can use the CCLib::Neighborhood class to easily determine it):
- the 3 first coefficients (a,b and c) are simply the plane normal (a=N.x, etc.)
- the last coefficient (d) is equal to the dot product of any point belonging to the plane with the plane normal vector. In effect you can use the cloud gravity center (you can use the CCLib::Neighborhood class to easily determine it):
Code: Select all
d = G.dot(N)
Daniel, CloudCompare admin