Skip to content

Commit

Permalink
Raytracing: Yield error when creating a Luxrender view of a shape wit…
Browse files Browse the repository at this point in the history
…h no faces - fixes #2685
  • Loading branch information
yorikvanhavre committed Sep 5, 2016
1 parent 11952d2 commit 1a0efaa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Mod/Raytracing/App/LuxFeature.cpp
Expand Up @@ -34,6 +34,8 @@
#include "LuxFeature.h"
#include "LuxTools.h"

#include <ShapeAnalysis_ShapeContents.hxx>


using namespace Raytracing;

Expand Down Expand Up @@ -64,7 +66,12 @@ App::DocumentObjectExecReturn *LuxFeature::execute(void)
std::string Name(std::string("Lux_")+static_cast<Part::Feature*>(link)->getNameInDocument());
if (shape.IsNull())
return new App::DocumentObjectExecReturn("Linked shape object is empty");

ShapeAnalysis_ShapeContents test;
test.Clear();
test.Perform(shape);
if (test.NbFaces() < 1)
return new App::DocumentObjectExecReturn("Shape contains no face to render");

// write a material entry
// This must not be done in LuxTools::writeShape!
const App::Color& c = Color.getValue();
Expand Down

0 comments on commit 1a0efaa

Please sign in to comment.