Do not write empty patches into STL

This commit is contained in:
Hrvoje Jasak 2012-01-29 11:48:36 +00:00
parent 8665ef69ce
commit b849115ecd
2 changed files with 8 additions and 2 deletions

View file

@ -49,7 +49,7 @@ namespace Foam
class dictionary;
/*---------------------------------------------------------------------------*\
Class geometricSurfacePatch Declaration
Class geometricSurfacePatch Declaration
\*---------------------------------------------------------------------------*/
class geometricSurfacePatch
@ -65,6 +65,7 @@ class geometricSurfacePatch
//- Index of patch in boundary
label index_;
public:
//- Runtime type information

View file

@ -44,11 +44,16 @@ void triSurface::writeSTLASCII(Ostream& os) const
surfacePatchList myPatches(calcPatches(faceMap));
label faceIndex = 0;
forAll(myPatches, patchI)
forAll (myPatches, patchI)
{
// Print all faces belonging to this region
const surfacePatch& patch = myPatches[patchI];
if (patch.size() == 0)
{
continue;
}
os << "solid " << patch.name() << endl;
for