0% found this document useful (0 votes)
11 views182 pages

CSK CIM Modelling I Mod (2024)

The document provides an overview of CIM modeling basics, focusing on geometric modeling techniques in CAD, including solid, surface, and wireframe modeling. It discusses the importance of complete part representation, data transfer between CAD and CAE/CAM, and various modeling techniques such as Constructive Solid Geometry (CSG) and Boundary Representation (B-rep). Additionally, it highlights the significance of geometric and topological information in engineering applications and the challenges associated with different modeling approaches.

Uploaded by

datta.abhirup04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views182 pages

CSK CIM Modelling I Mod (2024)

The document provides an overview of CIM modeling basics, focusing on geometric modeling techniques in CAD, including solid, surface, and wireframe modeling. It discusses the importance of complete part representation, data transfer between CAD and CAE/CAM, and various modeling techniques such as Constructive Solid Geometry (CSG) and Boundary Representation (B-rep). Additionally, it highlights the significance of geometric and topological information in engineering applications and the challenges associated with different modeling approaches.

Uploaded by

datta.abhirup04
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 182

CIM Modelling Basics

C S Kumar
CAD-CAM and Robotics Lab
Mechanical Engineering
IIT Kharagpur
Lecture Topics
• Basics of Modelling in CAD

• Lines, Curves, Surfaces

• Database Representations

• Solid Modelling
Form Models
Multi-view Drawings
Types of views

Isometric Perspective
Perspective and
3D rendering
CAD/CAM/CAE
The Role of Geometric
ModelingCAD
in aSystem
Computer
Display

Mathematical
User representation
Interface Drawing
(Database)
Generation
Determine Determine

Geometric
Modeling Analysis and
Technique Manufacturing
General Requirements

• Complete part representation including topological and


geometrical data
– Geometry: shape and dimensions
– Topology: the connectivity and associativity of the object
entities; it determines the relational information between
object entities
• Able to transfer data directly from CAD to CAE and CAM.
 Support various engineering applications, such as mass
properties, mechanism analysis, FEA/FEM and tool path
creation for CNC, and so on.
Topology and Geometry
Comments on Geometric Modeling
• Geometric modeling is only a means not the goal in engineering.

• Engineering analysis needs product geometry; the degree of


detail depends on the analysis procedure that utilizes the
geometry.

• There is no model that is sufficient to study all behavioral aspects


of an engineering component or a system.

• Attributes facilitate analysis and grow with applications


Basic Geometric Modeling Techniques
• 2-D Projection (Drawings)
• Wireframe Modeling
• Surface Modeling
■Analytical Surface
■Free-form, Curved, & Sculptured Surface
• Solid Modeling
■Constructive Solid Geometry (CSG)
■Boundary Representation (B-Rep)
■…
o Feature Based Modeling
o Parametric Modeling
2-D Projection

Problems:
 Training is necessary to understand the drawing
 Mistakes often occur
 Does not support subsequent applications such as finite element
analysis (FEA) or NC part programming
Wireframe Modeling
• Developed in 1960s and referred as “a stick figure” or “an edge
representation”
• The word “wireframe” is related to the fact that one may imagine
a wire that is bent to follow the object edges to generate a
model.
• Model consists entirely of points, lines, arcs and circles, conics,
and curves.
• In 3D wireframe model, an object is not recorded as a solid.
Instead the vertices that define the boundary of the object, or the
intersections of the edges of the object boundary are recorded
as a collection of points and their connectivity.
or
fro nt
fron t

ambiguous
Example of Wireframe Modeling
Surface Modeling
• A surface model is a set of faces.
• A surface model consists of wireframe entities that form
the basis to create surface entities.
• In general, a wireframe model can be extracted from a
surface model by deleting or blanking all surface entities
• Shape design and representation of complex objects such
as car, ship, and airplane bodies as well as castings

• Used to be separated, shape model are now incorporated


into solid models (e.g. Pro/E)
Examples of Surface Models

Free-form, Curved, or
Analytical Surfaces Sculptured Surface
Examples of Surface Models
• Surface models define only the geometry, no topology.
• Shading is possible

Shading - by interpreting the polygons’


 Direction (normal)
 Spatial order
Solid Modeling
• The solid modeling technique is based upon the "half-space"
concept.
• The boundary of the model separates the interior and exterior of the
modeled object.
• The object is defined by the volume space contained within the
defined boundary of the object.
• In general speaking, a closed boundary is needed to define a solid
object.
• informationally complete, valid, and unambiguous representation
(Spatial addressability)
– points in space to be classified relative to the object, if it is
inside, outside, or on the object
• store both geometric and topological information; can verify
whether two objects occupy the same space.
• improves the quality of design, improves visualization, and has
potential for functional automation and integration.
Why Solid Modeling?

Solid Modeling Support


• Using volume information
– weight or volume calculation, centroids, moments of inertia calculation,
– stress analysis (finite elements analysis), heat conduction
calculations, dynamic analysis,
– system dynamics analysis

• Using volume and boundary information


– generation of CNC codes, and robotic and assembly simulation
in
Foundation of SOLID Modeling
(Element of Primitives): Half Space
out
• Unbounded geometric entities
• Each one of them divides the representation space into
infinite portions, one filled with material and the other empty

• Surfaces can be considered half-space boundaries and half


spaces can be considered directed surfaces
• An object is defined by the volume space contained within
the defined boundary of the object

Introduces the direction into the modeling, thus enables the


topological information be stored in a geometric model
Half
in

Spaces
out

• By specifying different boundary surface, we can have any


half-spaces;

• The most commonly used half-spaces are


– planar, cylindrical, spherical, conical, and toroidal.
• By combining half-spaces (using Boolean operations) in a
building block fashion, various solids can be constructed.
Half Spaces
• Planar half-space H  {(x, y, z) : z  0}
• Cylindrical half-space H  {(x, y, z) : x 2  y 2  R 2 }

Block: {(x, y, z) : 0  x  W , 0  y  H , and 0  z  D}

Cylinder: {(x, y, z) : x 2  y 2  R 2 , and 0  z  H}


Example of Half Spaces
Different Solid Modeling
Techniques
• Constructive Solid Geometry (CSG)
• Sweeping and lofting
• Boundary Representation (B-Rep)
• Feature-Based Modeling - uses feature-based primitives to conduct a design

• Primitive Instancing - uses large numbers (200 - 300) of “primitives" to build object - used
for programming NC machine tools (past)
• Cell Decomposition, Spatial Enumeration, Octree (connected cubes of varying size) –
used for irregular objects, image processing, medical applications (CT)
Information complete, unambiguous, accurate solid model
Constructive Solid
Geometry (CSG)
• Pre-defined geometric primitives

• Boolean operations

• CSG tree structure (building process/approach)


Geometric Primitives
- CSG
• A collection of pre-defined (low level) geometric primitives
• Sweeping of a 2D cross-section in the form of extrusion
and revolving are used to define the 3D shape (for
uncommon shapes).

Low Level Dimensions


Geometric Location
Primitives Orientation

Defined
Geometric
Features
Boolean Operations
in CSG
• Union, U
• Intersection, n
• Difference, or Subtraction, -

U - - n
CSG Tree
Alternative Paths of Modeling
A lengthy,
lousy
process
Sweeping
Sweeping can be carried out in two different forms:
• Extrusion - to produce an object model from a 2D cross-section
shape, the direction of extrusion, and a given depth. Advanced
applications include curved extrusion guideline and varying
cross-sections.
• Revolving - to produce a rotation part, either in solid or in shell
shape. Revolving a 2D cross-section that is specified by a closed
curve around the axis of symmetry forms the model of an axially
symmetric object.

Sweeping is most convenient for


solids with translational or
rotational symmetry. Sweeping
also has the capability to
guarantee a closed object.

Advanced: spatial sweeping; &


varying cross-section
Examples of CSG

box( a, b, c) cylinder( h, r)
z
z
x
y

y
x
Z
primitives

X
-*

U* Trans( 10, 0, 0) box( 3, 10, 10)

U* Trans( 20, 12.5, 15) cylinder( 5, 3)

box( 25, 25, 15) Trans( 5 2,0, 15) Rot(Y, 45) Trans(-5,
-5, 0, -5) box( 10, 25, 10)
Questions:

Can we use a different set of primitives ?

Is the CSG representation unique ?

[how to determine if two solids are identical ?]


Issues with CSG based techniques

Non-Unique representation

Difficulty of performing analysis for some tasks


Boundary Representation (B-rep)

• The boundary representation method represents


a solid as a collection of boundary surfaces. The
database records both of the surface geometry
and the topological relations among these
surfaces.
• Boundary representation does not guarantee that
a group of boundary surfaces (often polygons)
form a closed solid. The data are also not in
the ideal form for model calculations.
• This representation is used mainly for graphical
displays.
• Many CAD systems have a hybrid data structure,
using both CSG and B-rep at the same time (i.e.
Pro/E).
Boundary Representation (B-rep)
• Object List ---- giving object name, a list of all its boundary
surfaces, and the relation to other objects of the model.
• Surface List ---- giving surface name, a list of all its component
polygons, and the relation to other surfaces of the object.
• Polygon List ---- giving polygon name, a list of all boundary
segments that form this polygon, and the relation to other
polygons of the surface.
• Boundary List ---- giving boundary name, a list of all line
segments that for this boundary, and the relation to other
boundary lines of the polygon.
• Line List ---- giving line name, the name of its two end points,
and the relation to other lines of the boundary line.
• Point List ---- giving point name, the X, Y and Z coordinates of
the point and, and the relation to other end point of the line.
BREP (Boundary REPresentation)

What entities define the

Boundary of a solid ?

Boundary of surfaces?

Boundary of curves (edges) ?

Boundary of points ?
BREP

Boundary of a solid…n (a) Solid: bounded, connected subset of E 3

Boundary of surfaces…
(b) Faces: boundary of solid
bounded, connected subsets of Surfaces

Boundary of curves (edges)…

(c) Edges: boundary of faces


bounded, connected subsets of curves
BREP: Polyhedral models
Using a Boundary Model

Compute Volume, Weight

Compute Surface area

Point inside/outside solid

Intersection of two faces


An Edge-Based Model F aces:
f1 e1 e4 e5
f2 e2 e6 e4
f3 e3 e5 e6
f4 e3 e2 e1
v4

e6 E d ges:
e4 e1 v1 v2
e5 v3 e2 v2 v3
e3 v3 v1
e3 e2 e4 v2 v4
e5 v1 v4
v1 v2 e6 v3 v4
e1

V e r tic e s :
v1 x1 y1 z1
v2 x2 y2 z2
v3 x3 y3 z3
v4 x4 y4 z4
v5 x5 y5 z5
v6 x6 y6 z6
BREP Example
v4

e6
v8
e12 v3
e5 e11 e10 e4
v7
e9
e8
v5 e2
e7 v6
e3
v1 v2
e1
BREP Example
Vertices:
v4 v1 x 1 y 1 z1
v2 x 2 y 2 z2
e6 v3 x 3 y 3 z3
v8
e12
v4 x 4 y 4 z4
v3
e5 e11
e9
e10
v7
e4
v5 x 5 y 5 z5
v5
e8
e2 v6 x 6 y 6 z6
e7 v6
e3 v7 x 7 y 7 z7
v1
e1 v2 v8 x 8 y 8 z8
v9 x 9 y 9 z9
v 10 x 10 y 10 z 10
v 11 x 11 y 11 z 11
v 12 x 12 y 12 z 12
BREP Example.. Edges:
e1 v1 v2
v4
e2 v2 v3
e3 v3 v1
e6
e4 v2 v4
v8 e5 v1 v4
e11 e10
e12
e4 v3 e6 v3 v4
e5 v7
e9 e7 v5 v6
e8
v5 v6
e2 e8 v6 v7
e7
e3 e9 v7 v5
v1
e1 v2
e10 v6 v8
e11 v5 v8
e12 v7 v8
BREP Example… Faces:
f1 l1 l2
f2 l3
v4
f3 l4
f4 l5
e6
v8 f5 l6
e12 f6 l7
e11 e10 e4 v3
e5 v7 f7 l8
e9
e8
v5 e2 Loops:
e7 v6
l1 +e1 +e4 -e5
e3
l2 -e7 +e11 -e10
v1 v2 l3 +e2 +e6 -e4
e1
l4 +e5 -e6 +e3
l5 -e1 -e3 -e2
l6 +e7 +e8 +e9
l7 +e10 -e12 -e8
l8 -e11 -e9 +e12
BREP: Winged edge data structure

Solid

s_faces f_solid

prev_f Face next_f

f_loops l_face

prev_l Loop next_l

l_coedge c_loop

prev_ce coEdge next_ce

v_start v_end

prev_v Vertex next_v


Edge-Based Models: algorithms can be complex

face

Compute Surface Area:


1. Identify Loops
2. Compute area of each loop
3. Compute area of face
The Winged-Edge Data Structure

Efficient implementation of often-used algorithms

Area of Face

Hidden surface removal

Find neighbor-faces of a face


Observations

2-Manifold => Each edge is shared by exactly 2


faces

co-edges

e6

e4 e4
Face CCW convention => e5
e2
Each edge is once +ve, once -ve
e1
Body, Face, Polygon
(Edge Loop), Edge, Vertex

Euler Operators
MBFV: Make body, face,
vertex
MME: Make multi edges
MEF: Make edge, face
KEML: Kill edge, make loop

KFMLG: Kill face, make loop,


genus
Feature-based, Parametric Models – Pro/E
• Feature-based, Parametric Solid Modeling system represents the recent
advance of computer geometric modeling. It is used as the foundation of
Pro/ENGINEER, etc.
• Feature-based, parametric solid modeling eliminated the direct use of
common geometric primitives such as cone, cylinder, sphere, etc, since
these primitives only represent low-level geometric entities. In designing
and manufacturing mechanical parts, one would always refer to
mechanical features.
• The modeling approach uses sweeping to form the main shape of the part,
and build-in mechanical features to specify the detailed geometry of the
model. These features include holes (through, blind, sink), rounds,
chamfers, slots, etc. Operations to solid model, such as cut and shell
(change a solid model into a hollow shell) are also supported.
• To create the 2D cross-section for sweeping, a 2D sketch needs to be
generated in the 2D Sketcher. A user can sketch the rough shape of the
closed shape. The system will automatically assign a dimension value of the
sketched feature. The dimensions of the sketched feature can be changed
at any time by simply entering the desired value, or kept as a variable,
allowing even more convenient change of its value. The user has to provide
all necessary dimensions to pass the section of cross-section generation.
Problems of under- or over- dimensioning can be identified.
Pro/E Model Generation
Introducing Datum
Primary Shape Definition
• Drawing Rough 2D Cross-section in A 2D Sketcher
• Defining the Precise Geometry
• Building Solid Objects
– Extrusion to Form Depth
– Revolving to Form Rotational Features
– Sweeps and Blends
Adding Detailed Geometry
• Making Holes and Cuts
• Adding Rounds, Chamfers, Slots, and Shells
Summary - Geometric Modeling
• Geometric Modeling is a fundamental CAD technique.
• The capability of various CAD tools in geometric modeling is usually used as a
crucial factor in tool selection.
• Wireframe models consist entirely of points, lines, and curves.
“ ”
Since wireframe models do not have body knowledge , topological data
are not needed in construction.
• Surface models store topological information of their corresponding
objects.
Both surface models and solid models support shading.
Surface models is still ambiguous and thus cannot support a full range of
engineering activities such as stress analysis.
• Solid models have complete, valid and unambiguous spatial addressability.
In general, a wireframe model can be extracted from a surface or a solid
model.
Wireframe Modeling
 Advantages
■ Simple to construct
■ Does not require as much as computer time and memory as
does surface or solid modeling (manufacturing display)
■ As a natural extension of drafting, it does not require
extensive training of users.
■ Form the basis for surface modeling as most surface
algorithms require wireframe entities (such as points, lines
and curves)
 Disadvantages
■ The input time is substantial and increases rapidly with the
complexity of the object
■ Both topological and geometric data need to be user-input;
while solid modeling requires only the input of geometric data.
■ Unless the object is two-and-a-half dimensional, volume and
mass properties, NC tool path generation, cross-sectioning,
and interference cannot be calculated.
Surface Modeling
 Advantages:
■ Less ambiguous
■ Provide hidden line and surface algorithms to add
realism to the displayed geometry
■ Support shading
■ Support volume and mass calculation, finite element
modeling, NC path generation, cross sectioning, and
interference detection. (when complete)
 Disadvantages
■ Require more training and mathematical background of
the users
■ Require more CPU time and memory
■ Still ambiguous; no topological information
■ Awkward to construct
CSG and Brep
1. CSG uses Euler operators in modeling.
2. CSG needs low storage due to the simple tree structure and primitives.
3. CSG primitives are constructed from the half-space concept.
4. Directed surfaces, Euler operations and Euler’s law fundamentally
distinguish the B-rep from wireframe modeling.
5. Traditionally, CSG cannot model sculptured objects and thus is limited
in modeling capability. (This is no longer true for Adv. CAD systems,
such as Pro/E)
6. It is easier to convert a CSG model to a wireframe model than to
convert a B-rep model to a wireframe model.
7. Because both CSG and B-rep use face direction (half-space or surface
normal), they can have a full “body knowledge.”
8. Generally speaking, most high-end CAD tools have the B-rep (or
hybrid) method while most low-end tools rely heavily on the CSG
method.
New Challenges to
Geometric Modeling
• Modeling Porous Medium
• Modeling Non-homogeneous Materials
• varying density
• changing composition
• multiple phases (solid, liquid)
• …
• Biomedical Applications (geometry, materials, motion and
mechanics)
• Medical Images (surgical operation simulator, training and planning)
• Computer models from CT scans (quantify motion in actual knees)
Curves

• Locus of a point moving with one degree of freedom


• Locus of a one-dimensional parameter family of
point
• Mathematically defined using:
• Explicit equations
• Implicit equations
• Parametric equations (Hermite, Bezier, B-spline)
Geometric Modeling of Curves

Computational Representations of a Curve for:

 Data fitting applications


 Shape representation (e.g. font design)
 Intersection computations
Differential Geometry Characterization

Frenet Frame Formulation


• Use of tangent, main normal and binormal:
T = P’(u)/ || P’(u) ||
B = P’(u) X P”(u) / || P’(u) X P”(u) ||
M=BXT
• (T,M,B) is the Frenet frame; it varies its orientation as
u traces the curve
Differential Geometry Characterization

• Arc Length Parametrization: Assume that the magnitude of the


derivative vector is 1. That implies that:
P’(u) . P’(u) = 1; & P’(u) . P”(u) = 0
• Frenet-Serret formulas:
T’ = M
M’ = - ô T + üB
B’ = - üM
is the curvature
ü is the torsion
Differential Geometry Characterization

Intrinsic Properties
• Curvature as a function of arc length: rate of change
of tangent vector
• Torsion as a function of arc-length: how much a space
curve deviates from a plane curve or rate of change of
binormal vector
Explicit Equations
Y = f(x)
• There is only one y value for each x value; not vice-
versa
• Easy to generate points or plot of the curves
• Can easily check whether a point lies on the curve
• Cannot represent closed or multiple-valued curves
Implicit Equations
Can represent closed form or multiple-valued:
f(x,y)=0
• Mostly deal with polynomial or rational functions
• Implicits are a proper superset of rational parametric
E.g. Line: Ax + By + C = 0
Conic: Ax2+ 2Bxy + Cy2 + Dx + Ey + F = 0

The coefficients determine the geometric properties


Parametric Equations of Curves

P(u) = [x(u) y(u) z(u)]


where x( ), y( ) and z( ) are polynomial or rational functions.
The definition extends to N-dimensions

• Usually the domain is restricted to u [0,1] or a subset of real


domain
• Each piece is a curve segment
ï
Q(u,v) = [x(u,v) y(u,v) z(u,v)] is a surface
P( ) and Q( ) are vector valued functions
Partials of P( ) & Q( ) are used to compute tangents and
normals to the curves & surfaces
Parametric Equations of Curves
• Model Space: x,y,z Cartesian
• Parametric space: u,v space or parametric domain

• Direct Mapping: Parametric => Model space


• Involves function evaluation
• Inverse mapping or Inversion: Given (x,y,z) compute u or (u,v)
• Involves solving non-linear equations
• Reparametrization: To change the parametric domain or
interval used to define the curve
Advantages of Parametric Formulation

• Allow separation of variables & direction computation


of point coordinates
• Easy to express them as vectors
• Each variable is treated alike
• More degrees of freedom to control curve shape
• Transformations can be performed directly on the
curves
• Accommodate slopes without computational
breakdown
Advantages of Parametric Formulation

• Extension or contraction to higher or lower dimension


is direct
• The curves are inherently bounded when the
parameter is constrained to a specified finite interval
• Same curve can be represented by mulitiple
parametrizations
• Choice of parametrization, because of computational
properties or application related benefits
Conic Curves

Ax2+ 2Bxy + Cy2 + Dx + Ey + F = 0


has a matrix form
P Q PT = 0,
where

â
P = [ x y 1], &
Q= A B D õ
B C E
D E F
P is given by homogeneous coordinates
Conic Curves

• Many characteristics are invariant under translation and


rotation transformation
• These include, A + C, k = AC – B 2 , and the determinant
of Q
• The values of k and Q indicate the type of conic curve
• Common conics are parabola, hyperbola and ellipse
Parametric Curves

• Hermite Curves: based on Hermite interpolation; uses points &


derivative data
• Bezier Curves: Defined by control points which determine its
degree; interpolates the first & last point; no local control
• B-Spline Curves: piecewise polynomial or rational curve defined by
control points; need not interpolate any point; degree is independent
of the number of control points; local control; affine invariance
Classical approach
• Pencil-and-paper draftsmen also needed smooth curves
• Origin of “spline:” strip of flexible metal
• held in place by pegs or weights to constrain shape
• traced to produce smooth contour

121
Translating into usable math
• Smoothness
• in drafting spline, comes from physical curvature minimization
• in CG spline, comes from choosing smooth functions
• usually low-order polynomials
• Control
• in drafting spline, comes from fixed pegs
• in CG spline, comes from user-specified control points

136
Defining spline curves
• At the most general they are parametric curves

• Generally f(t) is a piecewise polynomial


• for this lecture, the discontinuities are at the integers

137
Defining spline curves
• Generally f(t) is a piecewise polynomial
• for this lecture, the discontinuities are at the integers
• e.g., a cubic spline has the following form over [k, k + 1]:

• Coefficients are different for every interval

138
Coordinate functions

139
Control of spline curves

• Specified by a sequence of control points


• Shape is guided by control points (aka control polygon)
• interpolating: passes through points
• approximating: merely guided by points

140
How splines depend on their controls

• Each coordinate is separate


• the function x(t) is determined solely by the x coordinates of the control
points
• this means 1D, 2D, 3D, … curves are all really the same
• Spline curves are linear functions of their controls
• moving a control point two inches to the right moves x(t) twice as far as
moving it by one inch
• x(t), for fixed t, is a linear combination (weighted sum) of the control points’
x coordinates
• p(t), for fixed t, is a linear combination (weighted sum) of the control points

141
Trivial example: piecewise linear
• This spline is just a polygon
• control points are the vertices
• But we can derive it anyway as an illustration
• Each interval will be a linear function
• x(t) = at + b
• constraints are values at endpoints
• b = x0 ; a = x1 – x0
• this is linear interpolation

142
Trivial example: piecewise linear
• Vector formulation

• Matrix formulation

143
Trivial example: piecewise linear
• Basis function formulation
• regroup expression by p rather than t

• interpretation in matrix viewpoint

144
Trivial example: piecewise linear
• Vector blending formulation: “average of points”
• blending functions: contribution of each point as t changes

145
Trivial example: piecewise linear
• Basis function formulation: “function times point”
• basis functions: contribution of each point as t changes

• can think of them as blending functions glued together


• this is just like a reconstruction filter!

146
Seeing the basis functions
• Basis functions of a spline are revealed by how the curve changes in
response to a change in one control
• to get a graph of the basis function, start with the curve laid out in a straight,
constant-speed line
• what are x(t) and y(t)?
• then move one control straight up

147
Hermite splines
• Less trivial example
• Form of curve: piecewise cubic
• Constraints: endpoints and tangents (derivatives)

148
Hermite splines
• Solve constraints to find coefficients

149
Hermite splines
• Matrix form is much simpler

• cofficients = rows
• basis functions = columns
• note p columns sum to [0 0 0 1]T

150
Longer Hermite splines
• Can only do so much with one Hermite spline
• Can use these splines as segments of a longer curve
• curve from t = 0 to t = 1 defined by first segment
• curve from t = 1 to t = 2 defined by second segment
• To avoid discontinuity, match derivatives at junctions
• this produces a C1 curve

151
Hermite splines
• Hermite blending functions

152
Hermite splines
• Hermite basis functions

153
Continuity
• Smoothness can be described by degree of continuity
• zero-order (C0): position matches from both sides
• first-order (C1): tangent matches from both sides
• second-order (C2): curvature matches from both sides
• Gn vs. Cn
zero order first order second order

154
Continuity
• Parametric continuity (C) of spline is continuity of coordinate
functions
• Geometric continuity (G) is continuity of the curve itself
• Neither form of continuity is guaranteed by the other
• Can be C1 but not G1 when p(t) comes to a halt (next slide)
• Can be G1 but not C1 when the tangent vector changes length abruptly

155
Control
• Local control
• changing control point only affects a limited part of spline
• without this, splines are very difficult to use
• many likely formulations lack this
• natural spline
• polynomial fits

156
Control
• Convex hull property
• convex hull = smallest convex region containing points
• think of a rubber band around some pins
• some splines stay inside convex hull of control points
• make clipping, culling, picking, etc. simpler

YES YES YES NO

157
Affine invariance
• Transforming the control points is the same as transforming the curve
• true for all commonly used splines
• extremely convenient in practice…

158
Matrix form of spline

159
Hermite splines
• Constraints are endpoints
and endpoint tangents

160
Hermite basis

161
Affine invariance
• Basis functions associated with points should always sum to 1

162
Hermite to Bézier
• Mixture of points and vectors is awkward
• Specify tangents as differences of points

– note derivative is defined as 3 times


offset
• reason is illustrated by linear case
163
Hermite to Bézier

164
Bézier matrix

• note that these are the Bernstein polynomials

C(n,k) tk (1 – t)n – k

and that defines Bézier curves for any degree

165
Bézier basis

166
Convex hull
• If basis functions are all positive, the spline has the convex hull
property
• we’re still requiring them to sum to 1

• if any basis function is ever negative, no convex hull prop.


• proof: take the other three points at the same place

167
Chaining spline segments
• Hermite curves are convenient because they can be made long
easily
• Bézier curves are convenient because their controls are all points and
they have nice properties
• and they interpolate every 4th point, which is a little odd
• We derived Bézier from Hermite by defining tangents from control
points
• a similar construction leads to the interpolating Catmull-Rom spline

168
Chaining Bézier splines
• No continuity built in
• Achieve C1 using collinear control points

169
Subdivision
• A Bézier spline segment can be split into a two-segment
curve:

[FvDFH]
• de Casteljau’s algorithm
• also works for arbitrary t

170
Cubic Bézier splines
• Very widely used type, especially in 2D
• e.g. it is a primitive in PostScript/PDF
• Can represent C1 and/or G1 curves with corners
• Can easily add points at any position

171
B-splines
• We may want more continuity than C1
– http://en.wikipedia.org/wiki/Smooth_function
• We may not need an interpolating spline
• B-splines are a clean, flexible way of making long splines with
arbitrary order of continuity
• Various ways to think of construction
– a simple one is convolution
– relationship to sampling and reconstruction

172
Cubic B-spline basis

173
Deriving the B-Spline
• Approached from a different tack than Hermite-style constraints
• Want a cubic spline; therefore 4 active control points
• Want C2 continuity
• Turns out that is enough to determine everything

174
Efficient construction of any B-spline

• B-splines defined for all orders


• order d: degree d – 1
• order d: d points contribute to value
• One definition: Cox-deBoor recurrence

175
B-spline construction, alternate view

• Recurrence
• ramp up/down
• Convolution
• smoothing of basis fn
• smoothing of curve

176
Cubic B-spline matrix

177
Other types of B-splines
• Nonuniform B-splines
• discontinuities not evenly spaced
• allows control over continuity or interpolation at certain points
• e.g. interpolate endpoints (commonly used case)
• Nonuniform Rational B-splines (NURBS)
• ratios of nonuniform B-splines: x(t) / w(t); y(t) / w(t)
• key properties:
• invariance under perspective as well as affine
• ability to represent conic sections exactly

178
Converting spline representations
• All the splines we have seen so far are equivalent
• all represented by geometry matrices

• where S represents the type of spline


• therefore the control points may be transformed from one type to another
using matrix multiplication

179
Evaluating splines for display
• Need to generate a list of line segments to draw
• generate efficiently
• use as few as possible
• guarantee approximation accuracy
• Approaches
• reccursive subdivision (easy to do adaptively)
• uniform sampling (easy to do efficiently)

180
Evaluating by subdivision
• Recursively split spline
• stop when polygon is
within epsilon of curve

[FvDFH]
• Termination criteria
• distance between control points
• distance of control points from line

p2
p4

p1 p3

181
Evaluating with uniform spacing
• Forward differencing
• efficiently generate points for uniformly spaced t values
• evaluate polynomials using repeated differences

182

You might also like