From e15799c40d9a398a382f6bb0dc6aedc431d4eb4b Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 8 Sep 2016 14:01:34 +0200 Subject: [PATCH] improve handling of face colors when creating a mesh with segments --- src/Mod/MeshPart/Gui/Tessellation.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Mod/MeshPart/Gui/Tessellation.cpp b/src/Mod/MeshPart/Gui/Tessellation.cpp index 3e0aff5322..92edcf53bb 100644 --- a/src/Mod/MeshPart/Gui/Tessellation.cpp +++ b/src/Mod/MeshPart/Gui/Tessellation.cpp @@ -340,7 +340,17 @@ bool Tessellation::accept() MeshGui::ViewProviderMesh* vpmesh = dynamic_cast(vpm); PartGui::ViewProviderPart* vppart = dynamic_cast(vpp); if (vpmesh && vppart) { - vpmesh->highlightSegments(vppart->DiffuseColor.getValues()); + std::vector diff_col = vppart->DiffuseColor.getValues(); + if (ui->groupsFaceColors->isChecked()) { + // unique colors + std::set col_set; + for (auto it : diff_col) + col_set.insert(it.getPackedValue()); + diff_col.clear(); + for (auto it : col_set) + diff_col.push_back(App::Color(it)); + } + vpmesh->highlightSegments(diff_col); } } }