mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Add sphere overlap function to treeDataEdge and a test.
This commit is contained in:
@ -139,6 +139,25 @@ bool Foam::treeDataEdge::overlaps
|
||||
}
|
||||
|
||||
|
||||
// Check if any point on shape is inside sphere.
|
||||
bool Foam::treeDataEdge::overlaps
|
||||
(
|
||||
const label index,
|
||||
const point& centre,
|
||||
const scalar radiusSqr
|
||||
) const
|
||||
{
|
||||
if (cacheBb_)
|
||||
{
|
||||
return bbs_[index].overlaps(centre, radiusSqr);
|
||||
}
|
||||
else
|
||||
{
|
||||
return calcBb(edgeLabels_[index]).overlaps(centre, radiusSqr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Calculate nearest point to sample. Updates (if any) nearestDistSqr, minIndex,
|
||||
// nearestPoint.
|
||||
void Foam::treeDataEdge::findNearest
|
||||
|
||||
@ -148,6 +148,14 @@ public:
|
||||
const treeBoundBox& sampleBb
|
||||
) const;
|
||||
|
||||
//- Does (bb of) shape at index overlap bb
|
||||
bool overlaps
|
||||
(
|
||||
const label index,
|
||||
const point& centre,
|
||||
const scalar radiusSqr
|
||||
) const;
|
||||
|
||||
//- Calculates nearest (to sample) point in shape.
|
||||
// Returns actual point and distance (squared)
|
||||
void findNearest
|
||||
|
||||
Reference in New Issue
Block a user