Registered Member
|
Hi,
I am try to use the Hyperplane and ParametrizedLine classes to calculate the point at which a line intersects a plane. I am using the "Through" static methods to construct both the plane and line. The "Through" method seems to fail (i.e. the plane coefficients have strange values) in some cases depending on the three points I pass to it. The following code and output demonstrates this. Note that I am using version 3.0.5 of Eigen (due to wanting to use it with a particular version of the PCL library). I am new to the Eigen library so hope I am not using the library incorrectly?
Output : plane_ok coefficients : -0, 0, 1, -3 plane_bad coefficients : -1.#IND, -1.#IND, -1.#IND, 1.#QNAN Point of intersection with plane_ok : (0, 0, 3 ) Point of intersection with plane_bad : (-1.#IND, -1.#IND, -1.#IND ) Thanks in advance, Joel Gordon. |
Moderator
|
Indeed, the current code does not seem to handle the degenerate case where the three points are aligned. Among the infinite number of solutions, the method might pick one instead of returning NaN.
|
Moderator
|
Fixed in devel and 3.2 branches:
https://bitbucket.org/eigen/eigen/commits/d9af749994e1/ https://bitbucket.org/eigen/eigen/commits/7aa6b68a6f2a/ Feel free to upgrade to the latest 3.2, I guess that the 3.0.5 advice of PCL is a minimum only. |
Registered Member
|
Thanks very much for the prompt reply and quick fix.
It now works fine. Regards, Joel Gordon. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]