53 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
endl;
66 writeOBJ(os, points[pointLabels[i]]);
85 os<<
"l " << vertI-1 <<
' ' << vertI <<
nl;
104 const face&
f = faces[i];
108 if (foamToObj.insert(f[fp], vertI))
118 os <<
' ' << foamToObj[f[fp]]+1;
120 os <<
' ' << foamToObj[f[0]]+1 <<
nl;
135 ctrs[faceI] = faces[faceI].centre(points);
152 anchors[faceI] = points[faces[faceI][0]];
165 label faceI = oldToNew[oldFaceI];
167 return faceI >= start() && faceI < start()+size();
177 forAll(patchStarts, patchI)
179 if (patchStarts[patchI] <= faceI)
181 if (patchI == patchStarts.
size()-1)
185 else if (patchStarts[patchI+1] > faceI)
208 const point& cc = faceCentres[faceI];
210 const face&
f = faces[faceI];
214 scalar maxLenSqr = -GREAT;
217 scalar maxCmpt = -GREAT;
221 const point& pt = points[f[fp]];
222 maxLenSqr =
max(maxLenSqr,
magSqr(pt - cc));
225 tols[faceI] =
max(SMALL*maxCmpt, matchTol*
Foam::sqrt(maxLenSqr));
240 scalar minDistSqr = GREAT;
244 scalar distSqr =
magSqr(anchor - points[f[fp]]);
246 if (distSqr < minDistSqr)
248 minDistSqr = distSqr;
253 if (anchorFp == -1 ||
mag(minDistSqr) > tol)
260 return (f.
size() - anchorFp) % f.
size();
278 Pout<<
"coupledPolyPatch::calcTransformTensors : " <<
name() <<
endl
279 <<
" transform:" << transformTypeNames[
transform] <<
nl
280 <<
" (half)size:" << Cf.
size() <<
nl
281 <<
" absTol:" << absTol <<
nl
283 <<
" sum(mag(nf & nr)):" <<
sum(
mag(nf & nr)) <<
endl;
297 separation_.setSize(0);
312 transform == ROTATIONAL
314 transform != TRANSLATIONAL
321 separation_.setSize(0);
323 forwardT_.setSize(Cf.
size());
324 reverseT_.setSize(Cf.
size());
334 Pout<<
" sum(mag(forwardT_ - forwardT_[0])):"
335 <<
sum(
mag(forwardT_ - forwardT_[0]))
339 if (
sum(
mag(forwardT_ - forwardT_[0])) < error)
341 forwardT_.setSize(1);
342 reverseT_.setSize(1);
346 Pout<<
" difference in rotation less than"
347 <<
" local tolerance "
348 << error <<
". Assuming uniform rotation." <<
endl;
356 forwardT_.setSize(0);
357 reverseT_.setSize(0);
359 separation_ = Cr - Cf;
367 bool sameSeparation =
true;
369 forAll(separation_, facei)
371 scalar smallSqr =
sqr(smallDist[facei]);
373 if (
magSqr(separation_[facei] - separation_[0]) > smallSqr)
377 Pout<<
" separation " << separation_[facei]
379 <<
" differs from separation[0] " << separation_[0]
380 <<
" by more than local tolerance "
382 <<
". Assuming non-uniform separation." <<
endl;
384 sameSeparation =
false;
392 if (
magSqr(separation_[0]) <
sqr(smallDist[0]))
396 Pout<<
" separation " <<
mag(separation_[0])
397 <<
" less than local tolerance " << smallDist[0]
398 <<
". Assuming zero separation." <<
endl;
401 separation_.setSize(0);
407 Pout<<
" separation " <<
mag(separation_[0])
408 <<
" more than local tolerance " << smallDist[0]
409 <<
". Assuming uniform separation." <<
endl;
412 separation_.setSize(1);
420 Pout<<
" separation_:" << separation_.size() <<
nl
421 <<
" forwardT size:" << forwardT_.size() <<
endl;
472 polyPatch(pp, bm, index, newSize, newStart)