Skip to content

Commit 3d3c0a3

Browse files
authored
Merge pull request #51 from bluebarnacles/bluebarnacles/line_antialias
Bluebarnacles/line antialias
2 parents 7095408 + e450979 commit 3d3c0a3

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Diff for: 09-lines.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ Lines
220220

221221
The different line joints.
222222

223-
Polylines (i.e. line made of several segments) is much more difficult to render
224-
than segment because we have to take joints into account as illustrated on the
225-
image on the right. But, even if there appears to exist three different kind of
223+
Polylines (i.e. lines made of several segments) are much more difficult to render
224+
than segments because we have to take joints into account as illustrated in the
225+
image on the right. But even if there appear to be three different kinds of
226226
joints, there are really only two cases to consider: the bevel joint and the
227227
others (round and miter). These cases are different because we can code a
228228
reasonably fast solution for the bevel case while the two others ask for more
@@ -485,7 +485,7 @@ a search using the "Bézier" or "bezier" keyword (I even commited `one
485485
For the time being, we'll use an approximation of Bézier curves using an
486486
`adaptive subdivision <http://antigrain.com/research/adaptive_bezier/>`_ as
487487
designed by Maxim Shemarev (and translated in Python by me, see `curves.py
488-
<code/chapter-09/curves.py>`_). You can see on the images below that this
488+
<code/chapter-09/curves.py>`_). You can see in the images below that this
489489
method provides a very good approximation in a reasonable number of segments
490490
(third figure on the right).
491491

Diff for: code/chapter-09/agg-segments.py

+3
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
d = exp(-d*d);
6767
gl_FragColor = vec4(0.0, 0.0, 0.0, d*v_alpha);
6868
}
69+
else {
70+
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
71+
}
6972
} """
7073

7174
window = app.Window(1200, 400, color=(1,1,1,1))

0 commit comments

Comments
 (0)