Observe:
rand = RandomReal[1, {4, 3, 2}];
Graphics @ Polygon @ rand
Graphics[Polygon /@ rand]
I am losing anti-aliasing when I use the multiple-polygon syntax form of Polygon
. Yet it is possible for Mathematica to apply AA as can be shown with:
Style[
Graphics @ Polygon @ rand,
Antialiasing -> True
]
(Incidentally this Style
-applied AA does not copy with Szabolcs's Image Uploader but the in-Notebook appearance is identical to the second output above.)
Why am I losing anti-aliasing here?
Is there a system option to turn it on, and with what caveat?
Answer
It seems with antialiasing on, you get seams between adjacent polygons. It's at the end of the possible issues section in the Polygon
documentation page.
So probably it assumes that by default, with the all-in-one-polygon syntax form (one Polygon
head for multiple polygon representations) it's more important to avoid seams for adjacent polygons, and with the multiple-Polygon
-syntax, antialiasing is more important.
Functions such as ContourPlot
or ListDensityPlot
, that use Polygon
to render it's results, use this all-in-one syntax to save space, and require the polygons to join well, so by default antialiasing is off. See Antialiasing option behaves weird (polygon edges visible in ContourPlot) for an example of what can happen with anti-aliasing. You could always set the option Antialiasing
to True
instead of Automatic
, either at global or notebook or cell level, but you will suffer the consequences when using one of these functions.
Comments
Post a Comment