Class PointConverter

Object
PointConverter

public class PointConverter extends Object
Conversion utilities between points with different types and dimensionalities.
Author:
Owen Feehan
  • Method Details

    • intFromDoubleFloor

      public static Point2i intFromDoubleFloor(Point2d point)
      Convert a Point2d to a Point2i using the floor operation.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • intFromDoubleFloor

      public static Point3i intFromDoubleFloor(Point3d point)
      Convert a Point3d to a Point3i using the floor operation.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • intFromDoubleCeil

      public static Point3i intFromDoubleCeil(Point3d point)
      Convert a Point3d to a Point3i using the ceiling operation.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • convertTo3i

      public static Point3i convertTo3i(Point2i point)
      Convert a Point2i to a Point3i using 0 as the value of the Z-axis component.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • convertTo3i

      public static Point3i convertTo3i(Point2i point, int z)
      Convert a Point3i to a Point2i using an explicit value for the Z-axis component.
      Parameters:
      point - the point to convert.
      z - the value for the Z-axis component in the newly created point.
      Returns:
      the newly-created converted point.
    • convertTo3d

      public static Point3d convertTo3d(Point2d point)
      Convert a Point2d to a Point3d using 0 as the value of the Z-axis component.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • doubleFromFloat

      public static Point2d doubleFromFloat(Point2f point)
      Convert a Point2f to a Point2d.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • double3DFromFloat

      public static Point3d double3DFromFloat(Point2f point)
      Convert a Point2f to a Point3d.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • doubleFromFloat

      public static Point3d doubleFromFloat(Point3f point)
      Convert a Point3f to a Point3d.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • doubleFromInt

      public static Point3d doubleFromInt(Point2i point)
      Convert a Point2i to a Point3d using 0 as the value of the Z-axis component.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • doubleFromInt

      public static Point3d doubleFromInt(ReadableTuple3i point)
      Convert a ReadableTuple3i to a Point3d.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • floatFromInt

      public static Point3f floatFromInt(Point2i point)
      Convert a Point2i to a Point3f using 0 as the value of the Z-axis component.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • floatFromDouble

      public static Point2f floatFromDouble(Point2d point)
      Convert a Point2d to a Point2f.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • floatFromDouble

      public static Point3f floatFromDouble(Point3d point)
      Convert a Point3d to a Point3f.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • floatFromInt

      public static Point3f floatFromInt(ReadableTuple3i point)
      Convert a ReadableTuple3i to a Point3f.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • floatFromIntDropZ

      public static Point3f floatFromIntDropZ(ReadableTuple3i point)
      Creates a ReadableTuple3i to a Point3f, preserving X- and Y-components but set setting the Z-component to be 0.
      Parameters:
      point - the point to convert.
      Returns:
      the newly-created converted point.
    • intFromFloat

      public static Point3i intFromFloat(Point3f point, boolean round)
      Convert a Point3f to a Point3i, optionally rounding values.
      Parameters:
      point - the point to convert.
      round - if true, each component's value is rounded to the nearest integer, otherwise the ceiling operation is used.
      Returns:
      the newly-created converted point.
    • intFromDouble

      public static Point3i intFromDouble(Point3d point, boolean round)
      Convert a Point3d to a Point3i, optionally rounding values.
      Parameters:
      point - the point to convert.
      round - if true, each component's value is rounded to the nearest integer, otherwise the ceiling operation is used.
      Returns:
      the newly-created converted point.
    • convert3iTo3f

      public static List<Point3f> convert3iTo3f(List<Point3i> points)
      Convert a list of Point3i to a list of Point3f.
      Parameters:
      points - the list of points to convert.
      Returns:
      a newly-created list of converted points.
    • convert3dTo3f

      public static List<Point3f> convert3dTo3f(List<Point3d> points)
      Convert a list of Point3d to a list of Point3f.
      Parameters:
      points - the list of points to convert.
      Returns:
      a newly-created list of converted points.
    • convert2iTo3f

      public static List<Point3f> convert2iTo3f(List<Point2i> points)
      Convert a list of Point2i to a list of Point3f.
      Parameters:
      points - the list of points to convert.
      Returns:
      a newly-created list of converted points.
    • convert2iTo3d

      public static List<Point3d> convert2iTo3d(List<Point2i> points)
      Convert a list of Point2i to a list of Point3d.
      Parameters:
      points - the list of points to convert.
      Returns:
      a newly-created list of converted points.
    • convert3fTo3d

      public static List<Point3d> convert3fTo3d(List<Point3f> points)
      Convert a list of Point3f to a list of Point3d.
      Parameters:
      points - the list of points to convert.
      Returns:
      a newly-created list of converted points.
    • convert3i

      public static List<Point3i> convert3i(List<Point3f> points, boolean round)
      Convert a list of Point3f to a list of Point3i, optionally rounding values.
      Parameters:
      points - the list of points to convert.
      round - if true, each component's value is rounded to the nearest integer, otherwise the ceiling operation is used.
      Returns:
      a newly-created list of converted points.
    • convert3i

      public static List<Point3i> convert3i(List<Point3d> points)
      Convert a list of Point3d to a list of Point3i.
      Parameters:
      points - the list of points to convert.
      Returns:
      a newly-created list of converted points.