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);
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)
220 const surfZone& zone = zones[zoneI];
222 os <<
"solid " << zone.
name() <<
nl;
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);
294 const surfZone& zone = zones[zoneI];
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);
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
bool good() const
Return true if next operation might succeed.
void size(const label)
Override size to be inconsistent with allocated storage.
void clear()
Clear the list, i.e. set size to zero.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const List< surfZone > & surfZones() const
Const access to the surface zones.
const List< Face > & faces() const
Return const access to the faces.
bool useFaceMap() const
Use faceMap?
const List< label > & faceMap() const
Const access to the faceMap, zero-sized when unused.
const pointField & points() const
Return const access to the points.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
const List< Face > & faces() const
Return const access to the faces.
const Field< PointType > & points() const
Return reference to global points.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
const List< label > & zoneIds() const
Return const access to the zone ids.
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
const List< surfZoneIdentifier > & zoneToc() const
Return const access to the zone table-of-contents.
A class for handling file names.
word ext() const
Return file name extension (part after last .)
const word & name() const
Return name.
A surface zone on a MeshedSurface.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
vector point
Point is a vector.
Vector< scalar > vector
A scalar version of the templated Vector.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
triangle< point, const point & > triPointRef
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.