8#include "affine_matrix_3d.hpp"
35 Plane3D(
double nx,
double ny,
double nz,
double distanceToOrigin) noexcept
36 : normal_{nx, ny, nz}, distanceToOrigin_{distanceToOrigin}
47 : normal_{normal}, distanceToOrigin_{distanceToOrigin}
97 auto normal = normal_ / normal_.
Length();
98 return std::abs(normal.X() * x + normal.Y() * y + normal.Z() * z - distanceToOrigin_);
119 return Internal::DoResCallValueOut<AffineMatrix3D>([&](
AffineMatrix3D& value)
121 auto valueData =
reinterpret_cast<CExports::CVC3DTransformation*
>(&value);
123 return CVB_CALL_CAPI(CVC3DAlignToXYPlane(*
reinterpret_cast<const CExports::CVC3DPlane*
>(
this),
131 double distanceToOrigin_ = 0.0;
Affine transformation for 3D containing a transformation matrix and a translation vector.
Definition: affine_matrix_3d.hpp:147
A plane in 3D space in Hessian normal form.
Definition: plane_3d.hpp:19
Plane3D(Point3D< double > normal, double distanceToOrigin) noexcept
Creates a new Plane3D object.
Definition: plane_3d.hpp:46
double DistanceToPoint(const Point3D< double > &pt) const noexcept
Calculates the distance to the point pt.
Definition: plane_3d.hpp:85
double DistanceToPoint(double x, double y, double z) const noexcept
Calculates the distance to the point pt.
Definition: plane_3d.hpp:95
double DistanceToOrigin() const noexcept
Gets the distance to the origin in point units.
Definition: plane_3d.hpp:70
Plane3D() noexcept=default
Creates a default plane at (0, 0, 0, 0).
void SetDistanceToOrigin(double distanceToOrigin) noexcept
Sets the distance to the origin in point units.
Definition: plane_3d.hpp:77
Point3D< double > Normal() const noexcept
Gets the normal vector of the plane.
Definition: plane_3d.hpp:56
AffineMatrix3D AlignToXYPlane()
Calculates a rigid body transformation that maps the plane into the xy plane of the global coordinate...
Definition: plane_3d.hpp:117
void SetNormal(Point3D< double > normal) noexcept
Sets the normal vector of the plane.
Definition: plane_3d.hpp:63
T Length() const noexcept
Gets the length of this point.
Definition: point_3d.hpp:140
Root namespace for the Image Manager interface.
Definition: c_barcode.h:15