Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
f9134a51
Commit
f9134a51
authored
Jan 23, 2019
by
Mark OLESEN
Browse files
BUG: TRIReader point reading not order-independent
parent
567ae55e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/surfMesh/surfaceFormats/tri/TRIReader.C
View file @
f9134a51
...
...
@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017-201
8
OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017-201
9
OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
...
...
@@ -31,6 +31,21 @@ License
#include
"mergePoints.H"
#include
"Map.H"
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
namespace
Foam
{
static
inline
STLpoint
getSTLpoint
(
Istream
&
is
)
{
scalar
a
=
readScalar
(
is
);
scalar
b
=
readScalar
(
is
);
scalar
c
=
readScalar
(
is
);
return
STLpoint
(
a
,
b
,
c
);
}
}
// End namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool
Foam
::
fileFormats
::
TRIReader
::
readFile
(
const
fileName
&
filename
)
...
...
@@ -72,34 +87,13 @@ bool Foam::fileFormats::TRIReader::readFile(const fileName& filename)
IStringStream
lineStream
(
line
);
STLpoint
p
(
readScalar
(
lineStream
),
readScalar
(
lineStream
),
readScalar
(
lineStream
)
);
STLpoint
p
(
getSTLpoint
(
lineStream
));
if
(
!
lineStream
)
break
;
dynPoints
.
append
(
p
);
dynPoints
.
append
(
STLpoint
(
readScalar
(
lineStream
),
readScalar
(
lineStream
),
readScalar
(
lineStream
)
)
);
dynPoints
.
append
(
STLpoint
(
readScalar
(
lineStream
),
readScalar
(
lineStream
),
readScalar
(
lineStream
)
)
);
dynPoints
.
append
(
getSTLpoint
(
lineStream
));
dynPoints
.
append
(
getSTLpoint
(
lineStream
));
// zone/colour in .tri file starts with 0x. Skip.
// ie, instead of having 0xFF, skip 0 and leave xFF to
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment