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

Function writeOBJ

src/dynamicMesh/polyMeshAdder/faceCoupleInfo.C:46–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
45
46void Foam::faceCoupleInfo::writeOBJ
47(
48 const fileName& fName,
49 const edgeList& edges,
50 const pointField& points,
51 const bool compact
52)
53{
54 OFstream str(fName);
55
56 labelList pointMap(points.size(), -1);
57
58 if (compact)
59 {
60 label newPointi = 0;
61
62 forAll(edges, edgeI)
63 {
64 const edge& e = edges[edgeI];
65
66 forAll(e, eI)
67 {
68 label pointi = e[eI];
69
70 if (pointMap[pointi] == -1)
71 {
72 pointMap[pointi] = newPointi++;
73
74 meshTools::writeOBJ(str, points[pointi]);
75 }
76 }
77 }
78 }
79 else
80 {
81 forAll(points, pointi)
82 {
83 meshTools::writeOBJ(str, points[pointi]);
84 }
85
86 pointMap = identity(points.size());
87 }
88
89 forAll(edges, edgeI)
90 {
91 const edge& e = edges[edgeI];
92
93 str<< "l " << pointMap[e[0]]+1 << ' ' << pointMap[e[1]]+1 << nl;
94 }
95}
96
97
98void Foam::faceCoupleInfo::writeOBJ

Callers 4

writePointsFacesFunction · 0.70
faceCoupleInfo.CFile · 0.70
writeEdgesFunction · 0.70
subDivisionMatchFunction · 0.70

Calls 2

forAllFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected