union method

Bounds union(
  1. Bounds other
)

Computes the union of this bounding box and another one.

Implementation

Bounds union(Bounds other) {
  final result = Bounds(length);
  for (var i = 0; i < length; i++) {
    result.min[i] = math.min(min[i], other.min[i]);
    result.max[i] = math.max(max[i], other.max[i]);
  }
  return result;
}