getCriticalPoint method

Vector3 getCriticalPoint(
  1. Vector3 direction
)

Implementation

Vector3 getCriticalPoint(Vector3 direction) {
  var allPoints = getPointsDefiningBoundary();

  if (allPoints.isEmpty) {
    return ORIGIN;
  }

  var x = getExtremumAlongDim(
      points: allPoints, dim: 0, key: direction.x.toInt());
  var y = getExtremumAlongDim(
      points: allPoints, dim: 1, key: direction.y.toInt());
  var z = getExtremumAlongDim(
      points: allPoints, dim: 2, key: direction.z.toInt());

  return Vector3(x, y, z);
}