|
BRL-CAD
|
#include <func.h>
Data Fields | |
| size_t | n_rays |
| double | stability_mm |
| double | time_ms |
Stopping-criteria parameters for rt_crofton_shoot() and rt_crofton_sample().
All fields default to zero. Behaviour when all three are zero (or the pointer is NULL) is identical to the historical default: fire 2 000 rays and stop when two successive 1 %-threshold iterations agree.
When one or more non-zero fields are provided, sampling continues until the FIRST criterion that is met:
n_rays > 0 Stop once this many rays have been fired in total.
stability_mm > 0 Stop once the estimate is "stable" to within the given linear dimension. Stability is measured as the change in equivalent-sphere radius between successive iterations: r_sa = sqrt(SA / (4*pi)) for surface area and r_v = cbrt(3*V / (4*pi)) for volume. Sampling stops when both |Δr_sa| and |Δr_v| (for whichever outputs are requested) remain < stability_mm for consecutive stable windows.
time_ms > 0 Stop once this many wall-clock milliseconds have elapsed, returning the best estimate accumulated so far.
When multiple fields are non-zero the first criterion to fire wins, giving callers fine control over the accuracy / speed trade-off.
| size_t n_rays |
| double stability_mm |