Package georegression.geometry
Class UtilPlane3D_F64
java.lang.Object
georegression.geometry.UtilPlane3D_F64
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PlaneNormal3D_F64
convert
(PlaneGeneral3D_F64 input, @Nullable PlaneNormal3D_F64 output) Converts a plane in general form into normal form.static PlaneGeneral3D_F64
convert
(PlaneNormal3D_F64 input, @Nullable PlaneGeneral3D_F64 output) Converts a plane in normal form into a general equationstatic PlaneNormal3D_F64
convert
(PlaneTangent3D_F64 input, @Nullable PlaneNormal3D_F64 output) Converts a plane in tangent form into a plane in normal formstatic PlaneNormal3D_F64
convert
(Se3_F64 planeToWorld, @Nullable PlaneNormal3D_F64 output) Defines a plane using a 3D rigid body transform.static boolean
equals
(PlaneNormal3D_F64 a, PlaneNormal3D_F64 b, double tol) Returns true if the two plane equations are equal to within tolerance.static double
evaluate
(PlaneGeneral3D_F64 plane, Point3D_F64 point) Applies the plane's definition to test to see if a point is one the planestatic double
evaluate
(PlaneNormal3D_F64 plane, Point3D_F64 point) Applies the plane's definition to test to see if a point is one the planestatic void
Converts the plane into Hessian normal form.static Se3_F64
planeToWorld
(PlaneGeneral3D_F64 plane, @Nullable Se3_F64 planeToWorld) Creates a transform from the plane's reference frame into world's reference frame.static Se3_F64
planeToWorld
(PlaneGeneral3D_F64 plane, Vector3D_F64 axisX, Vector3D_F64 axisY, Vector3D_F64 axisZ, @Nullable Se3_F64 planeToWorld) static void
point2Dto3D
(Point3D_F64 origin, Vector3D_F64 axisX, Vector3D_F64 axisY, Point2D_F64 A, Point3D_F64 output) Given a point on the plane's 2D coordinate system, convert it back into a 3D point.static void
point3Dto2D
(Point3D_F64 pointOnPlane, Vector3D_F64 axisX, Vector3D_F64 axisY, Point3D_F64 A, Point2D_F64 output) Projects the point onto the 2D coordinate system specified by the provided x-axis.static void
selectAxis2D
(Vector3D_F64 normal, Vector3D_F64 axisX, Vector3D_F64 axisY) There are an infinite number of possible 2D coordinate axises for a plane.
-
Constructor Details
-
UtilPlane3D_F64
public UtilPlane3D_F64()
-
-
Method Details
-
convert
public static PlaneGeneral3D_F64 convert(PlaneNormal3D_F64 input, @Nullable @Nullable PlaneGeneral3D_F64 output) Converts a plane in normal form into a general equation- Parameters:
input
- Plane in normal form.output
- (Optional) Storage for output plane in general form. If null a new instance will be declared.- Returns:
- The convert plane in general form.
-
convert
public static PlaneNormal3D_F64 convert(PlaneGeneral3D_F64 input, @Nullable @Nullable PlaneNormal3D_F64 output) Converts a plane in general form into normal form. The point on the plane in normal form will be the closest point to the origin.
NOTE: The normal is not normalized.
- Parameters:
input
- Plane in general form.output
- (Optional) Storage for output plane in normal form. If null a new instance will be declared.- Returns:
- The plane in normal form.
-
convert
public static PlaneNormal3D_F64 convert(PlaneTangent3D_F64 input, @Nullable @Nullable PlaneNormal3D_F64 output) Converts a plane in tangent form into a plane in normal form- Parameters:
input
- Plane in tangent form.output
- (Optional) Storage for output plane in normal form. If null a new instance will be declared.- Returns:
- The convert plane in general form.
-
convert
public static PlaneNormal3D_F64 convert(Se3_F64 planeToWorld, @Nullable @Nullable PlaneNormal3D_F64 output) Defines a plane using a 3D rigid body transform. +z is the 3rd column the rotation matrix. The plane's point is the translation. The plane reference frame is the x-y plane.- Parameters:
planeToWorld
- (Input) SE3 transform from the plane into the "world" frame.output
- (Output) Plane- Returns:
- Plane
-
hessianNormalForm
Converts the plane into Hessian normal form. This is done by dividing each coefficient by the Euclidean norm of (A,B,C).- Parameters:
plane
- The input plane. Modified.
-
evaluate
Applies the plane's definition to test to see if a point is one the plane- Parameters:
plane
- Equation of the planepoint
- Equation of the point.- Returns:
- zero if the point is one the plane.
-
evaluate
Applies the plane's definition to test to see if a point is one the plane- Parameters:
plane
- Equation of the planepoint
- Equation of the point.- Returns:
- zero if the point is one the plane.
-
selectAxis2D
There are an infinite number of possible 2D coordinate axises for a plane. This selects one which will be right handed usingUtilVector3D_F64.perpendicularCanonical(Vector3D_F64, Vector3D_F64)
and a cross product.- Parameters:
normal
- (Input) The plane's normal or z-axisaxisX
- (Output) Selected x-axis. NormalizedaxisY
- (output) Selected y-axis. Normalized
-
point3Dto2D
public static void point3Dto2D(Point3D_F64 pointOnPlane, Vector3D_F64 axisX, Vector3D_F64 axisY, Point3D_F64 A, Point2D_F64 output) Projects the point onto the 2D coordinate system specified by the provided x-axis. If the chose of x-axis is arbitraryUtilVector3D_F64.perpendicularCanonical(Vector3D_F64, Vector3D_F64)
is recommended as a way to select- Parameters:
pointOnPlane
- (Input) A point on the plane.axisX
- (Input) Vector which defines the x-axisaxisY
- (Input) Vector which defines the y-axisA
- (Input) 3D vector you wish to project. MUST BE ON THE PlANEoutput
- (Output) 2D projected vector.
-
point2Dto3D
public static void point2Dto3D(Point3D_F64 origin, Vector3D_F64 axisX, Vector3D_F64 axisY, Point2D_F64 A, Point3D_F64 output) Given a point on the plane's 2D coordinate system, convert it back into a 3D point.- Parameters:
origin
- (Input) Point that defines the 2D coordinate system's origin.axisX
- (Input) axis which defines the 2D x-axisaxisY
- (Input) axis which defines the 2D y-axisA
- (Input) 2D point that is to be convertedoutput
- (Output) 3D point
-
equals
Returns true if the two plane equations are equal to within tolerance. Planes are converted into generalized format and normalized to take in account scale ambiguity.- Parameters:
a
- planeb
- planetol
- Tolerance for equality- Returns:
- true if equals and false if not
-
planeToWorld
public static Se3_F64 planeToWorld(PlaneGeneral3D_F64 plane, @Nullable @Nullable Se3_F64 planeToWorld) Creates a transform from the plane's reference frame into world's reference frame. The z-axis is set to the plane's normal and the x-axis and y-axis are arbitrarily choosen. Points which lie along the plane will lie along its x-y plane.- Parameters:
plane
- PlaneplaneToWorld
- (Optional) storage for the planeToWorld transform. Can be null.- Returns:
- Transform from planeToWorld
-
planeToWorld
public static Se3_F64 planeToWorld(PlaneGeneral3D_F64 plane, Vector3D_F64 axisX, Vector3D_F64 axisY, Vector3D_F64 axisZ, @Nullable @Nullable Se3_F64 planeToWorld)
-