# Correction of Highlight Line Structures

György Gyurecz, Gábor Renner

► To cite this version:

György Gyurecz, Gábor Renner. Correction of Highlight Line Structures. 6th Programming Languages for Manufacturing (PROLAMAT), Oct 2013, Dresden, Germany. pp.230-238, 10.1007/978-3-642-41329-2_24. hal-01485818

HAL Id: hal-01485818

https://inria.hal.science/hal-01485818

Submitted on 9 Mar 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Correction of Highlight Line Structures

György Gyurecz¹, Gábor Renner²

¹ Department of Machine Design and Safety Engineering, Óbuda University, Hungary
 gyurecz.gyorgy@bgk.uni-obuda.hu

² Computer and Automation Research Institute, Hungarian Academy of Sciences, Hungary
 renner@vision.sztaki.hu

**Abstract.** Class A surfaces are external surfaces of industrial objects, to which aesthetic appeal is attributed. Their design involves beyond functional criteria also subjective ones related to style and appearance. The design criteria include appropriate highlight line structures of the surfaces. Correction of highlight lines is usually performed interactively by the designer, which is time consuming, tedious and inaccurate.

In the current paper an algorithmic method is suggested to automatically improve the quality of the highlight line structure. Application of the method is demonstrated by the correction of highlight line structure of industrial surfaces.

**Keywords:** Highlight lines, highlight line structure

## 1 Introduction

Most important class A surfaces can be found on cars, airplanes, ship hulls, household appliances, etc. Beyond functional criteria, the design of class A surfaces involves aspects concerning style and appearance. Creating tools supporting the work of a stylist is a challenging task in CAD and CAGD.

A highlight line structure is a series of highlight lines, representing visually the reflection and the shape error characteristics of the surface. They are calculated as the surface imprint of the linear light source array placed above the surface [1].

The structures are evaluated by the pattern and the individual shape of the highlight lines. A comprehensive quality inspection can be carried out by the comparison of the highlight line structures of different light source and surface position settings. The uniform or smoothly changing highlight line pattern is essential for the high quality highlight line structures.

Following the inspection, the defective highlight curve segments are selected and corrected. Based on the corrected highlight curves, the parameters of the surface producing the new highlight line structure can be calculated [4].

In our method the correction of highlight line structure is carried out in two steps. First, sequences of evaluation points are defined to measure the error in terms of distance and angle functions. Next, these functions are smoothed and based on the new function values, new highlight line points are calculated. New highlight curve curves
are constructed using these points. The outline of the method is summarized in Figure 1.

<figure><img src="image_2.png" /><figcaption>Fig. 1. Block diagram of the highlight line structure improvement method</figcaption></figure>

## 2 Surface representation and calculation of highlight curves

The surfaces are represented in Bézier, B-spline or NURBS form that are widely used in CAD applications. The shape of S(u,v) surface is defined by an array of control points Pᵢⱼ and the Bézier, B-spline or NURBS basis functions [5]. The highlight lines are reflections of linear light sources on the surface, calculated as set of discrete high-light points. The highlight points are points on the surface where the corresponding surface normal and the light source intersect each other. Let L(λ)=A+B a line representing a light source, where A is a point on L(λ), and B is a vector defining the direction of the line. The signed perpendicular distance d(u,v) between the normal N(u,v) at a surface point S(u,v) and the linear light source is:

$$d(u, v) = \frac{|B \times N(u, v)| \cdot [A - S(u, v)]}{|B \times N(u, v)|} \quad (1)$$
For a point on the highlight line d(u,v)=0 holds, which must be solved for the control points of S(u,v). To design high quality surfaces, this relation has to be computed with high accuracy. We developed a robust method for computing points on highlight lines, which is described in detail in [3].

The highlight lines are represented by curves constructed by interpolation in B-Spline form. For the calculation of P<sub>i</sub> control points of C(t) curves system of equation is solved, where the unknowns are the control points [5].

$$Q_k = C(\bar{t}_k) = \sum_{i=0}^{n} N_i^r(\bar{t}_k) P_i \quad (2)$$

The parameter values tk of the highlight points Qk are set proportional to the chord distance between highlight points. To ensure C2 continuity of the curves, the degree r of the basis function N is set to 3.

### 3 Selection of the defective highlight curve segments

Selection identifies the location of the correction by fitting a sketch curve on the surface around the defective region. This is carried out by the interactive tools of the CAD system. For the identification of the affected highlight curve segments Ci, i=0...N, and the endpoints A<sub>i</sub> and B<sub>i</sub> intersection points are searched. The identification is carried out by an algorithm utilizing exhaustive search method [2]. The tangents T<sub>i1</sub> and T<sub>i2</sub> corresponding to the endpoints are also identified; they are utilized in a subsequent process of correction.

In Figure 2, the defective curve segments are shown in bold; the endpoints are marked by solid squares. The dashed curve represents the user drawn sketch curve.

<figure><img src="image_3.png" /><figcaption>Fig. 2. Selection of the defective highlight curve segments</figcaption></figure>

### 4 Evaluation of the highlight line pattern

The structure of the selected highlight curve segments is evaluated on sequences sj, j=0...M of highlight points E<sub>0,0</sub>,...E<sub>i,j</sub>,...E<sub>N,M</sub> spanning over the defective segment in crosswise direction. The sequences include correct highlight curve points E<sub>0,j</sub>, E<sub>1,j</sub> and E<sub>N-1,j</sub>, E<sub>N,j</sub> needed to ensure the continuity of corrected highlight segments with the adjoining unaffected region. We evaluate the structure error by dj distance and ∝j angle functions defined on sj, sequences The distance function represents the inequalities of the structure in crosswise direction; the angle function characterizes the structure error along the highlight curves.
<figure><img src="image_4.png" /><figcaption>Fig. 3. Definition of the evaluation point sequences</figcaption></figure>

## 4.1 Calculation of evaluation point sequences

Point sequences start with points $E_{0,0}...E_{0,M}$ equally spaced on $C_0$. They are determined by the location of the furthest $A_i$ and $B_i$ endpoints and the M number of sequences. The subsequent points are calculated based on the shortest perpendicular distance between subsequent highlight curves.

Let $E'_{i,j}$ a point on the $C_i$, and $E'_{i+1,j}$ a point on the $C_{i+1}$ highlight curve (Figure 4).

<figure><img src="image_5.png" /><figcaption>Fig. 4. Calculation of the evaluation points</figcaption></figure>

Point $E'_{i+1,j}$ is in the perpendicular direction if

$$H'_{i+1,j} \cdot T'_{i+1,j} = 0 \qquad (3)$$

where $H'_{i+1,j} = E'_{i+1,j} - E'_{i,j}$

$T'_{i+1,j} = C'_{i+1}$ at $H'_{i+1,j}$

The location of $E_{i+1,j}$ evaluation point is in the surrounding of $E'_{i+1,j}$ where:

$$T_{i+1,j} \cdot T_{i,j} = 1 \qquad (4)$$

$T_{i,j} = C'_{i+1}$ at $H'_{i,j}$
## 4.2 Definition of distance and angle error functions

The distance error function is defined by the d_(i,j) distances between the consecutive sequence elements:

$$d_{i,j} = \|\mathbf{E}_{i+1,j}\| - \|\mathbf{E}_{i,j}\| \qquad (5)$$

The angle error function is defined by α_(i,j) angles between the consecutive H_i vectors:

$$\alpha_{i,j} = \arccos\left(\frac{H_{i+1} \cdot H_i}{\|H_{i+1}\| \cdot \|H_i\|}\right) \qquad (6)$$

In Figure 5, an error function constructed from points Ei,j| i=0..N, N=5 is presented. The i=2...N-2 sequence of the error functions correspond to points on defective highlight curves. The rapid and irregular changes represent the defects in the highlight curve structure. The function values at i=0,1 and N-1,N correspond to points on highlight curves of the adjoining correct pattern.

<figure><img src="image_6.png" /><figcaption>Fig. 5. Error function example</figcaption></figure>

# 5 Calculation of the new highlight curve segments

A proper highlight line pattern has smooth evaluation functions, without the disturbances seen in Figure 5 and maintains continuity with the adjoining correct pattern. For the correction of highlight curves new, smooth evaluation functions are calculated. Based on the new functions, points for the new highlight curves are obtained.

## 5.1 Calculation of the new highlight curve points

The new function values are calculated by least square approximation method, applied on the original functions. The continuity with the highlight line structure of the adjoining region is ensured by constraints on function end tangents T11 and T12.

The tangents are calculated as: $T_j^1 = E_{0,j} - E_{1,j}$ and $T_j^2 = E_{N-1,j} - E_{N,j}$.
<figure><img src="image_7.png" /><figcaption>Fig. 6. The error function after smoothing</figcaption></figure>

In Figure 6. the original (thin donuts) and the new function (thick donuts) values are shown. The $R_{i,j}$ points of the new highlight curves are calculated by $s_j$ sequences, starting from point $E_{i,j|i=1}$ and adding the $\bar{V}_{i,j} = d_{i,j} \cdot \alpha_{i,j}$ vectors defined by the angle and distance function values:

$$R_{i,j} = E_{1,j} + \sum_{i} V_{i,j} \text{ where } i = 1..N-1, j = 1..M-1 \quad (7)$$

Figure 7 shows calculation of new $R_{(i,j)}$ points (indicated by solid squares).

<figure><img src="image_8.png" /><figcaption>Fig. 7. Calculation of points for new highlight curve segments</figcaption></figure>

## 5.2 Construction of the corrected highlight curve segments

The new $C_i$ highlight curve segments are cubic B-Splines constructed from the new $R_{(i,j)}$ points by constrained least squares curve fitting method [5]. The points to be approximated are $R_{(i,0)},...R_{(i,j)}...R_{(i,M)}$ new highlight curve points, arranged by $C_i$ highlight curves. The constraints are $A_i$ and $B_i$ segment endpoints and the $T_i^1$ and $T_i^2$ end-point tangents. The $u_{Ai}$ and $u_{Bi}$ parameter values of the new segments correspond to $A_i$ and $B_i$ segment endpoints. For the calculation of $P_i$ control points, system of equations is solved. The $u_k$, parameters of the curve points $Q_k$ are defined on $u_k = u_{Ai}...u_{Bi}$. The parameter values are set proportional to the chord distance between the highlight curve points.
<figure><img src="image_9.png" /><figcaption>Fig. 8. New highlight curve segment</figcaption></figure>

In Figure 8 the result of a curve fitting is shown. The corrected highlight curve segment (thick continuous curve) approximates the new highlight curve points and has C2 connectivity to the correct highlight curve segments in Ai and Bi endpoints.

# 6 Application and Examples

The method is implemented in Rhino 4 NURBS modeler. The calculation of new highlight curve points and the construction of corrected highlight curve segments is written in C++ code, the calculation and selection of highlight curves is realized in VBA. We tested our method on several industrial surfaces. In Fig. 9 and Fig. 10, two highlight curve structures before and after corrections are presented.

<figure><img src="image_10.png" /><figcaption>Fig. 9. Car body element before and after correction</figcaption></figure>
<figure><img src="image_11.png" /><figcaption>Fig. 10. Car body element before and after correction</figcaption></figure>

# 7 Summary

A method for correcting highlight line structures is presented. The correction is result of two consecutive steps. In the first step, distance and angle evaluation functions are defined to characterize the error in the highlight curve structure. In next step, the functions are smoothed, and based on the smoothed functions new highlight curve points are calculated. The corrected highlight curves are constructed based on the new points.

The defective surface area is selected interactively, the evaluation and correction of highlight lines is automated. The parameters of the automatic correction can be adjusted by the designer.

The method is successfully implemented in the surface modeling software (Rhino 4) widely used in industrial shape design. The method is applicable to surfaces with uniform or changing highlight line pattern, and wide range of highlight line errors. The applicability of the method was proved on number of industrial surfaces.
8 Literature

1. Beier K P, Chen Y. Highlight-line algorithm for real time surface quality assessment. Computer Aided Design 1994, 26(4), pp. 268-277.

2. Deb, K: Optimization for Engineering Design: Algorithms and Examples, New Delhi: Prentice-Hall 1998

3. Gyurecz, Gy., and G. Renner, "Robust computation of reflection lines", Journal of Machine Manufacturing, vol. 1: Gépipari Tudományos Egyesület, pp. 1-6, 2009

4. Gyurecz, Gy., and G. Renner, "Correcting Fine Structure of Surfaces by Genetic Algorithm", Acta Polytechnica Hungarica, vol. 8, issue 6, pp. 181-190, 02/2012

5. Pigel L, Tiller W. The NURBS Book, Springer, Berlin, Heidelberg New York, 1995