The documentation for Texture
states that "other filled objects" can be texturized:
Texture[obj]
is a graphics directive that specifies that obj should be used as a texture on faces of polygons and other filled graphics objects.
And also:
Texture can be used in FaceForm to texture front and back faces differently.
Though I fail to apply a simple texture to any of the following objects. It seems like that "other filled objects" only include Polygon
s and FilledPolygon
s, and FaceForm
does not work with those.
img = Rasterize@
DensityPlot[Sin@x Sin@y, {x, -4, 4}, {y, -3, 3},
ColorFunction -> "BlueGreenYellow", Frame -> None,
ImageSize -> 100, PlotRangePadding -> 0];
{
Graphics[{Texture@img, Disk[]}],
Graphics[{FaceForm@Texture@img, Disk[]}],
Graphics[{Texture@img, Rectangle[]}],
Graphics[{FaceForm@Texture@img, Rectangle[]}],
(* Only this one works *)
Graphics[{Texture@img,
Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}],
Graphics[{FaceForm@Texture@img,
Polygon[{{0, 0}, {1, 0}, {1, 1}, {0, 1}},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}]
}
Edit:
It turns out that "Applying Texture
to a disk directly isn't possible" (according to Heike, thanks s.s.o. for the link). This unfortunately means that:
- the official documentation of
Texture
is wrong (or at least is misleading, as graphics objects usually include primitives); - either
Texture
is not fully integrated with the system, as it is not applicable for such primitives as aRectangle
, which seems to be just a very specificPolygon
; orRectangle
is something else and is defined some other way at the lowest level than aPolygon
(maybe it is some OS-dependent object).
Frankly, it is quite hard to imagine what kept developers to include this functionality, but I must assume they had a good reason.
ParametricPlot
andPlotStyle
as in the documentation forParametricPlot
? $\endgroup$Plot
is not a graphics primitive, is it? (btw, are you referring toRegionPlot
?) I would like to texturize primitives, if possible. I am also aware of these threads: this and this. $\endgroup$Texture
primitives likeDisk[]
,Sphere[]
, etc $\endgroup$ParametricPlot
, not how to produce the exact primitives. Sometimes an alternative approach is of interest but, since you're a regular, I didn't think I'd bother typing up a response based on that. $\endgroup$