Algorithm Search⌘K

Techniquecore

Reflection lines

Also called reflection line analysis, zebra stripes.

Shows the mirror image of a family of parallel light lines in a surface, so a designer sees breaks in tangent or curvature continuity as kinks, after Klass.

Reflection lines are the curves on a surface where a fixed eye sees the mirror images of a family of parallel straight light lines, as on the polished body of a car in a hall with rows of strip lights. Klass introduced them in 1980 as a way to inspect and correct car body surfaces. They are a diagnostic, not an algorithm: they show the normal field of the surface in a form that the eye judges well, and a designer reads them. Because a reflection line depends on the normal, it is one order less smooth than the surface, so a jump in curvature shows as a kink and a jump in the tangent plane shows as a break.

In plain words

Put a shiny object under a ceiling with long parallel strip lights and look at it. On a flat mirror the strips look like straight lines. On a smooth curved panel they bend, but they bend smoothly. Where two panels meet with a sudden change in how sharply they bend, the reflected strips turn a corner, and where the panels meet at an angle the strips break apart. The eye is very good at seeing such corners and breaks, even when the change is too small to see in the shape. A program imitates this: for each point of the surface it follows the line of sight, bounces it off the surface like light off a mirror, and records which strip it hits. Drawing the boundaries between strips gives the reflection lines.

When it applies

  • The surface is given with its normals: a parametric patch, a set of patches, or a fine mesh with good normals.
  • The question is about smoothness: are two patches tangent (G1G^1) or curvature continuous (G2G^2) along their common boundary, and are there small waves inside a patch?
  • The answer is wanted as a picture for a person, at interactive speed, and not as a number. For a number, such as the size of a curvature jump, compute curvatures directly.
  • The result depends on the eye position and on the light lines, so a check must use several set-ups. A defect can be invisible in one of them.

The template

This page uses the unit normal n=ru×rv/∣ru×rv∣n = r_u \times r_v / |r_u \times r_v| of a surface r(u,v)r(u, v), and H=(k1+k2)/2H = (k_1 + k_2)/2 for this nn. Reflection lines do not depend on the sign of nn, because the mirror formula below is even in nn.

Set-up. An eye point EE. A light plane Π={x:m⋅x=h}\Pi = \{x : m \cdot x = h\} with unit normal mm. A unit direction dd in Π\Pi, and a unit vector ee in Π\Pi orthogonal to dd. The light lines are {x∈Π:(x−q0)⋅e=λ}\{x \in \Pi : (x - q_0) \cdot e = \lambda\} for a base point q0∈Πq_0 \in \Pi and the levels λ=λ0+jδ\lambda = \lambda_0 + j \delta, j∈Zj \in \mathbb{Z}.

The function. For a surface point P=r(u,v)P = r(u, v) with normal nn:

  1. The view direction is w=(P−E)/∣P−E∣w = (P - E)/|P - E|.
  2. The mirror direction is ρ=w−2(w⋅n) n\rho = w - 2 (w \cdot n)\, n.
  3. If m⋅ρ≠0m \cdot \rho \ne 0 and t=(h−m⋅P)/(m⋅ρ)>0t = (h - m \cdot P)/(m \cdot \rho) > 0, the reflected ray meets Π\Pi at Q=P+tρQ = P + t \rho, and g(u,v)=(Q−q0)⋅eg(u, v) = (Q - q_0) \cdot e. Otherwise PP sees no light line, and gg is undefined.

The reflection line of level λ\lambda is {r(u,v):g(u,v)=λ}\{r(u, v) : g(u, v) = \lambda\}.

Drawing. Evaluate gg on a grid of each patch and extract the level curves of the levels λj\lambda_j with marching squares, or trace them with a predictor and corrector step. The zebra display instead colours each point by the parity of ⌊(g−λ0)/δ⌋\lfloor (g - \lambda_0)/\delta \rfloor, which gives alternating light and dark stripes whose edges are the reflection lines. A renderer gets the same picture from an environment map with stripes.

Reading. Look at the lines where they cross patch boundaries. A smooth crossing means no visible defect for this set-up. A kink means a jump in curvature, and a break means a jump in the tangent plane. Then move the eye or turn the light lines and look again.

Continuity. gg is a smooth function of PP and nn where it is defined. So the isophote theorem carries over, with f=n⋅lf = n \cdot l replaced by gg, and with the same proof: on a surface that is GkG^k across a boundary, k≥2k \ge 2, the reflection lines are Gk−1G^{k-1} where ∇g≠0\nabla g \ne 0. For k=1k = 1, gg is continuous across the boundary, its tangential derivative aa along the boundary is the same on both sides, and a reflection line that crosses transversally (a≠0a \ne 0) has a corner exactly when the one-sided cross derivatives b±b^\pm differ. In a reparametrization that makes the union C1C^1, the position terms of b±b^\pm agree, so b+−b−=∂ng⋅(nv+−nv−)b^+ - b^- = \partial_n g \cdot (n^+_v - n^-_v), which involves only the jump of the derivative of the normal. At a crease gg itself jumps.

Classic examples

A plane mirror gives straight lines

Let the surface be a plane and E′E' the mirror image of EE in it. A ray from EE to PP reflects into the ray from PP in the direction P−E′P - E'. So PP lies on the reflection line of a light line ℓ\ell if and only if E′E', PP and a point of ℓ\ell are collinear, that is, if PP lies in the plane through E′E' and ℓ\ell. The reflection line is the intersection of two planes, a straight line. A defect of a flat panel therefore shows as a bend in a straight line.

A curvature jump, seen from three directions

Take the C1C^1 surface z=y2+max⁡(x,0)2z = y^2 + \max(x, 0)^2 near the origin, whose curvature in the xx direction jumps from 00 to 22 across x=0x = 0. Put the eye at E=(0,−3,3)E = (0, -3, 3), the light plane at z=5z = 5, and the point of interest at the origin, where n=(0,0,1)n = (0, 0, 1) on both sides, w=(0,1,−1)/2w = (0, 1, -1)/\sqrt 2, ρ=(0,1,1)/2\rho = (0, 1, 1)/\sqrt 2 and Q=(0,5,5)Q = (0, 5, 5). Let ∇g±=(gx,gy)\nabla g^\pm = (g_x, g_y) be the one-sided gradients at the origin; the boundary direction is yy.

light lines parallel to gg ∇g−\nabla g^- ∇g+\nabla g^+ what the picture shows at the origin
the xx axis QyQ_y (0,−112/3)(0, -112/3) (0,−112/3)(0, -112/3) no kink: the jump is hidden
the yy axis QxQ_x (8/3,0)(8/3, 0) (−52/3,0)(-52/3, 0) the line through the origin is tangent to the boundary
the diagonal x=−yx = -y (Qx+Qy)/2(Q_x + Q_y)/\sqrt 2 (8,−112)/(32)(8, -112)/(3\sqrt 2) (−52,−112)/(32)(-52, -112)/(3\sqrt 2) a kink of about 29.0°29.0°

The second row follows by hand. On y=0y = 0 to first order in xx, the left side has n=(0,0,1)n = (0, 0, 1), ρ∝(x,3,3)\rho \propto (x, 3, 3) and Qx=x+53x=83xQ_x = x + \frac{5}{3} x = \frac{8}{3} x. The right side has n≈(−2x,0,1)n \approx (-2x, 0, 1), ρ≈(x/(32)−22x, 1/2, 1/2)\rho \approx (x/(3\sqrt 2) - 2\sqrt 2 x,\ 1/\sqrt 2,\ 1/\sqrt 2), t=52t = 5\sqrt 2, and Qx=x+52⋅x(1/(32)−22)=−523xQ_x = x + 5\sqrt 2 \cdot x (1/(3\sqrt 2) - 2\sqrt 2) = -\frac{52}{3} x. In the third row the level curves are orthogonal to the gradients, and the angle between (8,−112)(8, -112) and (−52,−112)(-52, -112) is arccos⁡(12128/12608⋅15248)≈28.99°\arccos(12128/\sqrt{12608 \cdot 15248}) \approx 28.99°. The surface and the eye are symmetric under x↦−xx \mapsto -x on the left, which makes ∂g/∂x=0\partial g / \partial x = 0 in the first row. One set-up is not enough.

Car body inspection

The original use, after Klass: a designer looks at reflection lines on a car body model, finds the places where they wiggle or kink, and changes control points there until the lines are smooth. The same check, as zebra stripes, is a standard display of surface modelers today.

Variations

  • Isophotes. Lines of constant n⋅ln \cdot l. They need only a light direction and do not depend on the eye; see isophote.
  • Highlight lines. Points whose normal line meets a fixed straight light line. Like reflection lines they lose one order of continuity, and they do not depend on the eye.
  • Zebra stripes and environment maps. The raster form of reflection lines, drawn by a renderer from a striped environment map, at the cost of the accuracy of the mesh normals.
  • Light lines at infinity. As h→∞h \to \infty with EE fixed, g/h→(ρ⋅e)/(m⋅ρ)g/h \to (\rho \cdot e)/(m \cdot \rho), which depends only on nn and on the view direction ww.
  • Fairing with reflection lines. Klass also used reflection lines to correct the irregularities that they show, by changing the surface until the lines have the wanted shape. Energy based fairing is the usual numerical alternative.

Pitfalls

  • Hidden defects. The corner at a curvature jump has size proportional to ∂ng⋅(nv+−nv−)\partial_n g \cdot (n^+_v - n^-_v), which is zero for some set-ups, as the first row of the table shows. Always look with at least two directions of the light lines.
  • Lines along the boundary. Where a reflection line runs along a patch boundary (a=0a = 0), there is no crossing to judge.
  • Artifacts of the drawing. Marching squares on a coarse grid draws a polygon, and its corners are not defects of the surface. A zebra image of a coarse mesh shows kinks at the mesh edges, even for a G2G^2 surface, when the normals are interpolated linearly. Refine the grid or the mesh before reading a kink as a defect.
  • Missing parts. Points whose reflected ray does not reach the light plane (t≤0t \le 0 or m⋅ρ=0m \cdot \rho = 0) have no reflection line. A blank region is not a defect.
  • Wrong normals. A patch with a reversed normal does not change the lines, but a normal that is wrong in direction, for example a normal from a degenerate corner of a patch, gives false kinks.

Exercises

  1. Show that the mirror direction ρ=w−2(w⋅n)n\rho = w - 2(w \cdot n) n is a unit vector and that it does not change when nn is replaced by −n-n.
  2. For the plane z=0z = 0, E=(0,−3,3)E = (0, -3, 3) and the light plane z=5z = 5 with lines parallel to the xx axis, find the reflection line of level λ=5\lambda = 5. (Answer: the line y=0y = 0, z=0z = 0, since E′=(0,−3,−3)E' = (0, -3, -3) and the plane through E′E' and the light line {y=5,z=5}\{y = 5, z = 5\} is y=zy = z.)
  3. Show that for k=1k = 1 the tangential derivatives of gg on the two sides of a G1G^1 boundary agree, and that the position terms of the cross derivatives cancel in b+−b−b^+ - b^-.
  4. In the third row of the table, rotate the light lines by an angle ϕ\phi in the plane z=5z = 5. For which ϕ\phi does the kink at the origin disappear? (Answer: only for lines parallel to the xx axis, the first row. From the table, the jump of ∂Q/∂x\partial Q/\partial x across the boundary is (−52/3−8/3,0,0)=(−20,0,0)(-52/3 - 8/3, 0, 0) = (-20, 0, 0), and the jump of ∂g/∂x\partial g/\partial x is its dot product with ee, which is zero only for e=±(0,1,0)e = \pm(0, 1, 0).)

References

  1. Klass 1980, the definition of reflection lines for an eye point and a family of parallel light lines, and their use to find and correct surface irregularities
  2. Nicholas M. Patrikalakis and Takashi Maekawa, Shape Interrogation for Computer Aided Design and Manufacturing, Springer, 2002, Chapter 8, Curve and Surface Interrogation (Section 8.1.2.3, reflection lines)
  3. Hans Hagen, Stefanie Hahmann and coauthors, Surface interrogation algorithms, IEEE Computer Graphics and Applications 12(5), 1992, reflection lines as an interrogation tool, and the statement that they lose one order of continuity with respect to the surface

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • three classic examples