Added management of selection in laplacian smoothing for remeshing
This commit is contained in:
parent
59270c3023
commit
8b49a7803a
|
@ -646,18 +646,35 @@ private:
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
/*
|
/**
|
||||||
Simple Laplacian Smoothing step - Border and crease vertices are kept fixed.
|
* Simple Laplacian Smoothing step
|
||||||
|
* Border and crease vertices are kept fixed.
|
||||||
|
* If there are selected faces and the param.onlySelected is true we compute
|
||||||
|
* the set of internal vertices to the selection and we combine it in and with
|
||||||
|
* the vertexes not on border or creases
|
||||||
*/
|
*/
|
||||||
static void ImproveByLaplacian(MeshType &m, Params params)
|
static void ImproveByLaplacian(MeshType &m, Params params)
|
||||||
{
|
{
|
||||||
tri::UpdateTopology<MeshType>::FaceFace(m);
|
SelectionStack<MeshType> ss(m);
|
||||||
tri::UpdateFlags<MeshType>::VertexBorderFromFaceAdj(m);
|
|
||||||
tri::UpdateSelection<MeshType>::VertexFromBorderFlag(m);
|
if(params.selectedOnly) {
|
||||||
selectVertexFromCrease(m, params.creaseAngleCosThr);
|
ss.push();
|
||||||
tri::UpdateSelection<MeshType>::VertexInvert(m);
|
tri::UpdateSelection<MeshType>::VertexFromFaceStrict(m);
|
||||||
tri::Smooth<MeshType>::VertexCoordPlanarLaplacian(m,1,params.creaseAngleRadThr,true);
|
ss.push();
|
||||||
tri::UpdateSelection<MeshType>::VertexClear(m);
|
}
|
||||||
|
tri::UpdateTopology<MeshType>::FaceFace(m);
|
||||||
|
tri::UpdateFlags<MeshType>::VertexBorderFromFaceAdj(m);
|
||||||
|
tri::UpdateSelection<MeshType>::VertexFromBorderFlag(m);
|
||||||
|
selectVertexFromCrease(m, params.creaseAngleCosThr);
|
||||||
|
tri::UpdateSelection<MeshType>::VertexInvert(m);
|
||||||
|
if(params.selectedOnly) {
|
||||||
|
ss.popAnd();
|
||||||
|
}
|
||||||
|
tri::Smooth<MeshType>::VertexCoordPlanarLaplacian(m,1,params.creaseAngleRadThr,true);
|
||||||
|
tri::UpdateSelection<MeshType>::VertexClear(m);
|
||||||
|
if(params.selectedOnly) {
|
||||||
|
ss.pop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Reprojection step, this method reprojects each vertex on the original surface
|
Reprojection step, this method reprojects each vertex on the original surface
|
||||||
|
|
Loading…
Reference in New Issue