Reflection lines

From HandWiki
Revision as of 15:00, 6 February 2024 by Steve2012 (talk | contribs) (url)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 [math]\displaystyle{ C^2 }[/math]. 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 [math]\displaystyle{ C^1 }[/math] and [math]\displaystyle{ C^2 }[/math] 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 [math]\displaystyle{ p }[/math] on a surface [math]\displaystyle{ M }[/math] with (normalized) normal [math]\displaystyle{ n }[/math]. If an observer views this point from infinity at view direction [math]\displaystyle{ v }[/math] then the reflected view direction [math]\displaystyle{ r }[/math] is:

[math]\displaystyle{ r = v - 2 (n \cdot v) n. }[/math]

(The vector [math]\displaystyle{ v }[/math] is decomposed into its normal part [math]\displaystyle{ v_n = (n\cdot v) v }[/math] and tangential part [math]\displaystyle{ v_t = v - v_n }[/math]. Upon reflection, the tangential part is kept and the normal part is negated.)

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

Define the vector [math]\displaystyle{ r_p }[/math] to be the reflection direction [math]\displaystyle{ r }[/math] projected onto a plane [math]\displaystyle{ P }[/math] that is orthogonal to [math]\displaystyle{ a }[/math]:

[math]\displaystyle{ r_p = r - (r \cdot a)a }[/math]

and similarly let [math]\displaystyle{ v_p }[/math] be the viewing direction projected onto [math]\displaystyle{ P }[/math]:

[math]\displaystyle{ v_p = v - (v \cdot a)a }[/math]

Finally, define [math]\displaystyle{ v_o }[/math] to be the direction lying in [math]\displaystyle{ P }[/math] perpendicular to [math]\displaystyle{ a }[/math] and [math]\displaystyle{ v_p }[/math]:

[math]\displaystyle{ v_o = a \times v_p }[/math]

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

[math]\displaystyle{ \theta = \arctan{( r_p \cdot v_o, r_p \cdot v_p)} }[/math]

where [math]\displaystyle{ arctan(y,x) }[/math] is the atan2 function producing a number in the range [math]\displaystyle{ (-\pi,\pi] }[/math].

([math]\displaystyle{ v_p }[/math] and [math]\displaystyle{ v_o }[/math] can be viewed as a local coordinate system in [math]\displaystyle{ P }[/math] with [math]\displaystyle{ x }[/math]-axis in direction [math]\displaystyle{ v_p }[/math] and [math]\displaystyle{ y }[/math]-axis in direction [math]\displaystyle{ v_o }[/math].)

Finally, to render the reflection lines positive values [math]\displaystyle{ \theta\gt 0 }[/math] 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 [math]\displaystyle{ x }[/math] perpendicular to the light source:

[math]\displaystyle{ \theta = \arctan{( n_a \cdot a^\perp,n_a \cdot x)} }[/math]

where [math]\displaystyle{ n_a }[/math] is the surface normal projected on the light source plane [math]\displaystyle{ P }[/math]:

[math]\displaystyle{ \hat{n_a}/|\hat{n_a}|, \hat{n_a} = n - (n \cdot a)a }[/math]

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

References

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