B-spline Curves. Smoother than other curve forms

Similar documents
Representing Curves Part II. Foley & Van Dam, Chapter 11

Curves and Surfaces 1

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Computergrafik. Matthias Zwicker. Herbst 2010

Curves. Computer Graphics CSE 167 Lecture 11

The Free-form Surface Modelling System

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

3D Modeling Parametric Curves & Surfaces

Curves and Surfaces 2

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

Dgp _ lecture 2. Curves

2D Spline Curves. CS 4620 Lecture 13

Curves and Curved Surfaces. Adapted by FFL from CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006

Curves and Surfaces Computer Graphics I Lecture 9

Rational Bezier Curves

2D Spline Curves. CS 4620 Lecture 18

Curves and Surfaces Computer Graphics I Lecture 10

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

GL9: Engineering Communications. GL9: CAD techniques. Curves Surfaces Solids Techniques

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

CSE 167: Introduction to Computer Graphics Lecture #11: Bezier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

15.10 Curve Interpolation using Uniform Cubic B-Spline Curves. CS Dept, UK

Design considerations

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

Shape Representation Basic problem We make pictures of things How do we describe those things? Many of those things are shapes Other things include

Information Coding / Computer Graphics, ISY, LiTH. Splines

Sung-Eui Yoon ( 윤성의 )

Computer Graphics Curves and Surfaces. Matthias Teschner

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

3D Modeling techniques

Bezier Curves, B-Splines, NURBS

Bézier Splines. B-Splines. B-Splines. CS 475 / CS 675 Computer Graphics. Lecture 14 : Modelling Curves 3 B-Splines. n i t i 1 t n i. J n,i.

Introduction to Computer Graphics

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Geometric Modeling Systems

Curve Representation ME761A Instructor in Charge Prof. J. Ramkumar Department of Mechanical Engineering, IIT Kanpur

COMP3421. Global Lighting Part 2: Radiosity

CS 475 / CS Computer Graphics. Modelling Curves 3 - B-Splines

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

Lecture IV Bézier Curves

Curves & Surfaces. Last Time? Progressive Meshes. Selective Refinement. Adjacency Data Structures. Mesh Simplification. Mesh Simplification

Subdivision overview

Curve and Surface Basics

Lecture 9: Introduction to Spline Curves

Introduction to the Mathematical Concepts of CATIA V5

Subdivision Surfaces

Parametric curves. Brian Curless CSE 457 Spring 2016

Shape modeling Modeling technique Shape representation! 3D Graphics Modeling Techniques

Know it. Control points. B Spline surfaces. Implicit surfaces

Need for Parametric Equations

Subdivision curves and surfaces. Brian Curless CSE 557 Fall 2015

Subdivision Surfaces

Splines Computer Graphics I Lecture 10

Knot Insertion and Reparametrization of Interval B-spline Curves

Subdivision Curves and Surfaces: An Introduction

Spline Notes. Marc Olano University of Maryland, Baltimore County. February 20, 2004

Outline. Properties of Piecewise Linear Interpolations. The de Casteljau Algorithm. Recall: Linear Interpolation

(Refer Slide Time: 00:02:24 min)

Rendering Curves and Surfaces. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

CS354 Computer Graphics Surface Representation III. Qixing Huang March 5th 2018

Intro to Curves Week 1, Lecture 2

ECE 600, Dr. Farag, Summer 09

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

Curves & Surfaces. MIT EECS 6.837, Durand and Cutler

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

B-Spline Polynomials. B-Spline Polynomials. Uniform Cubic B-Spline Curves CS 460. Computer Graphics

Central issues in modelling

Subdivision Curves and Surfaces

CS 536 Computer Graphics Intro to Curves Week 1, Lecture 2

08 - Designing Approximating Curves

An introduction to interpolation and splines

Outline. The de Casteljau Algorithm. Properties of Piecewise Linear Interpolations. Recall: Linear Interpolation

Introduction to Geometry. Computer Graphics CMU /15-662

Computer Graphics. Curves and Surfaces. Hermite/Bezier Curves, (B-)Splines, and NURBS. By Ulf Assarsson

Curves and Surfaces. Shireen Elhabian and Aly A. Farag University of Louisville

Objects 2: Curves & Splines Christian Miller CS Fall 2011

Surface Modeling. Polygon Tables. Types: Generating models: Polygon Surfaces. Polygon surfaces Curved surfaces Volumes. Interactive Procedural

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

Intro to Curves Week 4, Lecture 7

Efficient GPU Rendering of Subdivision Surfaces. Tim Foley,

From curves to surfaces. Parametric surfaces and solid modeling. Extrusions. Surfaces of revolution. So far have discussed spline curves in 2D

Curves and Surfaces. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

LECTURE #6. Geometric Modelling for Engineering Applications. Geometric modeling for engineering applications

Computer Graphics I Lecture 11

Recursive Subdivision Surfaces for Geometric Modeling

Splines. Connecting the Dots

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Geometric modeling 1

Parameterization. Michael S. Floater. November 10, 2011

Subdivision Surfaces

Roadmap for tonight. What are Bezier curves (mathematically)? Programming Bezier curves (very high level view).

Computer Aided Geometric Design

Images from 3D Creative Magazine. 3D Modelling Systems

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

Introduction p. 1 What Is Geometric Modeling? p. 1 Computer-aided geometric design Solid modeling Algebraic geometry Computational geometry

Parametric curves. Reading. Curves before computers. Mathematical curve representation. CSE 457 Winter Required:

Transcription:

Curves and Surfaces

B-spline Curves These curves are approximating rather than interpolating curves. The curves come close to, but may not actually pass through, the control points. Usually used as multiple, joined curve segments B-splines have C 2 continuity between curve segments Smoother than other curve forms For a sequence of connected B-spline curves, each curve segment is determined from four control points. Each control point contributes to 4 curve segments (except the first three and last three) 2

B-spline Curves (2) By convention, curve segment Q i is determined by control points P i-3, P i-2, P i-1, and P i Rather than defining each curve segment on the interval 0 t 1, we make the parameter domains sequential. Curve segment Q i is defined on the parameter range t i t t i+1 Between two curve segments Q i-1 and Q i there is a join point or knot at parameter value t i A uniform B-spline has knots that are equally spaced in t. 3

B-spline Curve Example P 1 P 2 P 3 P 6 t 4 t 7 t 3 t 5 P 0 P 4 t 6 P 5 4

B-spline Geometry The B-spline geometry vector is given by G BS P P P The first curve segment, Q 3 is defined by P 0 to P 3 over the parameter t 3 = 0 to t 4 = 1 The second curve segment, Q 4 is defined by P 1 to P 4 over the parameter t 4 = 1 to t 5 = 2 The curve segment, Q m is defined by P m-3 to P m over the parameter t m = m-3 to t m+1 = m-2 i 3 i 2 i 1 P i 5

6 B-spline Properties Since each control point contributes to four curve segments, moving one control point alters four curve segments, but does not alter the others. Because of the way we have parameterized t, we define Then the curve segment is computed as 1 ) ( ) ( ) ( 2 3 i i i i t t t t t t T 1, ) ( i i Bs Bs i i t t t G M T t Q

7 B-spline Properties The B-spline basis matrix M Bs is defined as B-spline curve joins maintain C 2 continuity B-splines are bounded by their convex hulls 0 1 4 1 0 3 0 3 0 3 6 3 1 3 3 1 6 1 M Bs

Drawing Curves Once we have the curves defined, how do we draw them? Two approaches: 1. Evaluate x(t), y(t), and z(t) for incrementally spaced values of t in an iterative fashion. Draw line segments between the points at each iteration Can optimize using Horner s method or forward differences 2. Recursively subdivide the curve until the new control points get sufficiently close to the curve Can generate a large number of curve segments 8

Advantages of B-spline curves B-spline curves require more information and a more complex theory than Bézier curves. But it has advantages to offset these shortcomings. a B-spline curve can be a Bézier curve. B-spline curves satisfy all important properties that Bézier curves have. B-spline curves provide more control flexibility than Bézier curves can do. 9

Properties of B-spline curves We can change the position of a control point without globally changing the shape of the whole curve. Since B-spline curves satisfy the strong convex hull property, they have a finer shape control. There are other techniques for designing and editing the shape of a curve such as changing knots. B-spline curves are still polynomial curves and polynomial curves cannot represent many useful simple curves such as circles and ellipses. 10

Localized Control Moving the control point B 7 only changes the curve near that point. 11

Problems with B-splines B-splines cannot represent conic sections In order to represent them, we can use a ratio of polynomials Q ( t) p p 1 2 ( t) ( t) 12

NURBS NURBS are one form of rational polynomial curves Non-Uniform Rational B-Spline Defined by : its order determines the number of control points that affect a region of the curve The polynomial is degree one less than the order (i.e. order 4 is cubic polynomial) a set of weighted control points a knot vector a sequence of values that determine how the control points affect the curve NURBS curves are generalizations of both B-splines and Bezier curves 13

NURBS NURBS are one form of rational polynomial curves Non-Uniform Rational B-Spline Defined by: Q ( t ) n i 1 i i i, k n w w B N N i 1 i i, k ( t ) ( t ) with: w i scalar wei ght for each control point B i control points N i, k ( t ) the B - spline curve k B - spline parameter 14

NURBS If the weights are set to 1, the NURBS becomes a regular B-spline NURBS can represent conics exactly. 15

Non-Uniform Uniform Knot Vector {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0} Non-Uniform Knot Vector {0.0, 1.0, 2.0, 3.75, 4.0, 4.25, 6.0, 7.0} The knot intervals for B 2 and B 3 : {3.75, 4.0} and {4.0, 4.25} are narrower. 16

NURBS examples (from U of Calgary) 17

Parametric Bicubic Surfaces An extension to curves by adding another dimension t = 1.0 t = 0.2 t = 0.8 t = 0.6 t = 0.4 t = 0.0 s = 0.0 s = 0.2 s = 0.4 s = 0.6 s = 0.8 s = 1.0 18

Curve Equation Remember, the equation of the curve is: Q ( t ) TMG Or, equivalently: Q ( s) SMG Where G is the geometry vector, and s is a constant 19

20 The Surface Equations If we allow G to be a function, we get i.e., the geometry can now change, based on t ) ( ) ( ) ( ) ( ) ( ), ( 4 3 2 1 t G t G t G t G SM t SMG t s Q

The Surface Equations For a fixed t 1, Q(s, t 1 ) is a curve, since G(t 1 ) is a constant. Taking a new t 2 that is near in value to t 1 will give another curve which is slightly different from the first. Repeating the process for some number of parameters t, with 0 t < 1 will give a group of curves that define a surface. 21

22 The Surface Equations Each of the G i (t) functions are cubics, and can be represented as: where i G i TM t G ) ( 4 3 2 1 i i i i i g g g g G

Surface Equations Taking the transpose of this gives us G i ( t ) G i T M T T T If we substitute this back into our original equation, and expand to include all four geometry terms, we get: Q ( s, t) SM G T M T T T 23

24 Surface Equations So, With being the geometry matrix and M being the basis matrix. T T T x T M SM G t s x ), ( T T T y T M SM G t s y ), ( T T T z T M SM G t s z ), ( G

Bezier Surfaces The ends of each patch require 4 control points in the s direction. The t direction gives rise to 4 control points also Thus, there are 4x4 or 16 control points required for each patch. 25

Bezier Surface Example 26

Joining Bezier Surfaces P 21 Multiple Bezier surfaces can be joined with C 0 continuity by: P 41 P 31 P 42 P 43 P 32 P 11 P 22 P 12 P 23 P 33 P P 34 24 P 13 Making the four control points at the join common between the two patches P 44 P 45 P 46 P P 25 35 P 36 P 26 P 14 P 15 P 37 P 16 P 47 P 27 P 17 27

Joining Bezier Surfaces P 21 P 31 To join with C 1 continuity we must also enforce the following stipulations: 1. The control points on either side of the join must be collinear P 41 P 42 P 43 P 44 P 32 P 11 P 22 P 12 P 33 P 23 P 34 P 24 P 35 P 25 P 13 P 14 2. All of the pairs of line segments joining the three collinear control points must have lengths that have the same ratios P 45 P 46 P 47 P 36 P 26 P 37 P 27 P 15 P 16 P 17 28

Joining Bezier Surfaces P 21 For this example the following ratios must be equal: P 41 P 42 P 31 P 32 P 11 P 22 P 23 P 33 P 12 P 13 P 34 P 24 P P 13 14 P P 14 15 P P 23 24 P P 24 25 P P 33 34 P P 34 35 P P 43 44 P P 44 45 P 43 P 44 P 35 P 25 P 14 P 15 P 45 P 36 P 26 P 46 P 37 P 16 P 47 P 27 29 P 17

Displaying Surfaces Surfaces are displayed in a manner similar to curves. 1. Iteratively evaluate the surface equation at s and t intervals, then draw polygons for those patches 2. Subdivide the surface until the patch size is small enough 30

NURBS Surfaces NURBS Non Uniform - knots can have any spacing desired Rational the blending functions are the ratios of two polynomials B-Spline the surface type is B-spline Very flexible and powerful Also somewhat complex Can represent conics exactly Used extensively, particularly in CAD 31

NURBS Examples http://www.geomagic.com 32

http://gallery.mcneel.com/ 33

http://gallery.mcneel.com/ 34

http://gallery.mcneel.com/ 35

NURBS in OpenGL glunurbssurface(glunurbs *nurb, Glint sknotcount, GLfloat *sknots, Glint tknotcount, GLfloat *tknots, Glint sstride, Glint tstride, GLfloat *control, Glint sorder, Glint torder, GLenum type) 36

NURBS in OpenGL nurb specifies the NURBS object created with glunewnurbsrenderer sknotcount number of knots in the s direction sknots the array of s knots tknotcount number of knots in the t direction tknots the array of t knots sstride offset between control points in the s direction tstride offset between control points in the t direction control array of control points glunurbssurface(glunurbs *nurb, Glint sknotcount, GLfloat *sknots, Glint tknotcount, GLfloat *tknots, Glint sstride, Glint tstride, GLfloat *control, Glint sorder, Glint torder, GLenum type) sorder order of the NURBS in s torder order of the NURBS in t type type of surface 37

Trimming Curves Sometimes we want holes in the surface Can define them using trimming curves Define a NURBS curve on the NURBS surface Draw the surface everywhere except inside the curve 38

39

40

Subdivision Surfaces One problem with the surfaces we have discussed is the difficulty in changing resolution for a portion of the surface If we want more detail at one part of the patch, we have to introduce a whole new patch Subdivision surfaces allow local refinement of the control mesh This gives more flexibility in the objects to be modeled 41

Subdivision Surfaces Idea: recursively subdivide the patch to finer and finer resolution Refinement 1 Refinement 2 Refinement 42

Standard Subdivision Given initial control points, recursively subdivide until desired smoothness is reached 43

Adaptive Subdivision Generally some areas of the surface have higher curvature, and thus should be subdivided further than other areas Can apply an adaptive subdivision scheme to subdivide more where we want finer control of the surface 44

Adaptive Subdivision Surface Example Original Mesh After one refinement After two refinements The limit infinite refinement from http://grail.cs.washington.edu/projects/subdivision/ 45

Subdivision Surfaces Geri s Game (1997) : Pixar Animation Studios 46

Subdivision Surface Example http://mrl.nyu.edu/~dzorin/sig98course/multires/sld005.htm 47

Allowing for Sharp Edges and Creases Often we want to permit sharp edges How can we smooth some of the surface, but not all? Tag edges as sharp or non-sharp If an edge is sharp, apply sharp subdivision rules Otherwise apply normal subdivision rules 48

T-splines Introduced by Dr. Sederberg in 2003 Allow T-junctions in the surfaces T-junction 49

T-Splines 50

T-spline Hole Filling 51

T-spline example 52

Summary Surfaces allow for a higher level of realism Used in all CAD packages NURBS surfaces are the most popular type Subdivision surfaces allow for increased surface detail, and for local adaptation T-splines allow for even more flexibility 53