Data Structures
Geometry
Output types from scan integration and mesh/union generation, with export and memory management functions.
Functions
-
bool phoim_ExportPointCloud(const phoim_PointCloud point_cloud, const char *file_path)
Exports a point cloud (e.g. generated by the phoim_GetUnion function).
Note
Supported output file extensions: .ply
- Parameters:
point_cloud – Non-organized point cloud to be exported.
file_path – Full directory including filename and file extension. The content of the pointer is expected to be a null-terminated string.
- Returns:
Return true if the point cloud was successfully exported, false otherwise.
-
void phoim_FreePointCloud(phoim_PointCloud *point_cloud)
Free a point cloud and its resources.
- Parameters:
point_cloud – Point cloud to be freed.
-
bool phoim_ExportMesh(phoim_Mesh mesh, const char *file_path)
Save a mesh (e.g. generated by the phoim_GetMesh function) to a file.
Note
Supported output file extensions: .stl, .fbx, .ply.
- Parameters:
mesh – Mesh to be exported.
file_path – Full directory including filename and file extension. The content of the pointer is expected to be a null-terminated string. The content of the pointer is internally copied.
- Returns:
Return true if the mesh was successfully exported, false otherwise.
-
void phoim_FreeMesh(phoim_Mesh *mesh)
Free a mesh and its resources.
- Parameters:
mesh – Mesh to be freed.
-
void phoim_FreeScan(phoim_Scan *scan)
Free a scan and its resources.
- Parameters:
scan – Scan to be freed.
-
struct phoim_PointCloud
- #include <GeometryUtils.h>
Non-organized point cloud.
-
struct phoim_Mesh
- #include <GeometryUtils.h>
Non-organized point cloud with faces.
-
struct phoim_Scan
- #include <GeometryUtils.h>
Organized point cloud with defined resolution (3D scan). The ordering of points is row-major.
Public Members
-
phoim_PointCloud points
-
int32_t width
Resolution of the point cloud, width.
-
int32_t height
Resolution of the point cloud, height.
-
phoim_PointCloud points
Frame
Frame data supplied to phoim_AddScan: point cloud, texture,
virtual camera parameters, and PTP timestamps.
Functions
-
void phoim_AcceptFrame(const struct phoxi_frame_record_t *records, void *out_frame)
Callback function used with phoxi_frame_read to process frame records from PhoXi C API. This function converts the raw frame records into a phoim_Frame structure.
Note
This function is typically used when reading frames from a device or a dataset, example usage: phoim_Frame frame; phoxi_frame_read(dataset_name, frame_id, timeout, phoim_AcceptFrame, &frame);
Note
The output frame allocates and owns the data. Call phoim_FreeFrame to release its resources.
- Parameters:
records – Pointer to the frame records provided by the phoxi_frame_read function.
out_frame – Pointer to a pre-allocated phoim_Frame structure that will be populated with the converted data.
-
void phoim_FreeFrame(phoim_Frame *frame)
Free a frame and its resources.
- Parameters:
frame – Frame to be freed.
-
struct phoim_VirtualCamera
- #include <Frame.h>
Public Members
-
int32_t width
Frame width.
-
int32_t height
Frame height.
-
bool orthogonal_projection
True if the camera is in orthogonal projection mode (false for perspective).
-
utils_Vec3d position
Camera position.
-
utils_Vec3d x_axis
Camera direction - x axis.
-
utils_Vec3d y_axis
Camera direction - y axis.
-
utils_Vec3d z_axis
Camera direction - z axis.
-
phoim_CameraIntrinsics camera_intrinsics
Perspective camera intrinsics.
-
phoim_DistortionCoefficients distortion_coefficients
Perspective camera distortion coefficients.
-
float ortho_width
Width of the orthogonal view volume in millimeters.
-
float ortho_height
Height of the orthogonal view volume in millimeters.
-
int32_t width
-
struct phoim_Frame
- #include <Frame.h>
Frame The size of the members: point_cloud and texture (or texture_rgb) is expected to be equal to current_camera.width * current_camera.height.
Public Members
-
int64_t index
Frame index.
-
double timestamp
Timestamp of the frame.
-
double capturing_duration
Duration of the frame capturing in milliseconds.
-
double ptp_start_time
Frame start acquisition time point synchronized by PTP (milliseconds since epoch).
-
const char *ptp_port_state
PTP port state. Empty string “” if PTP not available (never null).
-
const char *ptp_grand_master_identity
PTP grand master identity. Empty string “” if PTP not available (never null).
-
phoim_VirtualCamera current_camera
Current camera parameters.
-
const utils_Vec3f *point_cloud
Point cloud with size equal to width * height.
-
const float *texture
Gray-scale texture.
-
const utils_Vec3us *texture_rgb
RGB texture.
-
int64_t index
Cropping Volumes
Spatial filters passed to phoim_SetCroppingVolume and phoim_GetMesh.
Enums
-
struct phoim_CroppingAabb
- #include <CroppingVolume.h>
Axis-aligned bounding box.
-
struct phoim_CroppingSphere
- #include <CroppingVolume.h>
Sphere.
-
struct phoim_CroppingVolume
- #include <CroppingVolume.h>
Struct for cropping volumes.
Public Members
-
phoim_CroppingType type
The type of the cropping volume.
-
phoim_CroppingAabb aabb
-
phoim_CroppingSphere sphere
-
union phoim_CroppingVolume::[anonymous] volume
The cropping volume. The assigned type in this union needs to match the CroppingVolume::type member.
-
phoim_CroppingType type