Interval#

class ansys.geometry.core.shapes.parameterization.Interval(start: ansys.geometry.core.typing.Real, end: ansys.geometry.core.typing.Real)#

Interval class that defines a range of values.

Parameters:
startReal

Start value of the interval.

endReal

End value of the interval.

Overview#

is_open

If the interval is open (-inf, inf).

is_closed

If the interval is closed. Neither value is inf or -inf.

is_empty

Check if the current interval is empty.

get_span

Get the quantity contained by the interval.

get_relative_val

Get an evaluation property of the interval, used in BoxUV.

is_negative

Indicate whether the current interval is negative.

self_unite

Get the union of two intervals and update the current interval.

self_intersect

Get the intersection of two intervals and update the current one.

contains_value

Check if the current interval contains the value t.

contains

Check if interval contains value t using default accuracy.

inflate

Enlarge the current interval by the given delta value.

start

Start value of the interval.

end

End value of the interval.

unite

Get the union of two intervals.

intersect

Get the intersection of two intervals.

__eq__

Compare two intervals.

__repr__

Represent the interval as a string.

Import detail#

from ansys.geometry.core.shapes.parameterization import Interval

Property detail#

property Interval.start: ansys.geometry.core.typing.Real#

Start value of the interval.

property Interval.end: ansys.geometry.core.typing.Real#

End value of the interval.

Attribute detail#

Interval.not_empty = True#

Method detail#

Interval.__eq__(other: object)#

Compare two intervals.

Interval.is_open() bool#

If the interval is open (-inf, inf).

Returns:
bool

True if both ends of the interval are negative and positive infinity respectively.

Interval.is_closed() bool#

If the interval is closed. Neither value is inf or -inf.

Returns:
bool

True if neither bound of the interval is infinite.

Interval.is_empty() bool#

Check if the current interval is empty.

Returns:
bool

True when the interval is empty, False otherwise.

Interval.get_span() ansys.geometry.core.typing.Real#

Get the quantity contained by the interval.

The interval must be closed.

Returns:
Real

The difference between the end and start of the interval.

Interval.get_relative_val(t: ansys.geometry.core.typing.Real) ansys.geometry.core.typing.Real#

Get an evaluation property of the interval, used in BoxUV.

Parameters:
tReal

Offset to evaluate the interval at.

Returns:
Real

Actual value according to the offset.

Interval.is_negative(tolerance: ansys.geometry.core.typing.Real) bool#

Indicate whether the current interval is negative.

Parameters:
toleranceReal

Accepted range because the data type of the interval could be in doubles.

Returns:
bool

True if the interval is negative, False otherwise.

static Interval.unite(first: Interval, second: Interval) Interval#

Get the union of two intervals.

Parameters:
firstInterval

First interval.

secondInterval

Second interval.

Returns:
Interval

Union of the two intervals.

Interval.self_unite(other: Interval) None#

Get the union of two intervals and update the current interval.

Parameters:
otherInterval

Interval to unite with.

static Interval.intersect(first: Interval, second: Interval, tolerance: ansys.geometry.core.typing.Real) Interval#

Get the intersection of two intervals.

Parameters:
firstInterval

First interval.

secondInterval

Second interval.

Returns:
Interval

Intersection of the two intervals.

Interval.self_intersect(other: Interval, tolerance: ansys.geometry.core.typing.Real) None#

Get the intersection of two intervals and update the current one.

Parameters:
otherInterval

Interval to intersect with.

toleranceReal

Accepted range of error given that the interval could be in float values.

Interval.contains_value(t: ansys.geometry.core.typing.Real, accuracy: ansys.geometry.core.typing.Real) bool#

Check if the current interval contains the value t.

Parameters:
tReal

Value of interest.

accuracyReal

Accepted range of error given that the interval could be in float values.

Returns:
bool

True if the interval contains the value, False otherwise.

Interval.contains(t: ansys.geometry.core.typing.Real) bool#

Check if interval contains value t using default accuracy.

Parameters:
tReal

Value of interest.

Returns:
bool

True if the interval contains the value, False otherwise.

Interval.inflate(delta: ansys.geometry.core.typing.Real) Interval#

Enlarge the current interval by the given delta value.

Interval.__repr__() str#

Represent the interval as a string.