Class PointCloud_3


public class PointCloud_3 extends PointCloud<Point_3>
Class representing a collection of points (in 3D)
Version:
jan 2014
Author:
Luca Castelli Aleardi, Ecole Polytechnique (INF562)
  • Constructor Details

    • PointCloud_3

      public PointCloud_3()
      Create a new empty point cloud
    • PointCloud_3

      public PointCloud_3(int n)
      Create a point cloud of size n
      Parameters:
      n - number of points
    • PointCloud_3

      public PointCloud_3(ArrayList<Point_3> points)
      Create a new point cloud (a copy) from a collection of points
      Parameters:
      points - list of points (stored as an ArrayList)
  • Method Details

    • boundingBox

      public Point_3[] boundingBox()
      Compute the bounding box (enclosing all points)
      Specified by:
      boundingBox in class PointCloud<Point_3>
      Returns:
      a Point_3[] array containing the min and max bounds
    • max

      public Point_3 max(int d)
      Return the point with greatest coordinate value (in direction d)
      Specified by:
      max in class PointCloud<Point_3>
      Parameters:
      d - dimension (0, 1 or 2, corresponding to x or y axis)
      Returns:
      Point_2 the greatest point (with greatest d-coordinate)
    • min

      public Point_3 min(int d)
      Return the point with smallest coordinate value (in direction d)
      Specified by:
      min in class PointCloud<Point_3>
      Parameters:
      d - dimension (0,1 or 2, corresponding to x or y axis)
      Returns:
      Point_2 the smallest point (with smallest d-coordinate)
    • pointsInSphere

      public static PointCloud_3 pointsInSphere(int n)
      Generate points inside a sphere at random
      Parameters:
      n - the number of points