Skip to content
Snippets Groups Projects
Commit 6bd16e1e authored by mattijs's avatar mattijs
Browse files

ENH: OBJstream: output triPointRef

parent 37b873b0
Branches
Tags
No related merge requests found
...@@ -238,6 +238,38 @@ Foam::Ostream& Foam::OBJstream::write(const linePointRef& ln) ...@@ -238,6 +238,38 @@ Foam::Ostream& Foam::OBJstream::write(const linePointRef& ln)
} }
Foam::Ostream& Foam::OBJstream::write
(
const triPointRef& f,
const bool lines
)
{
label start = nVertices_;
write(f.a());
write(f.b());
write(f.c());
if (lines)
{
write('l');
for (int i = 0; i < 3; i++)
{
write(' ') << start+1+i;
}
write(' ') << start+1 << '\n';
}
else
{
write('f');
for (int i = 0; i < 3; i++)
{
write(' ') << start+1+i;
}
write('\n');
}
return *this;
}
Foam::Ostream& Foam::OBJstream::write Foam::Ostream& Foam::OBJstream::write
( (
const face& f, const face& f,
......
...@@ -39,13 +39,14 @@ SourceFiles ...@@ -39,13 +39,14 @@ SourceFiles
#include "point.H" #include "point.H"
#include "edge.H" #include "edge.H"
#include "face.H" #include "face.H"
#include "triPointRef.H"
#include "linePointRef.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class OBJstream Declaration Class OBJstream Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
...@@ -134,6 +135,9 @@ public: ...@@ -134,6 +135,9 @@ public:
//- Write line //- Write line
Ostream& write(const linePointRef&); Ostream& write(const linePointRef&);
//- Write triangle as points with lines or filled polygon
Ostream& write(const triPointRef&, const bool lines = true);
//- Write face as points with lines or filled polygon //- Write face as points with lines or filled polygon
Ostream& write Ostream& write
( (
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment