Reflection lines

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 $$C^2$$. 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.



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 = v - 2 (n \cdot v) n.$$

(The vector $$v$$ is decomposed into its normal part $$v_n = (n\cdot v) v$$ and tangential part $$v_t = v - v_n$$. 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 $$r_p$$ to be the reflection direction $$r$$ projected onto a plane $$P$$ that is orthogonal to $$a$$:

$$r_p = r - (r \cdot a)a $$

and similarly let $$v_p$$ be the viewing direction projected onto $$P$$:

$$v_p = v - (v \cdot a)a$$

Finally, define $$v_o$$ to be the direction lying in $$P$$ perpendicular to $$a$$ and $$v_p$$:

$$v_o = a \times v_p$$

Using these vectors, the *reflection line function* $$\theta(p): M \rightarrow (-\pi,\pi]$$ is a scalar function mapping points $$p$$ on the surface to angles between $$v_p$$ and $$r_p$$:

$$\theta = \arctan{( r_p \cdot v_o, r_p \cdot v_p)}$$

where $$arctan(y,x)$$ is the atan2 function producing a number in the range $$(-\pi,\pi]$$.

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

Finally, to render the reflection lines positive values $$\theta>0$$ are mapped to a light color and non-positive values to a dark color.

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

$$\theta = \arctan{( n_a \cdot a^\perp,n_a \cdot x)}$$

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

$$\hat{n_a}/|\hat{n_a}|, \hat{n_a} = n - (n \cdot a)a$$

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