10.01.2013 Views

ComputerAided_Design_Engineering_amp_Manufactur.pdf

ComputerAided_Design_Engineering_amp_Manufactur.pdf

ComputerAided_Design_Engineering_amp_Manufactur.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

To approximate the curve described above by a minimum number of linear segments or circular arcs,<br />

the approach is to cast it as an optimization problem: minimize the number of segments subject to the<br />

constraint that in each segment, the maximum deviation must not exceed the tolerance,<br />

i.e.,<br />

© 2001 by CRC Press LLC<br />

minimize N<br />

subject to ( max d)<br />

i � � i � 1, …, N<br />

(2.2a)<br />

(2.2b)<br />

where N is the number of segments, d the deviation and � the tolerance.<br />

The problem will involve finding this number N and the N �1<br />

break points on the curve. This falls<br />

under the class of a nonlinear mathematical programming problem having mixed integer-continuous<br />

variables, which is usually difficult to solve. The problem is further compounded by the fact that the<br />

number of constraints is not fixed because it depends on N,<br />

which is the objective itself.<br />

Fortunately, in this case there is only one integer variable—the number of segments. Falling on a set<br />

of optimization principles known as the Monotonicity Principles,<br />

31 the problem becomes tractable because<br />

the principles dictate that for the problem to be bounded, at least one of the constraints in (2.2b) must<br />

be active. One can argue that a solution to (2.2) is to have as many of the constraints active as possible.<br />

Hence, one would try to find successive segments with their deviations from the curve equal to the<br />

tolerance. The problem as stated in (2.2) can thus be turned into a series of iterative continuous problems:<br />

for each segment, maximize the length of the segment subject to the constraint that the maximum deviation<br />

does not exceed the tolerance,<br />

i.e.,<br />

maximize t<br />

subject to max d �<br />

�<br />

(2.3a)<br />

(2.3b)<br />

Monotonicity Principles again dictate that the constraint (2.3b) must be active for the problem in (2.3)<br />

to be bounded. Discussions on the determination of the deviations between the linear or circular segments<br />

and the Bezier curve will not be given here but can be found in Reference 29.<br />

Algorithm for Linear Approximation<br />

The algorithm for linear approximation may be summarized as<br />

Initialization: The Bezier curve is first approximated by a single linear segment as shown in Figure 2.11(a).<br />

tlow and thigh, two variables which act as a control bracket, are initially set to 0 and 1, respectively. Initially, t0 is set to be equal to tlow and t1 to thigh. k is a counter that tracks the number of segments required. Set k � 1<br />

initially. The maximum deviation d between the line and the Bezier curve is then calculated and compared<br />

with the given tolerance �.<br />

Step 1: When d � �, set thigh � t1, t1 � 0.5 (tlow � t1), as shown in Figure 2.11(b). This procedure is<br />

repeated as long as d � �, as shown in Figure 2.11(c).<br />

Step 2: When d � �, set tlow � t1, t1 � 0.5 (t1 � thigh), as shown in Figure 2.11(d). This procedure is<br />

repeated as long as d � �.<br />

Steps 1 and 2 are repeated until:<br />

d � � by a specified convergence criterion (e.g., fixed at 10% of �) or,<br />

d � � and t1 is equal to 1.<br />

Then, the break point is considered found. t1 is then assigned to an array element t(k). Increment k.<br />

Step 3: The value of t1 is assigned to t0 and tlow. t1 and thigh are then set to the value of 1 as shown in<br />

Figure 2.11(e). The maximum deviation d is again calculated and compared with �.<br />

Steps 1 to 3 are repeated until t(k) � 1.<br />

End.<br />

Figures 2.12a and 2.12b show two typical Bezier curves approximated by linear segments.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!