Skip to main content
added 319 characters in body
Source Link
Simon Woods
  • 85.4k
  • 8
  • 180
  • 326

Here's a method based on creating a MeshRegion from the text:

text = Style[HoldForm @ Sum[x^2, {x, 0, 10}], 100, Bold];    
graphics = First[text ~ExportString~ "PDF" ~ImportString~ "PDF"];    
region = DiscretizeGraphics[graphics, MaxCellMeasure -> 5];    
image = ExampleData[{"ColorTexture", "Kingwood"}];

RegionPlot[region, Frame -> False, BoundaryStyle -> Black, PlotStyle -> Texture[image]]

enter image description here

Or in 3D...

Plot3D[1, {x, y} ∈ region,
 PlotStyle -> Texture[image],
 Extrusion -> 10, BoxRatios -> Automatic,
 Mesh -> False, Boxed -> False, Axes -> False]

enter image description here

Tiling

To tile the image you can use TextureCoordinateFunction, e.g:

RegionPlot[region, Frame -> False, BoundaryStyle -> Black, 
 PlotStyle -> Texture[image],
 TextureCoordinateFunction -> ({5 #1, 5 #2} &)]

enter image description here

Here's a method based on creating a MeshRegion from the text:

text = Style[HoldForm @ Sum[x^2, {x, 0, 10}], 100, Bold];    
graphics = First[text ~ExportString~ "PDF" ~ImportString~ "PDF"];    
region = DiscretizeGraphics[graphics, MaxCellMeasure -> 5];    
image = ExampleData[{"ColorTexture", "Kingwood"}];

RegionPlot[region, Frame -> False, BoundaryStyle -> Black, PlotStyle -> Texture[image]]

enter image description here

Or in 3D...

Plot3D[1, {x, y} ∈ region,
 PlotStyle -> Texture[image],
 Extrusion -> 10, BoxRatios -> Automatic,
 Mesh -> False, Boxed -> False, Axes -> False]

enter image description here

Here's a method based on creating a MeshRegion from the text:

text = Style[HoldForm @ Sum[x^2, {x, 0, 10}], 100, Bold];    
graphics = First[text ~ExportString~ "PDF" ~ImportString~ "PDF"];    
region = DiscretizeGraphics[graphics, MaxCellMeasure -> 5];    
image = ExampleData[{"ColorTexture", "Kingwood"}];

RegionPlot[region, Frame -> False, BoundaryStyle -> Black, PlotStyle -> Texture[image]]

enter image description here

Or in 3D...

Plot3D[1, {x, y} ∈ region,
 PlotStyle -> Texture[image],
 Extrusion -> 10, BoxRatios -> Automatic,
 Mesh -> False, Boxed -> False, Axes -> False]

enter image description here

Tiling

To tile the image you can use TextureCoordinateFunction, e.g:

RegionPlot[region, Frame -> False, BoundaryStyle -> Black, 
 PlotStyle -> Texture[image],
 TextureCoordinateFunction -> ({5 #1, 5 #2} &)]

enter image description here

Source Link
Simon Woods
  • 85.4k
  • 8
  • 180
  • 326

Here's a method based on creating a MeshRegion from the text:

text = Style[HoldForm @ Sum[x^2, {x, 0, 10}], 100, Bold];    
graphics = First[text ~ExportString~ "PDF" ~ImportString~ "PDF"];    
region = DiscretizeGraphics[graphics, MaxCellMeasure -> 5];    
image = ExampleData[{"ColorTexture", "Kingwood"}];

RegionPlot[region, Frame -> False, BoundaryStyle -> Black, PlotStyle -> Texture[image]]

enter image description here

Or in 3D...

Plot3D[1, {x, y} ∈ region,
 PlotStyle -> Texture[image],
 Extrusion -> 10, BoxRatios -> Automatic,
 Mesh -> False, Boxed -> False, Axes -> False]

enter image description here