Skip to content

Commit

Permalink
Merge pull request #1500 from fseegraeber:bugfix-compute-planar-section
Browse files Browse the repository at this point in the history
Fix Compute Planar Section - Split Surfaces: Now keeps attributes
  • Loading branch information
alemuntoni authored Jul 26, 2024
2 parents f213162 + f229d81 commit ad347bd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/meshlabplugins/filter_meshing/meshfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1901,8 +1901,12 @@ std::map<std::string, QVariant> ExtraMeshFilterPlugin::applyFilter(
if(par.getBool("splitSurfaceWithSection"))
{
MeshModel* underM= md.addNewMesh("",sectionName+"_under");
underM->updateDataMask(orig);
underM->updateDataMask(MeshModel::MM_FACEFACETOPO);
underM->updateDataMask(MeshModel::MM_VERTQUALITY);
for (const std::string& tex : orig->cm.textures) {
underM->addTexture(tex, orig->getTexture(tex));
}

tri::Append<CMeshO,CMeshO>::Mesh(underM->cm,orig->cm);
tri::UpdateQuality<CMeshO>::VertexFromPlane(underM->cm, slicingPlane);
Expand All @@ -1921,9 +1925,15 @@ std::map<std::string, QVariant> ExtraMeshFilterPlugin::applyFilter(
tri::UpdateSelection<CMeshO>::VertexFromQualityRange(underM->cm,0,std::numeric_limits<float>::max());
tri::UpdateSelection<CMeshO>::FaceFromVertexStrict(underM->cm);
tri::UpdateSelection<CMeshO>::FaceInvert(underM->cm);
tri::UpdateSelection<CMeshO>::VertexClear(underM->cm);

MeshModel* overM= md.addNewMesh("",sectionName+"_over");
overM->updateDataMask(underM);
for (const std::string& tex : underM->cm.textures) {
overM->addTexture(tex, underM->getTexture(tex));
}
tri::Append<CMeshO,CMeshO>::Mesh(overM->cm,underM->cm,true);
tri::UpdateSelection<CMeshO>::Clear(overM->cm);

tri::UpdateSelection<CMeshO>::VertexClear(underM->cm);
tri::UpdateSelection<CMeshO>::VertexFromFaceStrict(underM->cm);
Expand Down

0 comments on commit ad347bd

Please sign in to comment.