BallPivoting#

class BallPivoting(mesh, repair=True)[source]#

Bases: TriangularMesh

Attributes

Methods

BallPivoting.fit(positions[, radii, ...])

Ball pivoting surface reconstruction.

classmethod fit(positions, radii=(5.0,), max_hole_size=-1, target_edge_length=-1, smoothness=0.0, curvature_weight=0.0, pressure=0.0, n_smoothing=5, k_neighbors=15, boundary_ring=0, normals=None, **kwargs)[source]#

Ball pivoting surface reconstruction.

Parameters:
positionsnp.ndarray

Point coordinates with shape (n, 3).

radiituple of float

Ball radii for surface reconstruction. Use commas to specify multiple radii, e.g. (50, 30.5, 10).

max_hole_sizefloat

Maximum surface area of holes to triangulate. -1 fills all holes, 0 skips hole filling.

target_edge_lengthfloat

Target edge length for remeshing after hole filling. -1 uses the average edge length of the mesh.

smoothnessfloat

Controls the balance between position anchoring and curvature minimization. 0 = vertices stay in place, 1 = full curvature minimization.

curvature_weightfloat

Weight for triharmonic (higher-order smoothing) energy.

pressurefloat

Internal mesh pressure along vertex normals.

n_smoothingint

Taubin smoothing iterations applied after mesh creation.

k_neighborsint

Number of neighbors for normal estimation. Decrease for small point clouds. Ignored when normals is given.

boundary_ringint

Number of vertex rings around inferred hole vertices to include in fairing.

normalsnp.ndarray, optional

Precomputed per-point normals with shape (n, 3). When provided, internal normal estimation is skipped.

Returns:
BallPivoting

Reconstructed surface mesh.