Curve and Surface Basics

Similar documents
Curves and Surfaces Computer Graphics I Lecture 9

Curves and Surfaces Computer Graphics I Lecture 10

Parametric curves. Brian Curless CSE 457 Spring 2016

Design considerations

Curves and Surfaces 1

Curves and Surface I. Angel Ch.10

Reading. Parametric surfaces. Surfaces of revolution. Mathematical surface representations. Required:

Lecture IV Bézier Curves

Central issues in modelling

3D Modeling Parametric Curves & Surfaces

08 - Designing Approximating Curves

Sung-Eui Yoon ( 윤성의 )

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

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

Computer Graphics Curves and Surfaces. Matthias Teschner

Intro to Curves Week 4, Lecture 7

Intro to Curves Week 1, Lecture 2

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

Bezier Curves, B-Splines, NURBS

Properties of Blending Functions

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

Need for Parametric Equations

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.

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

Geometric Modeling of Curves

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

Bezier Curves. An Introduction. Detlef Reimers

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

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

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

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

Curves. Computer Graphics CSE 167 Lecture 11

Splines. Connecting the Dots

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

Let be a function. We say, is a plane curve given by the. Let a curve be given by function where is differentiable with continuous.

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

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Efficient Ray Tracing of Trimmed NURBS Surfaces

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

2D Spline Curves. CS 4620 Lecture 13

Computergrafik. Matthias Zwicker. Herbst 2010

CGT 581 G Geometric Modeling Curves

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

Computer Graphics Splines and Curves

Curves D.A. Forsyth, with slides from John Hart

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

ECE 600, Dr. Farag, Summer 09

Fundamentals of Computer Graphics. Lecture 3 Parametric curve and surface. Yong-Jin Liu.

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

Dgp _ lecture 2. Curves

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

CS770/870 Spring 2017 Ray Tracing Implementation

2D Spline Curves. CS 4620 Lecture 18

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

The Essentials of CAGD

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

Rational Bezier Surface

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

Surfaces. Ron Goldman Department of Computer Science Rice University

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

On an approach for cubic Bézier interpolation

Introduction to Geometry. Computer Graphics CMU /15-662

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

MA 323 Geometric Modelling Course Notes: Day 14 Properties of Bezier Curves

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

CS-184: Computer Graphics. Today

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

Linear Precision for Parametric Patches

Introduction to Computer Graphics

Curve Construction via Local Fitting

CS-184: Computer Graphics

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

CS3621 Midterm Solution (Fall 2005) 150 points

Parameterization of triangular meshes

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

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

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

Spline Curves. Spline Curves. Prof. Dr. Hans Hagen Algorithmic Geometry WS 2013/2014 1

CHAPTER 6 Parametric Spline Curves

The Free-form Surface Modelling System

Introduction to the Mathematical Concepts of CATIA V5

Computer Graphics Spline and Surfaces

Physically-Based Modeling and Animation. University of Missouri at Columbia

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

Rational Bezier Curves

PS Geometric Modeling Homework Assignment Sheet I (Due 20-Oct-2017)

Quasi-Quartic Trigonometric Bézier Curves and Surfaces with Shape Parameters

Surfaces for CAGD. FSP Tutorial. FSP-Seminar, Graz, November

Object representation

Parameterization. Michael S. Floater. November 10, 2011

For each question, indicate whether the statement is true or false by circling T or F, respectively.

2Surfaces. Design with Bézier Surfaces

COMP3421. Global Lighting Part 2: Radiosity

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

B-spline Curves. Smoother than other curve forms

A New Class of Quasi-Cubic Trigonometric Bezier Curve and Surfaces

Isoparametric Curve of Quadratic F-Bézier Curve

the straight line in the xy plane from the point (0, 4) to the point (2,0)

Mathematical Tools in Computer Graphics with C# Implementations Table of Contents

TO DUY ANH SHIP CALCULATION

Transcription:

Curve and Surface Basics Implicit and parametric forms Power basis form Bezier curves Rational Bezier Curves Tensor Product Surfaces ME525x NURBS Curve and Surface Modeling Page 1

Implicit and Parametric Forms Implicit Form: implicit functional relationship between coordinates of points lying on a curve. ME525x NURBS Curve and Surface Modeling Page 2

Implicit Form: example, circle of radius 1: f ( x, y) = x 2 + y 2 1 = 0 y r=1 x ME525x NURBS Curve and Surface Modeling Page 3

Parametric Form: each coordinate of points on the curve is represented separately as an explicit function of an independent variable, u: C ( u) = ( x ( u), y ( u) ), a u b the interval [a, b] is arbitrary. It is usually normalized to [0,1] ME525x NURBS Curve and Surface Modeling Page 4

The first quadrant of the unit circle can be defined by the parametric functions: x ( u) = cos ( u) y ( u) = sin ( u) 0 u π 2 Note, setting t = tan ( u 2), gives an alternative parametric form: 1 t x ( t) = ------------- 2 1 + t 2, 0 t 1 2t y ( t) = ------------- 1 + t 2, ME525x NURBS Curve and Surface Modeling Page 5

Thus the parametric representation of a curve is NOT unique. We can think of a parametric curve C(u) as the path traced out by a particle as a function of time: u is the time variable, [a, b] is the time interval. ME525x NURBS Curve and Surface Modeling Page 6

Then the first and second derivatives of C(u) are the velocity and acceleration of the particle, respectively, thus: C ( u) = ( x ( u), y ( u) ) = ( sin ( u), cos ( u) ) C ( t) = ( x ( t), y ( t) ) = 4t ---------------------- 2 ( 1 t2 ) ( 1 + t 2 ) 2, ----------------------- ( 1 + t 2 ) 2 ME525x NURBS Curve and Surface Modeling Page 7

Note that the magnitude of the velocity vector C (u) is a constant: C ( u) = sin 2 ( u) + cos 2 ( u) This is referred to as uniform parametrization. ME525x NURBS Curve and Surface Modeling Page 8

Substituting t = 0 and t = 1 into C (t) yields: C (0) = (0,2) and C (1) = (-1,0), i.e., the particle s start speed is twice its end speed. ---> non-uniform parameterization ME525x NURBS Curve and Surface Modeling Page 9

C (u=1) = C (t=1) y C (t=0) C (u=0) x ME525x NURBS Curve and Surface Modeling Page 10

An implicit surface is defined by an equation of the form f(x,y,z) = 0. For example, a sphere of radius 1, centered at the origin: f ( x, y, z) = x 2 + y 2 + z 2 1 = 0 ME525x NURBS Curve and Surface Modeling Page 11

A parametric representation (not unique) of the same sphere is given by S(u,v) = (x(u,v), y(u,v), z(u,v)), where: x ( u, v) = sin ( u) cos ( v) y ( u, v) = sin ( u) sin ( v) z ( u, v) = cos ( u) 0 u π; 0 v 2π Note that two parameters are required to define a surface. ME525x NURBS Curve and Surface Modeling Page 12

Denote the partial derivatives of S(u,v) by: S u (u,v) = (x u (u,v), y u (u,v), z u (u,v)) S v (u,v) = (x v (u,v), y v (u,v), z v (u,v)) At any surface point at which the cross product S u S v does not vanish, the unit normal vector is given by: N = S u S v ---------------------- S u S v ME525x NURBS Curve and Surface Modeling Page 13

The existence of the normal, and the corresponding tangent plane, is a geometric property of the surface, independent of parameterization. Different parameterizations will give different partial derivatives, but the above equation will always yield N. ME525x NURBS Curve and Surface Modeling Page 14

Implicit and parametric forms have their advantages and disadvantages; both have been applied to useful modeling methods. Summary By adding a z-coordinate, the parametric method is easily extended to represent arbitrary curves in 3D space. The implicit form can only represent curves in the coordinate planes (i.e., the xy-, xz-, or yzplanes). ME525x NURBS Curve and Surface Modeling Page 15

Boundedness is built into the parametric form through the bounds on the parametric interval. It is cumbersome to represent bounded curve segments (or surface patches) with the implicit form. Parametric curves possess a natural direction of traversal, implicit curves do not. ME525x NURBS Curve and Surface Modeling Page 16

Parametric forms can provide a natural method for designing and representing shape in a computer. Techniques exist which relate the coefficients of parametric functions to geometrically intuitive control handles Parametric form sometimes produces anomalies which are unrelated to the true geometry (e.g., vanishing normals) ME525x NURBS Curve and Surface Modeling Page 17

The complexity of many geometric operations depends greatly on the method of representation. Two classic examples are: 1) Compute a point on a curve or surface (difficult in implicit form) 2) Given a point, determine if it is on the curve or surface (difficult in the parametric form) ME525x NURBS Curve and Surface Modeling Page 18

Power Basis Form of a Curve The choice of basis for a parametric curve is arbitrary, but the choice involves trade-offs. Ideally, we want a class of functions which: are capable of representing precisely all curves needed are easily, efficiently and accurately processed in a computer ME525x NURBS Curve and Surface Modeling Page 19

numerical processing is insensitive to floating point operations functions should require little memory for storage Polynomials satisfy the last two criteria - there are curve and surface types which cannot be represented using polynomials. ME525x NURBS Curve and Surface Modeling Page 20

Two common methods of expressing polynomial functions are: Power basis (algebraic form) Bezier (a geometric form) Although they are mathematically equivalent, the Bezier is better suited to representing and manipulating shape on a computer. ME525x NURBS Curve and Surface Modeling Page 21

An n-th degree power basis curve is given by: C ( u) = ( x ( u), y ( u), z ( u) ) n = a i u i, 0 u 1 i = 0 The a i = (x i, y i, z i ) are vectors, so: ME525x NURBS Curve and Surface Modeling Page 22

n x ( u) = x i u i i = 0 n y ( u) = y i u i i = 0 n z ( u) = z i u i i = 0 ME525x NURBS Curve and Surface Modeling Page 23

Alternatively, the polynomial can be written in matrix form: 1 u C ( u) = a 0 a 1 a n = u n ( a i ) T ( u i ) ME525x NURBS Curve and Surface Modeling Page 24

Differentiation yields: a i = C ( i) u ( ) u = 0 ----------------------------------- i! where, C (i) (u) u=0 is the i-th derivative of C(u) at u=0. The n + 1 functions, {u i }, are called the basis (or blending) functions, and the {a i }, the coefficients of the power basis representation. ME525x NURBS Curve and Surface Modeling Page 25

Given a parameter value u i, the point C(u i ) on a power basis curve is most efficiently computed using Horner s method: for, degree = 1: C(u i ) = a 1 u i + a 0 degree = 2: C(u i ) = (a 2 u i + a 1 )u i + a 0 : degree = n: C(u i ) = ((... (a n u i + a n-1 )u i + a n-2 )u i +... + a 0 ME525x NURBS Curve and Surface Modeling Page 26

The general algorithm is: Algorithm A1.1 Horner1(a, n, u, C) { /* Compute point on power basis curve */ /* Input: a, n, u */ /* Output: C */ C = a[n]; for (i=n-1; i>=0; i--) C = C*u + a[i]; } ME525x NURBS Curve and Surface Modeling Page 27

Bezier Curves The power basis form has the following disadvantaged with respect to interactive geometric design: Coefficients {a i } convey little geometric insight. In addition, a designer typically wants to control both ends of the curve, not just the start point ME525x NURBS Curve and Surface Modeling Page 28

Numerically, it is a rather poor form; e.g., Horner s method is prone to round-off error if the coefficients vary in magnitude The Bezier form overcomes these deficiencies ME525x NURBS Curve and Surface Modeling Page 29

An n-th degree Bezier curve is defined by: n C ( u) = B i, n ( u) P i, 0 u 1 i = 0 The basis (blending) functions, {B i,n (u)} are the n-th degree Bernstein polynomials, given by: n! B i, n ( u) = i! ------------------------u ( n i)! i ( 1 u ) n i The coefficients of this geometric form {P i } are called control points. ME525x NURBS Curve and Surface Modeling Page 30

Examples: n = 1: From the definition, B 0,1 (u) = 1 - u, and B 1,1 (u) = u The Bezier curve takes the form: C(u) = (1 - u)p 0 + up 1 i.e., a parametric line segment from P 0 to P 1 ME525x NURBS Curve and Surface Modeling Page 31

n = 2: From the definition, C(u) = (1 - u) 2 P 0 + 2u(1 - u)p 1 + u 2 P 2, which is a parabolic arc from P 0 to P 2. P 1 P 1 P 2 P 0 P 0 ME525x NURBS Curve and Surface Modeling Page 32

Note that: the polygon formed by {P 0, P 1, P 2 } approximates the curve. This polygon is called the control polygon. P 0 = C(0) and P 2 = C(1) The tangent directions to the curve at its endpoints are parallel to P 1 -P 0 and P 2 -P 1. the curve is contained in the triangle P 0 P 1 P 2 ME525x NURBS Curve and Surface Modeling Page 33

n = 3: C(u) = (1 - u) 3 P 0 + 3u(1 - u) 2 P 1 + 3u 2 (1 - u)p 2 + u 3 P 3 P 3 P 0 P 0 P 2 P 2 P 1 P 1 P 3 ME525x NURBS Curve and Surface Modeling Page 34

Note that: the control polygons approximate the shapes of the curves P 0 = C(0) and P 3 = C(1) endpoint tangent directions are parallel to P 1 - P 0 and P 3 - P 2 ME525x NURBS Curve and Surface Modeling Page 35

Convex Hull Property: the curves are contained in the convex hulls of their defining control polygons Variation Diminishing Property: no straight line intersects a curve more times than it intersects the curve s control polygon (for 3D replace the words straight line with plane) ME525x NURBS Curve and Surface Modeling Page 36

Initially (at u=0) the curve is turning in the same direction as P 0 P 1 P 2. At u=1 it is turning in the direction of P 1 P 2 P 3 A loop in the control point polygon may or may not imply a loop in the curve. The transition is a curve with a cusp. Bezier curves are invariant under affine transformations (i.e., rotations, translations, scale). Simply transform the control points ME525x NURBS Curve and Surface Modeling Page 37

Bezier Curves Properties of Bezier basis functions, {B i,n (u)}: P1.1: Non-negativity: B i,n (u) 0 for all i, n and 0 u 1 P1.2: Partition of unity: B i,n (u) = 1 for all 0 u 1 P1.3: B 0,n (0) = B n,n (1) = 1 ME525x NURBS Curve and Surface Modeling Page 38

P1.4: B i,n (u) attains exactly one maximum on the interval [0,1], i.e., at u = i/n P1.5: Symmetry: For any n, the set polynomials, B i,n (u) is symmetric with respect to u = 1/2 P1.6: Recursive definition: B i,n (u) = (1 - u)b i,n-1 (u) + ub i-1,n-1 (u). We define B i,n (u) 0 if i < 0 or i > n. ME525x NURBS Curve and Surface Modeling Page 39

P1.7: Derivatives: B i, n ( u) where, = = d Bi du, n ( u) n ( B i 1, n 1 ( u) B i, n 1 ( u) ) B 1, n 1 u ( ) B n, n 1 ( u) 0 ME525x NURBS Curve and Surface Modeling Page 40

Properties 1.6 and 1.7 provide the basis for recursive algorithms to compute Bezier blending functions and their derivatives. ME525x NURBS Curve and Surface Modeling Page 41