Skip to content

shapeworks::PlaneConstraint

More...

#include <PlaneConstraint.h>

Inherits from shapeworks::Constraint

Public Functions

Name
virtual bool isViolated(const Eigen::Vector3d & pt) const override
Returns if pt in Eigen format is violated by the constraint.
virtual void print() const override
Prints the constraint neatly.
Eigen::Vector3d getPlaneNormal()
Get plane normal.
void setPlaneNormal(const Eigen::Vector3d & inPlane)
Set plane normal.
Eigen::Vector3d getPlanePoint()
Get plane center point.
void setPlanePoint(const vnl_vector< double > & point)
Set plane center point.
void setPlanePoint(const Eigen::Vector3d & p)
Set plane center point.
virtual Eigen::Vector3d constraintGradient(const Eigen::Vector3d & pt) const override
Returns the gradient of the constraint.
std::vector< Eigen::Vector3d > & points()
double getOffset()
void setOffset(double offset)
virtual double constraintEval(const Eigen::Vector3d & pt) const override
Returns the evaluation on the constraint, i.e. the signed distance to the constraint boundary.
void updatePlaneFromPoints()
void updatePointsFromPlane()
void setPlaneCenter(const Eigen::Vector3d & center)
void setPlaneNormalDirection(const Eigen::Vector3d & normal)
vtkSmartPointer< vtkPlane > getVTKPlane()
Return this plane as a vtkPlane.

Additional inherited members

Public Functions inherited from shapeworks::Constraint

Name
void setMus(std::vector< double > inmu)
Initializes mu.
std::vector< double > getMus()
Gets mu.
void updateMu(const Eigen::Vector3d & pt, double C, size_t index)
Updates the value of mu according to the augmented lagrangian update.
Eigen::Vector3d lagragianGradient(const Eigen::Vector3d & pt, double C, size_t index) const
Computes the lagrangian gradient based on lagrangian inequality equations. NOTE: Not actually lagrangian. We are using quadratic penalty and not lagrangian because it works better.

Protected Functions inherited from shapeworks::Constraint

Name
int sgn(double val)
Returns the sign of the double.

Protected Attributes inherited from shapeworks::Constraint

Name
std::vector< double > mus_
Mu is the lagrangian momentum term.

Detailed Description

class shapeworks::PlaneConstraint;

Encapsulate functionality related to cutting-plane constraints. Inherits from Constraint. See [Constraint.h] for more information

Public Functions Documentation

function isViolated

virtual bool isViolated(
    const Eigen::Vector3d & pt
) const override

Returns if pt in Eigen format is violated by the constraint.

Reimplements: shapeworks::Constraint::isViolated

function print

virtual void print() const override

Prints the constraint neatly.

Reimplements: shapeworks::Constraint::print

function getPlaneNormal

inline Eigen::Vector3d getPlaneNormal()

Get plane normal.

function setPlaneNormal

inline void setPlaneNormal(
    const Eigen::Vector3d & inPlane
)

Set plane normal.

function getPlanePoint

inline Eigen::Vector3d getPlanePoint()

Get plane center point.

function setPlanePoint

inline void setPlanePoint(
    const vnl_vector< double > & point
)

Set plane center point.

function setPlanePoint

inline void setPlanePoint(
    const Eigen::Vector3d & p
)

Set plane center point.

function constraintGradient

inline virtual Eigen::Vector3d constraintGradient(
    const Eigen::Vector3d & pt
) const override

Returns the gradient of the constraint.

Reimplements: shapeworks::Constraint::constraintGradient

function points

inline std::vector< Eigen::Vector3d > & points()

function getOffset

double getOffset()

function setOffset

void setOffset(
    double offset
)

function constraintEval

virtual double constraintEval(
    const Eigen::Vector3d & pt
) const override

Returns the evaluation on the constraint, i.e. the signed distance to the constraint boundary.

Reimplements: shapeworks::Constraint::constraintEval

function updatePlaneFromPoints

void updatePlaneFromPoints()

function updatePointsFromPlane

void updatePointsFromPlane()

Rebuild the three defining points from the current plane point and normal. This is the inverse of updatePlaneFromPoints() and is used when the center/normal are edited directly (e.g. in the Studio cutting-plane table).

function setPlaneCenter

void setPlaneCenter(
    const Eigen::Vector3d & center
)

Move the plane to a new center by translating the defining points. Preserves the triangle's shape and normal. Used when the center is edited directly (e.g. in the Studio cutting-plane table).

function setPlaneNormalDirection

void setPlaneNormalDirection(
    const Eigen::Vector3d & normal
)

Reorient the plane to a new normal by rotating the defining points about the current center. Preserves the triangle's shape and center. The input need not be a unit vector. Used when the normal is edited directly (e.g. in the Studio cutting-plane table).

function getVTKPlane

vtkSmartPointer< vtkPlane > getVTKPlane()

Return this plane as a vtkPlane.


Updated on 2026-07-01 at 23:50:08 +0000