Skip to content
Snippets Groups Projects
Commit 6289cd6a authored by Sreekanth Arikatla's avatar Sreekanth Arikatla
Browse files

ENH: Add the ability to set linear projection constraint to restrict solution to a line

parent bc6a6219
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,14 @@ LinearProjectionConstraint::setProjection(const size_t& nodeId, const Vec3d& p,
m_projection = Mat3d::Identity() - p*p.transpose() - q*q.transpose();
}
void
LinearProjectionConstraint::setProjectionToLine(const size_t& nodeId, const Vec3d& p)
{
m_nodeId = nodeId;
auto v = p/p.norm();
m_projection = v*v.transpose();
}
void
LinearProjectionConstraint::setProjectorToDirichlet(const unsigned int& nodeId, const Vec3d z)
{
......
......@@ -50,6 +50,11 @@ public:
///
void setProjection(const size_t& nodeId, const Vec3d& p, const Vec3d& q = Vec3d::Zero());
///
/// \brief Form the projection
///
void setProjectionToLine(const size_t& nodeId, const Vec3d& p);
///
/// \brief Set the projector to simulate Dirichlet conditions
///
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment