Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
model::PlanesIntersection< dim > Struct Template Reference

#include <PlanesIntersection.h>

Collaboration diagram for model::PlanesIntersection< dim >:

Public Types

typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixDimDynamic
typedef Eigen::Matrix< double, dim, 1 > VectorDim
typedef Eigen::JacobiSVD< MatrixDimDynamic > SVDsolverType

Public Member Functions

 PlanesIntersection (const MatrixDimDynamic &N, const MatrixDimDynamic &P, const double &tol=FLT_EPSILON)
std::pair< bool, VectorDim > snap (const VectorDim &x) const

Public Attributes

const std::pair< MatrixDimDynamic, MatrixDimDynamic > NP
const SVDsolverType svd

Detailed Description

template<int dim>
struct model::PlanesIntersection< dim >

Definition at line 20 of file PlanesIntersection.h.

Member Typedef Documentation

◆ MatrixDimDynamic

template<int dim>
typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> model::PlanesIntersection< dim >::MatrixDimDynamic

Definition at line 23 of file PlanesIntersection.h.

◆ SVDsolverType

template<int dim>
typedef Eigen::JacobiSVD<MatrixDimDynamic> model::PlanesIntersection< dim >::SVDsolverType

Definition at line 25 of file PlanesIntersection.h.

◆ VectorDim

template<int dim>
typedef Eigen::Matrix<double,dim,1> model::PlanesIntersection< dim >::VectorDim

Definition at line 24 of file PlanesIntersection.h.

Constructor & Destructor Documentation

◆ PlanesIntersection()

template<int dim>
model::PlanesIntersection< dim >::PlanesIntersection ( const MatrixDimDynamic & N,
const MatrixDimDynamic & P,
const double & tol = FLT_EPSILON )

Definition at line 22 of file PlanesIntersection.cpp.

Member Function Documentation

◆ snap()

template<int dim>
std::pair< bool, typename PlanesIntersection< dim >::VectorDim > model::PlanesIntersection< dim >::snap ( const VectorDim & x) const
Parameters
[in]xpoint to be snapped to the intersection between the planes
Returns
a pair where pair.first is true if snapping was successful, and pair.second is the position of the snapped point

The snapped point y minimizes the distance from x constrained to y belonging to the planes. Using lgrange multipliers, the solution is y=x-N*lam, where lam is a vector of Lagrance multipliers solving N^T*N lam = b, and b_k = n_k(x-P_k), where n_k and P_k are the normal and origin of the k0th plane. We solve this using svd, hence we get the "best solution", which may not actually satisfy the contraints if the planes are not intersecting. Hence we check that the solution actually belongs to the intersectoin between the planes before returning it.

Definition at line 29 of file PlanesIntersection.cpp.

Member Data Documentation

◆ NP

template<int dim>
const std::pair<MatrixDimDynamic,MatrixDimDynamic> model::PlanesIntersection< dim >::NP

Definition at line 27 of file PlanesIntersection.h.

◆ svd

template<int dim>
const SVDsolverType model::PlanesIntersection< dim >::svd

Definition at line 28 of file PlanesIntersection.h.


The documentation for this struct was generated from the following files: