Skip to content

Commit

Permalink
Mesh: [skip ci] improve support of asymptote export
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Aug 27, 2020
1 parent dd7afa7 commit b0f78f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Mod/Mesh/App/Core/MeshIO.cpp
Expand Up @@ -2424,6 +2424,12 @@ bool MeshOutput::SaveAsymptote(std::ostream &out) const
_material->diffuseColor.size() == rPoints.size());
bool saveFaceColor = (_material && _material->binding == MeshIO::PER_FACE &&
_material->diffuseColor.size() == rFacets.size());
// global mesh color
App::Color mc(0.8f, 0.8f, 0.8f);
if (_material && _material->binding == MeshIO::OVERALL &&
_material->diffuseColor.size() == 1) {
mc = _material->diffuseColor[0];
}

std::size_t index = 0;
const MeshGeomFacet *pclFacet;
Expand Down Expand Up @@ -2457,7 +2463,7 @@ bool MeshOutput::SaveAsymptote(std::ostream &out) const
out << "),\n rgb(" << c.r << ", " << c.g << ", " << c.b << "));\n";
}
else {
out << "),\n rgb(0.8, 0.8, 0.8));\n";
out << "),\n rgb(" << mc.r << ", " << mc.g << ", " << mc.b << "));\n";
}

++clIter;
Expand Down

0 comments on commit b0f78f5

Please sign in to comment.