Sunteți pe pagina 1din 17

Bezier Curves and Surfaces

Refer to the book Mathematical Elements in Computer Graphics


by Rogers and Adams. The subject is given a good treatment
there. Also the book by B K Choi (Surface modeling for CAD
CAM, may be referred to)

Bezier Curves and Surfaces

= ) u ( Q
) u ( J ) u ( B
i , n
n
0 i
i



A Bezier surface is given by
= ) , ( w u Q
) ( ) (
,
0 0
, ,
w K u J B
j m
n
i
m
j
i n j i
=
,
0 u s 1 s

and
0 w s 1 s

Where J
i n,
(u) and K
j m,
(w) are the Bernstein basis functions
in the
u
and
w
parametric directions and are given by the
following equations
=
i n
J
,
|
|
.
|

\
|
i
n
i n i
) u 1 ( u








=
j m
K
,
|
|
.
|

\
|
j
m
j m j
w w

) 1 (


|
|
.
|

\
|
i
n
=
)! ( !
!
i n i
n


|
|
.
|

\
|
j
m

=
)! ( !
!
j m j
m



With the assumptions 0 to the power 0 is 1 and factorial 0 is 1.




Bezier curve
Control Point

Bezier surface fitting

Suppose we have to pass a Bezier curve through a number of data points (the blue points
in the figure). Let the data points be D
i
. We have to find out the control points (as yet
unknown, shown by red points in the fig) B
i
that would produce a curve which would be
passing through the data points. In such a case, we may write that

(
(
(
(

(
(
(
(

=
(
(
(
(

n
n n n n
B
B
B
B
u J u J u J u J
u J u J u J u J
u J u J u J u J
u J u J u J u J
Dn
D
D
D
2
1
0
3 , 3 2 , 3 1 , 3 0 , 3
2 3 , 3 2 2 , 3 2 1 , 3 2 0 , 3
1 3 , 3 1 2 , 3 1 1 , 3 1 0 , 3
0 3 , 3 0 2 , 3 0 1 , 3 0 0 , 3
3
2
1
) ( ) ( ) ( ) (
) ( ) ( ) ( ) (
) ( ) ( ) ( ) (
) ( ) ( ) ( ) (

Or in short -
] ][ [ ] [ B C D =

If ] [C is square, the control points are obtained directly by
matrix inversion, i.e.,
] [ ] [ ] [
1
D C B

=

C will not be square if the number of data points is not
equal to the number of control points considered. In fact, it
is very common to have a huge number of data points and
consider very few control points. For example, there might
be 100 data points and only 6 (say) control points
considered by the design engineer to develop the curve that
would pass through all of these points. In such a case, the
problem is overspecified and the solution can only be
obtained in some mean sense. In particular the solution is
given by
] [ ] [ ]] [ ] [[ ] [
1
D C C C B
T T
=

This is just the matrix version of the mathematical
implementation of the least square fit, which ensures that
if the curve is not going to pass through all the points, it
would be such that the sum of the square of errors at all
data points would be the least. Error at a point is nothing
but the distance between the data point and the developed
curve (corresponding to the same parameter value as that of
the data point).
The u parameter value for each data point is obtained using
a chord length approximation where the parameter value u
i

at a data point D
i
is (please refer to fig)

1 3 2 1
3 2 1
... ...
...

+ + + + + +
+ + + +
=
n i
i
i
l l l l l
l l l l
u

Where the chords are the pink lines joining the data points.
The idea is something like this in curve modeling, the
parameter value at a particular point on the curve is
frequently taken as length of curve (from beginning of
curve) till that point / total length of curve. Here, we dont
have a curve to start with, so we have to go for some kind
of approximation. The approximation is: approximate the
lengths of the curve segments between the data points by
the respective chords (that is, the straight lines between the
data points).

d
i
l
1
l
2
l
3
l
i
l
n-1











Free form surface machining : a brief overview

A free form surface or shape is that which is free of any particular mathematical form. In other
words, it is not described by any standard mathematical expression like trigonometric formulae
or some such relation.

Our problem here is to generate such free form shapes out of a blank or raw material. Free form
shapes can be generated in a variety of ways. It can be machined out of a solid body with a
cutting tool, it could be bent into shape from a sheet metal with impressioned dies. EDM or ECM
with conjugate shaped electrodes could also be employed. Last and probably the most promising
and versatile method, rapid prototyping, can be used to generate free form surfaces. However, in
most instances (except in machining and in rapid manufacturing), it is a case of copying the free
form shape from a pre-existing one, so that, a free form surface would have to physically exist,
from which the required shape would be derived. This is true in case of impressioned die forging,
EDM and ECM. In these cases, the initial shapes (from which the copying is done) is generally
obtained by CNC machining.

Hence CNC machining is the one of the most prevalent methods of generating free form surfaces
and shapes and it will be discussed in detail here.

In free form surface machining, a ball end milling cutter can be employed. However, flat end
milling can also be employed and it can prove to be better than ball end milling. But, for flat end
milling cutter to be used in curved surface machining, ideally, 5-axis machine is required.




Fig



















A ball nose milling cutter enables a near-point contact between the cutter and the work piece
surface. This eliminates to a great extent, an undesirable phenomenon called gouging.

The basic idea of free form surface machining with a ball nose cutter is to traverse the whole
surface in to-and-fro (zig-zag) or spiral paths. The cutter actually moves through some points on
the curved surface. In between these points, the cutter moves in straight lines. These points on
the surface are called cutter contact points or CC points. The point on the cutter that comes in
contact with the surface (as the cutter moves along the cutter path) is not a fixed point on the
Fig 1 FFSM with ball
ended milling cutter
cutter (the blue points). In comparison, the red and black points are always fixed on the cutter. If
the cutter has to be moved through the CC points, then for every CC point, we need to find out
the location of the some fixed point on the cutter (like center or bottom most point for example)
and provide it to the CNC machine for movement. For example, in the figure, if the blue points
are the cutter contact points, a movement of radius along the outward normal of the surface at
those points would give us the center locations of the cutter (red points). These are frequently
called the cutter location points. Black points may also be used. The normal can easily be
determined by the cross product of two tangents to the surface at the CC points. In case of Bezier
surface, we can make use of the u- and v- tangents that can be found just by differentiating the
surface wrt u and v.














There are some specific problems encountered during the calculation of cutter paths in free form
surface machining, These are listed as below :

1. Forward step determination
2. Side step determination
3. Gouging
a. External
b. Internal
c. Side



Forward step calculation : The cutter does not actually move continuously along the chosen
cutter paths but through discrete points on such paths or lines.

There has to be a proper criterion for the choice of the length of forward step (i.e., the distance
between the discrete points along the cutter path). This criterion is based on the deviation of the
cutter path from the actual surface. The maximum deviation is made equal to the tolerance on
surface form ( e in fig. 4).




Successive Cutter Positions






Cutter Center Locus

r e r
s
R R




Bezier Surface

Fig 2 Forward Step Calculation

The forward step may be determined in an iterative manner or directly with some
approximations.
There are various ways of determining the forward step. These will be discussed in more detail
after this brief overview of free form surface machining.













Side step determination :



Tool Path Interval






Scallop Height h





Side Step g
Bezeir Surface


Fig 3 Side Step Calculations


Once a cutter has completed a cut from one edge of the surface to another, it shifts by a specific
distance to one side and starts a fresh cut. This is side shift or side step. Side shift has to be
provided so that the cutter can start a fresh cut on the uncut portion of the work surface.
Now, just as in case of forward step determination, there has to be a criterion for the proper
choice of the side step. The main effect of the side step on the work piece surface quality is the
resulting roughness. If too large a side step is chosen, high roughness of the work piece surface
would be obtained. If too low a side step is chosen, it yields a very high surface finish, but
consequently requires a higher machining time. Hence, the choice of the side step should be such
that the roughness of the surface at any point is always equal to (ideally) or less than the
recommended surface roughness.

There are various strategies for the choice of the side shift. They will be discussed in the
appropriate section.


Different strategies of cutter path generation

There are different strategies of cutter path generation in free form surface machining. These
strategies have their own relative advantages and disadvantages.
Some of the methods are :

1. Isoparametric method
2. Isoplanar method
3. Isoscallop method

In the isoparametric method, just as the name suggests, the cutter is made to move along
isoparametric lines as cutter paths. The main advantage of this method is that the determination
of the cutter paths is not computationally intensive. For determining the cutter paths, we only
need to determine points on isoparametric lines on a free form surface. This is simple, non-
iterative and straightforward. Isoparametric method, that way, serves its purpose quite
satisfactorily for surfaces where these lines are more or less parallel.

However, in case of surfaces which deviate from the typical rectangular shape














Fig 7 Clustering and diverging of isoparametric lines in ff surfaces


As shown in fig 7, the isoparametric liones are bunched up or clustered at one end and tend to
diverge at the other. If the cutter is made to follow these lines for machining out the job, it results
in drastic variation of surface roughness from one side of the surface to the other.

Surface roughness, as can be seen from the figure, is unacceptably high at the broad end of the
work piece while it is low at the narrow end. If a number of cutter paths are generated to obtain
Isoparametric lines
Broad end
acceptable surface roughness at the broad end as well, it would result in redundant machining at
the narrow end and subsequently higher machining time.

Side step in isoparametric machining method was determined by a shift along isoparametric lines
orthogonal (in the parametric u-v space) to the one serving as the present cutter path. Side shifts
are calculated at different points on a cutter path along orthogonal (in parametric plane)
isoparametric lines and the next isoparametric lines is chosen as the next cutter path on the basis
of least side shift. However, orthogonality in parametric space does not necessarily imply
orthogonality in physical space. Hence the side shift, which has to necessarily be orthogonal to
the cutter path, might not be so in the physical space and is thus not perfectly correct. However,
sidestep can always be calculated by any other method, to be discussed later in connection to
other strategies.

Isoparametric method finds wide applications simply because it is one of the very first of its kind
to be developed, implemented and commercialized. Further, the aesthetic applications, where
surface roughness is not a limiting criteria, or where a secondary surface finishing process is
possible, isoparametric method of machining is just as good a strategy as the others.

Forward step in isoparametric machining :

The method described under isoscallop machining with co-planar assumption can be followed
here.

Isoplanar machining :

Isoplanar machining is another strategy of cutter path generation in free form surface machining.
In this method, the cutter paths are obtained by the intersection lines between a free form surface
and a number of parallel vertical planes. As the planes are parallel, successive cutter paths are
equispaced when viewed along Z axis. However, this does not necessarily mean that the
roughness (=scallop height) is also the same throughout the lengths of the cuts. This is because
roughness depends not only on the radius of the cutter but also on side step and the radius of
curvature of the surface in a plane normal to the direction of the cutter velocity vector (tangent to
cutter path) at that point. So, of the three (that is, cutter radius, side step and surface curvature),
the first two are made constant in case of isoplanar machining. This ensures that for irregularly
shaped surfaces, machining can be completed by a reasonable (i.e., not so many as in
isoparametric machining) number of cutter paths. Still, the problem is roughness wont be the
same everywhere.
















Parallel
Vertical
Planes



u



v Bezeir
Surface

Cutter Paths










Fig 8 Isoplanar Method : The Surface-plane intersection lines


The side step in isoplanar machining method is decided on worst case consideration (like in
isoparametric). At different points along the cutter path, side steps are calculated for acceptable
surface roughness. That step, which is the minimum among these, is chosen. Hence, as
mentioned before, the surface roughness is not uniform but everywhere lower than or equal to
the allowable roughness.

For determining the cutter paths by isoplanar method, intersection curves between free form
surface and planes need to be determined. No straightforward algebraic solution by direct
substitution is possible as the planes are defined in cartesian variables and the freeform surface in
parametric variables. An iterative numerical procedure is employed for determining these
intersection curves. This makes the procedure computationally intensive. In order to determine
the surface-plane intersection curve, first, the intersection point between the plane and one edge
(boundary curve) of the surface is found out. This is done by a curve-plane intersection
algorithm. Once the intersection point is found out, the intersection curve is determined point by
point by a marching process. This is called the surface-plane intersection algorithm.

The curve-plane intersection algorithm

The intersection between a curve and an implicit plane (t) is given by the following
equation
d p r = . with 1 = p
Where, ) , , ( z y x r = : coordinates variables,
) , , ( c b a p = : Unit normal vector of the plane (t) and 1
2 2 2
= + + c b a .
Then the intersection with the isoparametric curve is given by
d p t r = ). ( 0
. ) ( ) ( ) ( d t cz t by t ax + + =
For general parametric curve ) (t r , an intersection point if it exists can be obtained by
using a Newton-Raphson iteration scheme starting from an initial guess point ) (t r .
Assuming linearity of the curve between the initial guess point
0
t and a estimated
intersection point t :

,
.
r , . ( t -
0
t ) u cos / e ~
Where, ) ) ( . (
0
d t r p e = ,
= u cos (
.
r . p ) / ,
.
r ,.
From the above relation, the estimated intersection point t
is obtained as t =
0
t - {( r p. (
0
t ) d )} / (
.
r . p )
Where,
.
r = dt t dr / ) (
at
0
t ,
a,b,c: Cofficients of plane equation.



Fig 9 Curve/plane intersection


Intersection between a surface and a plane

The intersection curve between the a isoparametric surface ) , ( v u r and the plane (t)
given by
d p v u r = ). , ( 0
d v u cz v u by v u ax + + = ) , ( ) , ( ) , (
Where c b a , , and d are the cofficients of implicit plane.
Two cases may arise in intersecting the parametric surface ) , ( v u r with the plane (t). The
resulting intersection may be either an open curve or a closed curve. In either case, the
overall procedure for solving above equation consists of three steps:
(a) detection of initial guess points,
(b) marching , and
(c) refinement.

The initial intersection points are obtained by finding intersection points between patch
boundary curves and the plane. For this, the CPI (curve/plane intersection) procedure
may be employed. Having determined initial points, the next step is to define a marching
vector. The unit marching vector c is taken to be a vector perpendicular to both the
surface normal and plane normal.
Namely,
p n p n c = / ) (
Where,
v u v u
r r r r n = / ) ( is the unit normal to surface and p is the unit normal to
plane (t).
The next step is to determine a guess point for the next intersection along the intersection
curve. The increments u A and v A of the domain values are determined by solving the
following linear equations:
0 ) . ( ) . ( = +
v u
r p v r p u A A (1)
o A A = + ) . ( ) . (
v u
r c v r c u (2)
Where, o : 3D stepping distance ,
c : Marching vector,
v u
r r , : Partials of the surface ) , ( v u r .
Let ) , (
0 0
v u denote the current intersection point, then the guess point for the next
intersection point is given by
0
u u u + = and
0
v v v + =
Finally the estimated intersection point ) , ( v u is refined to obtain a true intersection point
) , (
- -
v u . For this, one of the isoparametric curves which is more parallel to p is selected
and then the CPI is applied along that isoparametric curve to get exact intersection point.
For this the following condition is tested:
If ] / ) . ( / ) . [(
v v u u
r p r r p r > then
Perform CPI between ) , ( ) ( v t r t r and plane (t) to obtain
* *
t u = and v v =
*

Else perform CPI between ) , ( ) ( t u r t r and plane (t) to obtain u u =
*
and
* *
t v =





Fig 10 Surface/plane intersection


Hence the steps followed for the cutter path generation (as the intersection of vertical plane and
surface)

1. Find out the first point of the cutter path by CPI between plane and edge curve of surface.
2. Find out the radius of curvature at that point on the surface in the direction of the
intersection with vertical plane (expression of radius of curvature would be provided in
next notes)
3. The form tolerance (=max deviation of cutter path from curved surface)
4. Find out the forward step (blue line of fig 2) that can be taken at that point by
approximating the local curved surface by a circle of radius of curvature found in 2.
5. Apply the forward step thus obtained in SPI algo to get delta u and delta v. Get next point
on intersection curve.
6. Refine next point as suggested by application of CPI between isoparametric through
solution of 5 and the vertical plane
7. Move to the next step

S-ar putea să vă placă și