modeling curves and surfaces part i

13
Graphics I Faramarz Samavati UNIVERSITY OF CALGARY Modeling Curves and Surfaces part I Graphics II Faramarz Samavati UNIVERSITY OF CALGARY Making objects 3d scanner /3d digitizer (copying) Hard to edit a very high quality mesh There is no original object!

Upload: others

Post on 14-Mar-2022

5 views

Category:

Documents


0 download

TRANSCRIPT

Graphics IFaramarz Samavati

UNIVERSITY OF

CALGARY

ModelingCurves and Surfaces

part I

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Making objects

3d scanner /3d digitizer (copying)

Hard to edit a very high quality mesh

There is no original object!

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Mathematical Models

Line and arcs (from ancient world geometrician)

A short review on:

Graph of functions

implicit representation

parametric representation

parametric polynomial curves

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Mathematical Models

S

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY

Point in or

Bezier ModelP.Bezier,

1960, Unisurf in Renault automobile designing.

Mathematical definition

Old CAD and graphics software

Postscript

METAFONT

Modeling

Q(u)

curve

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Bezier Curve Definition

u is the parameter

Berenstein polynomial of order d

:Control points ( inputs)

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Bezier Curve Details

Bezier curve of order 1

Bezier curve of order 3

Bezier curve of order 2

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Cubic Bezier Curve

properties

1. is a polynomial curve with the domain [0,1]

2.

3.

4.

5.

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY

Non-negative polynomial of order d

Properties of

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Convex Hull

What is the Convex Hull?

Given a set of points (in )

The smallest convex polyhedral that includes all the points

given

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Implementation (brute force)

Input P[i], d //P[i]: control point, d : degree , u : parameter

for u=0 to 1 step 0.01for i=0 to d

b = Berenstein( i , d , u )q = q + b * P[i]

endplot(q);

end

This program isn’t efficientRedundant computations

High degree polynomialHigh number of control pointsHigh degree polynomial Unstable computation

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY de Casteljau AlgorithmAvoid direct evaluating of polynomials

Geometric interpretation

Consider a planer cubic at

column by column updating rule

u1-u

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Pseudo CodeInput P[j] , d , u//P[j] : control point, d : degree , u : parameter //output will be Q(u)

for i = 1 to dfor j = 0 to d-i

P[j] =(1-u)*P[j] + u*P[j+1]end

endOutput ???

Why is this algorithm correct?

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARYSome Observation on Cubic Case

After one step of deCasteljue algorithm for

Obtaining

4 green points

4 blue points

Where

Small left Bezier curve:

Small right Bezier curve: Original Bezier curve

Divided and conquer method

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Matrix Relation

Unit summation of any row.

Non negative elements.

Banded structure.

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Another View

We start with 4 points

We will obtain 8 new points 7 new points

New points:

New points are closer to the curve

We can repeat for any 4 points in the new points sets

And initial polyline is replaced by a finer polyline

Subdivision method

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARYPseudo Code for SubdivisionMethodPolyline subBezier (polyline P)

//cubic Bezier, d=3,//uniform subdivision, u=1/2 //Input is polyline P// n is number of P points (coarse polyline)// O is output polyline (fine polyline)

j=0;for ( i=0 ; i<n ; i=+3)

O[j]=P[i];O[j+1]=(P[i] + P[i+1])/2O[j+5]=(P[i+2] + P[i+3])/2t = (P[i+1] + P[i+2])/2

O[j+2]=(t + O[j+1])/2O[j+4]=(t + O[j+5])/2O[j+3]=(O[j+2] + O[j+4])/2j=j+6;

endforReturn O

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Weakness of Bezier curves

High degree polynomial

How can we increase the controlling on the curve without adding control points?

Composite Bezier curve: join Bezier curve segments.Apply some constraints at the connection points.What are these constrains?

Any other weakness?

o Positional Continuity = zero degree continuityo Same direction tangents = first degree continuity

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY

Easy and local algorithm

Two magic! numbers and

Corner cutting

Piecewise quadratic polynomials:Chaikin Algorithm

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Convergencesmooth limit curve (no corner), quadratic B-spline!

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Subdivision Matrix

Coarse points fine points

F= PC

Iterative process

P has a regular banded structure

subdivision

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Faber Subdivision

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Subdivision Matrix

What is the limit curve?Obvious interpretation in the resolution enhancement of images Periodic case

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Image Example

each row

each column

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Image application

Increasing the resolution of image

Traditional method(Faber)

½ left + ½ right

Chaikin ruleRepeating algorithm for every row

Graphics IIFaramarz Samavati

UNIVERSITY OF

CALGARY Comparing the results