mirror of https://github.com/CGAL/cgal
Fixed degenerated case of plane fitting to a linear set of points.
This commit is contained in:
parent
6bd510b943
commit
39df59901b
|
|
@ -723,7 +723,11 @@ fitting_plane_3(typename DiagonalizeTraits::Covariance_matrix& covariance, // co
|
||||||
eigen_vectors[1],
|
eigen_vectors[1],
|
||||||
eigen_vectors[2]);
|
eigen_vectors[2]);
|
||||||
plane = Plane(c,normal);
|
plane = Plane(c,normal);
|
||||||
return FT(1) - eigen_values[0] / eigen_values[1];
|
|
||||||
|
if (eigen_values[1] == 0)
|
||||||
|
return FT(0); // line case
|
||||||
|
else
|
||||||
|
return FT(1) - eigen_values[0] / eigen_values[1]; // regular case
|
||||||
} // end regular case
|
} // end regular case
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue