4.2 Sketch Recognition
The user input sketches must be smoothed and ap-
proximated by polylines in order use them for the sub-
sequent polygonal modelling algorithms. We use the
Douglas-Peucker algorithm (Douglas and Peucker,
1973) to approximate user-input, eliminate minor
noise and generate a set of straight lines which closely
matches the original input sketch.
We then separate the building outline from detail
features (windows, doors, reliefs) and extraneous fea-
tures (trees, smoke, clouds, ground plane). We first
identify the building silhouette, i.e., we search for the
largest approximately closed shape in the sketch. Our
current prototype requires outlines to be sketched as
one single stroke. This is inconvenient, but hasn’t
proved a major problem in practice. Solutions com-
bining disjoint sketches have been proposed in the lit-
erature (Sun et al., 2006) and will be implemented
in the future. Sketches inside the building silhou-
ette form “detail features” (we require again closed
shapes) and sketches outside of it are classified as ex-
traneous features and are discarded. In many cases
users want to achieve symmetric building contours,
but produce skewed results. We have incorporated an
algorithm for symmetry detection (axis of symmetry)
and adjustment (Olsen et al., 2011).
4.3 Projection Algorithm
Many buildings do have a square footprint and look
similar from all sides, e.g., skyscrapers and castles.
For this type of buildings a realistic 3D model can be
generated by taking the user’s 2D sketch of the front
face, extruding it in z-direction, and projecting the
front face onto the other faces of the extruded model,
so that the resulting 3D model has the same projection
in x- and z-direction. There are infinitely many 3D ob-
jects corresponding to a 2D projection - the described
idea results in the largest such object. Note that the
outline of a sketch is a potentially concave polygon
which contains all strokes of a sketch.
The algorithmic realisation is surprisingly simple.
By extruding an outline polygon to infinity, we cre-
ate the largest possible object with the given outline.
By clipping each polygon of this object against the
outline on the other axis, we ensure that the object
is constrained to fit the outline on the other axis as
well. In practice we use an extrusion length slightly
larger than the bounding box of the input sketch. We
then project the outline polygon in z-direction and clip
all faces against it. The resulting polygons are then
again clipped against the outline polygon oriented in
x-direction using an algorithm described in (Glassner,
1995).
4.4 Extrusion Algorithm
Unlike skyscrapers, residential houses do not tend
to have similar silhouettes from the front and side.
Given a user’s 2D sketch of the front face of a house,
the back and side faces can be obtained by extrud-
ing the front face by a given depth d in z-direction.
We currently use a depth of 0.65 times the building
width. This has been motivated by analysing pic-
tures of warehouses and residential houses and by the
fact that the value
width
depth
=
1
0.65
≈ 1.54 is close to the
golden ratio
1=
√
5
2
≈ 1.62 which has been shown to
be aesthetically pleasing. In reality this ratio varies
widely and we are considering giving the user some
control over the extrusion depth using sketch input.
4.5 Rotation Algorithm
Many building structures, such as towers, are rotation
symmetric. The identification of rotation symmetric
shapes is explained in the next section. We generate
the 3D geometry by determining an axis of rotation
and generating a surface-of-revolution by rotating the
sketched cross section around the axis. A common
problem is that the user sketch is not exactly symmet-
ric. We have incorporated an algorithm for symme-
try detection and correction (Olsen et al., 2011). The
number of segments of the rotated shape is by default
set high enough to generate a visually smooth curved
surface, but the user can change this parameter in a
menu. The higher the segment number, the rounder
the base - a segment number of 4 yields a square base
building. In future versions of this algorithm we want
to estimate the number of sections of the surface-of-
revolution from the users sketch input.
4.6 Automatic Detection of Building
Types
Selection between the projection algorithm and the
extrusion algorithm is performed based on the dimen-
sion of the sketched building outline, the shape of the
outline, and the number of internal features. If the
building is more than 50% taller than it is wide, it is
assumed to be some kind of tower and the projection
algorithm is used. Similarly the projection algorithms
is used if the building has more than 6 internal fea-
tures or if the contour has more than 10 sample points.
The motivation for this is that many detailed features,
such as windows, indicate large buildings such as of-
fice buildings, which should look consistent from all
SKETCH-BASED BUILDING MODELLING
121