Reflection lines

From testwiki
Revision as of 10:40, 3 September 2023 by imported>Edwinv1970 (Mathematical definition: added further explanations)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Orphan

Engineers use reflection lines to judge a surface's quality. Reflection lines reveal surface flaws, particularly discontinuities in normals indicating that the surface is not C2. Reflection lines may be created and examined on physical surfaces or virtual surfaces with the help of computer graphics. For example, the shiny surface of an automobile body is illuminated with reflection lines by surrounding the car with parallel light sources. Virtually, a surface can be rendered with reflection lines by modulating the surfaces point-wise color according to a simple calculation involving the surface normal, viewing direction and a square wave environment map.

Reflection lines visualized on surfaces completed using a biharmonic and triharmonic equation with C1 and C2 surface continuity respectively. Derivative discontinuities near the yellow-purple boundary on the left reveal normal discontinuities. Below are pseudocolor visualizations of curvature.

Mathematical definition

Consider a point p on a surface M with (normalized) normal n. If an observer views this point from infinity at view direction v then the reflected view direction r is:

r=v2(nv)n.

(The vector v is decomposed into its normal part vn=(nv)v and tangential part vt=vvn. Upon reflection, the tangential part is kept and the normal part is negated.)

For reflection lines we consider the surface M surrounded by parallel lines with direction a, representing infinite, non-dispersive light sources. For each point p on M we determine which line is seen from direction v. The position on each line is of no interest.

Define the vector rp to be the reflection direction r projected onto a plane P that is orthogonal to a:

rp=r(ra)a

and similarly let vp be the viewing direction projected onto P:

vp=v(va)a

Finally, define vo to be the direction lying in P perpendicular to a and vp:

vo=a×vp

Using these vectors, the *reflection line function* θ(p):M(π,π] is a scalar function mapping points p on the surface to angles between vp and rp:

θ=arctan(rpvo,rpvp)

where arctan(y,x) is the atan2 function producing a number in the range (π,π].

(vp and vo can be viewed as a local coordinate system in P with x-axis in direction vp and y-axis in direction vo.)

Finally, to render the reflection lines positive values θ>0 are mapped to a light color and non-positive values to a dark color.[1]

Highlight lines

Highlight lines are a view-independent alternative to reflection lines.[2] Here the projected normal is directly compared against some arbitrary vector x perpendicular to the light source:

θ=arctan(naa,nax)

where na is the surface normal projected on the light source plane P:

na^/|na^|,na^=n(na)a

The relationship between reflection lines and highlight lines is likened to that between specular and diffuse shading.

References

Template:Reflist

  1. Gingold et al. "Shape Optimization Using Reflection Lines"
  2. Beier and Chen. "Highlight-line algorithm for realtime surface-quality assessment"