Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 220.127.116.11 (18.104.22.16890)
- Type: System..::..Single
The desired relative error for approximations (in the range [0, 1]). For example, use the value 0.01 to get a maximal error of about 1%.
- Type: System..::..Int32
The iteration limit. Must be greater than or equal to 0. For most cases a small value like 4 is appropriate.
Return ValueThe volume of this shape.
If the volume can be computed with an exact formula, then the exact volume is returned. But for some shapes an approximate volume is computed. For approximated volumes relativeError defines the desired relative error and if the volume is computed by an iterative algorithm, no more than iterationLimit iterations are performed. If the iterationLimit is reached first, the returned mesh will have a higher relative error.
Currently, relativeError is proportional to the error of the approximated volume. But it is not guaranteed that the relative error between the approximated volume and the exact volume is less than relativeError. It is only guaranteed that a smaller relativeError value leads to a more accurate approximation.
Remember: To compute the volume of a scaled shape, you can compute the volume of the unscaled shape and multiply the result with the scaling factors:
volumescaled = volumeunscaled * scaleX * scaleY * scaleZ
Notes to Inheritors: The base implementation of this method computes the volume from the mesh of the shape (see GetMesh(Single, Int32)). And if iterationLimit is 0, the volume of the axis-aligned bounding box (see GetAabb(Pose)) is used. Derived classes should override this method to compute a more accurate volume or to provide a faster implementation.