ENH: additional methods for OBJstream

- write point fields
- writeLine (takes two points)
- writeFace (takes list of face loop points)
This commit is contained in:
Mark Olesen
2022-07-13 20:16:35 +02:00
parent dea31e9b4a
commit c4d18e97a3
40 changed files with 301 additions and 359 deletions

View File

@ -4979,13 +4979,10 @@ void Foam::distributedTriSurfaceMesh::distribute
/searchableSurface::name() + "_after.obj"
);
Info<< "Writing local bounding box to " << str.name() << endl;
const List<treeBoundBox>& myBbs = procBb_[Pstream::myProcNo()];
for (const treeBoundBox& bb : myBbs)
{
pointField pts(bb.points());
for (const edge& e : treeBoundBox::edges)
for (const treeBoundBox& bb : procBb_[Pstream::myProcNo()])
{
str.write(linePointRef(pts[e[0]], pts[e[1]]));
str.write(bb, true); // lines
}
}
}
@ -5001,11 +4998,7 @@ void Foam::distributedTriSurfaceMesh::distribute
{
for (const treeBoundBox& bb : myBbs)
{
pointField pts(bb.points());
for (const edge& e : treeBoundBox::edges)
{
str.write(linePointRef(pts[e[0]], pts[e[1]]));
}
str.write(bb, true); // lines
}
}
}

View File

@ -189,12 +189,12 @@ bool Foam::patchDistMethods::exact::correct
if (debug)
{
OBJstream str(mesh_.time().timePath()/"wallPoint.obj");
Info<< type() << ": dumping nearest wall point to " << str.name()
<< endl;
forAll(mesh_.cellCentres(), cellI)
Info<< type() << ": dumping nearest wall point to "
<< str.name() << endl;
forAll(mesh_.cellCentres(), celli)
{
const point& cc = mesh_.cellCentres()[cellI];
str.write(linePointRef(cc, info[cellI].hitPoint()));
const point& cc = mesh_.cellCentres()[celli];
str.writeLine(cc, info[celli].hitPoint());
}
}