From c769982ad5d7ceb180e761d3ef5bd447d9ab8f3c Mon Sep 17 00:00:00 2001 From: gianpaolopalma Date: Wed, 21 Feb 2018 15:04:47 +0100 Subject: [PATCH 1/2] Bug fixing - Adding the PerFaceNormal option in the "Montecarlo Sampling" - Fixing "Uniform Mesh Resampling" with negative offset --- src/meshlabplugins/filter_sampling/filter_sampling.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/meshlabplugins/filter_sampling/filter_sampling.cpp b/src/meshlabplugins/filter_sampling/filter_sampling.cpp index 02b5cfd3f..56e836866 100644 --- a/src/meshlabplugins/filter_sampling/filter_sampling.cpp +++ b/src/meshlabplugins/filter_sampling/filter_sampling.cpp @@ -776,6 +776,8 @@ switch(ID(action)) mm->updateDataMask(curMM); BaseSampler mps(&(mm->cm)); + mps.perFaceNormal = par.getBool("PerFaceNormal"); + if(par.getBool("EdgeSampling")) { tri::SurfaceSampling::EdgeMontecarlo(curMM->cm,mps,par.getInt("SampleNum"),false); @@ -1237,7 +1239,7 @@ switch(ID(action)) Point3i volumeDim; Box3m volumeBox = baseMesh->cm.bbox; - volumeBox.Offset(volumeBox.Diag()/10.0f+offsetThr); + volumeBox.Offset(volumeBox.Diag()/10.0f+abs(offsetThr)); BestDim(volumeBox , voxelSize, volumeDim ); Log("Resampling mesh using a volume of %i x %i x %i",volumeDim[0],volumeDim[1],volumeDim[2]); From aa018f181b5626f2949255515017c01b5d0b4d92 Mon Sep 17 00:00:00 2001 From: gianpaolopalma Date: Wed, 21 Feb 2018 15:07:04 +0100 Subject: [PATCH 2/2] Fix check in the "Texture to Vertex" transfer Check if the source mesh (not the tagert mesh) is not a point cloud --- src/meshlabplugins/filter_texture/filter_texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/meshlabplugins/filter_texture/filter_texture.cpp b/src/meshlabplugins/filter_texture/filter_texture.cpp index 05b3d5003..90d23b82b 100644 --- a/src/meshlabplugins/filter_texture/filter_texture.cpp +++ b/src/meshlabplugins/filter_texture/filter_texture.cpp @@ -1045,7 +1045,7 @@ bool FilterTexturePlugin::applyFilter(QAction *filter, MeshDocument &md, RichPar assert(srcMesh!=NULL); assert(trgMesh!=NULL); - CheckError(trgMesh->cm.fn == 0, "Source mesh requires to have faces"); + CheckError(srcMesh->cm.fn == 0, "Source mesh requires to have faces"); // Check whether is possible to access source mesh texture CheckError(!srcMesh->hasDataMask(MeshModel::MM_WEDGTEXCOORD), "Source mesh doesn't have Per Wedge Texture Coordinates");