Added to the voronoi sampling filter the restricted voronoi relaxation option

This commit is contained in:
Paolo Cignoni cignoni 2014-08-28 01:52:29 +00:00
parent 6fcf2eb419
commit c2c22778e8
2 changed files with 7 additions and 3 deletions

View File

@ -138,7 +138,10 @@ bool FilterVoronoiPlugin::applyFilter( const QString& filterName,MeshDocument& m
for(int i=0;i<iterNum;++i)
{
cb(100*i/iterNum, "Relaxing...");
tri::VoronoiProcessing<CMeshO, EuclideanDistance<CMeshO> >::VoronoiRelaxing(m.cm, seedVec, 1,dd,vpp);
if(env.evalEnum("relaxType")==2)
tri::VoronoiProcessing<CMeshO, EuclideanDistance<CMeshO> >::RestrictedVoronoiRelaxing(m.cm, seedVec, 10,vpp);
else
tri::VoronoiProcessing<CMeshO, EuclideanDistance<CMeshO> >::VoronoiRelaxing(m.cm, seedVec, 1,dd,vpp);
md.updateRenderStateMeshes(meshlist,int(MeshModel::MM_VERTCOLOR));
if (intteruptreq) return true;
}
@ -236,7 +239,7 @@ bool FilterVoronoiPlugin::applyFilter( const QString& filterName,MeshDocument& m
Log("Base Poisson volume sampling at a radius %f ",poissonVolumeRadius);
cb(40, "Relaxing Volume...");
vvs.RelaxVoronoiSamples(relaxStep);
vvs.BarycentricRelaxVoronoiSamples(relaxStep);
cb(50, "Building Scaffloding Volume...");
vvs.BuildScaffoldingMesh(sm->cm,voxelRes,isoThr,elemType,surfFlag);

View File

@ -27,7 +27,7 @@
<PARAM_HELP><![CDATA[]]></PARAM_HELP>
<CHECKBOX_GUI guiLabel="Preprocessing"/>
</PARAM>
<PARAM parName="relaxType" parIsImportant="true" parType="Enum { Geodesic : 0 | SquaredDistance : 1 }" parDefault="1">
<PARAM parName="relaxType" parIsImportant="true" parType="Enum { Geodesic : 0 | SquaredDistance : 1 | Restricted : 2 }" parDefault="1">
<PARAM_HELP><![CDATA[
At each relaxation step we search for each voronoi region the new position of the seed.
According to the classical LLoyd relaxation strategy it should have been placed onto the
@ -35,6 +35,7 @@
<ul>
<li> Geodesic: the seed is placed onto the vertex that maximize the geodesic distance from the border of the region </li>
<li> Squared Distance: the seed is placed in the vertex that minimize the squared sum of the distances from all the pints of the region.</li>
<li> Restricted: .</li>
</ul>
]]></PARAM_HELP>
<ENUM_GUI guiLabel="Relax Type"/>