Example Questions

CAGD2002: Example Questions

The following are exercises to help you internalise the ideas covered in class. They are not typical examination questions.

Introduction

Linear Geometry

Parametric Curve Definitions

Parametric Curve Interrogations

Parametric Surface Definitions

Parametric Surface Interrogations

Subdivision Curve Definitions - Box Splines

Subdivision Curve Definitions - Interpolating

Subdivision Curve Interrogations

Subdivision Curve Analysis

Subdivision Surface Definitions - Box Splines

Subdivision Surface Definitions - Interpolating

Subdivision Surface Interrogations

Subdivision Surface Analysis

Don't read the discussion about a question until you have written down something in the way of an answer, or at least identified why the particular question is hard.

Equally, don't spend longer than half an hour on any example.



Taster (1)

  1. Draw a closed polygon, P0
  2. Make a new polygon by joining the midpoints of the edges, Pi+1 = f( Pi )
  3. Repeat the process for i = 1,2,3...

Don't read the discussion until you have written down something in the way of an answer, or at least identified why the particular question is hard.

Equally, don't spend longer than half an hour on any example.


Taster (2)

  1. Draw a closed polyhedron SP, P0
  2. Make a new polyhedron by joining the midpoints of the edges, thus making a new face in each old face and a new face around each old vertex. Pi+1 = f( Pi )
  3. Repeat the process for i = 1,2,3...

What is the limit of Pi as i tends to infinity ?

Don't read the discussion until you have written down something in the way of an answer, or at least identified why the particular question is hard.

Equally, don't spend longer than half an hour on any example.

In this particular case, `what is the limit' should be read as `what can you say about the limit', as the full answer is fairly complicated.


Point and Displacement Arithmetic

How are the following operations implemented ?

Don't read the discussion until you have written down something in the way of an answer, or at least identified why the particular question is hard.

Equally, don't spend longer than half an hour on any example.


Conversions between plane representations

How can you convert (i.e. what are the algorithms for converting) from each of the following plane representations to the other two ?
  1. (Q,N):f(P) = [P-Q].N = 0

    Q is a point on the plane and N is a normal vector.

  2. (Q,U,V):P(u,v) = Q + uU + vV

    Q is a point on the plane and U and V are displacements lying in the plane.

  3. (Q,R,S):P(u,v,w) = wQ + uR + vS, u+v+w=1

    Q, R and S are all points lying in the plane.

Don't read the discussion until you have written down something in the way of an answer, or at least identified why the particular question is hard.

Equally, don't spend longer than half an hour on any example.


Perpendicular to two lines

In system building it is good practice to build a small kernel of methods which actually depend on the internal representation of an object (this is called the API), and then implement the bulk of the function of the software being built by calling those kernel functions.

Can you implement a routine to calculate the line perpendicular to two lines by calling the incidence routines defined for linear geometry ?

  1. point x point -> line
  2. point x point x point -> plane
  3. plane x plane -> line
  4. plane x plane x plane -> point
  5. point x line -> plane
  6. plane x line -> point

If not, why not ?

Don't read the discussion until you have written down something in the way of an answer, or at least identified why the particular question is hard.

Equally, don't spend longer than half an hour on any example.


Do two triangles intersect

Devise an algorithm which will report whether two triangles in E3 intersect or not.

The algorithm should still work when the planes of the triangles are parallel or coincident.

Don't read the discussion until you have written down something in the way of an answer, or at least identified why the particular question is hard.

Equally, don't spend longer than half an hour on any example.


Bernstein Hodograph property

Prove that the first derivative of a parametric curve whose basis functions are the Bernstein polynomials of degree n is itself a Bernstein polynomial of one degree lower, whose coefficients are n times the first differences of the original control points.

Don't read the discussion until you have written down something in the way of an answer, or at least identified why the particular question is hard.

Equally, don't spend longer than half an hour on any example.


Comparison of Lagrange and Spline interpolation

Consider the situation where 21 equally spaced points are to be interpolated.

Sketch the basis function corresponding to the central point in the case of Lagrange interpolation and in the case of cubic spline interpolation.

Don't read the discussion until you have written down something in the way of an answer, or at least identified why the particular question is hard.

Equally, don't spend longer than half an hour on any example.




Discussion of Examples

These discussions are not complete proofs, although they point towards places where proofs may be found.


Taster (1)

  1. Draw a closed polygon, P0
  2. Make a new polygon by joining the midpoints of the edges, Pi+1 = f( Pi )
  3. Repeat the process for i = 1,2,3...


Taster (2)

  1. Draw a closed polyhedron SP, P0
  2. Make a new polyhedron by joining the midpoints of the edges, thus making a new face in each old face and a new face around each old vertex. Pi+1 = f( Pi )
  3. Repeat the process for i = 1,2,3...

What is the limit of Pi as i tends to infinity ?

It is tempting to jump to the conclusion from the similarity with Taster(1) that the polyhedron converges to the centroid of the vertices. It doesn't. It converges to a smooth (C1) surface which contains parametric polynomial pieces. This is not obvious and will be treated later in the course.

However, it is possible to see that each original face is a polygon in the sense of Taster(1), which must shrink towards the centroid of that face. Thus if there is a limit surface it must contain the centroids of all the original faces and cannot therefore collapse to a single point.


Point and Displacement Arithmetic

How are the following operations implemented ?

These are all trivial. In each case a simple loop through the coordinates/components gives a simple-to-code solution. The compiler will probably unroll the loop for you, but if you want fast code and have a dumb compiler it is probably the same number of lines of code to write the loop in unrolled form initially.

Two examples follow, one using a loop and the other unrolled. Count from 1 convention is used for the arrays used to hold the displacements A, B and C.


Conversions between plane representations

How can you convert (i.e. what are the algorithms for converting) from each of the following plane representations to the other two ?
  1. (Q,N):f(P) = [P-Q].N = 0

    Q is a point on the plane and N is a normal vector.

  2. (Q,U,V):P(u,v) = Q + uU + vV

    Q is a point on the plane and U and V are displacements lying in the plane.

  3. (Q,R,S):P(u,v,w) = wQ + uR + vS, u+v+w=1

    Q, R and S are all points lying in the plane.

The easy conversions are between the generative forms and to the less redundant implicit form.

Note that representation 3 can be recast by noting that w=1-u-v, so that P = (1-u-v)Q + uR + vS = Q + u(R-Q) + v(S-Q).

The conversion from the implicit form to the parametric requires the arbitrary choice of a direction within the plane.

This can be computed by taking an arbitrary vector G not collinear with the given N (a possible choice is the axis vector making the largest angle with N), and then using the cross product with N to give a vector in the plane.

In each case, normalisation of N, or U and V, as is appropriate, can follow the computation of the unnormalised vectors.

The conversions between 1 and 3 can go via representation 2.


Perpendicular to two lines

In system building it is good practice to build a small kernel of methods which actually depend on the internal representation of an object (this is called the API), and then implement the bulk of the function of the software being built by calling those kernel functions.

Can you implement a routine to calculate the line perpendicular to two lines by calling the incidence routines defined for linear geometry ?

  1. point x point -> line
  2. point x point x point -> plane
  3. plane x plane -> line
  4. plane x plane x plane -> point
  5. point x line -> plane
  6. plane x line -> point

If not, why not ?

It is not possible to implement this function in terms of those primitives.

This latter is an example of a very powerful mathematical principle, probably known earlier, but articulated by Sophus Lie, that identifying the group under which a property is invariant is the most important step in studying that property.


Do two triangles intersect

Devise an algorithm which will report whether two triangles in E3 intersect or not.

The algorithm should still work when the planes of the triangles are parallel or coincident.

There are two issues here, robustness and performance.


Bernstein Hodograph property

Prove that the first derivative of a parametric curve whose basis functions are the Bernstein polynomials of degree n is itself a Bernstein polynomial of one degree lower, whose coefficients are n times the first differences of the original control points.

Given a parametric curve P(t) = Sumi=0..n Ai s(n-i)ti n! /(i! (n-i)!) where s = 1-t

To Prove that dP(t)/dt is also of the same form, but of one degree lower, and that its coefficients are the differences Ai+1-Ai.

Proof

dP(t)/dt = Sumi=0..n Ai d(s(n-i)ti)/dt n! /(i! (n-i)!)
d(sn-iti)/dt = sn-id(ti)/dt - d(sn-i)/ds ti
= isn-iti-1 - (n-i)sn-1-iti
dP(t)/dt = Sumi=0..n Ai isn-iti-1 n! /(i! (n-i)!) - Sumi=0..n Ai (n-i)sn-i-1ti n! /(i! (n-i)!)
= Sumi=1..n Ai sn-iti-1 n! /((i-1)! (n-i)!) - Sumi=0..n-1 Ai sn-1-iti n! /(i!(n-i-1)!)
= n [Sumi=1..n Ai sn-iti-1 (n-1)! /((i-1)! (n-i)!) - Sumi=0..n-1 Ai sn-i-1ti (n-1)! /(i! (n-i-1)!)]

Writing i'+1 for i in the first term and i' for i in the second, and n' for n-1 in both, we have
dP(t)/dt = n Sumi'=0..n' Ai'+1 sn'-i'ti' n'! /(i'! (n'-i')!) - Sumi'=0..n' Ai' sn'-i'ti' n'! /(i'! (n'-i')!)
= n Sumi'=0..n' [Ai'+1-Ai'] si'tn'-i' n'! /(i'! (n'-i')!)
which is exactly the form we sought to prove.


Comparison of Lagrange and Spline interpolation

Consider the situation where 21 equally spaced points are to be interpolated.

Sketch the basis function corresponding to the central point in the case of Lagrange interpolation and in the case of cubic spline interpolation.

It is easiest to let the points be at integer coordinates centred about zero.


This page was last updated on 3rd October 2002.
It is maintained by Malcolm Sabin <malcolm@geometry.demon.co.uk>