CS 536 Computer Graphics NURBS Drawing Week 4, Lecture 6

Similar documents
Computer Aided Design. B-Splines

Mathematics Precalculus: Academic Unit 7: Conics

Mr. Kelly s Algebra II Syllabus

Introduction to Computer Graphics. Modeling (1) April 13, 2017 Kenshi Takayama

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

MA 323 Geometric Modelling Course Notes: Day 12 de Casteljau s Algorithm and Subdivision

Conversion of Quadrics into Rational Biquadratic Bézier Patches

Curves, Surfaces and Segments, Patches

ALGEBRA 2 X. Final Exam. Review Packet

Give a geometric description of the set of points in space whose coordinates satisfy the given pair of equations.

GAT-UGTP-2018 Page 1 of 5

Interpolation and polynomial approximation Interpolation

Analytic Geometry MAT 1035

Page 1

The Distance Formula. The Midpoint Formula

Analytic Geometry MAT 1035

Your summer assignment consists of problems that cover the following concepts:

MA 323 Geometric Modelling Course Notes: Day 07 Parabolic Arcs

PHASE 1 CURRICULUM MAP M. Fellmeth Course/Subject: Honors Precalculus Grade: 11 th Teacher: M. Hart

LEVERS AND BARYCENTRIC COORDINATES (PART 2)

Saxon Advanced Mathematics Scope and Sequence

Pre-Calculus and Trigonometry Capacity Matrix

HUDSONVILLE HIGH SCHOOL COURSE FRAMEWORK

An O(h 2n ) Hermite approximation for conic sections

MAT300/500 Programming Project Spring 2019

Portable Assisted Study Sequence ALGEBRA IIB

Pre-Calculus EOC Review 2016

MCPS Algebra 2 and Precalculus Standards, Categories, and Indicators*

Common Core Georgia Performance Standards Mathematics Grades Adopted Reason quantitatively and use units to solve problems.

Integrated Math 3 Math 3 Course Description:

Appendix C: Event Topics per Meet

xvi xxiii xxvi Construction of the Real Line 2 Is Every Real Number Rational? 3 Problems Algebra of the Real Numbers 7

Conic Sections and Polar Graphing Lab Part 1 - Circles

COURSE OF STUDY MATHEMATICS

Geometric meanings of the parameters on rational conic segments

Lecture 20: Bezier Curves & Splines

Practice Set for IIT JEE. Paper I

A. 180 B. 108 C. 360 D. 540

Lecture 23: Hermite and Bezier Curves

M2R IVR, October 12th Mathematical tools 1 - Session 2

Algebra II Learning Targets

MA 323 Geometric Modelling Course Notes: Day 11 Barycentric Coordinates and de Casteljau s algorithm

Integrated Math II. IM2.1.2 Interpret given situations as functions in graphs, formulas, and words.

Pre-Calculus and Trigonometry Capacity Matrix

NON-AP CALCULUS SUMMER PACKET

Chapter 10. Properties of Circles

Pennsylvania Academic Standards for Mathematics Grade 11

Geometry Teachers Weekly Assessment Package Unit 8. Created by: Jeanette Stein

Time : 3 hours 02 - Mathematics - July 2006 Marks : 100 Pg - 1 Instructions : S E CT I O N - A

Bézier Curves and Splines

Chetek-Weyerhaeuser High School

THE PYTHAGOREAN THEOREM

Approximation of Circular Arcs by Parametric Polynomials

MAT1035 Analytic Geometry

3. A( 2,0) and B(6, -2), find M 4. A( 3, 7) and M(4,-3), find B. 5. M(4, -9) and B( -10, 11) find A 6. B(4, 8) and M(-2, 5), find A

Quantile Textbook Report

Sample Exam 1 KEY NAME: 1. CS 557 Sample Exam 1 KEY. These are some sample problems taken from exams in previous years. roughly ten questions.

Mathematics AKS

Sophomore Year: Algebra II Textbook: Algebra II, Common Core Edition Larson, Boswell, Kanold, Stiff Holt McDougal 2012

Indiana Academic Standards for Precalculus

PRACTICE TEST 1 Math Level IC

Mathematics Extension 2

Algebra II. A2.1.1 Recognize and graph various types of functions, including polynomial, rational, and algebraic functions.

Geometry Evidence Statements Evidence Statement Keys

Pre Calculus Gary Community School Corporation Unit Planning Map

T a b l e o f C o n t e n t s

Solution: We can cut the 2-simplex in two, perform the identification and then stitch it back up. The best way to see this is with the picture:

WEDNESDAY, 18 MAY 1.00 PM 1.45 PM. 2 Full credit will be given only where the solution contains appropriate working.

SKILL BUILDER TEN. Graphs of Linear Equations with Two Variables. If x = 2 then y = = = 7 and (2, 7) is a solution.

MATHEMATICS EXTENSION 2

Content Guidelines Overview

Integrated Mathematics I, II, III 2016 Scope and Sequence

CALCULUS BASIC SUMMER REVIEW

Maths Years 9 to 10. Boardworks Maths Years 9 to 10. Presentations: 3-D problems 9 slides. Algebraic fractions 22 slides

CIRCLES: #1. What is an equation of the circle at the origin and radius 12?

Algebra 2. Chapter 4 Exponential and Logarithmic Functions. Chapter 1 Foundations for Functions. Chapter 3 Polynomial Functions

Introduction to Computer Graphics (Lecture No 07) Ellipse and Other Curves

Parabola. The fixed point is called the focus and it is denoted by S. A (0, 0), S (a, 0) and P (x 1, y 1 ) PM=NZ=NA+AZ= x 1 + a

Computing the Hausdorff Distance between Two B-Spline Curves. Zachi Shtain

hmhco.com Adaptive. Intuitive. Transformative. AGA Scope and Sequence

by Jerald Murdock, Ellen Kamischke, and Eric Kamischke An Investigative Approach

Instructional Units Plan Algebra II

MATH Final Review

MATH II CCR MATH STANDARDS

October 16, Geometry, the Common Core, and Proof. John T. Baldwin, Andreas Mueller. The motivating problem. Euclidean Axioms and Diagrams

PreCalculus. American Heritage Upper School Summer Math Packet

Classical Theorems in Plane Geometry 1

MATH 1020 WORKSHEET 12.1 & 12.2 Vectors in the Plane

Integrated Math III. IM3.1.2 Use a graph to find the solution set of a pair of linear inequalities in two variables.

b g 6. P 2 4 π b g b g of the way from A to B. LATE AND ABSENT HOMEWORK IS ACCEPTED UP TO THE TIME OF THE CHAPTER TEST ON ASSIGNMENT DUE

MATH H53 : Mid-Term-1

3. A( 2,0) and B(6, -2), find M 4. A( 3, 7) and M(4,-3), find B. 5. M(4, -9) and B( -10, 11) find A 6. B(4, 8) and M(-2, 5), find A

STEM-Prep Pathway SLOs

correlated to the Indiana Academic Standards for Precalculus CC2

Dover-Sherborn High School Mathematics Curriculum Pre-Calculus Level 1/CP

TS EAMCET 2016 SYLLABUS ENGINEERING STREAM

Introduction. Chapter Points, Vectors and Coordinate Systems

The Research- Driven Solution to Raise the Quality of High School Core Courses. Algebra I I. Instructional Units Plan

9th and 10th Grade Math Proficiency Objectives Strand One: Number Sense and Operations

Accelerated Integrated Geometry Instructional Resource Calendar

Transcription:

CS 536 Computer Graphics NURBS Drawing Week 4, Lecture 6 David Breen, William Regli and Maxim Peysakhov Department of Computer Science Drexel University 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 θ 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 θ 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 B stitch them together with knots 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 6 { 1.732, 1,0.5} 3 = From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html

Conic Sections via NURBS Example: 4 arcs of 90 2 2 { 2 } B 1 = { 1,1, 2 } B 3 = 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 α j )P j-1 + α j P j Where α is defined as α 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

Programming Assignment 2 Process command-line arguments Read in 3D curve points and tangents Compute Bezier control points for curves defined by each two curve points Use HW1 code to compute points on each Bezier curve Each Bezier curve should be a polyline Output points by printing them to the console as an IndexedLineSet with multiple polylines, and control points as spheres in Open Inventor format 35