clampDirectedTo01 Method

  • On input, (f0,f1) is a (directed) segment.
  • On output, it is restricted to (0,1) while maintaining direction
  • If the clip leaves nothing, leave this segment alone and return false.
  • If the clip leaves something, update this segment and return true.

clampDirectedTo01(clamp0: booleantrue, clamp1: booleantrue, allowSingleton: booleanfalse): boolean

@returns whether this interval was clipped

Parameter Type Description
clamp0 boolean whether to clamp the smaller number to 0. Default value is true.
clamp1 boolean whether to clamp the larger number to 1. Default value is true.
allowSingleton boolean whether to return true for an interval clipped to a single number (x0 === x1). Default value is false.

Returns - boolean

whether this interval was clipped

Defined in

Last Updated: 21 November, 2024