Signed Distance Fields 1.0
SphereCarving Class Reference

Implementation of the Sphere Carving algorithm. More...

#include <spherecarving.h>

Public Member Functions

 SphereCarving (SDFTree *)
 Initialize the sphere carving process.
bool Iterate ()
 Makes one iteration of Sphere Carving.
void CompleteCarving (double epsilon=0.1, int max_iter=20, int max_spheres=2000)
 Loops Sphere Carving iterations until one of the stopping criteria is met.
Mesh GetConvexHull () const
 Return the convex hull mesh of the point set, which is the minimal convex bounding volume we can produce.
Mesh GetDebugSpheres () const
 Return the mesh of the initial 12 spheres, to check if they're covering space.
std::vector< PlaneGetBoundPlanes (int max_planes=25) const
 Returns a set of plane/half-spaces, which intersection is bounding.

Protected Member Functions

bool ValidIntersectionCheck (const Vector &p, const Vec3I &spheres_id) const
 Checks wether an intersection point is valid or not (ie. on the sphere set surface, and not inside).
void SphereSetIntersections ()
 Fill point_set with every valid intersections of the sphere_set.
void NewSpheresIntersections ()
 Updates point_set with every new valid intersections added by the new spheres. Also removes old intersections canceled by the new spheres.

Detailed Description

Implementation of the Sphere Carving algorithm.

Sphere Carving: Bounding Volumes for Signed Distance Fields. H. Schott, T. Thonat, T. Lambert, E. Gu�rin, E. Galin, A. Paris. ACM Transactions on Graphics, 44(4), 2025.

Constructor & Destructor Documentation

◆ SphereCarving()

SphereCarving::SphereCarving ( SDFTree * shape)

Initialize the sphere carving process.

Parameters
shapeSigned distance field construction tree.

Member Function Documentation

◆ GetBoundPlanes()

std::vector< Plane > SphereCarving::GetBoundPlanes ( int max_planes = 25) const

Returns a set of plane/half-spaces, which intersection is bounding.

Parameters
max_planesMaximum number of planes that can be used. No limit if 0.

◆ Iterate()

bool SphereCarving::Iterate ( )

Makes one iteration of Sphere Carving.

Computes new spheres and call NewSpheresIntersections to updates the point_set. Return false if no new spheres were found.

◆ ValidIntersectionCheck()

bool SphereCarving::ValidIntersectionCheck ( const Vector & p,
const Vec3I & spheres_id ) const
protected

Checks wether an intersection point is valid or not (ie. on the sphere set surface, and not inside).

Parameters
pIntersection point to check.
spheres_idTriplet of sphere ids that produced the considered intersection point.