cars_mesh.core.mesh

Meshing methods to create a surface from the point cloud.

Module Contents

Functions

ball_pivoting_reconstruction(...)

Bernardini, Fausto et al. “The ball-pivoting algorithm for surface

poisson_reconstruction(→ cars_mesh.tools.handlers.Mesh)

Kazhdan, Michael M. et al. “Poisson surface reconstruction.” SGP '06 (2006).

delaunay_2d_reconstruction(→ cars_mesh.tools.handlers.Mesh)

2.5D Delaunay triangulation: Delaunay triangulation on the planimetric

cars_mesh.core.mesh.ball_pivoting_reconstruction(pcd: cars_mesh.tools.handlers.PointCloud, radii: list | float | None = 0.6, normal_search_method: str = 'knn', normal_nb_neighbor: int = 30, normal_radius: float = 2.0) cars_mesh.tools.handlers.Mesh[source]

Bernardini, Fausto et al. “The ball-pivoting algorithm for surface reconstruction.” IEEE Transactions on Visualization and Computer Graphics 5 (1999): 349-359.

Function that computes a triangle mesh from a oriented PointCloud. This implements the Ball Pivoting algorithm proposed in F. Bernardini et al., “The ball-pivoting algorithm for surface reconstruction”, 1999. The implementation is also based on the algorithms outlined in Digne, “An Analysis and Implementation of a Parallel Ball Pivoting Algorithm”, 2014. The surface reconstruction is done by rolling a ball with a given radius over the point cloud, whenever the ball touches three points a triangle is created.

Radius is computed to be slightly larger than the average distance between points https://cs184team.github.io/cs184-final/writeup.html

Parameters:
  • pcd (PointCloud) – Point cloud object

  • radii (Union[list, float, None], default=0.6) – Radius (unique or a list) of the ball.

  • normal_search_method (str (default="knn")) – Search method for normal computation

  • normal_nb_neighbor (int (defaul=30)) – Number of neighbours used by the KNN algorithm to compute the normals with Open3D.

  • normal_radius (float (default=2.)) – Radius of search for neighbours for normal computation.

Returns:

mesh – Mesh object

Return type:

Mesh

cars_mesh.core.mesh.poisson_reconstruction(pcd: cars_mesh.tools.handlers.PointCloud, depth: int = 8, width: float = 0.8, scale: float = 1.1, linear_fit: bool = False, n_threads: int = -1, normal_search_method: str = 'knn', normal_nb_neighbor: int = 30, normal_radius: float = 2.0) cars_mesh.tools.handlers.Mesh[source]

Kazhdan, Michael M. et al. “Poisson surface reconstruction.” SGP ‘06 (2006).

Function that computes a triangle mesh from a oriented PointCloud pcd. This implements the Screened Poisson Reconstruction proposed in Kazhdan and Hoppe, “Screened Poisson Surface Reconstruction”, 2013. This function uses the original implementation by Kazhdan. See https://github.com/mkazhdan/PoissonRecon

Warning: Since the Poisson reconstruction is an optimisation process, the triangle vertices are not the initial point cloud points. Thus, “pcd” points will be different from “o3d…” and mesh points.

Parameters:
  • pcd (PointCloud) – Point cloud object

  • depth (int (default=8)) – Maximum depth of the tree that will be used for surface reconstruction. Running at depth d corresponds to solving on a grid whose resolution is no larger than 2^d x 2^d x 2^d. Note that since the reconstructor adapts the octree to the sampling density, the specified reconstruction depth is only an upper bound.

  • width (float (default=0.)) – Specifies the target width of the finest level octree cells. This parameter is ignored if depth is specified. It is expressed in the point cloud unit (for example in meters for utm data).

  • scale (float (default=1.1)) – Specifies the ratio between the diameter of the cube used for reconstruction and the diameter of the samples’ bounding cube.

  • linear_fit (bool (default=False)) – If true, the reconstructor will use linear interpolation to estimate the positions of iso-vertices.

  • n_threads (int (default=-1)) – Number of threads used for reconstruction. Set to -1 to automatically determine it.

  • normal_search_method (str (default="knn")) – Search method for normal computation

  • normal_nb_neighbor (int (default=30)) – Number of neighbours used by the KNN algorithm to compute the normals with Open3D.

  • normal_radius (float (default=2.)) – Radius of search for neighbours for normal computation.

Returns:

mesh – Mesh object

Return type:

Mesh

cars_mesh.core.mesh.delaunay_2d_reconstruction(pcd: cars_mesh.tools.handlers.PointCloud, method: str = 'matplotlib') cars_mesh.tools.handlers.Mesh[source]

2.5D Delaunay triangulation: Delaunay triangulation on the planimetric points and add afterwards the z coordinates.

Parameters:
  • pcd (PointCloud) – Point cloud object

  • method (str, default='matplotlib') – Method to use for Delaunay 2.5D triangulation. Available methods are ‘matplotlib’ and ‘scipy’.

Returns:

mesh – Mesh object

Return type:

Mesh