Skip to content
ForCADDocumentation

knot_tolerance Function

public pure function knot_tolerance(knot, first, last) result(tol)

Compute a scale- and span-aware tolerance for knot comparisons.

The tolerance is based on endpoint spacing and interval width, then capped at one eighth of the smallest positive inspected span so that two distinct spans cannot collapse under the comparison.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), contiguous :: knot(:)

Knot vector; an empty vector returns zero.

integer, intent(in) :: first

First inspected one-based index, clamped to the array.

integer, intent(in) :: last

Last inspected one-based index; reversed bounds are accepted.

Return Value real(kind=rk)