Google Groups

Re: Texture on Disk in Mathematica 8?


Heike Nov 24, 2011 3:57 AM
Posted in group: comp.soft-sys.math.mathematica
Applying Texture to a disk directly isn't possible, but you could for example use RegionPlot with the TextureCoordinateFunction option, e.g.

img = <<Texture image>>

RegionPlot[x^2 + y^2 < 1, {x, -1, 1}, {y, -1, 1},
 BoundaryStyle -> None,
 Axes -> False, Frame -> False,
 PlotStyle -> Directive[Opacity[1], Texture[img]],
 TextureCoordinateFunction -> ({#1, #2} &)]

Heike.

On 23 Nov 2011, at 13:04, mic...@socratica.com wrote:

> Is it possible to apply a texture to a disk?
>
> Applying a texture to a polygon works fine:
> Graphics[{Texture[<<Texture Image>>],
>  Polygon[{{0, 0}, {1, 0}, {1/2, 1}},
>   VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1/2, 1}}]}]
>
> But when I try to apply it to a disk I get a solid, black circle:
>  Graphics[{Texture[<<Texture Image>>], Disk[{0, 0}, 1]}]
>
> Thanks!
> -Michael
>