BUG: searchableSurfaceCollection: calculation of bounds, transformation of normal
This commit is contained in:
parent
657e68ed78
commit
df5feff482
@ -247,6 +247,35 @@ Foam::searchableSurfaceCollection::searchableSurfaceCollection
|
||||
transform_.setSize(surfI);
|
||||
subGeom_.setSize(surfI);
|
||||
indexOffset_.setSize(surfI+1);
|
||||
|
||||
// Bounds is the overall bounds
|
||||
bounds() = boundBox(point::max, point::min);
|
||||
|
||||
forAll(subGeom_, surfI)
|
||||
{
|
||||
const boundBox& surfBb = subGeom_[surfI].bounds();
|
||||
|
||||
// Transform back to global coordinate sys.
|
||||
const point surfBbMin = transform_[surfI].globalPosition
|
||||
(
|
||||
cmptMultiply
|
||||
(
|
||||
surfBb.min(),
|
||||
scale_[surfI]
|
||||
)
|
||||
);
|
||||
const point surfBbMax = transform_[surfI].globalPosition
|
||||
(
|
||||
cmptMultiply
|
||||
(
|
||||
surfBb.max(),
|
||||
scale_[surfI]
|
||||
)
|
||||
);
|
||||
|
||||
bounds().min() = min(bounds().min(), surfBbMin);
|
||||
bounds().max() = max(bounds().max(), surfBbMax);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -579,6 +608,9 @@ void Foam::searchableSurfaceCollection::getNormal
|
||||
vectorField surfNormal;
|
||||
subGeom_[surfI].getNormal(surfInfo[surfI], surfNormal);
|
||||
|
||||
// Transform back to global coordinate sys.
|
||||
surfNormal = transform_[surfI].globalVector(surfNormal);
|
||||
|
||||
const labelList& map = infoMap[surfI];
|
||||
forAll(map, i)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user