void Foam::searchableBox::projectOntoCoordPlane
(
    const direction dir,
    const point& planePt,
    pointIndexHit& info
) const
{
    // Set point
    info.rawPoint()[dir] = planePt[dir];
    // Set face
    if (planePt[dir] == min()[dir])
    {
        info.setIndex(dir*2);
    }
    else if (planePt[dir] == max()[dir])
    {
        info.setIndex(dir*2+1);
    }
    else
    {
        FatalErrorIn("searchableBox::projectOntoCoordPlane(..)")
            << "Point on plane " << planePt
            << " is not on coordinate " << min()[dir]
            << " nor " << max()[dir] << abort(FatalError);
    }
}
bool Foam::exclusiveSearchableSurface::revertNormalB(const pointIndexHit& h) const
{
    pointField pt(1,h.rawPoint());
    List<volumeType> inside;

    a().getVolumeType(pt,inside);

    return inside[0]==INSIDE;
}
Exemplo n.º 3
0
void Foam::planeSearchableSurface::findLineAll
(
    const point& start,
    const point& end,
    pointIndexHit& hit
) const
{
    hit.setMiss();

    vector dir=end-start;

    scalar f=plane_.normalIntersect(start,dir);
    if(0<=f && f<=1) {
        hit.rawPoint()=start+f*dir;
        hit.setHit();
        hit.setIndex(0);
    }
}