isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.45k stars 2.31k forks source link

How to initialize a TetraMesh ? #3143

Closed raphaelsulzer closed 3 years ago

raphaelsulzer commented 3 years ago

I would like to create a TetraMesh from an existing 3D Delaunay Triangulation made by cgal.

I cannot manage to create a TetraMesh instance, with any of the commands below.

I always get errors like:

error: aggregate ‘open3d::geometry::TetraMesh tetmesh’ has incomplete type and cannot be defined
     open3d::geometry::TetraMesh tetmesh;

or

error: incomplete type ‘open3d::geometry::TetraMesh’ used in nested name specifier
     auto tetmesh = open3d::geometry::TetraMesh::TetraMesh(points,tets);

To Reproduce

    vector<Eigen::Vector3d> points;
    vector<Eigen::Vector4i, open3d::utility::Vector4i_allocator> tets;

//    std::shared_ptr<open3d::geometry::TetraMesh> tetmesh_ptr(
//            new open3d::geometry::TetraMesh);

    open3d::geometry::TetraMesh tetmesh;
//    auto tetmesh = open3d::geometry::TetraMesh::TetraMesh(points,tets);

Environment:

raphaelsulzer commented 3 years ago

I simply forgot to #include "open3d/geometry/TetraMesh.h". Now it works fine with: auto tetmesh = open3d::geometry::TetraMesh(points,tets);