Volume Estimation Methods

This page describes the Monte Carlo volume estimation methods implemented in Crater.rs. Monte Carlo methods were pioneered by Metropolis and Ulam 7 and have become essential tools for numerical computation in high-dimensional spaces.

Consider a scalar field . We define the region enclosed by the surface as:

Where is the domain of interest.

Monte Carlo Volume Estimation

Monte Carlo volume estimation is a probabilistic method for approximating the volume of complex regions. This method is particularly useful for high-dimensional spaces where traditional grid-based methods would suffer from the curse of dimensionality.

Algorithm Steps:

  1. Generate random points uniformly distributed in domain :
  2. Evaluate the scalar field at these points:
  3. Count the number of points inside the region:
  4. Compute the volume approximation:

To approximate the volume of , we sample points from a uniform distribution, and count the fraction of points that fall inside the region:

Where:

  • is the known volume of the domain
  • is the volume we're estimating
  • is the indicator function that equals 1 if the condition is true, 0 otherwise

Error Analysis

The error in this approximation decreases as , where is the number of points sampled. This makes it suitable for high-dimensional volume estimation where traditional grid-based methods would suffer from the curse of dimensionality.

The standard error of the volume estimate is approximately:

Where is the estimated proportion of the domain occupied by the region.

Alternative Methods

While Monte Carlo methods are the primary approach in Crater.rs, other volume estimation methods include:

  • Grid-based methods: Discretize space into regular grids (suffers from curse of dimensionality)
  • Analytical methods: Exact solutions for simple primitives (limited applicability)
  • Adaptive sampling: Concentrate samples in regions of high curvature or complexity

Monte Carlo methods provide the best balance of generality, accuracy, and performance for complex CSG geometries.