• No se han encontrado resultados

BIENVENIDO EL FINAL Y BIENVENIDO EL COMIENZO

6.1.1 Translational Relaxation of a Single Polygon

In this section, we focus on planning the translation of a single polygon

Q

in an envi- ronment consisting of

k

static polygonal obstacles

P

1,

P

2,

:::

,

P

k that surround

Q

. The

purpose of the motion planning is to nd a point

q

 and a maximal value

l

 such that the

center of

Q

can be placed at any point within a square centered at

q

 and has size 2

l

2

l

.

without colliding with the surrounding obstacles. In other words, once

Q

's center is placed at (

q



x

;q



y), it will be free from collision when

displaced by (

l; l

) for parameters

and

whose values are in the range [ 1

;

1]. What this means for a boundary point

u

of

Q

when

Q

is placed at

q

 is that if we place the center

of a 2

l

2

l

square at

u

then the square can not contain any points from the obstacles. If

we move the center of the 2

l

2

l

square along the boundary of

Q

, the square generates a

\band" of obstacle-free region about the boundary of Q. We refer to this band as the slack region of

Q

. Hence, another way to look at the relaxation of

Q

is that if we place the center of

Q

at (

q



x

;q



y) then Q has the largest area slack region.

We call the above mentioned motion planning problem the relaxation problem for

Q

. We show next that by applying the position-based optimization model described in Chapter 4, we can nd a locally optimal solution to the relaxation problem.

Recall that, using the con guration space approach, we can convert the obstacles

P

i

(1 

i



k

) into enlarged obstacles

P

i(

Q

) (1 

i



k

) and reduce the problem of

planning the motion for

Q

to the problem of planning the motion for a single point

q

, which represents the center of

Q

, in the presence of the enlarged obstacles. The free space

F

Q for

the motion planning of

Q

is the complement of the union of these enlarged obstacles.

F

Q = (

P

1

(

Q

))[(

P

2

(

Q

))[

:::

[(

P

k (

Q

))

:

Let us denote the square corresponding to the range [

q

x

l;q

x+

l

][

q

y

l;q

y+

l

] by R.

Clearly, solving the relaxation problem for

Q

is equivalent to nding largest sized squareR

contained in

F

Q1. Using De Morgen's law, we can express

F

Q alternatively as

F

Q =

P

1

(

Q

)\

P

2

(

Q

)\

:::

\

P

k (

Q

)

:

Hence, nding the largestRin

F

Q is equivalent to nding the largestRthat belongs to all

of the enlarged obstacles

P

i(

Q

) (

i

= 1

;:::;k

) simultaneously.

Let us representRby its four corners: (

q

x+

l;q

y+

l

), (

q

x

l;q

y+

l

), (

q

x

l;q

y

l

) and

(

q

x+

l;q

y

l

). Since Rhas to be contained in

P

i(

Q

) (for 1

i



k

), its four corners

must also be contained in

P

i(

Q

). We use the same locality heuristic described the last

chapter to construct a large convex subset Ci of

P

i(

Q

) that contains

c

Q, the current

position of the center of

Q

. The locality heuristic is applicable here since in tightly packed layouts, such as in marker making applications, the freedom of

Q

to move around is very limited. This implies thatRis usually very small and that

q

 must be close

c

Q. Hence, for

the purpose of nding the largestR, the convex subsetCi obtained by the locality heuristic

gives a good approximation of

P

i(

Q

).

1More precisely, it is equivalent to nding the largest sized square in the connected component of

F Q

It follows from the convexity ofCi that ifCicontains all four corners of a square, thenCi

contains the entire rectangle. Thus, to ensure thatCicontainsR, it is sucient to constrain

the four corners of Rto remain in Ci.

We use the same method as described in Section 4.1.1 to derive a set of linear constraints for each of the four corners of R. Consider the upper right corner (

q

x+

l;q

y+

l

) as an

example. The linear constraint generated for this point with respect to an edge

AB

ofCi is

the following.

(

B

y

A

y)

q

x (

B

x

A

x)

q

y+ (

B

y

A

y

B

x+

A

x)

l

+

A

x

B

y+

A

y

B

x 0 (6

:

1)

which is a linear constraint on

q

x

;q

y and

l

. The constraints for other three corners with

respect to edge

AB

are built similarly.

Next, for each obstacle

P

i (

i

= 1

:::;k

), we calculate the convex setCi from

P

(

Q

)

using the locality heuristic and built a set of linear constraints for the corners ofRwithCi.

Let

S

be the collection of such linear constraints. We set up the following linear program of three variables

q

x,

q

y and

l

.

maximize

l

subject to :

S

The solution (

q



x

;q



y

;l

) of the linear program gives a locally optimal solution for the relax-

ation of

Q

. That is, if the center of

Q

is placed at (

q



x

;q



y), then

Q

can move (

;

)

l

 in

various directions (

;

), wherej

j

;

j

j

<

1, without colliding into the surrounding polygons.

Figure 6.1 shows an example of the relaxation for piece 12.

6.1.2 Rotational Compaction of a Single Polygon

From the previous section, we see that the larger the size of R, the larger the slack

region of

Q

. Conceivably, the size ofRcalculated for

Q

with di erent tilts can be di erent.

The idea behind rotational compaction using relaxation is the following: By sequentially placing each of the polygons in a position and proper tilt such that it has the largest slack region, we transform the layout into a \looser" con guration. Hence, we can subsequently apply our translational compaction algorithm to \tighten" the loosened layout.

Our rst task is to nd the tilt



of

Q

that yields the largest R. That is, when

Q

is

tilted by



, R as calculated by the algorithm in the previous section has the largest size.

0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3 4 5 6 7 8 9 10 11 12

Let the range of tilt allowed for

Q

be [ 

;

]. Ideally, we would like to calculate the size of Rfor every angle within the tilt range and choose the largest one. However, that would

require a complicated non-linear algorithm which would be dicult to make numerically stable. Therefore, we only take

K

equally-spaced discrete values within the range and calculate Rfor

Q

tilted by the rotation corresponding to a discrete value. We then set



to

the angle that yields the largestR.

An example of rotational relaxation is depicted in Figure 6.2. Piece 12 has the position and the tilt that allow it to have the largest slack region.

6.1.3 Algorithm for Rotational Compaction Using Relaxation

The complete algorithm for rotational compaction using relaxation method is as follows.

Step 1

Do a rotational relaxation for each polygon in the layout.

Step 2

Do a translational compaction.

Step 3

Iterate Step 1 and 2 until no progress can be made.

For Step 2, we can specify the same objective function used in the various compaction functions described in Chapter 4. The relaxation of Step 1 helps to \loosen" the layout and hence the translational compaction done in Step 2 usually achieves better results than without the relaxation.

Figure 6.3 through Figure 6.4 present an example of rotational compaction using relax- ation on a human generated marker. Figure 6.3 shows the original marker and the result of rotational compaction using relaxation. Figure 6.4 compares the results of applying left- ward translational compaction alone on the marker and applying rotational compaction using relaxation.

The best result we have achieved is 2.41% improvement in eciency on a human gener- ated production marker versus 0.79% improvement with translational compaction alone.