33 unweighted_(unweighted)
70 flipped_ = ow ? false :
true;
75 const label startPoint = faceEdgei;
80 const label lEdgeP = f[fwd] == f[f.
fcIndex(faceEdgei)] ? fwd : back;
83 fp = pointsAlpha[f[startPoint]] < pointsAlpha[f[lEdgeP]]
84 ? startPoint : lEdgeP;
91 && pointsAlpha[f[startPoint]] < pointsAlpha[f[lEdgeP]]
95 && pointsAlpha[f[startPoint]] > pointsAlpha[f[lEdgeP]]
119 const scalar& fl = pointsAlpha[f[fp]];
120 const scalar& fk = pointsAlpha[f[nextFp]];
122 const point& pL = points[f[fp]];
123 const point& pK = points[f[nextFp]];
125 const label edg = faceEdges[edgei];
128 if (fl >= target && cutPoints_.size() > 0)
130 subPoints_.append(pL);
133 subPointsU_.append(pointsU[f[fp]]);
141 && ((fl < target && fk >= target) || (fl >= target && fk < target))
144 const scalar coeff = (target - fk)/(fl - fk);
145 const point cut = pK + coeff*(pL - pK);
151 + coeff*(pointsU[f[fp]] - pointsU[f[nextFp]])
154 cutPoints_.append(cut);
155 subPoints_.append(cut);
156 cutEdges_.append(edg);
157 isEdgeCut[edg] =
true;
161 if (cutPoints_.size() == 2)
170 nextFp = f.rcIndex(fp);
176 nextFp = f.fcIndex(fp);
201 flipped_ = ow ? false :
true;
214 const scalar& fl = pointsAlpha[f[fp]];
215 const scalar& fk = pointsAlpha[f[nextFp]];
217 const point& pL = points[f[fp]];
218 const point& pK = points[f[nextFp]];
221 if (fl >= target && cutPoints_.size() > 0)
223 subPoints_.append(pL);
226 subPointsU_.append(pointsU[f[fp]]);
231 if ((fl < target && fk >= target) || (fl >= target && fk < target))
233 const scalar coeff = (target - fk)/(fl - fk);
234 const point cut = pK + coeff*(pL - pK);
240 + coeff*(pointsU[f[fp]] - pointsU[f[nextFp]])
243 cutPoints_.append(cut);
244 subPoints_.append(cut);
250 nextFp = f.rcIndex(fp);
255 nextFp = f.fcIndex(fp);
260 if (cutPoints_.size() == 2)
266 else if (cutPoints_.size() > 2)
#define forAll(list, i)
Loop across all elements in list.
label rcIndex(const label i) const
Return the reverse circular index, i.e. the previous index.
label fcIndex(const label i) const
Return the forward circular index, i.e. the next index.
label findMin(const ListType &, const label start=0)
Find index of min element (and less than given element).
MPLICface(const bool unweighted=true)
Construct empty.
label cutFace(const labelList &f, const labelList &faceEdges, const pointField &points, const boolList &isEdgeCutOld, boolList &isEdgeCut, label &faceEdgei, const UList< scalar > &pointsAlpha, const UList< vector > &pointsU, const label facei, const scalar target, const bool ow)
Function to cut for multi cut.