Next: Editing Up: The implementation Previous: Creating geometry

## Placing geometry

Object creation requires placement of the object in the scene. We base object placement on four rules: first, geometry is placed so that its salient features project onto their corresponding gesture strokes in the film plane; second, new objects are instantiated in contact with an existing object when possible; third, certain invariants of junctions in line drawings [9] that indicate the placement or dimension of geometry are exploited; and fourth, CSG subtraction is inferred automatically from the direction of gesture strokes.

These easy-to-understand rules often generate good placement choices; when they do not, users can edit the results. Furthermore, the few users that the system has had so far have rapidly learned to use the simple rules to their advantage, ``tricking'' the algorithm into doing what they want. (This may be a consequence of their programming background.)

Figure 1: A series of strokes is drawn in the film plane in red (left). The salient vertex is projected into the scene thus defining the placement of new geometry (green). Though this figure suggests a perspective camera, we use a parallel projection in our application. (see legend)

The first rule determines object placement except for translation along the view direction. This ambiguity is generally resolved by the second rule, implemented as follows: each gesture has a ``most salient'' vertex (the trivalent vertex for a cuboid, for example, or the first vertex of the two parallel strokes that indicate a cylinder); a ray is traced through this vertex to hit a surface at some point in the scene. The object is then instantiated so that the salient vertex is placed at the intersected surface point (Figure 1).(4)

 A tabletop is created and initially rests on the floor. To insert a leg under the tabletop, the vertical stroke of the leg is dran to form a T junction with the table's edge. The tabletop is automatically raised off the floor, and the leg touches both the floor and the underside of the table.
Figure 2: T junctions are recognized to help determine object placement. (see legend)

The third placement rule exploits invariants of vertex junctions in line drawings, as described by Clowes [9]. However, our use of T junctions is related to the treatment given by Lamb and Bandopadhay [15]. In particular, T-shaped junctions arise in line drawings when a line indicating the edge of one surface, Estem, ends somewhere along a line segment indicating the edge of another surface, Ebar. These junctions generally signify that the surface associated with Estem is occluded by the surface associated with Ebar, although it does not necessarily indicate that the two surfaces meet. In SKETCH, a similar notion exists when a straight line segment (except for connected polyline segments) of a gesture ends along an edge of an object already in the scene (Figure 2). To uphold the intuition that such T junctions indicate the occlusion of one surface by another, SKETCH first places the gesture line into the 3D scene according to the previous two placement rules. Then, SKETCH sends a ray out along the gesture line (toward the T junction). If this ray intersects the object that defined the bar of the T junction and the normal at the point of intersection is pointed in approximately the opposite direction of the ray, then the gesture edge is extended so that it will meet that surface.

If the ray does not intersect the surface, then the object defined by the surface is translated along the viewing vector toward the viewer until its edge exactly meets the end of the gesture edge. If the end of the gesture edge is never met (because it was farther away from the viewer), then neither the gesture, nor the existing objects are modified. We never translate objects away from the viewer as a result of T junctions; tests of this behavior on a variety of users indicated that it was both unintuitive and undesirable.

Figure 3: CSG subtraction is inferred from the direction of the gesture strokes and the surface normal of the contact object. (see legend)

The final rule determines whether the new geometry should be CSG-subtracted from the scene when added to it. If one or more of the gesture strokes are drawn into an existing surface (i.e., the dot product of a stroke and the normal to the existing surface on which it is drawn is negative), then the new piece of geometry is placed in the scene and subtracted from the existing object (Figure 3). CSG subtraction is recomputed each time the new geometry is manipulated. If the new geometry is moved out of the surface from which it was subtracted, CSG subtraction is no longer recomputed. This makes possible such constructions as the desk drawer in the Editing-Grouping-Copying section of the videotape.

Next: Editing Up: The implementation Previous: Creating geometry