46 MR_BIND_OVERLOAD_SUFFIX(pos)
MRMESH_API void fixVertex( VertId v, const Vector3f & fixedPos,
bool smooth = true );
67 [[nodiscard]]
const VertBitSet &
region()
const {
return region_; }
70 [[nodiscard]]
const VertBitSet &
freeVerts()
const {
return freeVerts_; }
73 [[nodiscard]]
const VertBitSet &
firstLayerFixedVerts()
const { assert( solver_ );
return firstLayerFixedVerts_; }
79 [[nodiscard]] VertCoords &
points()
const {
return points_; }
100 template <
typename I,
typename G,
typename S,
typename P>
101 void prepareRhs_( I && iniRhs, G && g, S && s, P && p )
const;
104 VertCoords & points_;
110 VertBitSet freeVerts_;
113 VertBitSet fixedSharpVertices_;
116 VertBitSet firstLayerFixedVerts_;
125 std::vector<Equation> equations_;
127 std::vector<Attractor> attractors_;
134 std::vector<Element> nonZeroElements_;
141 std::unique_ptr<Solver> solver_;
#define MRMESH_API
Definition MRMeshFwd.h:85
Definition MRMeshTopology.h:31
void addAttractor(const Attractor &a)
adds one more attractor to the stored list
void apply()
Definition MRLaplacian.h:60
void applyToScalar(VertScalars &scalarField)
const VertBitSet & freeVerts() const
return currently free vertices
Definition MRLaplacian.h:70
const VertBitSet & firstLayerFixedVerts() const
return fixed vertices from the first layer around free vertices
Definition MRLaplacian.h:73
int firstElem
coefficient on matrix diagonal
Definition MRLaplacian.h:123
MeshTriPoint
Definition MRMeshFwd.h:515
double weight
Definition MRLaplacian.h:90
void init(const VertBitSet &freeVerts, EdgeWeights weights, VertexMass vmass=VertexMass::Unit, RememberShape rem=RememberShape::Yes)
Definition MRLaplacian.h:33
MeshTriPoint p
Definition MRLaplacian.h:84
EdgeWeights
determines the weight of each edge in applications like Laplacian
Definition MREnums.h:44
void applyToVector(VertCoords &points)
double centerCoeff
equation right hand side
Definition MRLaplacian.h:122
void fixVertex(VertId v, bool smooth=true)
const VertBitSet & region() const
return all initially free vertices and the first layer of vertices around them
Definition MRLaplacian.h:67
Vector3d target
Definition MRLaplacian.h:85
RememberShape
Definition MREnums.h:56
void multVertexWeight(VertId v, double factor)
multiplies vertex equation's weight on the given factor
Vector3d rhs
Definition MRLaplacian.h:121
const MeshTopology & topology() const
return the topology for which Laplacian was constructed
Definition MRLaplacian.h:76
void removeAllAttractors()
forgets all attractors added previously
double coeff
Definition MRLaplacian.h:131
VertId neiVert
Definition MRLaplacian.h:132
VertexMass
determines the weight or mass of each vertex in applications like Laplacian
Definition MREnums.h:34
VertCoords & points() const
return the vector of coordinates for which Laplacian was constructed
Definition MRLaplacian.h:79
void updateSolver()
if you manually call this method after initialization and fixing vertices then next apply call will b...
void initFromPoints(const VertCoords &points, const VertBitSet &freeVerts, EdgeWeights weights, VertexMass vmass=VertexMass::Unit, RememberShape rem=RememberShape::Yes)
same as init() but uses the given points instead of ones passed to a constructor for weights computat...
@ factor
Definition MRUnitInfo.h:51
@ Yes
true Laplacian mode when initial mesh shape is remembered and copied in apply
Definition MREnums.h:57
@ Unit
all vertices have same mass=1
Definition MREnums.h:36
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
attracts the given point inside some mesh's triangle to the given target with the given weight
Definition MRLaplacian.h:83