Go to the documentation of this file.
68 bool reachedFacet =
false;
73 if(
badInput(is, tok) )
return false;
76 if(tok.isWord() && tok.wordToken() !=
"facet" )
78 name += tok.wordToken();
80 else if( tok.isNumber())
82 auto val = tok.number();
85 else if( tok.isPunctuation())
89 else if (tok.isWord() && tok.wordToken() ==
"facet")
102 if(!reachedFacet)
return false;
108 if(
badInput(is,tok) || !tok.isWord() )
return false;
109 word wTok = tok.wordToken();
110 if( wTok ==
"endsolid" )
return true;
111 if( wTok !=
"facet" )
return false;
116 if( !readFacet(is, tri) )
return false;
118 vertecies.push_back(tri);
141 for(
uint32 i=0; i<3; i++ )
165 if( i==0 ) tri.
x() = v;
166 if( i==1 ) tri.
y() = v;
167 if( i==2) tri.
z() = v;
197 << tri.
x().z() <<
endl;
202 << tri.
y().z() <<
endl;
207 << tri.
z().z() <<
endl;
229 for(
const auto& tri: vertecies)
233 os<<
"endsolid"<<
endl;
253 addSolid(name, vertecies);
266 addSolid(name, vertecies);
275 solids_.push_backSafe(vertecies);
276 solidNames_.push_back(name);
286 solids_.push_backSafe(std::move(vertecies));
287 solidNames_.push_back(name);
306 if(!readSolid(is, vertecies, name))
312 addSolid(name, std::move(vertecies));
315 if( is.
eof() || !tok.good())
return true;
328 for(
label i=0; i<size(); i++)
330 writeSolid(os, solids_[i], solidNames_[i]);
351 return solids_.size();
362 "requested out of range solid from stlFile "<<
378 "requested out of range solid name from stlFile "<<
383 return solidNames_[i];
bool checkWordToken(iIstream &is, token &tok, const word &check)
bool writeFacet(iOstream &os, const realx3x3 &tri) const
virtual const word & name() const
bool writeSolid(iOstream &os, const realx3x3Vector &vertecies, const word &name) const
iOstream & endl(iOstream &os)
bool checkNumberToken(iIstream &is, token &tok, real &val)
iOstream & indent(iOstream &os)
const realx3x3Vector & solid(label i) const
INLINE_FUNCTION_HD T & y()
INLINE_FUNCTION_HD triple< T > cross(const triple< T > &v1, const triple< T > &v2)
virtual int precision() const
#define fatalErrorInFunction
void addSolid(const word &name, const realx3x3Vector &vertecies)
void putBack(const token &tok)
bool readSolid(iIstream &is, realx3x3Vector &vertecies, word &name)
INLINE_FUNCTION_HD T & z()
const wordList & names() const
const word & name(label i) const
void setFile(fileSystem file) const
bool readFacet(iIstream &is, realx3x3 &tri)
word real2Word(const real &v, int32 numPrecision=6)
#define ioErrorInFile(fileName, lineNumber)
INLINE_FUNCTION_HD T & x()
const word & wordToken() const
bool badInput(iIstream &is, token &tok)