This paper focuses on the orthogonal projection of rational curves onto rational parameterized surface. Three symbolic algorithms are developed and studied. One of them, based on regular systems, is able to compute the exact parametric loci of projection. The one based on Gröbner basis can compute the minimal variety that contains the parametric loci. The remaining one computes a variety that contains the parametric loci via resultant. Examples show that our algorithms are efficient and valuable.
1. Introduction
Computing the projection of a point onto a surface is to find a closest point on the surface, and projection of a curve onto a surface is the locus of all points on the curve project onto the surface. The orthogonal projection problem attracted great interest in minimal distance computation [1, 2], calculating the intersection of curves and surfaces [3], surface curve design [4, 5], curve or surface selecting [6], and shape registration [7]. And many algorithms have been developed. The work in [8] proposed a second-order tracing method for calculating the orthogonal projection of parametric curves onto B-spline surfaces. The work in [9] focused on projecting points onto conics. The work in [10] developed a second-order algorithm for orthogonal projection onto curves and surfaces. The work in [11] used a torus patch to approach the surface in projection computation. In [12], an efficient algorithm is presented for projecting a point to its closest point. Among these methods, the common steps are to find the approach projective point in normed space by iteration techniques which rely on good initial values and then determine the approximate parameters in parametric space, which is called a point inversion problem.
Numerical methods above are efficient and stable in computing orthogonal projection and are easy applied. However, there exist common drawbacks as follows: the computation relies on samplings and the step size determines the accuracy of the result. The projective locus might be invisible while the locus is smaller than the step size. And the curve is always assumed to keep close enough to the surface so that a single solution is guaranteed. Symbolic methods would be necessary to overcome the shortcomings. Previous applications of symbolic methods in CAGD could be seen in [13–15]. In order to apply symbolic methods, we only are concerned about curves and surfaces that have rational parametric representations. As known to all, common representations of surface and curves are NURBS [16], which is formed by rational patches. And since the parametric locus could uniquely determine the projection in 3D space, we focus on the parametric locus of orthogonal projection. Moreover, the range of surfaces and curves is restricted in R3.
Classical symbolic tools applied in this paper are regular systems [17] (triangular decomposition), Gröbner basis [18], and resultant (see [19, 20]). Parametrization of curves and surfaces is a hard task in the area [21]. But, for convenience, we only consider parametric curves and surfaces. With the rational assumptions of curves and surfaces, the orthogonal condition would be transformed into a simple polynomial system. Then the orthogonal projection problem equals determining the real solution of the polynomial system, which can be solved by symbolic or mix symbolic-numeric techniques.
In this paper, three algorithms are presented to compute the orthogonal projection of a rational parameterized curve onto a rational parameterized surface. The algorithm based on regular systems is able to compute the exact loci of orthogonal projection, and the false points will be detected. By means of Gröbner bases, we can get the minimal variety that contains the projective loci. And the resultant method efficiently computes a variety that contains the projective loci. The former two algorithms can particularly be used to compute point projections.
Compared with numerical algorithms, our algorithms have distinct advantages:
We generate the exact results without numerical errors.
Both point projection and curve projection are included.
There is no point inversion problem involved since we directly are concerned about the parametric loci.
In addition, the decomposition method in [22] would generate duplicate zeros between different regular systems and Huang and Wang [15] proposed a method to simplify the result. We improve Huang’s method and directly consider the symbolic representation of zeros. Once the redundancy of zeros is judged, the corresponding regular system could be deleted without changing the zeros.
An early version of this paper has been reported on the 4th International Congress on Mathematical Software [23], in which the main algorithms and proofs are missing. The rest of the paper is organized as follows. In Section 2, some concepts and properties of regular systems, Gröbner basis, and resultant are introduced. Section 3 presents the main theorems. And Section 4 describes the algorithms based on the theorems in Section 3. In Section 5, we demonstrate nontrivial examples and experiment results. This paper is summarized in a brief conclusion in Section 6.
2. Preliminaries
Assume that K is a field with characteristic 0 and K[x1,…,xn] denotes the polynomial ring on K with ordered indeterminates x1<x2<⋯<xn. For a polynomial P∈K[x1,…,xn], ZeroK^(P)={a∈K^n∣P(a)=0} is called the zero set of P, where K^ is a field extension of K. And ZeroK^(P) is simply denoted as Zero(P) in this paper when there is no ambiguity.
Definition 1.
For Z⊆K^n, one defines (1)ProjkZ=x1,…,xk∣x1,…,xn∈Z,where 1≤k≤n.
Let P, Q be two polynomial sets contained in K[x1,…,xn]. We denote Zero(P)=∩P∈PZero(P), and ZeroP/Q=ZeroP,Q=ZeroP-∪Q∈QZero(Q). [P,Q] is called a polynomial system.
For a polynomial P∈K[x1,…,xn], we say cls(P)=k, if k is the largest such that xk appears in P. If cls(P)=k, then P has the following expression:(2)P=∑i=0daixki,where ai∈K[x1,…,xk-1] and ad≠0. ad is called the initial of P, denoted by ini(P).
Let P⊆K[x1,…,xn]∖{0} be a polynomial set; then P(k) denotes the set P∩K[x1,…,xk] for 0≤k≤n. Note that P(n)=P, P(0)=P∩K.
Definition 2.
A polynomial system [P,Q] is called regular if the following conditions hold:
P(0)=∅, and cls(P)≠cls(T), ∀P∈P, ∀T∈(P∪Q)∖{P};
ini(V)(x1^,x2^,…,xk^)≠0, ∀V∈P∪Q, k=cls(V), and (x1^,x2^,…,xk^)∈Zero(P(k)/Q(k)).
Proposition 3.
Let [P,Q] be a regular system; then(3)ProjkZeroP,Q=ZeroPk,Qk.
Regular system was proposed by [17], and an algorithm was given to decompose the zeros of a polynomial system into the union of zeros of a limited number of regular systems. Properties of regular systems could be referred to in [17, 22].
Definition 4.
Let I⊆K[x1,…,xn] be a nonempty polynomial ideal, and G={g1,…,gt} is a finite set contained in I. G is called a Gröbner basis of I, if and only if, for ∀f∈I, ∃1≤i≤t, such that lp(gi)∣lp(f), where lp(f) stands for the leading power product of f under a defined term order < (e.g., lexicographical order).
Proposition 5 (the elimination theorem [18, 20, 24]).
Let I⊆K[y1,…,ym,x1,…,xn] be a nonempty polynomial ideal; < is a defined order such that yi<xj, where 1≤i≤m and 1≤j≤n. If G={g1,g2,…,gt} is a Gröbner basis of I, then G∩K[y1,…,ym] is a Gröbner basis of I∩K[y1,…,ym].
For a polynomial ideal I, we denote I={f∣∃s>0,fs∈I} to be the radical of I. Note that Zero(I)=Zero(I). The saturation of I with respect to a polynomial P is defined to be the set I:P∞={f∣∃s>0,Psf∈I}. Let S⊆K^n; the Zariski closure S¯ of S is the smallest algebraic variety that contains S (see [20]).
It is obvious that I:P∞=(I:P∞). Furthermore,(4)ZeroI:P∞=ZeroI∖ZeroP¯.
Proposition 6.
Let I⊆K[x1,…,xn] be a polynomial ideal. Given a nonzero polynomial H∈K[x1,…,xn], let G be a Gröbner basis of 〈I,zH-1〉 under elimination term order xi<z, where z is a new added variable; then one has(5)I:H∞=G∩Kx1,…,xn.
Let R be a commutative ring with identity. Consider f(x),g(x)∈R[x]:(6)fx=anxn+an-1xn-1+⋯+a0,an≠0,gx=bmxm+bm-1xm-1+⋯+b0,bm≠0.The Sylvester Matrix of f(x) and g(x) with respect to x is defined to be(7)Sylf,g,x=an⋯a0an⋯a0⋱an⋯a0bn⋯b0bn⋯b0⋱bn⋯b0n+m×n+m,where the former m rows are only related to the coefficients of f and the last n rows are only involved with the coefficients of g.
We denote Res(f,g,x) to be the determinant of Syl(f,g,x). And Res(f,g,x) is called the resultant of f and g with respect to x. If f(x1,…,xn),g(x1,…,xn)∈K[x1,…,xn], then Res(f,g,xn)∈K[x1,…,xn-1]. Let lc(f,xk) denote the leading term coefficient of f in variable xk.
Proposition 7 (see [19]).
Let f(x1,…,xn),g(x1,…,xn)∈K[x1,…,xn].
If (a1,…,an)∈Zero(f)∩Zero(g), then(8)a1,…,an-1∈ZeroResf,g,xn.
Conversely, if (a1,…,an-1)∈Zero(Res(f,g,xn)), then one of the following holds:
(a1,…,an-1)∈Zero(lc(f,xn))∩Zero(lc(g,xn));
(a1,…,an-1,xn)∈Zero(f)∪Zero(g), where xn is an indeterminate;
∃an∈K^, such that (a1,…,an-1,an)∈Zero(f)∩Zero(g).
Remark 8.
For a polynomial f(x1,…,xn)∈K[x1,…,xn], if f=∑i=0mAixki, where Am≠0, then we denote Cof(f,xk)={A1,…,Am}. Then entry (b) of statement (2) equals (9)a1,…,an-1∈ZeroCoff,xn∪ZeroCofg,xn.
Lemma 9 (see [21, 25]).
An algebraic curve C is rational if and only if genus(C)=0.
3. The Main Results
In this section, we consider the orthogonal projection of a rational parameterized curve onto a rational parameterized surface.
Rational parameterized curves are defined as the images of mappings form(10)Φ:C⟶R3,t⟶Φt=Φ1tΦ0t,Φ2tΦ0t,Φ3tΦ0t,where Φi(t)∈R[t], i=0,1,2,3.
And rational parameterized surface is defined as the images of mappings form (11)Ψ:C2⟶R3,u,v⟶Ψu,v=Ψ1u,vΨ0u,v,Ψ2u,vΨ0u,v,Ψ3u,vΨ0u,v,where Ψi(u,v)∈R[u,v], i=0,1,2,3.
Given a rational parameterized curve C with parametric equation Φ(t) and a rational parameterized surface S with parametric equation Ψ(u,v), the orthogonal projection of C onto S is defined to be the set ΓCS of points (u,v,t) satisfying the following condition:(12)Ψu,v-Φt×Nu,v=0,where N(u,v) stands for the normal vector of Ψ(u,v) of S at (u,v). Since N(u,v) is parallel with Ψu(u,v)×Ψv(u,v), the above condition can be written as(13)Ψu,v-Φt·Ψuu,v=0,Ψu,v-Φt·Ψvu,v=0.The problem of orthogonal projection is to find the solution of system (13). And note that (13) can be treated as polynomial systems, where Φ,Ψ are rational mappings.
To study the locus of orthogonal projection in three-dimensional space, we can equivalently discuss the parametric locus of orthogonal projection. We denote ΓCS(u,v)={(u,v)∣∃t,s.t.(u,v,t)∈ΓCS}.
In the rest of the paper, let Φ(t)=(Φ1(t)/Φ0(t),Φ2(t)/Φ0(t),Φ3(t)/Φ0(t)) be the parametric equation of rational curve C and let (14)Ψu,v=Ψ1u,vΨ0u,v,Ψ2u,vΨ0u,v,Ψ3u,vΨ0u,vbe the parametric mapping of surface S.
Proposition 10.
One denotes(15)PCS1=∑i=13ΨiΦ0-ΦiΨ0ΨiuΨ0-ΨiΨ0u,PCS2=∑i=13ΨiΦ0-ΦiΨ0ΨivΨ0-ΨiΨ0v,PCS=PCS1,PCS2,QCS=Ψ0Φ0,QCS=Ψ0,Φ0.Then ΓCS=Zero(PCS∖QCS).
Proof.
Equation (13) could be simplified as the following form by substituting Φ(t) and Ψ(u,v):(16)∑i=13ΨiΦ0-ΦiΨ0ΨiuΨ0-ΨiΨ0uΨ03Φ0,∑i=13ΨiΦ0-ΦiΨ0ΨivΨ0-ΨiΨ0vΨ03Φ0.That implies PCS1=0, PCS2=0 and Ψ0≠0, Φ0≠0 as 0 will not be denominators.
Theorem 11.
[T1,U1],…,[Tk,Uk] are regular systems with the variable order u<v<t, such that Zero([PCS,QCS])=∪i=1kZero([Ti,Ui]). Then(17)ΓCS=⋃i=1kZeroTi,Ui,and ΓCS(u,v)=∪i=1kZero([Ti(2),Ui(2)]).
Proof.
Since it is directly that ΓCS=Zero([PCS,QCS])=∪i=1kZero([Ti,Ui]). And the second statement of the theorem holds according to Proposition 3.
Remark 12.
For the polynomial system [PCS,QCS], an algorithm RegSer([PCS,QCS],[u,v,t])={[T1,U1],…,[Tk,Uk]} such that Zero([PCS,QCS])=∪i=1kZero([Ti,Ui]) had been established [17], where [u,v,t] means the variable order is u<v<t.
Theorem 13.
G is a Gröbner basis of(18)I=PCS1,PCS2,zQCS-1under a variable order u<v<t<z. Then(19)ΓCS¯=ZeroG∩Ru,v,t.Furthermore, ΓCS(u,v)¯=Zero(G∩R[u,v]).
Proof.
According to the properties of radical ideal and saturation of ideal, we have(20)ΓCS¯=ZeroPCS∖ZeroQCS¯=ZeroPCS∖ZeroQCS¯=ZeroPCS:QCS∞=ZeroPCS:QCS∞=ZeroPCS:QCS∞=ZeroI∩Ru,v,t=ZeroG∩Ru,v,t.The last two equations hold under the statement of Proposition 6. And apparently ΓCS(u,v)¯=Zero(G∩R[u,v]).
Lemma 14.
Let P⊆R[u,v,t] be a polynomial set and f1(t)∈R[t], f2(u,v)∈R[u,v]. Then Proj2(Zero(P∖{f1,f2}))=Proj2Zero(P)∖Zero(f2)-Proj2Zero(P∪{f1}).
Proof.
For (u,v)∈Proj2(Zero(P∖{f1,f2})), that is, ∃t, s.t. (u,v,t)∈Zero(P) and (u,v)∉Zero(f2),t∉Zero(f1), we have (u,v)∈Proj2Zero(P)∖Zero(f2)-Proj2Zero(P∪{f1}).
Conversely, if(21)u,v∈Proj2ZeroP∖Zerof2-Proj2ZeroP∪f1,then ∃t, s.t. (u,v,t)∈Zero(P),(u,v)∉Zero(f2),t∉Zero(f1). So (u,v)∈Proj2(Zero(P∖{f1,f2})).
In summary, Proj2(Zero(P∖{f1,f2}))=Proj2Zero(P)∖Zero(f2)-Proj2Zero(P∪{f1}).
Theorem 15.
One has(22)ZeroResPCS1,PCS2,t⊇ZeroResPCS1,PCS2,t∖ZeroΨ0⊇ΓCSu,v.Furthermore, if
ZeroResPCS1,PCS2,t∩ZerolcPCS1,t∩ZerolcPCS2,t=∅,
Zero(Res(PCS1,PCS2,t))∩Zero(Cof(PCS1,t))=∅ and Zero(Res(PCS1,PCS2,t))∩Zero(Cof(PCS2,t))=∅,
Zero(Φ0)∩Zero(PCS)=∅,
then(23)ZeroResPCS1,PCS2,t∖ZeroΨ0=ΓCSu,v.
Proof.
Proposition 7(1) induces the fact that(24)ZeroResPCS1,PCS2,t⊇Proj2ZeroPCS,and it follows from Lemma 14 that(25)Proj2ZeroPCS∖ZeroΨ0⊇ΓCSu,v.The(26)ZeroResPCS1,PCS2,t⊇ZeroResPCS1,PCS2,t∖ZeroΨ0⊇ΓCSu,v.Moreover, according to conditions (a), (b) and Proposition 7, we have Zero(Res(PCS1,PCS2,t))=Proj2Zero(PCS). And condition (c) induced by Lemma 14 that Proj2Zero(PCS)∖Zero(Ψ0)=ΓCS(u,v). In that way(27)ZeroResPCS1,PCS2,t∖ZeroΨ0=ΓCSu,v.
4. Algorithms
For a polynomial set P and a set M⊆K^2, we denote Zero([P,M])=Zero(P)-M. Then, for a polynomial system [P,Q], we have Zero([P,Q])=Zero(P)∖∪Q∈QZero(Q) = Zero(P)∖∪Q∈QZero(P∪{Q})=Zero([P,∪Q∈QZero(P∪{Q})]). Letting (28)Ω=T1,M1,…,Tk,Mk,we define Zero(Ω)=∪i=1kZero([Ti,Mi]).
Theorem 11 induces that the exact loci of projection could be decomposed into the union of zeros of regular systems, which could be in a complex form. In order to analyze the result easier, we developed an algorithm, which is improved from SIM [15], to simplify regular systems.
Proposition 16.
Algorithm 1 is correct.
Algorithm 1: Simplify(Ω).
INPUTΩ=T1,U1,…,Tk,Uk
OUTPUTΘ=P1,Q1,…,Pm,Qm,
where m≤k, Qi⊆C2 and ⋃i=1kZero([Ti,Ui])=⋃i=1m(Zero(Pi)-Qi).
Step 1.
Ω1≔∅, Ω2≔∅, i=1, Θ≔∅.
For [T,U] in Ω do
If U≠∅, then
For U in U do U≔factors(U). end do;
Ω1≔Ω1∪T,U.
Else Ω2≔Ω2∪T,U.
End do;
Step 2.
For [T,U] in Ω1 do
Ω1≔Ω1∖T,U;
For U in U do U≔Zero(T∪U)
If ∃T1,…,Tk∈Ω2 such that U=⋃i=1kZero(Ti)
then delete [Ti,∅]1≤i≤k from Ω2; U≔U∖U;
Else if ∃T1,…,Tk∈Ω2 such that U⊇⋃i=1kZero(Ti),
then delete [Ti,∅]1≤i≤k from Ω2;
U≔(U∖{U})∪(U∖⋃i=1kZero(Ti));
Else if ∃T1,…,Tk∈Ω2 such that U⊂⋃i=1kZero(Ti),
then ≔U∖U;
End do;
If U=∅ then Ω2≔Ω2∪T,∅;
Else Θ≔Θ∪T,U.
End do;
Step 3.
For [T,∅] in Ω2 do
For [T′,U] in Θ do
If U⊇Zero(T),
then U≔U∖Zero(T); Ω2≔Ω2∖T,∅; break;
End do;
End do;
Step 4. Return Θ≔Θ∪Ω2.
/∗/ factors(U) returns all the irreducible factors of U
Proof.
Steps 1 and 2 are similar to SIM; we only need to prove Step 3.
In Step 3, if U⊇Zero(T), then(29)ZeroT′,U∪ZeroT=ZeroT′∖U∪ZeroT=ZeroT′∖U∖ZeroT=ZeroT′,U∖ZeroT.So T can be deleted from Ω2 and U would be substituted by U∖Zero(T).
Given a rational curve C and a rational surface S, Algorithm 2 computes the exact parametric loci of the orthogonal projection of C onto S.
Algorithm 2: Exact parametric loci of orthogonal projection: EPLOP(C,S).
InputC, S
OutputΓCS(u,v).
Step 1. Generate the polynomial system [PCS,QCS].
Step 2. Decompose [PCS,QCS] in to the union of regular systems, Let RegSys([PCS,QCS],[u,v,t])=T1,U1,…,Tk,Uk.
Step 3. Let Ω=T1′,U1′,…,Tm′,Um′=RegSer([PCS,QCS],[u,v,t])∩C[u,v]
Step 4. Ω≔Simplify(Ω).
Step 5. Return ΓCS(u,v)=Zero(Ω).
Algorithm 3 returns the minimal variety that contains ΓCS(u,v). If dim=0, then MVPLOP(C,S) consists of finitely many points. If dim=1, then(30)ΓCSu,v¯=ZeroG′=ZeroG′=Zero⋂i=1nMi=⋃i=1nZeroMi=⋃i=1nZeroMi.Since 〈Mi〉 are prime ideals, {Zero(Mi)}1≤i≤n are irreducible components of ΓCS(u,v)¯ that do not contain each other. If dim=2, then ΓCS(u,v)¯ equals the whole parametric plane.
Algorithm 3: Minimal variety that contains the parametric loci of orthogonal projection: MVPLOP(C,S).
InputC, S
OutputΓCS(u,v)¯.
Step 1. Generate the polynomial system [PCS,QCS].
Step 2. Compute the Gröebner basis G of 〈PCS1,PCS2,zQCS-1〉 under the term order such that u<v<t<z.
Step 3. Let G′=G∩C[u,v]. Let dim to be the dimension of Zero(G′).
Step 4. If dim=0, then return Zero(G′).
Step 5. If dim=1, then decompose 〈G′〉 into the intersection of prime ideals: 〈G′〉=⋂i=1n〈Mi〉.
Return ⋃i=1nZero(Mi).
Step 6. If dim=2, return Zero(0).
Algorithm 4 calculates a variety that contains ΓCS(u,v). Note that Res(PCS1,PCS2,t) is a polynomial in R[u,v] and ∏i=1nfi factorize Res(PCS1,PCS2,t) into irreducible algebraic curves. For each irreducible algebra curve fi, if Genus(fi)=0, then fi can be rational parameterized.
Algorithm 4: Parametric loci of orthogonal projection: APLOP(C,S).
InputC, S, where max0≤i≤3degree(Φi(t))>0.
Output A variety that contains ΓCS(u,v).
Step 1. Generate the polynomial system [PCS,QCS].
Step 2. Compute Res(PCS1,PCS2,t).
Step 3. Factorize Res(PCS1,PCS2,t)=∏i=1nfi, fi is a irreducible factor of Res(PCS1,PCS2,t) in R[u,v].
Step 4.
Let V≔∅;
For i=1 to n do
g≔Genus(fi);
If g>0, V≔V∪Zero(fi).
Else V≔V∪Parametrization(fi,t).
End for
Step 5. Return V.
/∗/Parametrization(fi,t) [21] returns the parametric presetations of fi in parameters t.
Theorem 17.
One has(31)EPLOPC,S⊆MVPLOPC,S⊆APLOPC,S.
Proof.
It is a direct consequence of the above discussion that(32)EPLOPC,S⊆MVPLOPC,S,EPLOPC,S⊆APLOPC,S.Note that MVPLOP(C,S) and APLOP(C,S) are varieties. And MVPLOP(C,S) is the minimal variety that contains ΓCS(u,v); then MVPLOP(C,S)⊆APLOP(C,S).
5. Examples and ComparisonExample 1 (point projection).
Consider the algebraic surface S:(33)Ψu,v=Ψ1u,vΨ0u,v,Ψ2u,vΨ0u,v,Ψ3u,vΨ0u,v,where Ψ1(u,v)=2v-u2, Ψ2(u,v)=-u2+3uv, Ψ3(u,v)=7v-u, Ψ0(u,v)=1. Let P=(-10,0,30) be a point in 3D space. P could be treated as a constant function with variable t.
Algorithm 2 yields {[{P1,P2},∅]}, where(34)P1=-53v+2u2+190+3u3-9u2v+7u,P2=6890+114326u-26133u2-5883u3-2208u4+216u5-81u6+81u7.Algorithm 3 returns the same loci as above. Since {P1,P2} is a triangular system, it is easy to check that Zero(P1,P2) contains only finitely isolated points. The point projections are shown in Figure 1.
Projection of P onto S in Example 1.
Example 2.
We consider a simple case with an algebraic surface S: Ψ(u,v)=(v2+u,4uv+2,u2+3) and an algebraic curve C: Φ(t)=(t+3,-2t,5t+5).
In Step 3 of Algorithm 2, Ω=T1,U1,T2,U2,T3,U3, where(36)T1=-13uv+9u2v-4u-4v4-2uv2+8v2-3uv2+39u3v+14u2+4u4,U1=-3278u+10228u2+38016u4+7512u3+127,T2=1-8v+10u,-492v2-1351+2824v+6912v3,T3=-3278u+10228u2+38016u4+7512u3+127,3392u3+412u2-1280u2v-464uv-452u-1024uv2+1016v+127-64v2-512v3,U2=∅,U3=∅.
And Huang’s [15] algorithm SIM outputs {[T1,U],[T3,∅]}, where(37)U=122,211,122RootOf4Z3+19Z2-3752Z-8953,122,12α,β,α=RootOf216Z3+105Z2+242Z-127,β=RootOf-1728Z3+1728+216Z2+1080-3429Z-1270+348α2+2366α.
While algorithm Simplify(Ω) yields {[T1,{(1/22,2/11)}]}, compared with algorithm SIM, algorithm Simplify returns a more laconic result by directly computing the zero sets.
Algorithm 3 returns Zero(-13uv+9u2v-4u-4v4-2uv2+8v2-3uv2+39u3v+14u2+4u4), while Algorithm 4 returns the same variety, as shown in Figure 2. And Genus(-13uv+9u2v-4u-4v4-2uv2+8v2-3uv2+39u3v+14u2+4u4)=3, so the variety could not be rational parameterized. Furthermore, p(1/22,2/11)∈Zero(lc(PCS1,t))∩Zero(lc(PCS2,t)), so (1/22,2/11) is not in the exact parametric of the loci.
Parametric loci and 3D curve of orthogonal projection for Example 2.
Example 3.
Consider the algebraic surface S: Ψ(u,v)=(Ψ1(u,v)/Ψ0(u,v),Ψ2(u,v)/Ψ0(u,v),Ψ3(u,v)/Ψ0(u,v)), where(38)Ψ0u,v=1,Ψ1u,v=-94.4+88.9v+5.6v2,Ψ2u,v=-131.3u+28.1u2,Ψ3u,v=5.9u2v2+u2v-3.9v2u+76.2u2+6.7v2-27.3uv-50.8u+25v+12.1.We randomly pick a curve C: Φ(t)=(Φ1(t)/Φ0(t),Φ2(t)/Φ0(t),Φ3(t)/Φ0(t)) passing over S, where(39)Φ1t=-90t-1t+5,Φ2t=-4t-200,Φ3t=-5t+30t+5,Φ0t=t+5.S is a common surface in mold industry [26] and is also a popular test surface for CNC machining methods. And note that C is a rational curve.
Algorithm 2 yields {[T1,U1],[T2,∅],[T3,∅],[T4,∅]}, where(40)T1=M,U1=α1,β1,α2,β2,M=129735449752u9v4+⋯82terms,T2=T3=T4=2.Since T2,T3,T4 are triangular systems with two elements, ∪i=24Zero(Ti) consisted of finite points. Furthermore, one could check that ∪i=24Zero(Ti)⊆Zero([T1,U1]). So the exact parametric locus of orthogonal projection is Zero([T1,U1]). And moreover (α1,β1,-5) and (α2,β2,-5) are in Zero(PCS), while t=-5 is not in the domain of Φ(t).
Algorithm 3 returns Z(M). And one can obtain Z(M)∪Z(u-1313/562) by means of Algorithm 4. Compared with Algorithm 3, u-1313/562 is a redundant branch of the projective loci. As a matter of fact, (1313/562,v,-5) is a zero of PCS, while t=-5 is not in the domain of Φ(t). The results are illustrated in Figure 3.
Parametric loci and 3D curve of orthogonal projection for Example 3.
Example 4.
Let S: Ψ(u,v)=(Ψ1(u,v)/Ψ0(u,v),Ψ2(u,v)/Ψ0(u,v),Ψ3(u,v)/Ψ0(u,v)), where(41)Ψ1u,v=u+2v2,Ψ2u,v=3u2+1,Ψ3u,v=v+2,Ψ0u,v=u+v+2,and let C: Φ(t)=(Φ1(t)/Φ0(t),Φ2(t)/Φ0(t),Φ3(t)/Φ0(t)), where(42)Φ1t=-90t-1,Φ2t=-4t-200,Φ3t=t+2,Φ0t=t+5.Note that S and C are both rational.
Algorithm 2 returns(43)ZeroM,α1,β1,α2,β2,α3,β3,where(44)M=-33019v+4592u-27012u2-1017u4-13776u3-507v3-3v4+58308uv3+1080u2v3+1080v4u+4041u3v2+108246v2u2+419468uv-18716v2+70692u3v+312582u2v+325363uv2+4041vu4+9117;α1=-2-β1,α2=113270-449270β2,β1=RootOf102379Z+14179+125682Z2+11532Z4+62620Z3;β2=RootOf80371Z2-586394Z-11531;α3=0.0000008327858555β311+⋯-0.4481487421,β3=RootOf7488Z12+⋯+555282888.One can check that (α1,β1) is root of u+v+2, which could not be vanished as denominator. (α2,β2,-5) is a root of PCS, vanishing t+5. And(45)PCS1α3,β3,t=c1≠0,PCS2α3,β3,t=c2≠0,where c1,c2 are constants that do not involve t.
Algorithm 3 yields Zero(M), which represents the minimal variety that contains the projection loci.
And the output of Algorithm 4 is Zero(M)∪Zero(u+v+2). The redundant branch Zero(u+v+2) is outside the domain of Ψ(u,v). Figure 4 shows the projections of the example.
Parametric loci and 3D curve of orthogonal projection for Example 4.
More examples have been computed with a 3 GHz CPU and 2 GB memories. And the cost of time for each algorithm has been demonstrated in Table 1. And Table 2 records the number of solutions before simplified, solutions simplified via SIM and solutions simplified using Simplify. “Y” in the chart induces the fact that Algorithm 4 has redundant branches with respect to the result of Algorithm 3, and “N” for no redundant branches. “NA” means the result is not available in 3600 s or the memory reached the hardware limit. In each example, let rational curve be C: Φ(t)=(Φ1(t)/Φ0(t),Φ2(t)/Φ0(t),Φ3(t)/Φ0(t)) and let rational surface be S: Ψ(u,v)=(Ψ1(u,v)/Ψ0(u,v),Ψ2(u,v)/Ψ0(u,v),Ψ3(u,v)/Ψ0(u,v)); then Degree(a,b,c,d) mean max1≤i≤3degree(Ψi)=a, degree(Ψ0)=b, max1≤i≤3degree(Φi)=c, and degree(Φ0)=d.
Time cost of the algorithms.
Degree
Algorithm 2
Algorithm 3
Algorithm 4
Redundancy
EX1
(1, 0, 1, 0)
0.016 s
0.016 s
<0.001 s
N
EX2
(2, 0, 1, 0)
0.188 s
0.063 s
<0.001 s
N
EX3
(3, 0, 1, 0)
0.032 s
0.468 s
0.016 s
N
EX4
(4, 0, 1, 0)
0.734 s
2.671 s
<0.001 s
N
EX5
(2, 0, 2, 0)
0.203 s
0.031 s
<0.001 s
N
EX6
(3, 0, 2, 0)
596.797 s
0.047 s
<0.001 s
N
EX7
(1, 1, 1, 1)
0.078 s
0.016 s
<0.001 s
Y
EX8
(2, 1, 2, 1)
0.891 s
0.297 s
0.016 s
Y
EX9
(2, 2, 2, 1)
0.078 s
0.015 s
0.032 s
Y
EX10
(2, 2, 2, 2)
1.515 s
0.984 s
0.016 s
Y
EX11
(3, 1, 2, 1)
NA
113.938 s
0.016 s
Y
Comparison on simplification methods (number of elements).
RegSer
SIM
Simplify
EX1
1
1
1
EX2
3
3
3
EX3
4
2
2
EX4
6
3
2
EX5
4
1
1
EX6
8
2
2
EX7
2
1
1
EX8
7
2
1
EX9
2
1
1
EX10
6
2
1
EX11
NA
NA
NA
Table 1 illustrates that Algorithm 2 performs well in low degree case, but the time cost increases fast while the degree of surface and curve increasing; this is because the degree and the number of output regular systems in Step 3 are getting enormous (see EX6 and EX11). Since most commonly used surfaces and curves have low degree, Algorithm 2 is valuable for engineering practice.
Algorithm 3 is significantly better than Algorithm 2 at time cost and works fine while the input degree grows.
Algorithm 4 performs in a steady and excellent way at the computation cost, but it always generates redundant branches when the inputs are rational.
Table 2 induces the fact that the algorithm Simplify could reduce the number of regular systems for the parametric loci in most circumstances. And, compared with SIM, our algorithm has a more concise output.
6. Conclusions
In this paper, three algorithms for computing orthogonal projection of a rational curve onto rational parametric surface were presented. The method EPLOP based on regular systems could compute the exact parameter loci of the projection, Algorithm MVPLOP computes the minimal variety that contains the parameter loci of the projection, and APLOP returns a variety passing through the parameter loci of the projection. We also developed the algorithm Simplify to simplify a series of regular systems. Preliminary examples showed that our algorithms work well and are valuable.
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
This work was partly supported by the Chinese National Natural Science Foundation Project 11271040. Furthermore, the authors thank the anonymous reviewers for their helpful comments.
GilbertE. G.JohnsonD. W.KeerthiS. S.A fast procedure for computing the distance between complex objects in three-dimensional space19884219320310.1109/56.20832-s2.0-0023998710ChenX.-D.YongJ.-H.WangG.PaulJ.-C.XuG.Computing the minimum distance between a point and a NURBS curve20084010-111051105410.1016/j.cad.2008.06.0082-s2.0-56649107906LimaiemA.TrochuF.Geometric algorithms for the intersection of curves and surfaces199519339140310.1016/0097-8493(95)00009-22-s2.0-0038215364PegnaJ.WolterF.-E.Surface curve design by orthogonal projection of space curves onto free-form surfaces19961181455210.1115/1.28268552-s2.0-0030104909DietzR.HoschekJ.JüttlerB.An algebraic approach to curves and surfaces on the sphere and on other quadrics1993103-421122910.1016/0167-8396(93)90037-4MR12351532-s2.0-0027640669MaY. L.HewittW. T.Point inversion and projection for NURBS curve and surface: control polygon approach2003202799910.1016/s0167-8396(03)00021-9MR19820492-s2.0-0037621953PottmannH.LeopoldsederS.HoferM.Registration without icp2004951547110.1016/j.cviu.2004.04.0022-s2.0-3042565717SongH.-C.YongJ.-H.YangY.-J.LiuX.-M.Algorithm for orthogonal projection of parametric curves onto b-spline surfaces201143438139310.1016/j.cad.2011.01.0082-s2.0-79551591699ChernovN.WijewickremaS.Algorithms for projecting points onto conics201325182110.1016/j.cam.2013.03.031MR30485732-s2.0-84876133011HuS.-M.WallnerJ.A second order algorithm for orthogonal projection onto curves and surfaces200522325126010.1016/j.cagd.2004.12.001MR2122491ZBL1205.650862-s2.0-13544270799LiuX.-M.YangL.YongJ.-H.GuH.-J.SunJ.-G.A torus patch approximation approach for point projection on surfaces200926559359810.1016/j.cagd.2009.01.004MR25260142-s2.0-64849110983OhY.-T.KimY.-J.LeeJ.KimM.-S.ElberG.Efficient point-projection to freeform curves and surfaces201229524225410.1016/j.cagd.2011.04.002MR29218502-s2.0-84860450282BuséL.ElkadiM.GalligoA.Intersection and self-intersection of surfaces by means of bezoutian matrices2008252536810.1016/j.cagd.2007.07.001MR23884052-s2.0-37249018129WangD.2004London, UKImperial College Press10.1142/9781848161207MR2050441HuangY.WangD.Computing intersection and self-intersection loci of parametrized surfaces using regular systems and Gröbner bases201128956658110.1016/j.cagd.2011.09.002MR28615562-s2.0-81355148472PieglL.TillerW.2012Berlin, GermanySpringerWangD.Computing triangular systems and regular systems200030222123610.1006/jsco.1999.0355MR17771742-s2.0-0011620090BuchbergerB.Gröbner bases: a short introduction for systems theorists20012178Berlin, GermanySpringer119Lecture Notes in Computer Science10.1007/3-540-45654-6_1MishraB.1993New York, NY, USASpringer10.1007/978-1-4612-4344-1MR1239443CoxD.LittleJ.O'SheaD.2007Springer10.1007/978-0-387-35651-8MR2290010van HoeijM.Rational parametrizations of algebraic curves using a canonical divisor1997232-320922710.1006/jsco.1996.0084MR14486952-s2.0-0031071301WangD.2001Berlin, GermanySpringerTexts and Monographs in Symbolic Computation10.1007/978-3-7091-6202-6MR1826878GanZ.ZhouM.Computing the orthogonal projection of rational curves onto rational parameterized surface by symbolic methods20148592Berlin, GermanySpringer261268Lecture Notes in Computer Science10.1007/978-3-662-44199-2_41MR33347752-s2.0-84905860779WinklerF.1996Vienna, AustriaSpringer10.1007/bf01191382MR1408683SendraJ. R.WinklerF.Pérez-DíazS.2008Berlin, GermanySpringer10.1007/978-3-540-73725-4MR2361646WarkentinA.IsmailF.BediS.Comparison between multi-point and other 5-axis tool positioning strategies200040218520810.1016/S0890-6955(99)00058-92-s2.0-0033897746