Path::defaultToleranceForTesting - what exactly is this?

could anyone, please, describe what exactly does:
const float Path::defaultToleranceForTesting

const float Path::defaultToleranceForMeasurement

And what is the value it returns.

In the documentation there is nothing about that, or I just can’t find anything. It looks like that

They don’t return anything because they’re static member variables - not methods… Their values are 1.0 for testing and 0.6 for measurement:

1 Like

Ok I can see it now. Thanks.

When you look at: those values are used as a default value for the tolerance arguments in methods like
contains(), intersectsLine() (both testing) and e.g. getLength() (measuring).

When measuring the length, the path first is split into linear segments, whose lengths are added. Depending on the tolerance the linear segments are smaller or longer. Longer ones (high tolerance) will of course not perfectly represent the length of that path. See the figure in the “General Approach” section of

Don’t be afraid of searching the JUCE codebase (modules directory) for variables, methods etc and looking at the code. They did a very good job in keeping the code readable :slight_smile:

1 Like

Thanks, yes I always search direct Juce code if I don’t understand something. But due to my low programming skills very often oryginal code is hard to understand for me.
So thanks for explanation.