Table of Contents

Method Use

Namespace
GeometryHelper
Assembly
GeometryHelper.dll

Use(Tolerance)

Makes a tolerance the one every overload without a tolerance uses on this thread, until the returned scope is disposed.

public static IDisposable Use(Tolerance tolerance)

Parameters

tolerance Tolerance

The tolerance.

Returns

IDisposable

The scope; disposing it puts back whatever this thread used before.

Remarks

using (Tolerance.Use(new Tolerance(1E-1, 1E-1)))
{
    plate.CollidesWith(bolt);   // within a tenth, on this thread only
}

Scopes nest: each one disposed puts back the one it replaced. The scope belongs to the thread that opened it — work handed to other threads, by Parallel or a task, sees the process-wide setting, which is why the methods that spread their work, such as Clash3.Find, take the tolerance as it stands when they are called and pass it on.