ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
reusex::io Namespace Reference

Namespaces

namespace  speckle

Classes

struct  ExportScene
 Intermediate representation for exporting all project data. More...

Functions

double read_exif_timestamp (const std::filesystem::path &jpeg_path)
 Read EXIF DateTimeOriginal from a JPEG file.
ExportScene gather_export_scene (const ProjectDB &db)
 Gather all exportable data from a ProjectDB.
auto getPlanes (CloudLConstPtr planes, CloudNConstPtr normals, CloudLocConstPtr locations) -> std::tuple< EigenVectorContainer< double, 4 >, EigenVectorContainer< double, 3 >, std::vector< IndicesPtr > >
 Extract plane data from labeled point clouds.
bool save (std::filesystem::path const &output_path, std::vector< pcl::ModelCoefficients > const &model_coefficients, std::vector< Eigen::Vector4f, Eigen::aligned_allocator< Eigen::Vector4f > > const &centroids, std::vector< std::shared_ptr< pcl::Indices > > const &inlier_indices)
 Save plane data to file.
bool read (std::filesystem::path const &input_path, std::vector< pcl::ModelCoefficients > &model_coefficients, std::vector< Eigen::Vector4f, Eigen::aligned_allocator< Eigen::Vector4f > > &centroids, std::vector< std::shared_ptr< pcl::Indices > > &inlier_indices)
 Read plane data from file.
auto configure_rhino_model () -> std::unique_ptr< ONX_Model >
 Create a configured ONX_Model with ReUseX metadata, units, and tolerances.
auto export_to_rhino (const ExportScene &scene) -> std::unique_ptr< ONX_Model >
 Export a full ExportScene to a Rhino ONX_Model with layer hierarchy.
auto make_rhino_pointcloud (CloudConstPtr cloud) -> std::unique_ptr< ON_PointCloud >
 Convert a PCL XYZRGB point cloud to an ON_PointCloud.
auto make_rhino_pointcloud (CloudConstPtr cloud, CloudNConstPtr normals) -> std::unique_ptr< ON_PointCloud >
 Convert a PCL XYZRGB point cloud with normals to an ON_PointCloud.
auto make_rhino_mesh (const pcl::PolygonMesh &mesh) -> std::unique_ptr< ON_Mesh >
 Convert a PCL PolygonMesh to an ON_Mesh.
auto make_sphere_mesh (double cx, double cy, double cz, double radius, int resolution=16) -> std::unique_ptr< ON_Mesh >
 Create a UV sphere mesh.
void import_rtabmap (ProjectDB &db, const std::filesystem::path &rtabmap_db_path)
 Import raw sensor data from an RTABMap database into a ProjectDB.

Function Documentation

◆ configure_rhino_model()

auto reusex::io::configure_rhino_model ( ) -> std::unique_ptr< ONX_Model >

Create a configured ONX_Model with ReUseX metadata, units, and tolerances.

◆ export_to_rhino()

auto reusex::io::export_to_rhino ( const ExportScene & scene) -> std::unique_ptr< ONX_Model >

Export a full ExportScene to a Rhino ONX_Model with layer hierarchy.

◆ gather_export_scene()

ExportScene reusex::io::gather_export_scene ( const ProjectDB & db)

Gather all exportable data from a ProjectDB.

Only populates layers that have data.

◆ getPlanes()

auto reusex::io::getPlanes ( CloudLConstPtr planes,
CloudNConstPtr normals,
CloudLocConstPtr locations ) -> std::tuple< EigenVectorContainer< double, 4 >, EigenVectorContainer< double, 3 >, std::vector< IndicesPtr > >

Extract plane data from labeled point clouds.

Parameters
planesLabeled point cloud where labels indicate plane IDs.
normalsPoint cloud containing plane normals.
locationsPoint cloud containing plane centroid locations.
Returns
Tuple of (plane coefficients, centroids, inlier indices).

◆ import_rtabmap()

void reusex::io::import_rtabmap ( ProjectDB & db,
const std::filesystem::path & rtabmap_db_path )

Import raw sensor data from an RTABMap database into a ProjectDB.

For each node the function extracts color, depth, confidence, the optimized world pose, and camera intrinsics in their original RTABMap format and stores everything in the project database. Images are stored in their native orientation without rotation.

No heavy processing (voxelization, normal estimation, etc.) is performed. Point cloud generation is handled separately by reusex::geometry::reconstruct_point_clouds().

Parameters
dbTarget project database (must be open in write mode).
rtabmap_db_pathPath to the source RTABMap .db file.

◆ make_rhino_mesh()

auto reusex::io::make_rhino_mesh ( const pcl::PolygonMesh & mesh) -> std::unique_ptr< ON_Mesh >

Convert a PCL PolygonMesh to an ON_Mesh.

◆ make_rhino_pointcloud() [1/2]

auto reusex::io::make_rhino_pointcloud ( CloudConstPtr cloud) -> std::unique_ptr< ON_PointCloud >

Convert a PCL XYZRGB point cloud to an ON_PointCloud.

◆ make_rhino_pointcloud() [2/2]

auto reusex::io::make_rhino_pointcloud ( CloudConstPtr cloud,
CloudNConstPtr normals ) -> std::unique_ptr< ON_PointCloud >

Convert a PCL XYZRGB point cloud with normals to an ON_PointCloud.

◆ make_sphere_mesh()

auto reusex::io::make_sphere_mesh ( double cx,
double cy,
double cz,
double radius,
int resolution = 16 ) -> std::unique_ptr< ON_Mesh >

Create a UV sphere mesh.

◆ read()

bool reusex::io::read ( std::filesystem::path const & input_path,
std::vector< pcl::ModelCoefficients > & model_coefficients,
std::vector< Eigen::Vector4f, Eigen::aligned_allocator< Eigen::Vector4f > > & centroids,
std::vector< std::shared_ptr< pcl::Indices > > & inlier_indices )
nodiscard

Read plane data from file.

Parameters
input_pathPath to input file.
model_coefficientsOutput plane model coefficients.
centroidsOutput plane centroids.
inlier_indicesOutput indices of points belonging to each plane.
Returns
True if read was successful, false otherwise.

◆ read_exif_timestamp()

double reusex::io::read_exif_timestamp ( const std::filesystem::path & jpeg_path)

Read EXIF DateTimeOriginal from a JPEG file.

Returns epoch seconds (double), or -1.0 if not available.

◆ save()

bool reusex::io::save ( std::filesystem::path const & output_path,
std::vector< pcl::ModelCoefficients > const & model_coefficients,
std::vector< Eigen::Vector4f, Eigen::aligned_allocator< Eigen::Vector4f > > const & centroids,
std::vector< std::shared_ptr< pcl::Indices > > const & inlier_indices )
nodiscard

Save plane data to file.

Parameters
output_pathPath to output file.
model_coefficientsPlane model coefficients.
centroidsPlane centroids.
inlier_indicesIndices of points belonging to each plane.
Returns
True if save was successful, false otherwise.