mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: boundBox improvements (#2609)
- construct boundBox from Pair<point> of min/max limits,
make sortable
- additional bounding box intersections (linePointRef), add noexcept
- templated access for boundBox hex-corners
(used to avoid temporary point field).
Eg, unrolled plane/bound-box intersection with early exit
- bounding box grow() to expand box by absolute amounts
Eg,
bb.grow(ROOTVSMALL); // Or: bb.grow(point::uniform(ROOTVSMALL));
vs
bb.min() -= point::uniform(ROOTVSMALL);
bb.max() += point::uniform(ROOTVSMALL);
- treeBoundBox bounding box extend with two or three parameters.
The three parameter version includes grow(...) for reduced writing.
Eg,
bb = bb.extend(rndGen, 1e-4, ROOTVSMALL);
vs
bb = bb.extend(rndGen, 1e-4);
bb.min() -= point::uniform(ROOTVSMALL);
bb.max() += point::uniform(ROOTVSMALL);
This also permits use as const variables or parameter passing.
Eg,
const treeBoundBox bb
(
treeBoundBox(some_points).extend(rndGen, 1e-4, ROOTVSMALL)
);
This commit is contained in:
@ -356,7 +356,7 @@ bool Foam::distributedTriSurfaceMesh::read()
|
||||
//outsideVolType_ = volumeType::UNKNOWN;
|
||||
//if (surfaceClosed_)
|
||||
//{
|
||||
// point outsidePt(localBb.max()+localBb.midpoint());
|
||||
// point outsidePt(localBb.max()+localBb.centre());
|
||||
// List<volumeType> outsideVolTypes;
|
||||
// triSurfaceMesh::getVolumeType
|
||||
// (
|
||||
@ -1539,7 +1539,7 @@ void Foam::distributedTriSurfaceMesh::collectLeafMids
|
||||
// No data in this octant. Set type for octant acc. to the mid
|
||||
// of its bounding box.
|
||||
const treeBoundBox subBb = nod.bb_.subBbox(octant);
|
||||
midPoints.append(subBb.midpoint());
|
||||
midPoints.append(subBb.centre());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user