Go to the documentation of this file.
39 const UList<point>& pts,
51 for (
label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
53 const label fp2 =
f.fcIndex(fp1);
72 const UList<point>& pts,
85 for (
label fp1 = 1; fp1 <
f.size() - 1; ++fp1)
87 const label fp2 =
f.fcIndex(fp1);
132 const auto& readpts = reader.
points();
136 pointLst.setSize(nUniquePoints);
139 pointLst[pointMap[pointi]] = readpts[pointi];
155 const label startPt = 3*facei;
156 faceLst[facei] = Face
174 faceLst[facei] = Face
185 this->storedFaces().transfer(faceLst);
189 this->addZones(sizes, names);
193 this->addZones(sizes);
195 this->addZonesToFaces();
212 <<
"Cannot open file for writing " << filename
223 ? surfaceFormatsCore::oneZone(faceLst)
227 const bool useFaceMap = (surf.
useFaceMap() && zones.size() > 1);
238 for (
label i=0; i<nLocalFaces; ++i)
240 writeShell(os, pointLst, faceLst[
faceMap[faceIndex++]]);
245 for (
label i=0; i<nLocalFaces; ++i)
247 writeShell(os, pointLst, faceLst[faceIndex++]);
262 std::ofstream os(filename, std::ios::binary);
266 <<
"Cannot open file for writing " << filename
278 : surfaceFormatsCore::oneZone(faceLst)
281 const bool useFaceMap = (surf.
useFaceMap() && zones.size() > 1);
285 STLCore::writeBinaryHeader(os, nTris);
295 for (
label i=0; i<nLocalFaces; ++i)
297 const Face&
f = faceLst[
faceMap[faceIndex++]];
298 writeShell(os, pointLst,
f, zoneIndex);
303 for (
label i=0; i<nLocalFaces; ++i)
305 const Face&
f = faceLst[faceIndex++];
306 writeShell(os, pointLst,
f, zoneIndex);
326 <<
"Cannot open file for writing " << filename
334 if (surf.
zoneToc().size() == 1)
336 os <<
"solid " << surf.
zoneToc()[0].name() <<
nl;
337 for (
const Face&
f : faceLst)
339 writeShell(os, pointLst,
f);
341 os <<
"endsolid " << surf.
zoneToc()[0].name() <<
nl;
370 std::ofstream os(filename, std::ios::binary);
374 <<
"Cannot open file for writing " << filename
383 unsigned int nTris = surf.nTriangles();
384 STLCore::writeBinaryHeader(os, nTris);
409 bool useBinary = STLCore::isBinaryName(filename, STLCore::UNKNOWN);
413 writeBinary(filename, surf);
417 writeAscii(filename, surf);
430 if (STLCore::isBinaryName(filename,
format))
432 writeBinary(filename, surf);
436 writeAscii(filename, surf);
450 bool useBinary = STLCore::isBinaryName(filename, STLCore::UNKNOWN);
454 writeBinary(filename, surf);
458 writeAscii(filename, surf);
471 if (STLCore::isBinaryName(filename,
format))
473 writeBinary(filename, surf);
477 writeAscii(filename, surf);
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling file names.
bool useFaceMap() const
Use faceMap?
label nTriangles() const
Count number of triangles.
Base class for mesh zones.
const pointField & points() const
Return const access to the points.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
const labelUList & faceMap() const
Const access to the faceMap, zero-sized when unused.
#define forAll(list, i)
Loop across all elements in list.
virtual const labelList & zoneIds() const
Return const access to the zone ids.
word format(conversionProperties.get< word >("format"))
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated...
const List< surfZoneIdentifier > & zoneToc() const
Return const access to the zone table-of-contents.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const word & name() const
Return name.
Vector< scalar > vector
A scalar version of the templated Vector.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Output to file stream, using an OSstream.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A surface zone on a MeshedSurface.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void clear()
Clear the list, i.e. set size to zero.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Various functions to operate on Lists.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
const UList< Face > & surfFaces() const
Return const access to the faces.
const volScalarField & p0
vector point
Point is a vector.
bool good() const
Return true if next operation might succeed.
surfZoneList sortedZones(labelList &faceMap) const
Sort faces according to zoneIds.
triangle< point, const point & > triPointRef
const UList< surfZone > & surfZones() const
Const access to the surface zones.