# CS 284: CAGD  Lecture #6 -- Tue 9/11, 2012.

PREVIOUS < - - - - > CS 284 HOME < - - - - > CURRENT < - - - - > NEXT

## Preparation:

Get SLIDE to work and figure out how to modify the Tcl expressions to change the default behavior for stitching curve segments together.

## Discussion of Homework Assignment:

Review of observed behavior of the sweeps in your assignment.

How could the 15 Bézier segments be combined into one smooth sweep surface?

## Current Homework Assignment:  Sweeps along Complex 3D Curves

Study the sweep manual pages on SLIDE !

1. Implement smooth curve interpolation in 3D.
- - Start from the file http://www.cs.berkeley.edu/~sequin/CS284/CODE/pa2.slf
- - Write the corresponding formulas for the z-components of the inner Bézier control points.
- - Add the necessary z-expressions in all places where I have not already done so.
- - I have added a "Z-scale" slider that multiplies all the new z-coordinates with a slider-controlled constant,
so that you can readily go back and forth between 2D (multiplier=0.0) and 3D (multiplier=1.0).
- - Lift the data points out of the x-y-plane, and convince yourself that everything still "works smoothly in 3D."

2. Use the SLIDE "sweep" construct to form a small ribbon going along a closed B-spline curve approximating the original 15 control points.
- - This can be done by sweeping a "star" type cross section, and giving the star TWO skinny spokes.
- - I have already put in most of the needed code; if you turn on "drawSweep" in the "slf_swp" slider menu,
you should see such a ribbon in red, displayed edge-on.
- - However, the ribbon seems to have 10 pinched-off, twisted points in its loop; -- WHY is this ? -- Write down your thoughts!
- - Under what conditions do you get a nice "prismatic" sweep with no funny points ?
- - How do you have to set parameters such as : "minimizeTorsion" "closed (curve)" "symmetry" "azimuth" ...
in order to achieve a nice result ?   See manual pages on SLIDE !
- - Now lift the original control points out of the x-y-plane by increasing the "Z-scale" slider in the "slf_bez" slider menu..
- - How is the behavior of the sweep different now ?
- - Pay particular attention to the end condition where the loop closes; under what circumstances do you get a smooth, seamless closure ?
- - Answer the same questions also for a 5-pointed star (set "Spokes" to 5).

ATTENTION: -- the "closed" flag does not seem to work when set dynamically:
closed {expr \$oSweep(closed)}
but will work when set explicitly in the SLIDE file, either as:
closed 0
or:
closed 1

Do this before TUESDAY, 9/11/2012 so you can ask questions and resolve issues for the remainder of this assignment.

3. Now try to make such a nice sweep along your own smooth, composite, interpolating curve.
- - It is somewhat tedious, since you have to specify a separate sweep construct for each of the 15 Bézier segments.
- - But again, the code is already in place, and you can see such a ribbon in green, if you turn on "drawSweep" in the "slf_bez" menu.
- - (You may now want to turn off the B-spline at this time, so that you can focus on the Bézier segments.)
- - For a 2D curve, as long as the ribbon is perpendicular to the curve's plane, everything should work fairly nicely.
- - But there may be problems in 3D. -- WHY ? What can you do about them ?
>>> Just discuss the issues you encounter in the 3D case.  Find out what "hooks" are or are not available in the SLIDE sweep.
Briefly summarize what would have to be done to make nice prismatic sweeps along a composite
Bézier curve in 3D,
and how the necessary information may be computed.
No need to actually do all the programming -- unless you want to.

4. Now use all the originally given points, as well as your own calculated control points,
to make a closed polyline with 45 joints, and then sweep a 5-pointed star along that polyline.
- - The code for this is right next to the B-spline "backbone" code (near line 483 in pa2.slf).
- - Under what conditions do you get nice prismatic beams with nicely mitered joints ?
- - How do you have to set parameters such as : "azimuth", "twist", "minimize Torsion", "closed (curve)", "symmetry"  ...
in order to achieve a nice result ?
- - Can the "twist" parameter be of any use in achieving nice, properly mitred joints ? HOW ?
>>> Implement the sweep for the polyline case. The SLIDE machinery should handle all that.

DUE: Thursday 9/13/2012, 2:40pm.
Set the initial values for the sliders to the proper values, so that when your program is run,
one will see a nice "prismatic" sweep of a 3-pointed star along your best composite Bézier curve.
(You may want to change some of the parameters from the values that you gave them in pa1.slf)
>>> Without the implementation of (3), this will not work well in 3D.
But the 2D case is much simpler. You should be able to get nice results for the 2D case.

E-mail me a copy of your final modified pa2.slf SLIDE file.

Capture a hardcopy print-out of this sweep.

Hand in at the beginning of class (Thursday 9/13/2012, 2:40pm):

• A hardcopy print-out of your sweep;
• and a page of text, answering the questions raised above.

## Continuing Topic: Space-Curves and Sweeps

### Review:  Frenet Frame (Reference frame for intrinsic properties) (demo with wire and trihedron)

• Finding the Tangent -- velocity = p'(t) -- normalize ...
• Normal Plane -- from acceleration = change of velocity = p''(t) -- has two components:
• in line with tangent = true acceleration.
• perpendicular to tangent = turning. ==> Defines the:
• Principal Normal Vector (change of normalized tangent vector) -- points in the direction that curve bends.
• Osculating Plane -- spanned by tangent and principal normal vectors;  = best-fitting plane.
• Osculating Circle -- best-fitting circle in that plane; -- defines curvature:  k = 1/r
• Binormal -- perpendicular on osculating plane; -- axis around which tangent vector turns.

### Review:  Serret - Frenet Relations

• What is Curvature ? -- rate of rotation around binormal (1/r of the osculating circle)
• What is Torsion ? -- rate of rotation of osculating plane (around tangent)
• Inflection points -- where curvature = 0.
• Which unit vectors serve as local rotation axis ?  (==> see above)
• Visual Representation: How can we best show graphically properties such as curvature and torsion? -- Color? -- Better options:
• for curvature: use negative normal vector; {N would crowd the inside of the bend} ==> "hedgehog" curvature plots.
• for torsion: use binormal vector; {allows both signs; T would crowd the tangent vector}.

# Blossoms: A geometrical view of iterated "multi-level" inter-/extra-polation.

This will allow us to see the various spline types in a unified manner and to convert easily between them.

• Basic Notation and Machinery
• Create N-"digit" labels for system with N iterative steps (curves of degree N).
• Each "digit" is an "affine distance"; it can be a fraction or real number.
• Each "digit" specifies interpolation value used in one step.
• To capture a polynomial of degree D, we need: N >= D.
• Geometric interpretation leads to algorithms for subdivision, knot-insertion, degree elevation,
curve evaluation (deCasteljeau, Aitken, deBoor), conversion between Bézier and B-Splines, ...
• General Properties of Blossoms
• Diagonal agreement, -- if all labels the same ==> point lies on curve at that t value.
• Symmetry, -- order of the "digits" in a label is irrelevant.
• Multiaffinity property, -- if two labels differ in only one "digit", one can inter/extra-polate along a line through those labeled points.
• Bézier Curves in Blossom Form
• Control point labeling (p82). { aaaaa ...  bbbb }
• Generalization  (you may skip this)
• Arbitrary blossom parametrization ==> EvalBlossomProgram (p88).
• "systolic" computation: synchronous pumping action (e.g. as in heart chambers).
• Illustration of the Cubic Blossom (p89). {80% down}
• Find out how the point moves around in the (whole?) plane.
• What makes it move along a segment of the control polygon?

# Next Topic:  B-Splines

• An approximating spline, controlled by the "deBoor points".
• Relations between Bézier Curves and B-Splines
• B-Spline in Blossom Form (p 94) {0% down}
• Watch the de Boor control points fly...
• Control Points of the Uniform B-Spline
• Finding de Boor Points Geometrically
• Interpretation: Change to a new set of basis functions -- some linear combination of old ones.

### Read:  Rockwood:  pp 94-103 (basics of B-splines)

PREVIOUS < - - - - > CS 284 HOME < - - - - > CURRENT < - - - - > NEXT
Page Editor: Carlo H. Séquin