Class ExtractMidpoint

Object
ExtractMidpoint

public class ExtractMidpoint extends Object
Extracts a Point3i representing the mid-point of an ObjectWithProperties.

The midpoint is taken, in order of preference:

  • From a property with key "midpointInt", if it exists.
  • From the center-of-gravity of the ObjectMask.
Author:
Owen Feehan
  • Method Details

    • midpoint

      public static Point3i midpoint(ObjectWithProperties object, boolean suppressZ)
      Calculates the midpoint of object.
      Parameters:
      object - the object to calculate a midpoint for, possibly containing a property with key "midpointInt".
      suppressZ - when true, the z-dimension is ignored, and the midpoint will always have z==0. when false, it is included in the calculation.
      Returns:
      the midpoint.