From 4660a96c6436731a0090aa87bf4fb9aa625d74f2 Mon Sep 17 00:00:00 2001 From: Marco Callieri Date: Mon, 7 Nov 2016 13:46:09 +0100 Subject: [PATCH] border selection polyline now uses transformation the current mesh transformation is used whwn creating the new layer, which is generated in scene space. --- src/meshlabplugins/filter_meshing/meshfilter.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/meshlabplugins/filter_meshing/meshfilter.cpp b/src/meshlabplugins/filter_meshing/meshfilter.cpp index cf245d00f..909b69ac3 100644 --- a/src/meshlabplugins/filter_meshing/meshfilter.cpp +++ b/src/meshlabplugins/filter_meshing/meshfilter.cpp @@ -1507,6 +1507,9 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction * filter, MeshDocument & md, Ric MeshModel* perimeter = md.addNewMesh("", newLayerName, true); perimeter->Clear(); + Matrix44m rotM = m.cm.Tr; + rotM.SetColumn(3, Point3m(0.0, 0.0, 0.0)); + for (CMeshO::FaceIterator fi = m.cm.face.begin(); fi != m.cm.face.end(); ++fi) if (!(*fi).IsD()) if ((*fi).IsS()) @@ -1519,12 +1522,12 @@ bool ExtraMeshFilterPlugin::applyFilter(QAction * filter, MeshDocument & md, Ric CMeshO::VertexIterator nvi; vcg::tri::Allocator::AddEdges(perimeter->cm, 1); nvi = vcg::tri::Allocator::AddVertices(perimeter->cm, 2); - (*nvi).P() = (*fi).V(ei)->P(); - (*nvi).N() = (*fi).V(ei)->N(); + (*nvi).P() = m.cm.Tr * (*fi).V(ei)->P(); + (*nvi).N() = rotM * (*fi).V(ei)->N(); perimeter->cm.edge.back().V(0) = &(*nvi); nvi++; - (*nvi).P() = (*fi).V((ei + 1) % 3)->P(); - (*nvi).N() = (*fi).V((ei + 1) % 3)->N(); + (*nvi).P() = m.cm.Tr * (*fi).V((ei + 1) % 3)->P(); + (*nvi).N() = rotM * (*fi).V((ei + 1) % 3)->N(); perimeter->cm.edge.back().V(1) = &(*nvi); } }