mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-04 11:05:56 +00:00
kernel: measure integrates to SMLib's finest accuracy, 1e-8, not 1e-4
measure asked SMLib for a relative accuracy of 1e-4, after SmApiBrepComputeMassProperties' documented clamp to [1e-4, 1e-1]. smlib_brep_mass_properties does not go through that call: it calls the kernel's integration directly because the clamp "leaves curved faces off by 1e-5 to 1e-3", and takes [1e-8, 1e-1] (solidcraft_smlib::MEASURE_ACCURACY). Asking 1e-4 threw that away: a swept cylinder's centre came out 5e-7 off its exact place, and a 0.0177 mm³ crescent (a pin 0.59 µm off its hole) 0.27% off the lens of two circles. Measured at 1e-8, the sweep centres are exact to 1e-7 and the crescents match the closed form to 1e-6; the engine-commands batch runs in the same 20 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -43,10 +43,11 @@ pub struct MassMeasure {
|
||||
pub notes: Vec<String>,
|
||||
}
|
||||
|
||||
/// The relative accuracy SMLib integrates at: the finest of SmApiBrepComputeMassProperties'
|
||||
/// documented range ("clamped to [1e-4, 1e-1]", SmApiQueries.h). Its cost is "governed by
|
||||
/// dRelativeAccuracy".
|
||||
const ACCURACY: f64 = 1e-4;
|
||||
/// The relative accuracy SMLib integrates at: the finest the C API takes
|
||||
/// ([`solidcraft_smlib::MEASURE_ACCURACY`], 1e-8). `smlib_brep_mass_properties` calls the
|
||||
/// kernel's integration directly because SmApiBrepComputeMassProperties clamps to [1e-4, 1e-1],
|
||||
/// which leaves curved faces off by 1e-5 to 1e-3; asking 1e-4 here threw that away.
|
||||
const ACCURACY: f64 = solidcraft_smlib::MEASURE_ACCURACY;
|
||||
|
||||
/// Measure a body. A B-rep body's volume, area and centre are SMLib's, integrated on its exact
|
||||
/// surfaces over its material regions (a sheet's: its faces' area and their centre, volume 0),
|
||||
|
||||
Reference in New Issue
Block a user