III Engineering Week, Schmalkalden 2013
Engineering curves and CAGD
Rubén Dorado Vicente Department of mechanical & mining engineering University Univer sity of Jaén
Contents •
Computer Aided Engineering
•
Computer Aided Geometric Design CAGD
•
Mathematical model of a curve
•
Useful engineering curves
•
Bézier, B-spline and NURBS representation
•
Fitting: approximation and interpolati i nterpolation on
Contents •
Computer Aided Engineering
•
Computer Aided Geometric Design CAGD
•
Mathematical model of a curve
•
Useful engineering curves
•
Bézier, B-spline and NURBS representation
•
Fitting: approximation and interpolati i nterpolation on
CAGD
Curve s
Eng. curves CAD representation
Fittin g
Conclusions
Computer aided engineering Idea
Product
Concept
Analysis
Prototype
& Design
Simulation
Tests
Manufacturing
CAE =
CAx, x
x = process aided by computer Design CAD based on CAGD: computational representa representation tion of shapes Analysis + virtual prototyping CAA ManufacturingCAM III Engineering week, Schmalkalden 2013
CAGD
Curve s
Eng. curves CAD representation
CAE advantages
•
Design errors lead to high final costs
•
CAE reduces the need for prototyping:
Fittin g
Conclusions
cost & time to take market
Delays lost sales and lock-in
III Engineering week, Schmalkalden 2013
CAGD
Curve s
Eng. curves CAD representation
Fittin g
Conclusions
Examples of first mover advantages •
Operating systems: Microsoft 1981, DOS: Unstable, unsafe, "backward compatibility”
•
CAD software: AutoCAD First CAD software
•
QWERTY keyboard Designed to avoid a mechanical problem •
Alternative combustion engine Contamination, mechanically complex
Source: Itedo
III Engineering week, Schmalkalden 2013
CAGD
Curve s
Eng. curves CAD representation
CAE: disadvantages
•
There are many CAD format
Fittin g
Conclusions
Lost time & errors
Solution for geometry: Neutral formats like IGES, STEP •
Data maintenance: Hardware + software, High costs III Engineering week, Schmalkalden 2013
CAGD
Curve s
Eng. curves CAD representation
Finite element analysis •
Fittin g
Conclusions
Numerical solution
of mechanical problems Application in structural, thermal and dynamic studies •
Idea: “divide and conquer” Discretization in “elements ”≠
Source: engineering.com
Analytical CAD models.
III Engineering week, Schmalkalden 2013
CAGD
Curve s
Eng. curves CAD representation
Fittin g
Conclusions
Finite Element Analysis software Software
Company
Analysis
ANSYS INC
Fluids, structural, thermal, dynamic.
Dassault Systemes
Fluids, structural, thermal, dynamic.
Siemens
Fluids, structural, thermal, dynamic.
Open source
Fluids, structural, thermal
Open source
Dynamic
III Engineering week, Schmalkalden 2013
CAGD
Curve s
Eng. curves CAD representation
Fittin g
Conclusions
Computer aided manufacturing •
Help to generate ISO code from CAD models Manufacturing automatization Control and inspection
•
CAD software admits CAM plugins Example DELCAM within SolidWorks Source: delcam.com
•
Tool-path generation based on CAGD An adequate tool-path can reduce time and forces.
III Engineering week, Schmalkalden 2013
CAGD
Curve s
Eng. curves CAD representation
Fittin g
CAM software Software
Conclusions
Company
Analysis
Dassault Systemes
Machining, mold design, plastic injection
NX CAM 9
Siemens
Machining, inspection
DELCAM
Delcam
Machining and inspection
Blendef
Open source
Milling
CATIA Mold & Tooling Design
III Engineering week, Schmalkalden 2013
CAE
Curve s
Eng. curves CAD representation
Fittin g
Conclusions
Computer Aided Geometric Design •
“It is a discipline dealing with computational aspects of geometric objects” G. Farin (2002)
How model engineering curves and surfaces in a computer It became a scientific & engineering discipline in 1974 Try to reduce errors and time by the use of a pc •
•
Main CAGD advances: Theory of Bézier curves and B-spline techniques Other CAGD applications: Solid modelling, Geographic information systems, Medical imaging, Computer gaming, Scientific visualization III Engineering week, Schmalkalden 2013
CAE
Curve s
Eng. curves CAD representation
Fittin g
Conclusions
Traditional vs. computer design •
CAD reduces time and cost it allows to represent real 3D models No material and size limitations as paper planes
•
Lot of different computer graphic solutions 2D-Design Technical illustrations Metal sheet Solid modelling
III Engineering week, Schmalkalden 2013
CAE
Curve s
Eng. curves CAD representation
Design software 2D Software AutoCAD
Corel Designer
PTC Creo Schematic
MicroStation Powerdraft
LibreCAD
Fittin g
Conclusions
Company
web
AutoDesk
AutoDesk.com
Corel Corp.
Corel.com
PTC Corp.
Ptc.com
Bentley
Bentley.com
Open source
Librecad.org
III Engineering week, Schmalkalden 2013
CAE
Curve s
Eng. curves CAD representation
Fittin g
Conclusions
Technical illustrations 2D & 3D
Source: Ptc corp.
Software Adobe Illustrator Corel Draw PTC Creo Illustrate InkScape
Company
web
Adobe
adobe.com
Corel Corp.
Corel.com
PTC Corp.
Ptc.com
Open source
inkscape.org
III Engineering week, Schmalkalden 2013
CAE
Curve s
Eng. curves CAD representation
Fittin g
Conclusions
Surface & Solid Modelling
Source: linuxaideddesign.
Software RhinoCeros
Application
Company
web
NURBS curves & surfaces
Robert McNeel & Associates
rhino3D.com
Dassault Systemes
3ds.com
PTC Corp.
Ptc.com
Open source
freecadweb.org
SolidWorks, Catia Surfaces & Solid Modelling Creo Elements Surfaces & Solid Modelling FreeCAD
Solid Modelling
III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Curve models
Fittin g
Conclusions
Curve: A continuous map from one dimension to n-dimension space.
They have useful applications: CAD Modelling uses: Define contours of orthographic projections Define wireframe models in CAD: rotations and translations of a curve profile generate revolution and swept surfaces. •
•
Engineering curves: conics, Cycloid, Spirals, Helix & so on
•
Scientific visualization via approximation or interpolation III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Single valued curves •
Definition: Graphic of a function a vertical line cuts the curve once
•
Examples:
III Engineering week, Schmalkalden 2013
Fittin g
Conclusions
CAE CAGD
Eng. curves CAD representation
Fittin g
Conclusions
Single valued curves: Problems •
This representation is not valid after a rotation
•
Simple and useful curves are not single valued
III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Parametric curves Definition:
III Engineering week, Schmalkalden 2013
Fittin g
Conclusions
CAE CAGD
Eng. curves CAD representation
Parametric curves
Fittin g
Conclusions
Advantages: •
Solve the aforementioned drawbacks of single valued curves
•
Single valued (case x=t) parametric curve
•
Simple modelling and visualization: 1. give values (t) points c(t) 2. Join c(t) (linear segments)
•
Computer graphic cards draw 100 Msegments / s
Disadvantages: •
It is complicated to define areas
•
Therefore it is difficult to distinguish inside and outside III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Fittin g
Conclusions
Polynomial parametric curves c(t ) = { x (t ), y (t )},
x (t ), y (t ) are degree n polynomials.
III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Fittin g
Conclusions
Rational parametric curves c(t ) = { x (t ), ), y (t )}, )}, x (t ), y (t ) are degree n rational functions. p(t ) q(t ) , , p(t ), q(t ), w (t ) are degree n polynomials. c(t ) = w (t ) w (t )
Parametric
Rational
Polynomial
Advantages Advant ages of Polynomial-Rational Parametric Curves •
Extremely fast point evaluation: Additions, products (and division for rational)
•
Operations implemented within microprocessor GFLOPS (G Floating Point Operations per Second) III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Fittin g
Conclusions
Rational para. curves: Examples
III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Implicit curves •
•
•
•
Fittin g
Conclusions
Those plane curves / f(x,y)=0 Algebraic curves f is a degree n polynomial
Advantages: inside-outside classifica classification. tion. Disadvantages: It is difficult to model free form curves. It is also complex to extend this representation representation to 3D. III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Transcendental curves
•
•
Fittin g
Conclusions
Definition: non algebraic curves Main drawback: they do not admit an exact computer representation Polynomial-rational parametric curves standard CAD representation
•
•
•
Solution: polynomial-rational fitting Detection: intersection between a line and a transcendental curve infinite points Examples: Logarithmic and Archimedes spiral, helix, catenary III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Spline curves Complex shapes
Fittin g
Conclusions
Piecewise parametric curves
III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
Geometric continuity G
Fittin g
Conclusions
r
Spline continuity type. Mechanical applications: G 0 or G1 tool paths (conventional machines), G2 vehicles and High speed machining
III Engineering week, Schmalkalden 2013
CAE CAGD
Eng. curves CAD representation
“Quality” assessment
Fittin g
Conclusions
Evaluation via Curvature k(s), s=Arc length parameterization ìis a continuous function ï Smooth curve if k ( s) : íhas few and monotonic segments ïends at specified points î
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
CAD representation
Engineering curves
Fittin g
Conclusions
We have two main types of Engineering curves: •
Curves with CAD representation: Polynomial and rational Applications Design
•
Curves without CAD representation: Transcendental curves (examples in the following slides) CAD incorporation via interpolation or approximation Lot of engineering applications III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
CAD representation
Fittin g
Conclusions
Engineering curves: Trochoids
Curve described by a fixed point as a circle rolls… •
outside a circle (Epitrochoid)
•
inside a circle (Hypotrochoid)
They admit a rational representation III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
CAD representation
Trochoids applications
Fittin g
Conclusions
Rotary blower Mazda’s Wankel engine •
Design of roots blower rotors. They handles large quantities of air at a small pressure diff.
•
Wankel engine: few vibration & mechanical stress at high rpm
•
Design of gear tooth profiles III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
CAD representation
Catenary
III Engineering week, Schmalkalden 2013
Fittin g
Conclusions
CAE CAGD
Curve s
CAD representation
Clothoid spiral •
•
Conclusions
Curvature is proportional to distance. Parameterization: Fresnel integrals (Transcendental curve) t ìC (t ) 2 cos( ) d 2 ò æ C (t ) ö ï 0 , . c(t ) ç t è S (t ) ø÷ í ï S (t ) ò sin( 2 2 ) d 0 î Application: road design, roller coasters Speed = Constant =
=
=
•
Fittin g
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
CAD representation
Involute or evolvent
•
Conclusions
Definition: Path follow by the end of a string which is wound tangent to a profile. It is a transcendental curve.
•
Fittin g
Application: design of gear teeth III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
CAD representation
Offset
•
Fittin g
Conclusions
Definition: parallel curve cd(t ) ìn(t ) normal . cd (t ) = c(t ) ± d n(t ), í î+ up, - down
•
In general, it is a non polynomial/rational curve III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
CAD representation
Offset: Applications
Tool path and road design
Cam design III Engineering week, Schmalkalden 2013
Fittin g
Conclusions
CAE CAGD
Curve s
CAD representation
Fittin g
Conclusions
Offset: representation problems Self-intersections
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Fittin g
Conclusions
Standard CAD representation •
•
We can incorporate polynomial curves into CAD but there are different ways to describe a polynomial. Our first choice is the monomial basis, but is it the best representation for CAD? Next slides try to answer this question
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Fittin g
Monomial basis •
Conclusions
Definition: A way to describe a polynomial using a linear combination of monomials
{
2
Monomialbasis: 1,t ,t ,...,t
n
}, n
Polynomialrepresentation: a(t )
a
=
i •
i
t
i
.
0
=
Main advantages: –
Simple algebraic manipulation: additions, products, derivation
–
OK to approximate functions around a point (Taylor, t = 0)
–
Efficient computing algorithm (Horner)
–
Everybody learned this representation in high school III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Monomial basis
•
•
Fittin g
Conclusions
Disadvantages: –
Coefficients have not geometric meaning
–
Poor numerical properties: small errors in ai gaps
Gaps and non geometric meaning are unacceptable for CAD III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Bézier curves •
Conclusions
Provide a polynomial representation: –
–
•
Fittin g
where coefficients have geometric meaning Control points without numerical problems no gaps
End control points = curve end points.
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Fittin g
Examples of Bézier curves
III Engineering week, Schmalkalden 2013
Conclusions
CAE CAGD
Curve s
Eng. curves
Bernstein polynomials •
•
Definition:
B
n
i
æ (u) = ç è
n i
ö 1 ( ÷ ø
u
)
n i
u
i
Fittin g
Conclusions
.
Bézier: combination of control pts via Bernstein polynomials n n
b(u) =
b B (u). i
i
i =0
–
bi Control points
–
B (u)
n
i
effect of bi in the curve shape.
bi pulls the curve (u=i/n Maximum
n
B (u) i
)
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Fittin g
Conclusions
Bézier curves: geometric properties Affine invariance. Reposition-scale-rotation so on transformation of control points
Other Application Typography:
S III Engineering week, Schmalkalden 2013
S S
CAE CAGD
Curve s
Eng. curves
Fittin g
Conclusions
Bézier curves: geometric properties End point interpolation. The curve pass through the end control points no gaps Linear precision. If bi are aligned line Convex hull property. B(t) lies in the convex hull of the control polygon. Application: Interference checking. Operations like integration and derivation via additions, products and divisions of control points Good numerical properties III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Fittin g
Conclusions
Bézier curves: smoothness conditions
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Bézier curve: Derivation
III Engineering week, Schmalkalden 2013
Fittin g
Conclusions
CAE CAGD
Curve s
Eng. curves
Bézier curves: Integration
III Engineering week, Schmalkalden 2013
Fittin g
Conclusions
CAE CAGD
Curve s
Eng. curves
Fittin g
Design Example: cam profile
Hypothesis. Constant angular speed
=
cte
Conditions: Constraint forces y(θ) is C1 Avoid jerk y(θ) is C2 III Engineering week, Schmalkalden 2013
Conclusions
CAE CAGD
Curve s
Eng. curves
Rational Bézier curves
Fittin g
Conclusions
Several conic curves (ellipse, circle, hyperbola) can not be represented by means of a polynomial Bézier curve.
Solution: Rational Bézier curve a perspective transformation III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Rational Bézier curves
Effect of control points reposition
Fittin g
Conclusions
Effect of weight modification
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Fittin g
Conclusions
Conic construction via Rational Bézier curves
ìCentre (circle), focus: C ï Conic arc ® íAngle 2 ïWeights: w = w = 1,w 0 2 1 î
ì[0,1] ® Ellipse (w 2 = cos( ), Circle) ï w Îí1 ® Parabola 1 ï[1, ¥] ® Hyperbola î
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Conics applications
Fittin g
Conclusions
Source: radartutorial.eu
Source: Alternative-energy-tutorials.com
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Fittin g
B-spline curves
Conclusions
Definition: Spline of Bézier curves same Bézier properties Application curves with complex shape n n
d(u) =
d N (u). i
i
N
n
i
(u) ® piecewisebasis
i =0
III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
B-spline versus Bézier
Fittin g
Bézier Design Continuity guarantee
Conclusions
B-spline
Pseudo local shape control
Local control
Complex
Simple (polynomial degree - 1)
Evaluation cost
N control points increase It doesn’t depend on number computational cost of control points
Implementation
Complex Straightforward III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Fittin g
Conclusions
Example: Degree n=3 B-spline
Continuity n-1=2 Number of control points p=7 9 knots, Number of pieces m m=p-n=4 III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves
Fittin g
Conclusions
NURBS: Non uniform rational B-spline
Definition: Spline of Rational Bézier curves with a non uniform knot sequence. III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves CAD representation
Conclusions
Fitting
•
•
Definition: Construction of a NURBS that approximates a non polynomial-rational curve
Main fitting techniques: –
Approximation. NURBS passes close to a set of points
–
Interpolation. NURBS satisfies a set of conditions III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves CAD representation
Conclusions
Lagrange Interpolation Original curve Degree 4 Lagrange Interpolation Degree 8 Lagrange Interpolation
Source: wikipedia
•
•
Lagrange interpolation: the interpolation curve passes through an uniformly distributed set of points Drawbacks: –
Runge’s phenomenon
–
New data re-compute III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves CAD representation
Conclusions
Hermite Interpolation
•
•
Definition: the interpolation curve passes through an non uniformly distributed set of points data: end points and their derivate Applications: –
Approximation of boundary problems
–
Useful to control continuity III Engineering week, Schmalkalden 2013
CAE CAGD
Curve s
Eng. curves CAD representation
Conclusions
Approximation
•
The construction passes close to a set of data.
•
Complex implementation: iterative algorithm.
•
Basic approximation technique: Least squared method. III Engineering week, Schmalkalden 2013