Registered Member
|
Hi,
I have two 3 dimensional discretized curves describt by 3 double arrays per curve (each curve has one array of doubles for x, one array for y, and one array for z). I have to make different calculations with this curves. For example, find the nearest point of curve 2 to an given point of curve 1, or calculate the normal vector on a specific point, and something else. I would like to use the eigen-library. Is ist a good idea? If so, what is the best way to store the arrays into Eigen::Vector3d (there are thousand of points)? Best regards, flambert |
Moderator
|
In order to get the best our of Eigen, I'd rather store the point coordinates into a Matrix<double,3,Dynamic,RowMajor>. This way data.row(0) gives you the vector of x, and data.col(i) gives you coordinates of the i-th points. You can try ColMajor or RowMajor to see what works best in your case.
For instance, the bounding box is simply obtained as: data.rowwise().minCoeff(), data.rowwise().maxCoeff(). The tangent vectors of the n-1 first points: data.tail(n-1) - data(head(n-1); ... |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]