Package georegression.geometry
Class UtilPlane3D_F32
java.lang.Object
georegression.geometry.UtilPlane3D_F32
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic PlaneNormal3D_F32
convert
(PlaneGeneral3D_F32 input, @Nullable PlaneNormal3D_F32 output) Converts a plane in general form into normal form.static PlaneGeneral3D_F32
convert
(PlaneNormal3D_F32 input, @Nullable PlaneGeneral3D_F32 output) Converts a plane in normal form into a general equationstatic PlaneNormal3D_F32
convert
(PlaneTangent3D_F32 input, @Nullable PlaneNormal3D_F32 output) Converts a plane in tangent form into a plane in normal formstatic PlaneNormal3D_F32
convert
(Se3_F32 planeToWorld, @Nullable PlaneNormal3D_F32 output) Defines a plane using a 3D rigid body transform.static boolean
equals
(PlaneNormal3D_F32 a, PlaneNormal3D_F32 b, float tol) Returns true if the two plane equations are equal to within tolerance.static float
evaluate
(PlaneGeneral3D_F32 plane, Point3D_F32 point) Applies the plane's definition to test to see if a point is one the planestatic float
evaluate
(PlaneNormal3D_F32 plane, Point3D_F32 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_F32
planeToWorld
(PlaneGeneral3D_F32 plane, @Nullable Se3_F32 planeToWorld) Creates a transform from the plane's reference frame into world's reference frame.static Se3_F32
planeToWorld
(PlaneGeneral3D_F32 plane, Vector3D_F32 axisX, Vector3D_F32 axisY, Vector3D_F32 axisZ, @Nullable Se3_F32 planeToWorld) static void
point2Dto3D
(Point3D_F32 origin, Vector3D_F32 axisX, Vector3D_F32 axisY, Point2D_F32 A, Point3D_F32 output) Given a point on the plane's 2D coordinate system, convert it back into a 3D point.static void
point3Dto2D
(Point3D_F32 pointOnPlane, Vector3D_F32 axisX, Vector3D_F32 axisY, Point3D_F32 A, Point2D_F32 output) Projects the point onto the 2D coordinate system specified by the provided x-axis.static void
selectAxis2D
(Vector3D_F32 normal, Vector3D_F32 axisX, Vector3D_F32 axisY) There are an infinite number of possible 2D coordinate axises for a plane.
-
Constructor Details
-
UtilPlane3D_F32
public UtilPlane3D_F32()
-
-
Method Details
-
convert
public static PlaneGeneral3D_F32 convert(PlaneNormal3D_F32 input, @Nullable @Nullable PlaneGeneral3D_F32 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_F32 convert(PlaneGeneral3D_F32 input, @Nullable @Nullable PlaneNormal3D_F32 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_F32 convert(PlaneTangent3D_F32 input, @Nullable @Nullable PlaneNormal3D_F32 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_F32 convert(Se3_F32 planeToWorld, @Nullable @Nullable PlaneNormal3D_F32 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_F32.perpendicularCanonical(Vector3D_F32, Vector3D_F32)
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_F32 pointOnPlane, Vector3D_F32 axisX, Vector3D_F32 axisY, Point3D_F32 A, Point2D_F32 output) Projects the point onto the 2D coordinate system specified by the provided x-axis. If the chose of x-axis is arbitraryUtilVector3D_F32.perpendicularCanonical(Vector3D_F32, Vector3D_F32)
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_F32 origin, Vector3D_F32 axisX, Vector3D_F32 axisY, Point2D_F32 A, Point3D_F32 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_F32 planeToWorld(PlaneGeneral3D_F32 plane, @Nullable @Nullable Se3_F32 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_F32 planeToWorld(PlaneGeneral3D_F32 plane, Vector3D_F32 axisX, Vector3D_F32 axisY, Vector3D_F32 axisZ, @Nullable @Nullable Se3_F32 planeToWorld)
-