ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
Toggle main menu visibility
Loading...
Searching...
No Matches
cgal_utils.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2025 Povl Filip Sonne-Frederiksen
2
// SPDX-License-Identifier: GPL-3.0-or-later
3
4
#pragma once
5
6
#include <CGAL/Simple_cartesian.h>
7
#include <CGAL/Surface_mesh.h>
8
#include <Eigen/Core>
9
#include <pcl/PolygonMesh.h>
10
11
namespace
reusex::geometry::cgal
{
12
14
using
K
= CGAL::Simple_cartesian<double>;
15
17
using
Point_3
= K::Point_3;
18
20
using
Vector_3
= K::Vector_3;
21
23
using
Mesh
= CGAL::Surface_mesh<Point_3>;
24
28
Mesh
pcl_to_cgal_mesh
(
const
pcl::PolygonMesh &pcl_mesh);
29
33
pcl::PolygonMesh
cgal_to_pcl_mesh
(
const
Mesh
&cgal_mesh);
34
38
inline
Point_3
eigen_to_cgal
(
const
Eigen::Vector3d &v) {
39
return
Point_3
(v.x(), v.y(), v.z());
40
}
41
45
inline
Eigen::Vector3d
cgal_to_eigen
(
const
Point_3
&p) {
46
return
Eigen::Vector3d(CGAL::to_double(p.x()), CGAL::to_double(p.y()),
47
CGAL::to_double(p.z()));
48
}
49
53
inline
Eigen::Vector3d
cgal_to_eigen
(
const
Vector_3
&v) {
54
return
Eigen::Vector3d(CGAL::to_double(v.x()), CGAL::to_double(v.y()),
55
CGAL::to_double(v.z()));
56
}
57
60
std::vector<pcl::PolygonMeshPtr>
decompose_mesh
(
const
pcl::PolygonMesh &
mesh
);
61
62
}
// namespace reusex::geometry::cgal
reusex::geometry::cgal
Definition
cgal_utils.hpp:11
reusex::geometry::cgal::Mesh
CGAL::Surface_mesh< Point_3 > Mesh
CGAL surface mesh type.
Definition
cgal_utils.hpp:23
reusex::geometry::cgal::Vector_3
K::Vector_3 Vector_3
CGAL 3D vector type.
Definition
cgal_utils.hpp:20
reusex::geometry::cgal::cgal_to_pcl_mesh
pcl::PolygonMesh cgal_to_pcl_mesh(const Mesh &cgal_mesh)
Convert CGAL Surface_mesh to PCL PolygonMesh.
reusex::geometry::cgal::eigen_to_cgal
Point_3 eigen_to_cgal(const Eigen::Vector3d &v)
Convert Eigen Vector3d to CGAL Point_3.
Definition
cgal_utils.hpp:38
reusex::geometry::cgal::cgal_to_eigen
Eigen::Vector3d cgal_to_eigen(const Point_3 &p)
Convert CGAL Point_3 to Eigen Vector3d.
Definition
cgal_utils.hpp:45
reusex::geometry::cgal::K
CGAL::Simple_cartesian< double > K
CGAL kernel for geometric computations.
Definition
cgal_utils.hpp:14
reusex::geometry::cgal::Point_3
K::Point_3 Point_3
CGAL 3D point type.
Definition
cgal_utils.hpp:17
reusex::geometry::cgal::pcl_to_cgal_mesh
Mesh pcl_to_cgal_mesh(const pcl::PolygonMesh &pcl_mesh)
Convert PCL PolygonMesh to CGAL Surface_mesh.
reusex::geometry::cgal::decompose_mesh
std::vector< pcl::PolygonMeshPtr > decompose_mesh(const pcl::PolygonMesh &mesh)
Split a mesh into its connected components.
reusex::geometry::mesh
pcl::PolygonMeshPtr mesh(CloudConstPtr cloud, CloudNConstPtr normals, EigenVectorContainer< double, 4 > &planes, EigenVectorContainer< double, 3 > ¢roids, std::vector< IndicesPtr > &inliers, CloudLConstPtr rooms, MeshOptions const opt=MeshOptions{})
Generate a mesh from point cloud and geometric primitives.
libs
reusex
include
geometry
cgal_utils.hpp
Generated by
1.17.0