DistancePredicate
Represents a predicate for distance.
The predicate can effectively be used to check the distance between two coordinates in 3D-space. The distance will firstly be checked separately against the x, y, and z bounds that have been specified. If those checks succeed, then horizontal distance will be taken into consideration, measuring the distance between the two points only along the X and Z axis. Lastly, the absolute distance considering all axis will be checked.
Any of the above checks will be skipped if no value has been specified for any of them. By default, the predicate will not add any restrictions on the distance between two points.
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
Extending AnyDefaultingVanillaWrappingPredicate
DistancePredicate extends AnyDefaultingVanillaWrappingPredicate. That means all methods available in AnyDefaultingVanillaWrappingPredicate are also available in DistancePredicate
Methods
Sets the maximum value the absolute distance should be to max
.
If the absolute distance had already some bounds specified, then the maximum value of the bound will be
overwritten with the value specified in max
. On the other hand, if the absolute distance didn’t have
any bounds set, the maximum is set, leaving the lower end unbounded.
The maximum value is inclusive, meaning that a value that is equal to max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter max | Type float | Description The maximum value the absolute distance should be. |
Sets the maximum value the horizontal distance should be to max
.
If the horizontal distance had already some bounds specified, then the maximum value of the bound will be
overwritten with the value specified in max
. On the other hand, if the horizontal distance didn’t
have any bounds set, the maximum is set, leaving the lower end unbounded.
The maximum value is inclusive, meaning that a value that is equal to max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter max | Type float | Description The maximum value the horizontal distance should be. |
Sets the maximum value the distance along the X axis should be to max
.
If the distance had already some bounds specified, then the maximum value of the bound will be overwritten with
the value specified in max
. On the other hand, if the distance didn’t have any bounds set, the
maximum is set, leaving the lower end unbounded.
The maximum value is inclusive, meaning that a value that is equal to max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter max | Type float | Description The maximum value the distance along the X axis should be. |
Sets the maximum value the distance along the Y axis should be to max
.
If the distance had already some bounds specified, then the maximum value of the bound will be overwritten with
the value specified in max
. On the other hand, if the distance didn’t have any bounds set, the
maximum is set, leaving the lower end unbounded.
The maximum value is inclusive, meaning that a value that is equal to max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter max | Type float | Description The maximum value the distance along the Y axis should be. |
Sets the maximum value the distance along the Z axis should be to max
.
If the distance had already some bounds specified, then the maximum value of the bound will be overwritten with
the value specified in max
. On the other hand, if the distance didn’t have any bounds set, the
maximum is set, leaving the lower end unbounded.
The maximum value is inclusive, meaning that a value that is equal to max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter max | Type float | Description The maximum value the distance along the Z axis should be. |
Sets the minimum value the absolute distance should be to min
.
If the absolute distance had already some bounds specified, then the minimum value of the bound will be
overwritten with the value specified in min
. On the other hand, if the absolute distance didn’t have
any bounds set, the minimum is set, leaving the upper end unbounded.
The minimum value is inclusive, meaning that a value that is equal to min
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the absolute distance should be. |
Sets the minimum value the horizontal distance should be to min
.
If the horizontal distance had already some bounds specified, then the minimum value of the bound will be
overwritten with the value specified in min
. On the other hand, if the horizontal distance didn’t
have any bounds set, the minimum is set, leaving the upper end unbounded.
The minimum value is inclusive, meaning that a value that is equal to min
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the horizontal distance should be. |
Sets the minimum value the distance along the X axis should be to min
.
If the distance had already some bounds specified, then the minimum value of the bound will be overwritten with
the value specified in min
. On the other hand, if the distance didn’t have any bounds set, the
minimum is set, leaving the upper end unbounded.
The minimum value is inclusive, meaning that a value that is equal to min
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the distance along the X axis should be. |
Sets the minimum value the distance along the Y axis should be to min
.
If the distance had already some bounds specified, then the minimum value of the bound will be overwritten with
the value specified in min
. On the other hand, if the distance didn’t have any bounds set, the
minimum is set, leaving the upper end unbounded.
The minimum value is inclusive, meaning that a value that is equal to min
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the distance along the Y axis should be. |
Sets the minimum value the distance along the Z axis should be to min
.
If the distance had already some bounds specified, then the minimum value of the bound will be overwritten with
the value specified in min
. On the other hand, if the distance didn’t have any bounds set, the
minimum is set, leaving the upper end unbounded.
The minimum value is inclusive, meaning that a value that is equal to min
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the distance along the Z axis should be. |
Sets both the minimum and maximum value the absolute distance should be to min
and max
respectively.
If the absolute distance had already some bounds specified, then they will be overwritten with the new values.
Both minimum and maximum values are inclusive, meaning that a value that is equal to either min
or max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the absolute distance should be. |
Parameter max | Type float | Description The maximum value the absolute distance should be. |
Sets both the minimum and maximum value the horizontal distance should be to min
and max
respectively.
If the horizontal distance had already some bounds specified, then they will be overwritten with the new values.
Both minimum and maximum values are inclusive, meaning that a value that is equal to either min
or max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the horizontal distance should be. |
Parameter max | Type float | Description The maximum value the horizontal distance should be. |
Sets both the minimum and maximum value the distance along the X axis should be to min
and max
respectively.
If the distance had already some bounds specified, then they will be overwritten with the new values.
Both minimum and maximum values are inclusive, meaning that a value that is equal to either min
or max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the distance along the X axis should be. |
Parameter max | Type float | Description The maximum value the distance along the X axis should be. |
Sets both the minimum and maximum value the distance along the Y axis should be to min
and max
respectively.
If the distance had already some bounds specified, then they will be overwritten with the new values.
Both minimum and maximum values are inclusive, meaning that a value that is equal to either min
or max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the distance along the Y axis should be. |
Parameter max | Type float | Description The maximum value the distance along the Y axis should be. |
Sets both the minimum and maximum value the distance along the Z axis should be to min
and max
respectively.
If the distance had already some bounds specified, then they will be overwritten with the new values.
Both minimum and maximum values are inclusive, meaning that a value that is equal to either min
or max
will pass the check.
Returns: This predicate for chaining.
Return Type: DistancePredicate
Parameter | Type | Description |
---|---|---|
Parameter min | Type float | Description The minimum value the distance along the Z axis should be. |
Parameter max | Type float | Description The maximum value the distance along the Z axis should be. |