IntervalExtensionMethods

public static class IntervalExtensionMethods
Extension methods for Rhino.Geometry.Interval

Methods

public static Interval[] Cut(this Interval interval, Interval[] splitters)
Cut holes into an interval.
interval (Interval)Interval to split.
splitters (Interval[])Intervals to remove from main interval.
Array of split intervals.

DateTimeToSeconds

#
public static double DateTimeToSeconds(DateTime time, out string message)
Convert a DateTime instance into an double used in Interval timespans.
time (DateTime)DateTime value to convert.
message (out string)A failure message in case the time falls outside the scope.
Number of seconds since midnight, January 1st, 2000
public static Interval Scale(this Interval interval, double origin, double factor)
Scale an interval.
interval (Interval)Interval to scale.
origin (double)Scaling origin.
factor (double)Scaling factor.
Scaled interval.

SecondsToDateTime

#
public static DateTime SecondsToDateTime(double seconds, out string message)
Convert a second count used in Interval timespans into a DateTime value.
seconds (double)DateTime value to convert.
message (out string)A failure message in case the time falls outside the scope.
DateTime associated with the given second count.

Shrink

#Example
public static Interval Shrink(this Interval interval, double amount)
Shrink an interval by moving the extremes inwards.
interval (Interval)Interval to shrink.
amount (double)Amount to shrink by. If the amount falls short of the double-precision accuracy, the domain will be shrunk the smallest possible amount instead.
Shrunk domain.
public static Interval[] Split(this Interval interval, double[] parameters)
Split an interval into multiple intervals at given parameters.
interval (Interval)Interval to split.
parameters (double[])Parameters to split at.
Array of split intervals.