Fast Eigen::MatrixXd type casting to points #6173
Replies: 5 comments 12 replies
-
@mglisse Is there a chance that could be done using Epick_d in dimension 3? I know you are using Eigen types natively, in that kernel. |
Beta Was this translation helpful? Give feedback.
-
What do you want to do exactly? It sounds like you have an array that you can interpret as a sequence of vectors (points) from Eigen, and you would like a sequence of CGAL points? The answer really depends on what you want to do with that sequence of CGAL points... Are you trying to build a CGAL mesh? @lrineau By default Epick_d uses std::array/std::vector. It is possible to make it use a wrapper over Eigen vectors. It is also possible to build a similar traits class that uses Eigen vectors directly as points (drop the wrapper). But that still won't be exactly the same type as you get when accessing the i-th column of an array. |
Beta Was this translation helpful? Give feedback.
-
This was also my dream up to the moment that I discovered that in libigl a vector of N points is not not a vector of N triplets, but a vector of 3 vectors of size N. |
Beta Was this translation helpful? Give feedback.
-
@BBBBBbruce what do you mean with collision detection? What CGAL functions do you want to apply on your libigl mesh? Does it stay unmodified, or do you change coordinates from the CGAL side? |
Beta Was this translation helpful? Give feedback.
-
Note that you may want to consider the following class: It is working even if global affine transformations are applied to the input meshes, without having to rebuild the trees. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am wondering if there is a fast way to cast the MatrixXd/MatrixXi to points_3? I saw issue #3161, but it is using the for-loop.
In my case, I have multiple(3, to be specific) tetrahedral meshes(GMSH, *.msh), loading by libigl. The vertices and tetrahedrons are stored in one MatrixXd and one MatrixXi separately. And they would have millions of points which for loop would be quite a pain in run time speed.
I wonder how can I do this efficiently?
Thanks for the help
Beta Was this translation helpful? Give feedback.
All reactions