Algorithm Search⌘K

Definitionadvanced

Gregory patch

Also called rational Gregory patch.

A bicubic patch with two inner control points at each corner, blended by rational weights, so that the cross derivative of each edge can be set independently.

A Gregory patch is a four sided patch that is a bicubic Bezier patch except at its four inner control points: each of them is split into two points, and a rational blend of the parameters picks one point near each of the two edges at that corner. So the cross derivative along each edge depends only on that edge and its own two inner points, and the four edges can be joined with G1G^1 continuity to four independent neighbours. Gregory introduced the rational corner blend in 1974 for Coons type interpolants, and Chiyokura and Kimura gave the form with twenty control points in 1983. The patch is a rational function of uu and vv, which is the reason for the name rational Gregory patch.

Definition

Let Bi(t)=(3i)ti(1−t)3−iB_i(t) = \binom{3}{i} t^i (1 - t)^{3 - i} be the cubic Bernstein polynomials. A Gregory patch has twelve boundary control points PijP_{ij}, those with i∈{0,3}i \in \{0, 3\} or j∈{0,3}j \in \{0, 3\}, and eight inner control points PijuP^u_{ij} and PijvP^v_{ij} for i,j∈{1,2}i, j \in \{1, 2\}. Here PijuP^u_{ij} is the inner point that serves the nearby edge along which uu varies (v=0v = 0 or v=1v = 1), and PijvP^v_{ij} serves the nearby edge along which vv varies (u=0u = 0 or u=1u = 1). For (u,v)(u, v) in the open square put

P11(u,v)=uP11u+vP11vu+v,P12(u,v)=uP12u+(1−v)P12vu+1−v,P_{11}(u, v) = \frac{u P^u_{11} + v P^v_{11}}{u + v}, \qquad P_{12}(u, v) = \frac{u P^u_{12} + (1 - v) P^v_{12}}{u + 1 - v},
P21(u,v)=(1−u)P21u+vP21v1−u+v,P22(u,v)=(1−u)P22u+(1−v)P22v2−u−v,P_{21}(u, v) = \frac{(1 - u) P^u_{21} + v P^v_{21}}{1 - u + v}, \qquad P_{22}(u, v) = \frac{(1 - u) P^u_{22} + (1 - v) P^v_{22}}{2 - u - v},

and

r(u,v)=∑i=03∑j=03Bi(u)Bj(v)Pij(u,v),r(u, v) = \sum_{i=0}^{3} \sum_{j=0}^{3} B_i(u) B_j(v) P_{ij}(u, v),

where the twelve boundary points are constant. Each Pij(u,v)P_{ij}(u, v) for i,j∈{1,2}i, j \in \{1, 2\} is a convex combination of its two points, so it is bounded, and Bi(u)Bj(v)→0B_i(u) B_j(v) \to 0 at the corners for these i,ji, j. So rr extends continuously to the closed square, with the four corners equal to P00,P03,P30,P33P_{00}, P_{03}, P_{30}, P_{33}.

Theorem (independent edges). The boundary curve r(u,0)r(u, 0) is the cubic Bezier curve of P00,…,P30P_{00}, \dots, P_{30}, and the cross derivative along it is

rv(u,0)=3∑i=03Bi(u)(Qi1−Pi0),Q01=P01, Q11=P11u, Q21=P21u, Q31=P31.r_v(u, 0) = 3 \sum_{i=0}^{3} B_i(u) \bigl(Q_{i1} - P_{i0}\bigr), \qquad Q_{01} = P_{01},\ Q_{11} = P^u_{11},\ Q_{21} = P^u_{21},\ Q_{31} = P_{31}.

So it is the cross derivative of the bicubic Bezier patch whose inner points near this edge are P11uP^u_{11} and P21uP^u_{21}, and it does not depend on any PvP^v point or on the other inner points. The same holds for the other three edges, with the PvP^v points on the edges u=0u = 0 and u=1u = 1.

Proof. At v=0v = 0, Bj(0)=0B_j(0) = 0 for j≥1j \ge 1, so r(u,0)=∑iBi(u)Pi0r(u, 0) = \sum_i B_i(u) P_{i0}. Differentiate in vv by the product rule:

rv(u,0)=∑i,jBi(u)[Bj′(0)Pij(u,0)+Bj(0) ∂vPij(u,0)].r_v(u, 0) = \sum_{i, j} B_i(u) \bigl[B_j'(0) P_{ij}(u, 0) + B_j(0)\, \partial_v P_{ij}(u, 0)\bigr].

The second term is zero: for j≥1j \ge 1 because Bj(0)=0B_j(0) = 0, and for j=0j = 0 because the boundary points do not depend on vv. For 0<u<10 < u < 1 the derivatives ∂vPij\partial_v P_{ij} exist and are bounded near v=0v = 0, so the product rule is valid. In the first term, B0′(0)=−3B_0'(0) = -3, B1′(0)=3B_1'(0) = 3 and Bj′(0)=0B_j'(0) = 0 for j≥2j \ge 2, so only the rows j=0j = 0 and j=1j = 1 remain. In row j=1j = 1, P11(u,0)=uP11u/u=P11uP_{11}(u, 0) = u P^u_{11}/u = P^u_{11} and P21(u,0)=(1−u)P21u/(1−u)=P21uP_{21}(u, 0) = (1 - u) P^u_{21}/(1 - u) = P^u_{21}. This gives the formula for 0<u<10 < u < 1, and both sides are continuous in uu on [0,1][0, 1]. The other edges follow in the same way. □\square

Consequence. To join the patch to a neighbour across the edge v=0v = 0 with tangent plane continuity, choose P11uP^u_{11} and P21uP^u_{21} so that this cross derivative satisfies the G1G^1 condition with the neighbour. The choice does not change the other three edges. At the corner (0,0)(0, 0) the edge v=0v = 0 gives the twist 9(P11u−P10−P01+P00)9 (P^u_{11} - P_{10} - P_{01} + P_{00}), and the edge u=0u = 0 gives 9(P11v−P10−P01+P00)9 (P^v_{11} - P_{10} - P_{01} + P_{00}). These are the two twists of twist compatibility, and the patch takes both, so it needs no compatibility condition. The price is smoothness at the corner points: there the mixed derivative of rr has no limit when P11u≠P11vP^u_{11} \ne P^v_{11}, which the theorem on the twist compatibility page shows to be unavoidable.

Examples and non-examples

Incompatible twists. Take Pij=(i,j,0)P_{ij} = (i, j, 0) for all boundary points and all inner points, except P11u=(1,1,1)P^u_{11} = (1, 1, 1). By the theorem, along v=0v = 0 the cross derivative is rv(u,0)=(0,3,3B1(u))=(0,3,9u(1−u)2)r_v(u, 0) = (0, 3, 3 B_1(u)) = (0, 3, 9u(1 - u)^2), while along u=0u = 0 it is ru(0,v)=(3,0,0)r_u(0, v) = (3, 0, 0). The height zz therefore has zvu=9z_{vu} = 9 from the first edge and zuv=0z_{uv} = 0 from the second at the corner (0,0)(0, 0), which no polynomial patch can have. The Gregory patch has them both. Its centre is r(1/2,1/2)=(3/2,3/2,z)r(1/2, 1/2) = (3/2, 3/2, z) with z=B1(1/2)2⋅12=964⋅12=9128z = B_1(1/2)^2 \cdot \frac{1}{2} = \frac{9}{64} \cdot \frac{1}{2} = \frac{9}{128}, since only the P11P_{11} term has a height and the blend gives it the weight u/(u+v)=1/2u/(u + v) = 1/2.

A bicubic Bezier patch. If Piju=PijvP^u_{ij} = P^v_{ij} for all four inner positions, every blend is constant and the Gregory patch is the bicubic Bezier patch with these inner points. So bicubic Bezier patches are the Gregory patches with compatible twists of this special form.

Not a polynomial patch. If P11u≠P11vP^u_{11} \ne P^v_{11}, the patch is not a polynomial, and it is not C2C^2 at the corner (0,0)(0, 0), by the twist compatibility theorem. Inside the open square it is C∞C^\infty, since the denominators u+vu + v, u+1−vu + 1 - v, 1−u+v1 - u + v and 2−u−v2 - u - v are positive there.

A pitfall at the corners. A program that evaluates the formula at a corner divides 00 by 00. The value at the corner is the corner point, and derivatives near the corners must be taken from the limits or from points just inside.

  • The Gregory square. Gregory's 1974 construction is a Coons type Boolean sum of Hermite interpolants on all four edges, in which each corner twist is replaced by a rational blend of the two twists given by the edges, as on the twist compatibility page. The Bezier form above applies the same rational corner blend to the inner control points of a bicubic patch.
  • Coons patch. The Boolean sum construction that the Gregory square modifies at the corners.
  • n-sided patches. Triangular and multi-sided patches often use the same idea: each edge has its own cross derivative data, and rational functions blend the data of the edges so that each edge sees only its own. The generalized Bezier patch does this with rational weights on its control points.
  • Vertex blends. Where several blends meet, the corner region is a multi-sided hole, and Gregory type patches are one way to fill it.

References

  1. J. A. Gregory, Smooth interpolation without twist constraints, in R. E. Barnhill and R. F. Riesenfeld (eds.), Computer Aided Geometric Design, Academic Press, 1974, pp. 71 to 87, the Coons type interpolant whose corner twists are rational blends of the two twists given by the edges
  2. Hiroaki Chiyokura and Fumihiko Kimura, Design of solids with free-form surfaces, Computer Graphics 17(3), SIGGRAPH 1983, the Gregory patch in Bezier form, with twenty control points, and its use for G1 joins in a solid modeler (general locator)
  3. Gerald Farin, Curves and Surfaces for CAGD, A Practical Guide, fifth edition, Morgan Kaufmann, 2002, Chapter 22, Coons Patches (Boolean sums, twists and their compatibility)

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)
WritingW4 complete
  • a review of the text: no review record reviews/T032P8/text.yaml