Conversion of Dupin cyclide patches into rational ... - CiteSeerX

Conversion of Dupin cyclide patches into rational biquadratic B´ ezier form Sebti Foufou1 , Lionel Garnier1 , and Michael J. Pratt2 1

2

LE2I, UMR CNRS 5158, UFR Sciences, Universit´e de Bourgogne, BP 47870, 21078 Dijon Cedex, France [email protected], [email protected] LMR Systems, 21 High Street, Carlton, Bedford, MK43 7LA, UK [email protected]

Abstract. This paper uses the symmetry properties of circles and Bernstein polynomials to establish a series of interesting barycentric properties of rational biquadratic B´ezier patches. A robust algorithm is presented, based on these properties, for the conversion of Dupin cyclide patches into B´ezier form. A set of conversion examples illustrates the use of this algorithm.

1

Introduction

Rational Biquadratic B´ezier Surfaces (RBBSs) are tensor product parametric surfaces widely used in the first generation of computer graphics applications and geometric modelling systems. Good introductions to RBBSs may be found in [1–4]. Dupin cyclide surfaces represent a family of ringed surfaces, i.e., surfaces generated by a circle of variable radius sweeping through space [5–7]. It is possible to formulate them either as algebraic or parametric surfaces. In recent decades, the interest of several authors in these surfaces relates to their potential value in the development of CAGD tools [8, 9]. Also, cyclide intersections and the use of cyclides as blending surfaces have been investigated [10, 11]. The primary aim of this paper is to prove a series of useful properties of RBBSs, called barycentric properties, and to show how they can be used to convert cyclide patches into RBBSs. Section 2 gives background information concerning Rational Quadratic B´ezier Curves (RQBCs) and RBBSs, introduces the Dupin cyclides, and discusses an algorithm for conversion of Dupin cyclide patches to RBBSs. Section 3 shows the use of RQBCs to represent circular arcs. Section 4 states and proves a set of new barycentric properties of RBBSs. Section 5 uses these properties to define a robust new algorithm for the conversion of Dupin cyclides into RBBSs, and illustrates some of the conversion results obtained. Section 6 presents our conclusions and suggests directions for future work.

2

2 2.1

Background Rational quadratic B´ ezier curves and surfaces

A Rational Quadratic B´ezier Curve (RQBC) is a second degree parametric curve defined by:   2  1 −−−−→ −−→ OM (t) = 2 wi Bi (t)OPi , t ∈ [0, 1] (1)  i=0 wi Bi (t) i=0 2

where Bi (t) are quadratic Bernstein polynomials defined as: B0 (t) = (1 − t) , B1 (t) = 2t (1 − t) and B2 (t) = t2 , and for i ∈ {0, 1, 2}, wi are weights associated with the control points Pi . For a standard RQBC w0 and w2 are equal to 1, while w1 can be used to control the type of conic defined by the curve. Rational Biquadratic B´ezier Surfaces (RBBSs) are defined by a tensor product of two RQBCs by: −−−−−−−→ OM (u, v) =

1 2  2 

wij Bi (u) Bj (v)

2 2  

−−−→ wij Bi (u) Bj (v) OPij

(2)

i=0 j=0

i=0 j=0

More details on B´ezier curves and surfaces can be found in [12, 4]. 2.2

Dupin cyclides

Non-degenerate Dupin cyclides can be characterized by either of the following two equivalent implicit equations:  2 2 2 x + y 2 + z 2 − μ2 + b2 = 4 (ax − cμ) + 4b2 y 2 (3)  2 2 2 x + y 2 + z 2 − μ2 − b2 = 4 (cx − aμ) − 4b2 z 2 (4) Parameters a, b and c are related by c2 = a2 − b2 . The parameter a is always greater than or equal to c. Parameters a, c and μ determine the type of the cyclide. When c < μ ≤ a it is a ring cyclide, when 0 < μ ≤ c it is a horned cyclide, and when μ > a it is a spindle cyclide. The parametric form is represented by equation (5), where parameters θ and ψ satisfy (0 ≤ θ, ψ ≤ 2π): ⎧ μ(c − a cos θ cos ψ) + b2 cos θ ⎪ ⎪ x(θ, ψ) = ⎪ ⎪ a − c cos θ cos ψ ⎪ ⎪ ⎪ ⎪ ⎨ b sin θ × (a − μ cos ψ) (5) y(θ, ψ) = ⎪ a − c cos θ cos ψ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ b sin ψ × (c cos θ − μ) ⎪ ⎩ z(θ, ψ) = a − c cos θ cos ψ These are the most important properties of Dupin cyclide surfaces:

3

– Simple mathematical representation in either implicit or parametric form. – Circular lines of curvature. These lines of curvature correspond to isoparametric lines of constant θ or ψ. The angle between the surface normal and the principal normal on the lines of curvature is also constant. – Each cyclide has two perpendicular planes of symmetry. The intersections of a cyclide with its planes of symmetry are two pairs of circles called the principal circles. These are the lines of curvature of the cyclide for which ψ = 0, ψ = π, θ = 0 or θ = π. – In the parametric form, knowledge of the four principal circles allows the computation of the parameters a, c, and μ. – The curvature line and tangent cone properties given above make it easy to use Dupin cyclides to create blends between other cyclide surfaces, including the important special cases of circular cylinders, circular cones, spheres and toruses. 2.3

Conversion of Dupin cyclides to RBBSs

If a RBBS is parameterized in terms of u and v, its isoparametric curves are conics. Lines of curvature of Dupin cyclides are circles, which are particular cases of conics. It is thus possible to convert a Dupin cyclide patch into an RBBS. In the rest of this paper, the Dupin cyclide patch to be converted will be referred to as a cyclide patch. It is assumed to be delimited by the curvature lines corresponding to parameter values (θ0 , θ1 , ψ0 , ψ1 ). A conversion algorithm of the type discussed was proposed in [5]. The control points and their associated weights were determined from the parametric equation of the Dupin cyclide (equation (5)) by the following method: 1. The parameter transformations ∀θ ∈ R − (π + 2πZ), cos θ =

2 tan U 1 − tan2 U , sin θ = 1 + tan2 U 1 + tan2 U

(6)

where U = tan(θ/2), together with corresponding expressions for cos ψ and sin ψ in terms of V = tan(ψ/2), were used to obtain rational quadratic forms for the three coordinates in terms of U, V . 2. A linear reparametrization was now applied to obtain a representation in terms of u, v such that u, v ∈ [0, 1]. 3. The common denominator of the resulting scalar-valued rational biquadratics in u and v was reformulated in terms of the quadratic Bernstein basis functions. The resulting coefficients of those basis functions were identified with the weights wij in the denominator of equation (2). 4. Finally, with the weights known, the numerators of the three rational biquadratics were similarly reformulated. This gave the coordinates of the patch control points, expressed in terms of the defining constants of the particular cyclide, a, c, μ, together with the bounding parameter values of the original cyclide patch.

4

Fig. 1. Conversion of a Dupin cyclide patch (left) to RBBS (right) using Pratt’s original algorithm.

Figure 1 shows an example of the conversion of a Dupin cyclide patch into a RBBS using this algorithm. A problem with this algorithm is that the function tan is discontinuous, not being defined for values π2 + πZ. This has the results that 1. for certain choices of patch boundary the reparametrization functions are not defined (though these special cases could be identified and appropriate limiting values used); 2. more importantly, the algorithm gives incorrect results when π ∈ ]θ0 , θ1 [ or when π ∈ ]ψ0 , ψ1 [.

Fig. 2. Incorrect conversion. Left, the cyclide patch. Middle, the resulting RBBS representing the complementary patch, not the intended one. Right, the correct corresponding RBBS

Figure 2 illustrates a case of erroneous results from this algorithm. The cyclide patch (left subfigure) is defined by a = 6, μ = 3, c = 2, θ0 = π4 , θ1 = 5π 6 , 4π ψ0 = 2π 3 and ψ1 = 3 . To obtain the RBBS of the right subfigure, that correctly represents the cyclide patch of the left subfigure, we used a new variant of this algorithm obtained by taking the absolute value of the weights as calculated by Pratt’s original formula, i.e., wij = |a (1 + Gi ) (1 + Hj ) − c (1 − Gi ) (1 − Hj )|

(7)

In this formula, the variables Gi and Hj are intermediate values computed from tan of θ0 /2, θ1 /2, ψ0 /2 and ψ1 /2 (see [5] for further details).

5

As we have seen, the boundary parameter values θ0 , θ1 , ψ0 and ψ1 , together with the values of a, c and μ, can be used to determine control points and weights of the RBBS. If θ0 = 0 and θ1 = 4π 3 , the computed control points calculated by the variant algorithm incorrectly correspond to the patch delimited by θ0 = − 2π 3 and θ1 = 0. We must therefore require |θ0 − θ1 | < π and |ψ0 − ψ1 | < π. Taking this constraint into consideration gives several possibilities for conversion of a complete Dupin cyclide. Figure 3 left illustrates a Dupin cyclide converted into 9 RBBSs using this new variant of the algorithm. Combined use of both the original and the variant algorithm allows to decrease the number of RBBSs to 6, which is believed to be the minimal number of RBBSs necessary for the representation of a complete Dupin cyclide (Figure 3 right). The new variant of

Fig. 3. Conversion of a whole Dupin cyclide into a set of RBBSs

this algorithm makes it possible to convert a whole Dupin cyclide into a set of RBBSs, but it is still not possible to convert a cyclide patch delimited by a curve obtained with one of the parameters equal to π. Moreover, having only positive weights is not enough to work correctly for certain cases where some control points need to have negative weights. Figure 4 shows a case where the original

Fig. 4. Conversion of a cyclide patch. Left, the cyclide patch. Middle, the RBBS given by Pratt’s algorithm. Right, the RBBS given by the variant of Pratt’s algorithm.

algorithm works correctly (the middle subfigure) while the new variant fails (the right subfigure). The cyclide patch is defined by a = 6, c = 2, μ = 3, θ0 = − π3 , θ1 = π2 , ψ0 = 0 and ψ1 = π2 . The output of the new variant is completely wrong: Border curve C  is the complement, on the circle, of the border curve C of the

6

cyclide patch. This is due to the fact that w10 is positive while it should be negative to model the border curve C. The same problem occurs for w11 . Another

Fig. 5. A conversion example where both Pratt’s algorithm and its variant fail.

conversion example is given in Figure 5. Parameters defining the cyclide patch 4π 5π 3π are a = 6, c = 2, μ = 3, θ0 = 2π 3 , θ1 = 3 , ψ0 = 6 and ψ1 = 2 . The original algorithm gives exactly the complement of the cyclide patch: the corner points are those of the cyclide patch while thr delimiting curves are the complements, on the circle, of the curves defining the cyclide patch. On the other hand, the RBBS obtained by the new variant of this algorithm (right subfigure) has the same corner points and border curves as the cyclide patch, but the central control point P11 is not correct; the weight w11 should be negative, while the new variant gives only positive weights. A less problematic conversion algorithm, based on barycentric properties of RBBSs and geometric properties of Dupin cyclides is proposed in section 5.

3

Modeling circular arcs using RQBCs

RQBCs can be used to model conics. Three control points and a scalar value (the weight of the middle control point) are enough to define an arc of a conic. In this section, we give some results on the expression of circular arcs using RQBC. Theorem 1 shows how to define a circle from two points and two tangents on these points. Theorem 2 presents how to compute the middle control point of the RQBC that represents a given circular arc. Theorem 3 shows how to compute the weight of the middle control point of the RQBC that represents a given circular arc. Figure 6 shows the modeling of circular arcs using RQBC. This is the geometric construction used for Theorems 1, 2 and 3. C(O0 , R) is a circle of centre O0 and radius R. Segments [P0 P1 ] and [P2 P1 ] are tangents to the circle at points P0 and P2 . I1 is the midpoint of segment [P0 P2 ]. P is the median plane of segment [P0 P2 ]. Theorem 1. Circle from two points and tangents at these points. – If the circle C(O0 , R) exists then P1 ∈ P and P1 ∈ / [P0 P2 ]. The radius is R = O0 P0 and the centre O0 is given by formula: −−−→ −−→ P P12 P1 O0 = t0 P1 I1 t0 = −−→0 −− (8) −→ I1 P 1 • P 0 P 1

7

Fig. 6. Modeling circular arcs by RQBC

– In the plane determined by C, the geometric angle P 0 O0 P2 is less than π, this means that if we take a parametrization γ of the circle in terms of cosine and sine such as P0 = γ (θ0 ), P2 = γ (θ1 ), we have |θ0 − θ1 | < π. Theorem 2. Computing control point P1 when the centre of the circle is known. The RQBC is the arc of the circle C passing through P0 and P2 . In this case, the control point P1 satisfies: −−→ −−→ I1 P1 = t1 O0 I1

−−−→ −−→ O0 P0 •I1 P0 t1 = − −−→ −−→ O0 P0 •O0 I1

(9)

Theorem 3. Computing the weight w1 . The RQBC defined by control points P0 , P1 and P2 and the weight w1 is a circular arc if and only if the following condition hold: |1 + w1 | R = |O0 I1 + w1 O0 P1 |

(10)

The RQBC defines the smaller arc of the circle if: w1 =

O0 I1 − R O0 I1 − O0 P0 = >0 R − O0 P1 O0 P0 − O0 P1

(11)

It defines the larger arc of the circle if: w1 = −

O0 I1 + R O0 I1 + O0 P0 =−