3 <title>Swept polygons - Sketch
</title>
4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"Sketch">
6 <meta name=
"generator" content=
"makeinfo 4.7">
7 <link title=
"Top" rel=
"start" href=
"index.html#Top">
8 <link rel=
"up" href=
"Sweeps.html#Sweeps" title=
"Sweeps">
9 <link rel=
"prev" href=
"Swept-lines.html#Swept-lines" title=
"Swept lines">
10 <link rel=
"next" href=
"Swept-blocks.html#Swept-blocks" title=
"Swept blocks">
11 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home" title=
"Texinfo Homepage">
13 Copyright (C) 2005, 2006, 2007, 2008 Eugene K. Ressler.
15 This manual is for `sketch', version 0.2 (build 161),
16 Tuesday, September 08, 2009, a program that converts descriptions of simple
17 three-dimensional scenes into static drawings. This version generates
18 `PSTricks' or `PGF/TikZ' code suitable for use with the
19 TeX document processing system.
21 `Sketch' is free software; you can redistribute it and/or modify
22 it under the terms of the GNU General Public License as published by
23 the Free Software Foundation; either version 3, or (at your option)
26 Sketch is distributed in the hope that it will be useful,
27 but WITHOUT ANY WARRANTY; without even the implied warranty of
28 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 GNU General Public License for more details.
31 You should have received a copy of the GNU General Public License
32 along with `sketch'; see the file COPYING.txt. If not, see
33 http://www.gnu.org/copyleft.-->
34 <meta http-equiv=
"Content-Style-Type" content=
"text/css">
35 <style type=
"text/css"><!--
36 pre
.display
{ font-family:inherit
}
37 pre
.format
{ font-family:inherit
}
38 pre
.smalldisplay
{ font-family:inherit
; font-size:smaller
}
39 pre
.smallformat
{ font-family:inherit
; font-size:smaller
}
40 pre
.smallexample
{ font-size:smaller
}
41 pre
.smalllisp
{ font-size:smaller
}
42 span
.sc
{ font-variant:small-caps
}
43 span
.roman
{ font-family: serif
; font-weight: normal
; }
49 <a name=
"Swept-polygons"></a>Next:
<a rel=
"next" accesskey=
"n" href=
"Swept-blocks.html#Swept-blocks">Swept blocks
</a>,
50 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Swept-lines.html#Swept-lines">Swept lines
</a>,
51 Up:
<a rel=
"up" accesskey=
"u" href=
"Sweeps.html#Sweeps">Sweeps
</a>
55 <!-- node-name, next, previous, up -->
56 <h5 class=
"subsubsection">3.2.6.3 Swept polygons
</h5>
58 <p><a name=
"index-polygon-sweep-310"></a>If
<var>swept_object
</var> is a polygon, the
<code>sweep
</code> connects
59 <var>n
</var>+
1 successive copies of the closed polyline border of
60 the polygon to form body polygons exactly as though the border were a
61 swept polyline as described in
<a href=
"Swept-lines.html#Swept-lines">Swept lines
</a>.
62 <a name=
"index-body-polygon-311"></a><a name=
"index-polygon_002c-body-312"></a>If there are m points in the
63 original polygon, then m
<var>n
</var> body polygons are formed by
64 this sweep. The body polygons form an
<dfn>extrusion
</dfn> of the boundary of the
65 original polygon with two holes at the open ends.
67 <p>Finally, the sweep adds two copies of the original polygon to cover
68 the holes. We call these hole-filling polygons
<dfn>ends
</dfn>.
69 <a name=
"index-end-polygon-313"></a><a name=
"index-polygon_002c-end-314"></a>In this manner,
<code>sweep
</code> forms the boundary of a three-dimensional
70 object from a two-dimensional polygon.
72 <p>The order of vertices
73 <a name=
"index-polygon-vertex-order-315"></a><a name=
"index-order_002c-polygon-vertex-316"></a>of end polygons is important for correct culling as described above.
74 An exact copy of the original polygon with vertex order intact forms
75 the first end polygon. The other end polygon results from
76 transforming and the reversing the order of vertices in the original.
77 The transform places the original polygon at the uncovered hole;
79 <pre class=
"example"> <var>T_1
</var>^n then
<var>T_2
</var>^n then ... then
<var>T_r
</var>^n.
81 <p class=
"noindent">If there are no options on the swept polygon, then the
<span class=
"samp">sweep
</span>
82 options are copied to each output polygon. If the swept polygon does
83 have options, these are copied to the ends; the sweep options are
84 copied to the body polygons. In this manner, body and ends may be
85 drawn with different characteristics such as
<code>fillcolor
</code>.