You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've slightly adapted the polygonal surface reconstruction without planes example to pass ransac and polyfit parameters. The code used is here.
I've been using the following ply files containing points with normals dsm_as_point_cloud_with_walls.zip as input. (This file is produced by combining digital surface model and building footprint that's why the roof goes inside the building 😉)
The result I'm getting has incorrectly oriented faces.
I managed to fix the faces orientation errors by using the following snippet (I'm not an expert in CGAL so this might not be the optimal solution to do so)
// Cleanup and fix obtained mesh (holes, orientation, ...)
std::vector<Point> _points;
std::vector<std::vector<std::size_t>> _polygons;
// mesh will be the correctly oriented model
Surface_mesh mesh;
// model is the result of Polygonal Surface ReconstructionPMP::polygon_mesh_to_polygon_soup(model, _points, _polygons);
PMP::repair_polygon_soup(_points, _polygons);
PMP::orient_polygon_soup(_points, _polygons);
PMP::polygon_soup_to_polygon_mesh(_points, _polygons, mesh);
PMP::triangulate_faces(mesh);
if (CGAL::is_closed(mesh))
{
std::cout << "The obtained mesh is closed" << std::endl;
PMP::orient_to_bound_a_volume(mesh);
}
The full source code with the face orientation fix is available here. Here is the mesh obtained whose faces are now correctly oriented.
My questions
Is there something wrong in my dataset or in my understanding of polyfit + ransac ?
If not, should a fix be introduced in polygonal surface reconstruction so that the result models are correctly oriented ?
Thanks in advance for any help
Environment
Ubuntu 20.04
Compiler: g++ 9.4.0
Release or debug mode: Release
Specific flags used (if any): built with scip (SCIP_INCLUDE_DIR, SCIP_DIR)
CGAL version: 5.5.1
Boost version: 1.80.0
Other libraries versions if used (Eigen, TBB, etc.):
cmake: 3.24.2
gmp: 6.2.1
mpfr: 4.1.1
eigen: 3.4.0
glpk: 5.0
ipopt: 3.14.10
hmetis: 1.5
criterion: 2.4.1
scip: 8.0.2
The text was updated successfully, but these errors were encountered:
Issue Details
I've slightly adapted the polygonal surface reconstruction without planes example to pass ransac and polyfit parameters. The code used is here.
I've been using the following ply files containing points with normals dsm_as_point_cloud_with_walls.zip as input. (This file is produced by combining digital surface model and building footprint that's why the roof goes inside the building 😉)
The result I'm getting has incorrectly oriented faces.
I managed to fix the faces orientation errors by using the following snippet (I'm not an expert in CGAL so this might not be the optimal solution to do so)
The full source code with the face orientation fix is available here. Here is the mesh obtained whose faces are now correctly oriented.
My questions
Thanks in advance for any help
Environment
The text was updated successfully, but these errors were encountered: