50 const point& p0 = pointLst[f[0]];
51 for (
label fp1 = 1; fp1 < f.size() - 1; ++fp1)
53 label fp2 = f.fcIndex(fp1);
55 const point& p1 = pointLst[f[fp1]];
56 const point& p2 = pointLst[f[fp2]];
59 os <<
" facet normal " 60 << norm.
x() <<
' ' << norm.y() <<
' ' << norm.z() <<
nl 62 <<
" vertex " << p0.x() <<
' ' << p0.y() <<
' ' << p0.z() <<
nl 63 <<
" vertex " << p1.x() <<
' ' << p1.y() <<
' ' << p1.z() <<
nl 64 <<
" vertex " << p2.x() <<
' ' << p2.y() <<
' ' << p2.z() <<
nl 66 <<
" endfacet" <<
endl;
90 const point& p0 = pointLst[f[0]];
91 for (
label fp1 = 1; fp1 < f.size() - 1; ++fp1)
93 label fp2 = f.fcIndex(fp1);
135 this->storedPoints().transfer(reader.
points());
150 const label startPt = 3*facei;
151 faceLst[facei] =
triFace(startPt, startPt+1, startPt+2);
164 const label startPt = 3*faceMap[facei];
165 faceLst[facei] =
triFace(startPt, startPt+1, startPt+2);
171 this->storedFaces().transfer(faceLst);
175 this->addZones(sizes, names);
179 this->addZones(sizes);
182 this->stitchFaces(small);
199 <<
"Cannot open file for writing " << filename
210 ? surfaceFormatsCore::oneZone(faceLst)
222 os <<
"solid " << zone.
name() <<
nl;
228 const label facei = faceMap[faceIndex++];
229 writeShell(os, pointLst, faceLst[facei]);
236 writeShell(os, pointLst, faceLst[faceIndex++]);
239 os <<
"endsolid " << zone.
name() <<
endl;
251 std::ofstream os(filename.c_str(), std::ios::binary);
255 <<
"Cannot open file for writing " << filename
268 : surfaceFormatsCore::oneZone(faceLst)
274 unsigned int nTris = 0;
277 nTris = faceLst.
size();
284 nTris += faceLst[facei].
size() - 2;
289 STLsurfaceFormatCore::writeHeaderBINARY(os, nTris);
304 faceLst[faceMap[faceIndex++]],
317 faceLst[faceIndex++],
337 <<
"Cannot open file for writing " << filename
342 if (surf.
zoneToc().size() == 1)
347 os <<
"solid " << surf.
zoneToc()[0].name() <<
endl;
350 writeShell(os, pointLst, faceLst[facei]);
352 os <<
"endsolid " << surf.
zoneToc()[0].name() <<
endl;
381 std::ofstream os(filename.c_str(), std::ios::binary);
385 <<
"Cannot open file for writing " << filename
393 unsigned int nTris = 0;
396 nTris = faceLst.
size();
403 nTris += faceLst[facei].
size() - 2;
408 STLsurfaceFormatCore::writeHeaderBINARY(os, nTris);
431 const word ext = filename.
ext();
436 writeBinary(filename, surf);
440 writeAscii(filename, surf);
457 writeBinary(filename, surf);
461 writeAscii(filename, surf);
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
#define forAll(list, i)
Loop across all elements in list.
FvWallInfoData< WallInfo, label > label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const
Return name.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
A surface zone on a MeshedSurface.
void size(const label)
Override size to be inconsistent with allocated storage.
const List< label > & zoneIds() const
Return const access to the zone ids.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Vector< scalar > vector
A scalar version of the templated Vector.
bool good() const
Return true if next operation might succeed.
word ext() const
Return file name extension (part after last .)
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
Various functions to operate on Lists.
bool useFaceMap() const
Use faceMap?
vectorField pointField
pointField is a vectorField.
void clear()
Clear the list, i.e. set size to zero.
const List< Face > & faces() const
Return const access to the faces.
A class for handling words, derived from string.
const Field< PointType > & points() const
Return reference to global points.
const List< surfZone > & surfZones() const
Const access to the surface zones.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats...
const List< Face > & faces() const
Return const access to the faces.
const List< surfZoneIdentifier > & zoneToc() const
Return const access to the zone table-of-contents.
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
vector point
Point is a vector.
const pointField & points() const
Return const access to the points.
const List< label > & faceMap() const
Const access to the faceMap, zero-sized when unused.
triangle< point, const point & > triPointRef