Debian Codegraph @

packages/seacas/applications/blot/claspt.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 subroutine claspt( xpt, ypt, zpt, cutpt, cutnrm, status)
8
9 real xpt, ypt, zpt
10 real cutpt(3), cutnrm(3)
11 integer status
12 parameter(ISIN=1, ISON=-2, ISOUT=-1)
13 real vec(3)
14 real tol
15 parameter(REFTOL=1e-4)
16 c check dot product of normal vector and (pt-cutpt) vector to find
17 c if point is in front or behind plane
18 vec(1) = xpt - cutpt(1)
19 vec(2) = ypt - cutpt(2)
20 vec(3) = zpt - cutpt(3)
21 c tol = amax1( vec(1), vec(2), vec(3) ) * REFTOL
22 tol = REFTOL
23 dot = vec(1)*cutnrm(1) + vec(2)*cutnrm(2) + vec(3)*cutnrm(3)
24
25 if( abs(dot) .lt. tol) then
26 status = ISON
27 else if(dot .gt. 0.0) then
28 status = ISOUT
29 else
30 status = ISIN
31 end if
32 return
33 end