MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / readSTL

Function readSTL

src/triSurface/triSurface/interfaces/STL/readSTL.C:36–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
35
36bool triSurface::readSTL(const fileName& STLfileName)
37{
38 token firstToken;
39 {
40 IFstream str(STLfileName);
41
42 if (!str.good())
43 {
44 return false;
45 }
46 firstToken = token(str);
47 }
48
49 if (firstToken.isWord())
50 {
51 word firstWord(firstToken.wordToken());
52
53 for (size_t i = 0; i < firstWord.size(); i++)
54 {
55 firstWord[i] = std::toupper(firstWord[i]);
56 }
57
58 if (firstWord == "SOLID" || firstWord(5) == "SOLID")
59 {
60 return readSTLASCII(STLfileName);
61 }
62 }
63
64 return readSTLBINARY(STLfileName);
65}
66
67
68// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Callers 1

readFunction · 0.85

Calls 5

readSTLBINARYFunction · 0.85
isWordMethod · 0.80
tokenClass · 0.50
goodMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected