• Aucun résultat trouvé

The Representation: QC-Space

2.4 Using QC-Space to Fix a Sketch

monotonic. This was true of the rotor and slider, but there are devices with non-monotonic interactions. Figure 2-13 shows one example in which the cs-curve is a piece of a sine curve. However, this interaction can be split into two monotonic interactions (one with negative slope and one with positive slope) by spitting the piston face into two faces. SketchIT requires that the user break non-monotonic interactions into a set of monotonic interactions.

US

US UR

UR

Figure 2-13: The c-space for this lever and piston is a section of a sine curve. If the face of the piston is split in half the c-space becomes two monotonic interactions.

2.4 Using QC-Space to Fix a Sketch

SketchIT uses qc-space as a tool for determining what behavior each part of the sketch ought to provide. The qc-space that SketchIT computes directly from the sketch is the program's rst hypothesis about the behavior of each part. SketchIT tests this hypothesis by qualitatively simulating the overall behavior of the qc-space and comparing this to the desired behavior described with a state transition diagram (e.g., Figure 1-3b). If this qc-space produces the correct overall behavior,SketchIT is nished with this step. Otherwise SketchIT must modify the qc-space until it does produce the desired behavior (or untilSketchIT determines that the qc-space is not capable of producing the desired behavior).

Figure 2-11 illustrates that there are only two ways of modifying a qc-space:

changing the qualitative slope of a qcs-curve and changing the relative locations of two qcs-curves.3 Hence the program searches for a working qc-space by applying just these two kinds of modications. OnceSketchITnds a qc-space that produces the desired behavior, the program produces working geometry by using a library to map the qc-space back to real geometry. The library, described in Chapter 7, contains implementations for each kind of behavior that a qc-space can represent.

The remainder of this section provides an example of SketchIT in action, illus-trating how it uses qc-space to transform a sketch into working geometry. The exam-ple, shown in Figure 2-14, consists of two translating blocks that interact through a pair of sloped faces. The desired behavior is for the spring to push block A against block B, driving B into the stop (the xed surface).

For the particular geometry shown in the gure, the device does not work: block A cannot drive block B into the stop. The qc-space trajectory in the accompanying qc-space shows the actual behavior: the spring pushes block A into block B; A pushes B towards the stop; A and B disengage (before B reaches the stop); B comes to rest;

and A continues to the right until the spring relaxes.

Because this qc-space does not produce the desired behavior, SketchIT must repair it. In this case, there is exactly one modication that will x the qc-space (i.e., of all of the particular ways the program could apply the two general kinds of modications, there is exactly one way that will x the sketch): SketchIT must change the relative locations of the diagonal qcs-curve and the horizontal qcs-curve as shown in Figure 2-15.4

While there is only one particular modication that will repair the qc-space, there are many ways to map this modication to the geometry of the device. Figure 2-16 shows three possibilities: the face on A can be extended, the face on B can be extended, and the xed surface can be lowered.

This example illustrates an important point: often many dierent changes to physical geometry map to the same change in qc-space. Thus, the number of ways to modify physical geometry is often much larger than the number of ways to modify qc-space. This is one of the reasons why qc-space is a convenient design space.

Also note the intuitive diagnosis of the failure \A doesn't push B far enough to reach the stop." In qc-space, \push" is a technically precise term meaning a diagonal qcs-curve. Similarly, \push far enough to reach the stop" means that the diagonal

3Changing the qualitative slope subsumes choosing which side of the curve is blocked space. For example, the slope of curve A in Figure 2-12 can be changed to produce curve E. In addition, for short hand convenience, we use the expression \the relative locations of the qcs-curves" to refer to the locations of both qcs-curves and innite boundaries.

4At rst glance, one might suggest two ways of repairing the qc-space: making the diagonal qcs-curve longer or lowering the horizontal qcs-curve. However, because locations in qc-space are relative rather than absolute, these are really the same repair, i.e., changing the relative locations of the diagonal qcs-curve and the horizontal qcs-curve (as shown in Figure 2-15.)

2.4. USINGQC-SPACE TO FIXA SKETCH 53 qcs-curve (representing the pushing interaction) must reach the horizontal qcs-curve (representing the stop). As this example illustrates, qcs-space represents behavior (e.g., \pushing" and \far enough") rather than implementation. Thus, by modifying qc-space we modify behavior directly. Once we nd the desired behavior, we then map to implementation. As Figure 2-16 illustrates, there are many ways to map from behavior to implementation.

fixed surface

A

B

UA

UB

UA

UB

np

spring

fixed surface

A pushing B

Figure 2-14: A simple mechanical device and its qc-space. Block A translates hori-zontally, B translates vertically, a spring pushes A to the right, B can bump into a xed surface. The arrow in the qc-space shows the actual behavior of this device.

UA

UB

np

spring

fixed surface

A pushing B

Figure 2-15: The qc-space of the two blocks modied to produce the desired behavior.

A

B

A

B A

B

Figure 2-16: Three of the possible ways to implement the qc-space modication used in Figure 2-15: extend the face on A, extend the face on B, and lower the xed surface.

Chapter 3