Go to the documentation of this file.
39 os <<
"v " << tri[0].x() <<
" " << tri[0].y() <<
" 0" <<
nl
40 <<
"v " << tri[1].x() <<
" " << tri[1].y() <<
" 0" <<
nl
41 <<
"v " << tri[2].x() <<
" " << tri[2].y() <<
" 0" <<
nl
88 return 0.5*e1.perp(e2);
96 return (1/3.0)*(tri[0] + tri[1] + tri[2]);
112 const scalar rcs = r.
perp(
s);
114 if (
mag(rcs) > ROOTVSMALL)
116 const scalar u = (sp1 - lp1).perp(r)/rcs;
118 if (u >= -relTol && u <= 1+relTol)
142 OFstream
os(
"bad-intersection.obj");
143 os <<
"v " << lp1.
x() <<
" " << lp1.
y() <<
" 0" <<
nl
144 <<
"v " << lp2.
x() <<
" " << lp2.
y() <<
" 0" <<
nl
145 <<
"v " << sp1.
x() <<
" " << sp1.
y() <<
" 0" <<
nl
146 <<
"v " << sp2.
x() <<
" " << sp2.
y() <<
" 0" <<
nl
201 return mag(area_) < SMALL ? 0 :
sign(area_);
209 && pointInside(tri[1])
210 && pointInside(tri[2]);
219 triA[0].isClose(triB[0])
220 && triA[1].isClose(triB[1])
221 && triA[2].isClose(triB[2]);
229 for (
int i = 0; i < 3; ++i)
231 if ((triA[(i + 1) % 3] - triA[i]).perp(
p - triA[i]) < 0)
static bool lineIntersects(const vector2D &a, const vector2D &b, const vector2D &c, const vector2D &d)
scalar area() const noexcept
bool isClose(const Vector2D< Cmpt > &b, const scalar tol=1e-10) const
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
bool isSame(const triangle2D &triB) const
static label nClosePoints(const triangle2D &triA, const triangle2D &triB)
Ostream & endl(Ostream &os)
static void writeOBJ(Ostream &os, const triangle2D &tri, label offset)
dimensionedScalar sign(const dimensionedScalar &ds)
const dimensionedScalar b
static bool lineIntersectionPoint(const vector2D &a, const vector2D &b, const vector2D &c, const vector2D &d, vector2D &intersection)
static bool lineSegmentIntersectionPoint(const vector2D &lp1, const vector2D &lp2, const vector2D &sp1, const vector2D &sp2, vector2D &intersection)
OBJstream os(runTime.globalPath()/outputName)
Output to file stream, using an OSstream.
bool match(const UList< wordRe > &patterns, const std::string &text)
bool pointInside(const vector2D &p) const
Vector2D< scalar > vector2D
A 2D vector of scalars obtained from the generic Vector2D.
bool contains(const triangle2D &tri) const
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
const dimensionedScalar c
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
scalar perp(const Vector2D< Cmpt > &b) const