Package org.robwork.sdurw_geometry
Class QuadraticSurface
- java.lang.Object
-
- org.robwork.sdurw_geometry.QuadraticSurface
-
public class QuadraticSurface extends java.lang.Object
A quadratic surface.
The general quadratic surface is described as an implicit surface of the form:
x^T A x + 2 a^T x + u = 0
where
A is a symmetric matrix, A \in \mathbb{R}^{3\times3} , and a \in \mathbb{R}^3, u \in \mathbb{R}
-
-
Constructor Summary
Constructors Constructor Description QuadraticSurface(long cPtr, boolean cMemoryOwn)
QuadraticSurface(SWIGTYPE_p_Eigen__DiagonalMatrixT_double_3_3_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Eigen::Diagonal<Eigen::Matrix3d>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)QuadraticSurface(SWIGTYPE_p_Eigen__DiagonalMatrixT_double_3_3_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Eigen::Diagonal<Eigen::Matrix3d>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)QuadraticSurface(SWIGTYPE_p_Eigen__DiagonalT_Eigen__Matrix3d_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is diagonal.
Some functions, such as #getTriMesh and #extremums, work on a diagonalized surface.
When this constructor is used, some effort is saved as the surface is already known to be
diagonalized.
For a diagonalized surface, all scaled, cloned and translated surfaces will also be
diagonalized surfaces.
QuadraticSurface(SWIGTYPE_p_Eigen__DiagonalT_Eigen__Matrix3d_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is diagonal.
Some functions, such as #getTriMesh and #extremums, work on a diagonalized surface.
When this constructor is used, some effort is saved as the surface is already known to be
diagonalized.
For a diagonalized surface, all scaled, cloned and translated surfaces will also be
diagonalized surfaces.
QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_const_Eigen__Lower_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is non-diagonal.QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_const_Eigen__Lower_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is non-diagonal.QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_const_Eigen__Upper_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is non-diagonal.QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_const_Eigen__Upper_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is non-diagonal.QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_Eigen__Lower_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Lower>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_Eigen__Lower_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Lower>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_Eigen__Upper_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Upper>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_Eigen__Upper_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Upper>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SWIGTYPE_p_Eigen__Vector3d
a()
Get the 3d vector for the first order term in the implicit formulation.SWIGTYPE_p_Eigen__Matrix3d
A()
Get the 3 x 3 symmetric matrix for the second order term in the implicit formulation.void
addTrimmingCondition(ImplicitSurfaceCPtr condition)
Add a trimming condition to this surface.double
call(Vector3D in)
QuadraticSurfacePtr
clone()
void
delete()
double
determinantA()
Get the determinant of the \mathbf{A} matrix.SWIGTYPE_p_std__pairT_rw__geometry__QuadraticSurface_rw__math__Rotation3DT_t_t
diagonalize()
Get a diagonalization of the surface.boolean
diagonalized()
Check if this surface is diagonalized.pair_d_d
extremums(Vector3D direction)
static long
getCPtr(QuadraticSurface obj)
TriMeshPtr
getTriMesh()
TriMeshPtr
getTriMesh(SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_double_t_t border)
SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t
getTrimmingConditions()
Get the trimming conditions for the surface.Vector3D
gradient(Vector3D x)
boolean
insideTrimmingRegion(Vector3D P)
static QuadraticSurfacePtr
makeCircularCone(double a, double b)
static QuadraticSurfacePtr
makeCircularCylinder(double radius)
static QuadraticSurfacePtr
makeCircularCylinder(double radius, boolean outward)
static QuadraticSurfacePtr
makeCircularHyperboloidOneSheet(double a, double b)
static QuadraticSurfacePtr
makeCircularHyperboloidTwoSheets(double a, double b)
static QuadraticSurfacePtr
makeCircularParaboloid(double a)
static QuadraticSurfacePtr
makeEllipsoid(double a, double b, double c)
static QuadraticSurfacePtr
makeEllipticCone(double a, double b, double c)
static QuadraticSurfacePtr
makeEllipticCylinder(double a, double b)
static QuadraticSurfacePtr
makeEllipticHyperboloidOneSheet(double a, double b, double c)
static QuadraticSurfacePtr
makeEllipticHyperboloidTwoSheets(double a, double b, double c)
static QuadraticSurfacePtr
makeEllipticParaboloid(double a, double b)
static QuadraticSurfacePtr
makeHyperbolicCylinder(double a, double b)
static QuadraticSurfacePtr
makeHyperbolicParaboloid(double a, double b)
static QuadraticSurfacePtr
makeParabolicCylinder(double a)
static QuadraticSurfacePtr
makePlane(Vector3D n, double d)
Represent a plane as a QuadraticSurface.
A plane is a particularly simple type of quadratic surface, where
\mathbf{A}=\mathbf{0} .
Even though a plane is not strictly a quadratic surface, is is often convenient to be
able to treat it like a quadratic surface.
static QuadraticSurfacePtr
makeSphere(double radius)
static QuadraticSurfacePtr
makeSpheroid(double a, double b)
Vector3D
normal(Vector3D x)
QuadraticSurfacePtr
normalize()
Normalize the implicit expression such that the largest coefficient becomes one.
For a quadratic surface, a scaling of \mathbf{A}, \mathbf{a} and u with a common
factor, will give the exact same surface.void
reuseTrimmingRegions(ImplicitSurfacePtr surface)
QuadraticSurfacePtr
scale(double factor)
void
setDiscretizationResolution(double resolution)
void
setTrimmingConditions(SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Set the trimming conditions of this surface.boolean
SurfaceEqual(Surface surface, double threshold)
QuadraticSurfacePtr
transform(Transform3D T)
rw::math::Transform3D<double>&) constQuadraticSurfacePtr
transform(Vector3D P)
rw::math::Vector3D<double>&) constdouble
u()
Get the scalar for the zero order term in the implicit formulation.
-
-
-
Constructor Detail
-
QuadraticSurface
public QuadraticSurface(long cPtr, boolean cMemoryOwn)
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__DiagonalT_Eigen__Matrix3d_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is diagonal.
Some functions, such as #getTriMesh and #extremums, work on a diagonalized surface.
When this constructor is used, some effort is saved as the surface is already known to be
diagonalized.
For a diagonalized surface, all scaled, cloned and translated surfaces will also be
diagonalized surfaces.
- Parameters:
A
- [in] the diagonal of the A matrix.a
- [in] the vector a \in \mathbb{R}^3 .u
- [in] the scalar offset u \in \mathbb{R} .conditions
- [in] (optional) list of trimming conditions.
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__DiagonalT_Eigen__Matrix3d_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is diagonal.
Some functions, such as #getTriMesh and #extremums, work on a diagonalized surface.
When this constructor is used, some effort is saved as the surface is already known to be
diagonalized.
For a diagonalized surface, all scaled, cloned and translated surfaces will also be
diagonalized surfaces.
- Parameters:
A
- [in] the diagonal of the A matrix.a
- [in] the vector a \in \mathbb{R}^3 .u
- [in] the scalar offset u \in \mathbb{R} .
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__DiagonalMatrixT_double_3_3_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Eigen::Diagonal<Eigen::Matrix3d>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__DiagonalMatrixT_double_3_3_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Eigen::Diagonal<Eigen::Matrix3d>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_const_Eigen__Upper_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is non-diagonal.- Parameters:
A
- [in] a view of the upper part of the symmetric matrix A \in \mathbb{R}^{3\times3} . Use the Eigen function A.selfadjointView<Eigen::Upper>() to
extract the upper part.a
- [in] the vector a \in \mathbb{R}^3 .u
- [in] the scalar offset u \in \mathbb{R} .conditions
- [in] (optional) list of trimming conditions.
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_const_Eigen__Upper_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is non-diagonal.- Parameters:
A
- [in] a view of the upper part of the symmetric matrix A \in \mathbb{R}^{3\times3} . Use the Eigen function A.selfadjointView<Eigen::Upper>() to
extract the upper part.a
- [in] the vector a \in \mathbb{R}^3 .u
- [in] the scalar offset u \in \mathbb{R} .
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_Eigen__Upper_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Upper>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_Eigen__Upper_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Upper>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_const_Eigen__Lower_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is non-diagonal.- Parameters:
A
- [in] a view of the lower part of the symmetric matrix A \in \mathbb{R}^{3\times3} . Use the Eigen function A.selfadjointView<Eigen::Lower>() to
extract the lower part.a
- [in] the vector a \in \mathbb{R}^3 .u
- [in] the scalar offset u \in \mathbb{R} .conditions
- [in] (optional) list of trimming conditions.
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_const_Eigen__Lower_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Construct new quadratic surface of the implicit form x^T A x + 2 a^T x + u = 0 when A is non-diagonal.- Parameters:
A
- [in] a view of the lower part of the symmetric matrix A \in \mathbb{R}^{3\times3} . Use the Eigen function A.selfadjointView<Eigen::Lower>() to
extract the lower part.a
- [in] the vector a \in \mathbb{R}^3 .u
- [in] the scalar offset u \in \mathbb{R} .
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_Eigen__Lower_t A, SWIGTYPE_p_Eigen__Vector3d a, double u, SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Lower>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)
-
QuadraticSurface
public QuadraticSurface(SWIGTYPE_p_Eigen__SelfAdjointViewT_Eigen__Matrix3d_Eigen__Lower_t A, SWIGTYPE_p_Eigen__Vector3d a, double u)
Eigen::SelfAdjointView<const Eigen::Matrix3d, Eigen::Lower>&, const Eigen::Vector3d&, double, const std::vector<TrimmingRegion>&)
-
-
Method Detail
-
getCPtr
public static long getCPtr(QuadraticSurface obj)
-
delete
public void delete()
-
transform
public QuadraticSurfacePtr transform(Transform3D T)
rw::math::Transform3D<double>&) const
-
transform
public QuadraticSurfacePtr transform(Vector3D P)
rw::math::Vector3D<double>&) const
-
scale
public QuadraticSurfacePtr scale(double factor)
-
clone
public QuadraticSurfacePtr clone()
-
getTriMesh
public TriMeshPtr getTriMesh(SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_double_t_t border)
-
getTriMesh
public TriMeshPtr getTriMesh()
-
setDiscretizationResolution
public void setDiscretizationResolution(double resolution)
-
SurfaceEqual
public boolean SurfaceEqual(Surface surface, double threshold)
-
call
public double call(Vector3D in)
-
insideTrimmingRegion
public boolean insideTrimmingRegion(Vector3D P)
-
reuseTrimmingRegions
public void reuseTrimmingRegions(ImplicitSurfacePtr surface)
-
A
public SWIGTYPE_p_Eigen__Matrix3d A()
Get the 3 x 3 symmetric matrix for the second order term in the implicit formulation.
-
a
public SWIGTYPE_p_Eigen__Vector3d a()
Get the 3d vector for the first order term in the implicit formulation.
-
u
public double u()
Get the scalar for the zero order term in the implicit formulation.
-
determinantA
public double determinantA()
Get the determinant of the \mathbf{A} matrix.- Returns:
- the determinant.
-
normalize
public QuadraticSurfacePtr normalize()
Normalize the implicit expression such that the largest coefficient becomes one.
For a quadratic surface, a scaling of \mathbf{A}, \mathbf{a} and u with a common
factor, will give the exact same surface. This means that the numerical values can get
arbitrarily big or small. This functions scales the expression such that the largest
element becomes 1.
- Returns:
- a mathematically identical surface, where the coefficients of the defining
equation is normalized.
-
getTrimmingConditions
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t getTrimmingConditions()
Get the trimming conditions for the surface.- Returns:
- ImplicitSurface vector specifying the boundary of the surface. If surface is
unbounded, the length of the vector is zero.
-
setTrimmingConditions
public void setTrimmingConditions(SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__ImplicitSurface_const_t_t conditions)
Set the trimming conditions of this surface.- Parameters:
conditions
- [in] a vector of conditions.
-
addTrimmingCondition
public void addTrimmingCondition(ImplicitSurfaceCPtr condition)
Add a trimming condition to this surface.- Parameters:
condition
- [in] the condition to add.
-
diagonalize
public SWIGTYPE_p_std__pairT_rw__geometry__QuadraticSurface_rw__math__Rotation3DT_t_t diagonalize()
Get a diagonalization of the surface.- Returns:
- the diagonalized surface, and the rotation transforming this surface into the
diagonalized surface.
-
diagonalized
public boolean diagonalized()
Check if this surface is diagonalized.- Returns:
- true if A is digaonalized, false otherwise.
-
makeEllipsoid
public static QuadraticSurfacePtr makeEllipsoid(double a, double b, double c)
-
makeSpheroid
public static QuadraticSurfacePtr makeSpheroid(double a, double b)
-
makeSphere
public static QuadraticSurfacePtr makeSphere(double radius)
-
makeEllipticParaboloid
public static QuadraticSurfacePtr makeEllipticParaboloid(double a, double b)
-
makeCircularParaboloid
public static QuadraticSurfacePtr makeCircularParaboloid(double a)
-
makeHyperbolicParaboloid
public static QuadraticSurfacePtr makeHyperbolicParaboloid(double a, double b)
-
makeEllipticHyperboloidOneSheet
public static QuadraticSurfacePtr makeEllipticHyperboloidOneSheet(double a, double b, double c)
-
makeCircularHyperboloidOneSheet
public static QuadraticSurfacePtr makeCircularHyperboloidOneSheet(double a, double b)
-
makeEllipticHyperboloidTwoSheets
public static QuadraticSurfacePtr makeEllipticHyperboloidTwoSheets(double a, double b, double c)
-
makeCircularHyperboloidTwoSheets
public static QuadraticSurfacePtr makeCircularHyperboloidTwoSheets(double a, double b)
-
makeEllipticCone
public static QuadraticSurfacePtr makeEllipticCone(double a, double b, double c)
-
makeCircularCone
public static QuadraticSurfacePtr makeCircularCone(double a, double b)
-
makeEllipticCylinder
public static QuadraticSurfacePtr makeEllipticCylinder(double a, double b)
-
makeCircularCylinder
public static QuadraticSurfacePtr makeCircularCylinder(double radius, boolean outward)
-
makeCircularCylinder
public static QuadraticSurfacePtr makeCircularCylinder(double radius)
-
makeHyperbolicCylinder
public static QuadraticSurfacePtr makeHyperbolicCylinder(double a, double b)
-
makeParabolicCylinder
public static QuadraticSurfacePtr makeParabolicCylinder(double a)
-
makePlane
public static QuadraticSurfacePtr makePlane(Vector3D n, double d)
Represent a plane as a QuadraticSurface.
A plane is a particularly simple type of quadratic surface, where
\mathbf{A}=\mathbf{0} .
Even though a plane is not strictly a quadratic surface, is is often convenient to be
able to treat it like a quadratic surface.
- Parameters:
n
- [in] the normal of the plane.d
- [in] the distance from the plane to the origo.- Returns:
- a QuadraticSurface representing a plane.
-
-