Interface Face3D

All Superinterfaces:
Showable, Transformable
All Known Implementing Classes:
Cylindrical3D, Sector3D, Trap3D, Triangle3D

public interface Face3D extends Transformable, Showable
A 3D triangle represented by three points.

Since any three points in 3D space that are not collinear define a plane, a face can be converted into a plane via {link #plane()}.

The normal of the surface of a face is oriented such that when looking antiparallel to the normal towards the face the face's points wound counterclockwise. Conversely, when looking in a direction parallel to the normal, the points are wound in a clockwise fashion.

The intersection of a line with a face can be calculated using the intersection methods: intersection(...), intersectionRay(...), intersectionSegment(...).

Author:
gavalian
  • Method Details Link icon

    • point Link icon

      Point3D point(int index)
      Returns the point from this Face3D with corresponding index. If an invalid index is given, then null is returned.
      Parameters:
      index - index of the point
      Returns:
      the point at the corresponding index, otherwise null
    • intersection Link icon

      int intersection(Line3D line, List<Point3D> intersections)
      Finds the intersections of the given infinite line with this Face3D. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.
      Parameters:
      line - the infinite line
      intersections - the list to store the intersections in
      Returns:
      the number of intersections found
    • intersectionRay Link icon

      int intersectionRay(Line3D line, List<Point3D> intersections)
      Finds the intersections of the given ray with this Face3D. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.
      Parameters:
      line - the ray
      intersections - the list to store the intersections in
      Returns:
      the number of intersections found
    • intersectionSegment Link icon

      int intersectionSegment(Line3D line, List<Point3D> intersections)
      Finds the intersections of the given line segment with this Face3D. If intersections are found they will be appended to the given list. The return value will indicate the number of intersections that were found.
      Parameters:
      line - the line segment
      intersections - the list to store the intersections in
      Returns:
      the number of intersections found