Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Feb 11, 2025
1 parent 985a578 commit d88ae14
Show file tree
Hide file tree
Showing 10 changed files with 647 additions and 315 deletions.
33 changes: 17 additions & 16 deletions easy3d/algo/point_cloud_ransac.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ namespace easy3d {
*/
class PrimitivesRansac {
public:
/// The primitive types that can be extracted.
enum PrimType { // Do NOT modify the order!!! Values have to be exactly the same as in RANSAC
PLANE = 0,
SPHERE = 1,
CYLINDER = 2,
CONE = 3,
TORUS = 4,
UNKNOWN = -1
PLANE = 0, ///< Plane primitive
SPHERE = 1, ///< Sphere primitive
CYLINDER = 2, ///< Cylinder primitive
CONE = 3, ///< Cone primitive
TORUS = 4, ///< Torus primitive
UNKNOWN = -1 ///< Unknown primitive
};

public:
Expand Down Expand Up @@ -127,11 +128,11 @@ namespace easy3d {
* \brief Information about a plane primitive.
*/
struct PlanePrim {
int primitive_index; /// the index of this plane (w.r.t. the entire list of detected primitives)
std::vector<int> vertices; /// the vertex indices (w.r.t. the point cloud) of this plane
Plane3 plane; /// the plane representation
vec3 position; /// the position of the plane (represented by a point on the plane)
vec3 normal; /// the normal of the plane
int primitive_index; ///< the index of this plane (w.r.t. the entire list of detected primitives)
std::vector<int> vertices; ///< the vertex indices (w.r.t. the point cloud) of this plane
Plane3 plane; ///< the plane representation
vec3 position; ///< the position of the plane (represented by a point on the plane)
vec3 normal; ///< the normal of the plane
};
/**
* \brief Get the detected planes.
Expand All @@ -142,11 +143,11 @@ namespace easy3d {
* \brief Information about a cylinder primitive.
*/
struct CylinderPrim {
int primitive_index; /// the index of this cylinder (w.r.t. the entire list of detected primitives)
std::vector<int> vertices; /// the vertex indices (w.r.t. the point cloud) of this cylinder
float radius; /// the radius of the cylinder
vec3 position; /// the position of the cylinder (represented by the center of the bottom circle)
vec3 direction; /// the direction of the cylinder
int primitive_index; ///< the index of this cylinder (w.r.t. the entire list of detected primitives)
std::vector<int> vertices; ///< the vertex indices (w.r.t. the point cloud) of this cylinder
float radius; ///< the radius of the cylinder
vec3 position; ///< the position of the cylinder (represented by the center of the bottom circle)
vec3 direction; ///< the direction of the cylinder
};
/**
* Get the detected cylinders.
Expand Down
6 changes: 5 additions & 1 deletion easy3d/core/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ namespace easy3d {

/// Helper structure to be able to use std::unordered_map
struct Hash {
/// Hash function, which is simply the index.
/**
* \brief Hash function for BaseHandle.
* \param h The handle to hash.
* \return The hash value of the handle, which is the index.
*/
std::size_t operator()(const BaseHandle& h) const { return h.idx(); }
};

Expand Down
Loading

0 comments on commit d88ae14

Please sign in to comment.