33 template<
class Po
int,
class Po
intRef>
34 template<
class AboveOp,
class BelowOp>
44 FixedList<scalar, 3> d;
52 d[i] = pln.signedDistance(tri[i]);
75 label i1 = d.fcIndex(i0);
76 label i2 = d.fcIndex(i1);
79 point p01 = planeIntersection(d, tri, i0, i1);
80 point p02 = planeIntersection(d, tri, i0, i2);
82 aboveOp(triPoints(tri[i1], tri[i2], p02));
83 aboveOp(triPoints(tri[i1], p02, p01));
84 belowOp(triPoints(tri[i0], p01, p02));
92 label i1 = d.fcIndex(i0);
93 label i2 = d.fcIndex(i1);
96 point p01 = planeIntersection(d, tri, i0, i1);
97 point p02 = planeIntersection(d, tri, i0, i2);
99 belowOp(triPoints(tri[i1], tri[i2], p02));
100 belowOp(triPoints(tri[i1], p02, p01));
101 aboveOp(triPoints(tri[i0], p01, p02));
111 template<
class Po
int,
class Po
intRef>
112 template<
class AboveOp,
class BelowOp>
120 triSliceWithPlane(pl,
triPoints(a_, b_, c_), aboveOp, belowOp);
124 template<
class Po
int,
class Po
intRef>
125 template<
class Ins
ideOp,
class Outs
ideOp>
141 triIntersectionList insideTrisA;
143 storeOp insideOpA(insideTrisA, nInsideA);
145 triIntersectionList outsideTrisA;
147 storeOp outsideOpA(outsideTrisA, nOutsideA);
157 const plane pl0(tgt.
a(), tgt.
b(), tgt.
b() +
s*
n);
158 triSliceWithPlane(pl0, thisTri, insideOpA, outsideOpA);
163 if (insideOpA.nTris_ == 0)
169 if (outsideOpA.nTris_ == 0)
179 triIntersectionList insideTrisB;
181 storeOp insideOpB(insideTrisB, nInsideB);
189 const plane pl0(tgt.
b(), tgt.
c(), tgt.
c() +
s*
n);
191 for (label i = 0; i < insideOpA.nTris_; i++)
193 const triPoints& tri = insideOpA.tris_[i];
194 triSliceWithPlane(pl0, tri, insideOpB, outsideOpA);
211 const plane pl0(tgt.
c(), tgt.
a(), tgt.
a() +
s*
n);
213 insideOpA.nTris_ = 0;
215 for (label i = 0; i < insideOpB.nTris_; i++)
217 const triPoints& tri = insideOpB.tris_[i];
218 triSliceWithPlane(pl0, tri, insideOpA, outsideOpA);
231 for (label i = 0; i < insideOpA.nTris_; i++)
233 insideOp(insideOpA.tris_[i]);
236 for (label i = 0; i < outsideOpA.nTris_; i++)
238 outsideOp(outsideOpA.tris_[i]);
A triangle primitive used to calculate face normals and swept volumes. Uses referred points...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void sliceWithPlane(const plane &pln, AboveOp &aboveOp, BelowOp &belowOp) const
Decompose triangle into triangles above and below plane.
const Point & a() const noexcept
The first vertex.
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
const Point & c() const noexcept
The third vertex.
#define forAll(list, i)
Loop across all elements in list.
const Point & b() const noexcept
The second vertex.
Triangle point storage. Default constructable (triangle is not)
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
void triangleOverlap(const vector &n, const triangle< Point, PointRef > &tri, InsideOp &insideOp, OutsideOp &outsideOp) const
Decompose triangle into triangles inside and outside.
vector point
Point is a vector.
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))