Class Surface3d

java.lang.Object
com.flarerobotics.lib.region.Surface3d

public class Surface3d extends Object
Represents a finite quadrilateral surface in 3D defined by four corner points.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Surface3d(edu.wpi.first.math.geometry.Translation3d p1, edu.wpi.first.math.geometry.Translation3d p2, edu.wpi.first.math.geometry.Translation3d p3, edu.wpi.first.math.geometry.Translation3d p4)
    Constructs a new Surface3d.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isColliding(edu.wpi.first.math.geometry.Pose3d testPose)
    Tests if a single pose lies within the finite quad surface (including edges).
    boolean
    isColliding(edu.wpi.first.math.geometry.Pose3d lastPose, edu.wpi.first.math.geometry.Pose3d currentPose)
    Tests if the linear motion from lastPose to currentPose intersects the finite quad.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Surface3d

      public Surface3d(edu.wpi.first.math.geometry.Translation3d p1, edu.wpi.first.math.geometry.Translation3d p2, edu.wpi.first.math.geometry.Translation3d p3, edu.wpi.first.math.geometry.Translation3d p4)
      Constructs a new Surface3d.

      Validates that the first three points are non-collinear and that the fourth point is coplanar. The provided points must be in order.

      Parameters:
      p1 - The first corner.
      p2 - The second corner.
      p3 - The third corner.
      p4 - The fourth corner.
      Throws:
      IllegalArgumentException - If points are invalid or non-coplanar
  • Method Details

    • isColliding

      public boolean isColliding(edu.wpi.first.math.geometry.Pose3d testPose)
      Tests if a single pose lies within the finite quad surface (including edges).
      Parameters:
      testPose - The pose to test.
      Returns:
      true if the point is on the plane.
    • isColliding

      public boolean isColliding(edu.wpi.first.math.geometry.Pose3d lastPose, edu.wpi.first.math.geometry.Pose3d currentPose)
      Tests if the linear motion from lastPose to currentPose intersects the finite quad.
      Parameters:
      lastPose - The starting pose.
      currentPose - The ending pose.
      Returns:
      true if the segment crosses or touches the quad.