public class CenterOfGravity extends FeatureSingleObject
Calculates the center of gravity of a single object along a specified axis.

This feature computes the center of gravity of an object along the X, Y, or Z axis.

  • Constructor Details

    • CenterOfGravity

      public CenterOfGravity(Axis axis)
      Creates a CenterOfGravity feature for a specific axis.
      Parameters:
      axis - the axis along which to calculate the center of gravity
    • CenterOfGravity

      public CenterOfGravity()
  • Method Details

    • calculate

      Description copied from class: Feature
      Calculates a value for some input.
      Specified by:
      calculate in class Feature<FeatureInputSingleObject>
      Parameters:
      input - the input to the calculation.
      Returns:
      the result of the calculation.
      Throws:
      FeatureCalculationException - if the calculation cannot successfully complete.
    • getAxis

      public String getAxis()
      The axis along which to calculate the center of gravity. Can be "x", "y", or "z".
    • setAxis

      public void setAxis(String axis)
      The axis along which to calculate the center of gravity. Can be "x", "y", or "z".
    • getEmptyValue

      public double getEmptyValue()
      The value to return if the center of gravity calculation results in NaN.
    • setEmptyValue

      public void setEmptyValue(double emptyValue)
      The value to return if the center of gravity calculation results in NaN.