NURBS Drawing Week 5, Lecture 10



Similar documents
NURBS Drawing Week 5, Lecture 10

NURBS Drawing Week 5, Lecture 10

How To Use Design Mentor

Computer Graphics CS 543 Lecture 12 (Part 1) Curves. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Introduction Week 1, Lecture 1

Geometric Modelling & Curves

MA 323 Geometric Modelling Course Notes: Day 02 Model Construction Problem

Essential Mathematics for Computer Graphics fast

PYTHAGOREAN TRIPLES KEITH CONRAD

B2.53-R3: COMPUTER GRAPHICS. NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions.

CSE 167: Lecture 13: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

New York State Student Learning Objective: Regents Geometry

We can display an object on a monitor screen in three different computer-model forms: Wireframe model Surface Model Solid model

Algebra 2 Chapter 1 Vocabulary. identity - A statement that equates two equivalent expressions.

Conjectures. Chapter 2. Chapter 3

Geometry Enduring Understandings Students will understand 1. that all circles are similar.

Determine whether the following lines intersect, are parallel, or skew. L 1 : x = 6t y = 1 + 9t z = 3t. x = 1 + 2s y = 4 3s z = s

BEZIER CURVES AND SURFACES

39 Symmetry of Plane Figures

4. How many integers between 2004 and 4002 are perfect squares?

Chapter 6 Notes: Circles

Section 9-1. Basic Terms: Tangents, Arcs and Chords Homework Pages : 1-18

Solutions to Homework 10

Chapters 6 and 7 Notes: Circles, Locus and Concurrence

arxiv: v1 [math.dg] 24 Apr 2014

TWO-DIMENSIONAL TRANSFORMATION

Solutions to old Exam 1 problems

Outline. Quantizing Intensities. Achromatic Light. Optical Illusion. Quantizing Intensities. CS 430/585 Computer Graphics I

Definitions, Postulates and Theorems

GEOMETRY COMMON CORE STANDARDS

DEFINITIONS. Perpendicular Two lines are called perpendicular if they form a right angle.

L 2 : x = s + 1, y = s, z = 4s Suppose that C has coordinates (x, y, z). Then from the vector equality AC = BD, one has

Angles that are between parallel lines, but on opposite sides of a transversal.

Advanced Math Study Guide

Introduction Week 1, Lecture 1

ME 111: Engineering Drawing

Computer Graphics. Geometric Modeling. Page 1. Copyright Gotsman, Elber, Barequet, Karni, Sheffer Computer Science - Technion. An Example.

2.3 WINDOW-TO-VIEWPORT COORDINATE TRANSFORMATION

Computer Animation: Art, Science and Criticism

x 2 + y 2 = 1 y 1 = x 2 + 2x y = x 2 + 2x + 1

Computer Aided Design (CAD)

Figure 2.1: Center of mass of four points.

Introduction to CATIA V5

1 Solution of Homework

Geometric description of the cross product of the vectors u and v. The cross product of two vectors is a vector! u x v is perpendicular to u and v

Heron s Formula. Key Words: Triangle, area, Heron s formula, angle bisectors, incenter

Gymnázium, Brno, Slovanské nám. 7, SCHEME OF WORK Mathematics SCHEME OF WORK. cz

Unit 2 - Triangles. Equilateral Triangles

5.1 Midsegment Theorem and Coordinate Proof

CENTER OF GRAVITY, CENTER OF MASS AND CENTROID OF A BODY

ME 111: Engineering Drawing

Computer Aided Design (CAD)

CHAPTER 8, GEOMETRY. 4. A circular cylinder has a circumference of 33 in. Use 22 as the approximate value of π and find the radius of this cylinder.

The Geometry of Piles of Salt Thinking Deeply About Simple Things

CIRCLE COORDINATE GEOMETRY

ME 111: Engineering Drawing

61. Pascal s Hexagon Theorem.

Identifying second degree equations

LEAVING CERT DCG SCHEME OF WORK

Lecture 2: Homogeneous Coordinates, Lines and Conics

Content. Chapter 4 Functions Basic concepts on real functions 62. Credits 11

GEOMETRY CONCEPT MAP. Suggested Sequence:

Lecture 1: Systems of Linear Equations

Lecture L17 - Orbit Transfers and Interplanetary Trajectories

Vector Notation: AB represents the vector from point A to point B on a graph. The vector can be computed by B A.

Biggar High School Mathematics Department. National 5 Learning Intentions & Success Criteria: Assessing My Progress

Visualizing Triangle Centers Using Geogebra

Math 531, Exam 1 Information.

WORK SCHEDULE: MATHEMATICS 2007

alternate interior angles

Astromechanics Two-Body Problem (Cont)

Name Class. Date Section. Test Form A Chapter 11. Chapter 11 Test Bank 155

Selected practice exam solutions (part 5, item 2) (MAT 360)

Week 1 Chapter 1: Fundamentals of Geometry. Week 2 Chapter 1: Fundamentals of Geometry. Week 3 Chapter 1: Fundamentals of Geometry Chapter 1 Test

Algebra 1 Course Title

SIMSON S THEOREM MARY RIEGEL

Dear Accelerated Pre-Calculus Student:

The University of the State of New York REGENTS HIGH SCHOOL EXAMINATION MATHEMATICS B. Tuesday, August 16, :30 to 11:30 a.m.

11.1. Objectives. Component Form of a Vector. Component Form of a Vector. Component Form of a Vector. Vectors and the Geometry of Space

South Carolina College- and Career-Ready (SCCCR) Pre-Calculus

Computational Geometry. Lecture 1: Introduction and Convex Hulls

TABLE OF CONTENTS. INTRODUCTION... 5 Advance Concrete... 5 Where to find information?... 6 INSTALLATION... 7 STARTING ADVANCE CONCRETE...

How To Draw In Autocad

Geometry. Higher Mathematics Courses 69. Geometry

Prentice Hall Mathematics: Algebra Correlated to: Utah Core Curriculum for Math, Intermediate Algebra (Secondary)

HIGH SCHOOL: GEOMETRY (Page 1 of 4)

2.1 Three Dimensional Curves and Surfaces

Volumes of Revolution

A matrix method for degree-raising of B-spline curves *

Curriculum Map by Block Geometry Mapping for Math Block Testing August 20 to August 24 Review concepts from previous grades.

Chapter 5: Distributed Forces; Centroids and Centers of Gravity

Modeling Curves and Surfaces

NEW YORK STATE TEACHER CERTIFICATION EXAMINATIONS

Triangulation by Ear Clipping

Chapter 8 Integers 8.1 Addition and Subtraction

Vector storage and access; algorithms in GIS. This is lecture 6

42 CHAPTER 1. VECTORS AND THE GEOMETRY OF SPACE. Figure 1.18: Parabola y = 2x Brief review of Conic Sections

Chapter 17. Orthogonal Matrices and Symmetries of Space

Curve Fitting with Maple

Monash University Clayton s School of Information Technology CSE3313 Computer Graphics Sample Exam Questions 2007

Transcription:

CS 430/536 Computer Graphics I NURBS Drawing Week 5, Lecture 10 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing Laboratory Department of Computer Science Drexel University http://gicl.cs.drexel.edu 1

Outline Conic Sections via NURBS Knot insertion algorithm The de Boor s algorithm for B-Splines for NURBS Oslo Algorithm Barycentric Coordinates Discussion of homework #3 2

Conic Sections via NURBS Obtained via projection of the 3D parabola onto a plane Note: 3D Case: rational curve is a 4D object 2D Case: rational curve is a 3D object assign w to each control point From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html 3

Conic Sections via NURBS Define the curve with three control points Weights of first/last control points are 1 For center control point w<1 gives an ellipse w>1 gives a hyperbola w=1 gives a parabola Knot vector is {0.0, 0.0,0.0, 1.0, 1.0, 1.0} 4 From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html

Conic Sections via NURBS: A Circular Arc The two sides of the control polygon are of equal length The chord connecting the first and last control points meets each leg at an angle q equal to half the angular extent of the desired arc (for instance, 30 for a 60 arc) The weight of the inner control point is equal to the cosine of q Knot vector is {0.0, 0.0, 0.0, 1.0, 1.0, 1.0} 5 From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html

Conic Sections via NURBS: A Circle What if we need an arc of >180? Idea: Use multiple 90 or 120 arcs stitch them together with knots B 0 = B6 = - { 0.866,0.5,1} B 5 = { 0,2,0.5} B 4 = { 0.866,0.5,1} Example: 3 arcs of 120 B {- 1.732, 1,0.5} 1 = - B { 0, 1,1 } 2 = - B 0,0,0,1,1,2,2,3,3,3 { 1.732, 1,0.5} 3 = - 6 From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html

Conic Sections via NURBS Example: 4 arcs of 90 2 { 2 } B 3 = -1,1, 2 { 2 } B 1 = 1,1, 2 { 2 } B 5 = -1,-1, 2 { 2 } B 7 = 1,-1, From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html 7

Knot Insertion Issue: More control points mean more control How do we add more points and keep same curve? From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html 8

Knot Insertion Basic Approach Decide where we d like to tweak the curve Add a new knot Find affected d-1 control points Replace it with d new control points Example: New knot at u=2.6 9 From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html

Knot Insertion Given: n+1 control points (P 0, P 1,..., P n ), a knot vector of m+1 knots U = { u 0, u1,..., u m } and a degree d B- spline curve C(u). Insert a new knot t into the knot vector without changing the shape of the curve. If t lies in knot span [u k, u k+1 ), only the basis functions for (P k, P k-d ) are non-zero. Find d new control points Q k on edge P k-1 P k, Q k-1 on edge P k-2 P k-1,..., and Q k-d+1 on edge P k-d P k-d+1 All other control points are unchanged. Note that d-1 control points of the original control polyline are removed and replaced with d new control points. 10 See http://www.cs.mtu.edu/~shene/courses/cs3621/notes/spline/b-spline/single-insertion.html

Knot Insertion Algorithm Create new control point Q j = (1 a j )P j-1 + a j P j Where a is defined as a j = t - u j u j +d - u j See http://www.cs.mtu.edu/~shene/courses/cs3621/notes/spline/b-spline/single-insertion.html 11

Properties of Knot Insertion Increasing the multiplicity of a knot decreases the number of non-zero basis functions at this knot At a knot of multiplicity d, there will be only one non-zero basis function Corresponding point on the curve p(u) is affected by exactly one control point p i In fact p(u) is p i! 12 Compiled from Lecture notes of Dr. Ching-Kuang Shene @ Michigan Technological University

The de Boor Algorithm Generalization of de Casteljau's algorithm It provides a fast and numerically stable way for finding a point on a B-spline curve Observation: if a knot u is inserted d times to a B-spline, then p(u) is the point on the curve. Idea: We just simply insert u d times and the last point is p(u)! See http://www.cs.mtu.edu/~shene/courses/cs3621/notes/spline/b-spline/de-boor.html 13 Compiled from Lecture notes of Dr. Ching-Kuang Shene @ Michigan Technological University

The de Boor Algorithm 14

The de Boor Algorithm 15

The de Boor Algorithm 16

The de Boor Algorithm 17

The de Boor Algorithm 18

De Boor s Algorithm If u lies in [u k,u k+1 ) and u!= u k, let h = d If u = u k and u k is a knot of multiplicity s, let h = d s Copy the affected control points p k-s, p k-s-1,..., p k-d+1, p k-d to a new array and rename them as p k-s,0, p k-s-1,0,..., p k-d+1,0 for r := 1 to h do for i := k-d+r to k-s do { Let a i,r = (u - u i ) / ( u i+d-r+1 - u i ) Let p i,r = (1 - a i,r ) p i-1,r-1 + a i,r p i,r-1 } p k-s,d-s is the point p(u). 19 Compiled from Lecture notes of Dr. Ching-Kuang Shene @ Michigan Technological University

De Boor s Algorithm (cont) for u := 0 to u max do { for r := 1 to h do for i := k-p+r to k-s do { Let a i,r = (u - u i ) / ( u i+p-r+1 - u i ) Let p i,r = (1 - a i,r ) p i-1,r-1 + a i,r p i,r-1 } p k-s,p-s is the point p(u). } 21 Compiled from Lecture notes of Dr. Ching-Kuang Shene @ Michigan Technological University

Example of de Boor s Algorithm Degree 3 B-spline curve (i.e., d = 3) Defined by seven control points p 0,..., p 6 And knot vector: u = 0.4 u 0 = u 1 = u 2 = u 3 u 4 u 5 u 6 u 7 = u 8 = u 9 = u 10 0 0.25 0.5 0.75 1 a 4,1 = (u - u 4 ) / ( u 4+3 - u 4 ) = 0.2 a 3,1 = (u - u 3 ) / ( u 3+3 - u 3 ) = 8/15 = 0.53 a 2,1 = (u - u 2 ) / ( u 2+3 - u 2 ) = 0.8 p 4,1 = (1 - a 4,1 )p 3,0 + a 4,1 p 4,0 = 0.8p 3,0 + 0.2p 4,0 p 3,1 = (1 - a 3,1 )p 2,0 + a 3,1 p 3,0 = 0.47p 2,0 + 0.53p 3,0 p 2,1 = (1 - a 2,1 )p 1,0 + a 2,1 p 2,0 = 0.2p 1,0 + 0.8p 2,0 a 4,2 = (u - u 4 ) / (u 4+3-1 - u 4 ) = 0.3 a 3,2 = (u - u 3 ) / (u 3+3-1 - u 3 ) = 0.8 p 4,2 = (1 - a 4,2 ) p 3,1 + a 4,2 p 4,1 = 0.7p 3,1 + 0.3p 4,1 p 3,2 = (1 - a 3,2 ) p 2,1 + a 3,2 p 3,1 = 0.2p 2,1 + 0.8p 3,1 a 4,3 = (u - u 4 )/ (u 4+3-2 - u 4 ) = 0.6 p 4,3 = (1 - a 4,3 )p 3,2 + a 4,3 p 4,2 = 0.4p 3,2 + 0.6p 4,2 22 Compiled from Lecture notes of Dr. Ching-Kuang Shene @ Michigan Technological University

Similar but Different De Casteljau's: Dividing points are computed with a pair of numbers (1 - u) and u that never change Can be used for curve subdivision Uses all control points De Boor's These pairs of numbers are different and depend on the column number and control point number Intermediate control points are not sufficient d+1 affected control points are involved in the computation 23 Compiled from Lecture notes of Dr. Ching-Kuang Shene @ Michigan Technological University

De Boor s: Curves 25 Animated by Max Peysakhov @ Drexel University

Oslo Algorithm A subdivision algorithm for B-splines, the basic idea: Take the curve with m+1 control points P 0 to P m Insert a knot in any point (0.5 maybe?) As a result you will have 2 new points P k and P k Take curves with m+1 control points P 0 P k, P k P m-1 and P 1 P k, P k P m Apply procedure recursively on each part 26

Oslo Algorithm 27 Recorded from: http://heim.ifi.uio.no/~trondbre/osloalgapp.html

Barycentric Coordinates By Ceva's Theorem: For any point K inside the triangle ABC Consider the existence of masses w A, w B, and w C, placed at the vertices of the triangle Their center of gravity (barycenter) will coincide with the point K. August Ferdinand Moebius (1790-1868) defined (1827) w A, w B, and w C as the barycentric coordinates of K K = w A A + w B B + w C C B, w B A, w A K C, w C 28 http://www.cut-the-knot.org/triangle/barycenter.shtml

Properties of Barycentric Coordinates Not unique Can be generalized to negative masses Can be made unique by setting w A + w B + w C = 1 w A = 0 for points on BC w B = 0 for points on AC w C = 0 on AB B, w B A, w A K C, w C 29 http://www.cut-the-knot.org/triangle/barycenter.shtml

Area Ta: (b-p) x (c-p) /2 30

Calculating the Weights Given vertices A, B, C and Centroid K What are the weights, w A, w B, w C? x K = w A x A + w B x B + w C x C y K = w A y A + w B y B + w C y C Substitute w C = 1 - w A - w B x K = w A x A + w B x B + (1- w A - w B )x C y K = w A y A + w B y B + (1- w A - w B )y C 33

Calculating Weights (cont.) Solve for w A and w B w A = (x B - x C )(y C - y K ) - (x C - x K )(y B - y C ) (x A - x C )(y B - y C ) - (x B - x C )(y A - y C ) w B = (x A - x C )(y C - y K ) - (x C - x K )(y A - y C ) (x B - x C )(y A - y C ) - (x A - x C )(y B - y C ) w C = 1 - w A - w B 34

Onto Bézier Surfaces B-spline Surfaces NURBS Surfaces Faceting, Subdivision, Tessellation 3D Objects 38

Programming assignment 3 Input PostScript-like file containing polygons Output B/W XPM Implement viewports Use Sutherland-Hodgman intersection for polygon clipping Implement scanline polygon filling. (You can not use flood filling algorithms) 39