Table of Contents

Method TryGetVolume

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

TryGetVolume(out double)

Gets the volume of the material where it can be trusted, using the default tolerance.

public bool TryGetVolume(out double volume)

Parameters

volume double

Returns

bool

TryGetVolume(out double, Tolerance)

Gets the volume of the material where it can be trusted: every opening cut out, and the material closed.

public bool TryGetVolume(out double volume, Tolerance tolerance)

Parameters

volume double

The volume GetVolume(Tolerance) gives; nought when the method returns false.

tolerance Tolerance

The tolerance the openings are cut out and the faces judged closed within.

Returns

bool

true when every opening was cut out and the material closes, or the openings take all of it; false when an opening could not be cut out, or the faces do not close and so enclose no volume to measure.

Remarks

The area and the centroid are of the same material, so the answer holds for them too. A body without openings costs one check that its faces close, and nothing is cut.

The material is judged closed with the ends of its edges matched first, each to the first corner seen within the tolerance, as the booleans judge the bodies they work on, and not as IsClosed(Tolerance) reads it, which the two can part on either way; this answer, not IsClosed, says whether the volume can be trusted. A cube of 100 whose top stands 0.0015 over its sides, a speck of a face at each corner of its top half way up given before the cube's faces, is trusted, 1 000 005, where IsClosed reads it open; the union of two turned boxes made within a thousandth is refused at a tolerance of nought, where IsClosed reads it closed to the rounding of its coordinates. A cube cracked across three faces 0.001 wide less a skewed box, at a tolerance of a thousandth, read open by IsClosed by a hair of rounding, keeps its volume, 860.046 where the cube less the box holds 860.047.

Below the rounding of the coordinates, where the openings are cut within it, a body whose own faces do not close within it is not trusted, whatever its cut gives: a cube 10 across with cracks 0.0001 wide in its faces, less a tetrahedron, cut within the rounding at a tolerance of nought, is a closed sliver of 0.000042 cubic millimetres, where the cube less the tetrahedron holds 888.41.