58 if (orient && area_ < 0)
104 if (match[tb] && a.isClose(triB[tb]))
138 static int nInter = 0;
140 writeOBJ(
os, triA, 0);
141 writeOBJ(
os, triB, 3);
164 for (
int i0 = 0; i0 <= 2; ++i0)
168 Info<<
"\nstarting points:";
169 for (
int i = 0; i < nPoint2; ++i)
177 const label i1 = (i0 + 1) % 3;
184 for (
int j = 0; j < nPoint2; ++j)
187 const vector2D& p1 = work2[(j+1) % nPoint2];
193 work_[nPoint++] = p1;
211 work_[nPoint++] = p1;
224 for (
int i = 0; i < nPoint; ++i)
226 os <<
"v " << work_[i].x() <<
" " << work_[i].y() <<
" 0" <<
nl;
229 for (
int i = 0; i < nPoint; ++i)
231 os <<
" " << (i + 1);
236 Info<<
"Intersection points:" <<
endl;
237 for (
int i = 0; i < nPoint; ++i)
248 for (
int i = 0; i < nPoint - 1; ++i)
250 twoArea += work_[i].x()*work_[i+1].y();
251 twoArea -= work_[i].y()*work_[i+1].x();
254 twoArea += work_[nPoint-1].
x()*work_[0].y();
255 twoArea -= work_[nPoint-1].y()*work_[0].x();
257 centre += work_[nPoint - 1];
258 centre /= scalar(nPoint);
270 interArea(triB, dummyCentre, area);
281 for (
int i = 0; i < 3; ++i)
283 int i1 = (i + 1) % 3;
285 for (
int j = 0; j < 3; ++j)
287 int j1 = (j + 1) % 3;
289 if (lineIntersects(triA[i], triA[i1], triB[j], triB[
j1]))
297 (nClosePoints(triA, triB) == 3)
A 1D vector of objects of type <T> with a fixed length <N>.
Output to file stream, using an OSstream.
virtual const fileName & name() const
Read/write access to the name of the stream.
int overlaps
Flag to control which overlap calculations are performed.
const Cmpt & x() const
Access to the vector x component.
A class for managing temporary objects.
static scalar absTol
Absolute tolerance.
label snapClosePoints(const triangle2D &triB)
void interArea(const triangle2D &triB, vector2D ¢re, scalar &area) const
Return the intersection centre and area.
static scalar relTol
Relative tolerance.
bool contains(const triangle2D &tri) const
Return true if tri is within this triangle.
const volScalarField & p0
OBJstream os(runTime.globalPath()/outputName)
dimensionedScalar j1(const dimensionedScalar &ds)
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.
A non-counting (dummy) refCount.