2 added 430 characters in body
source | link

This needs to be adjusted, but that is a starting point.

Mesh generation By adding noise to a regular triangular mesh:

n = 10;
m = n/2;
pts = Table[{i + .5*Mod[j, 2], j} + 0.2*RandomReal[{-1, 1}, {2}], {i, 
    1, n}, {j, 1, m}];
triangles = Flatten[{Table[Triangle[
             {pts[[i + 1, j]], pts[[i, j + 1]], pts[[i + k, j + k]]}
             ], {i, 1, n - 1}, {j, 1, m - 1}, {k, 0, 1}]}]

Define a color The following defines a color based on the $x$ position of the triangle centroid, with noise (from black to red, basically).

col[triangle_] := 
 With[{center = RegionCentroid[triangle]}, 
  RGBColor[RandomReal[center[[1]]/n + {-.1, .1}], 0.1, 0.0]]

Result Draw each triangle with its corresponding color:

Graphics[Table[{col[triangles[[i]]], triangles[[i]]}, 
          {i, 1, Length@triangles}], PlotRangePadding -> 0]

And another run:

enter image description here

enter image description here

Possible improvements:

  • The color could be adjusted for a better match (in particular, yellow is almost missing).
  • The lines and aliasing should be removed.

Edit Using Antialising -> False, Blend and cropping the output with n = 20:

  col[triangle_] := 
 With[{center = RegionCentroid[triangle]}, 
  Blend[{Yellow, Red}, center[[1]]/n + RandomReal[{-.2, .2}]]]

 Style[Graphics[
  Table[{col[triangles[[i]]], triangles[[i]]}, {i, 1, 
    Length@triangles}], PlotRangePadding -> 0, 
  PlotRange -> {{2, n - 2}, {2, m - 2}}], Antialiasing -> False]

enter image description here

This needs to be adjusted, but that is a starting point.

Mesh generation By adding noise to a regular triangular mesh:

n = 10;
m = n/2;
pts = Table[{i + .5*Mod[j, 2], j} + 0.2*RandomReal[{-1, 1}, {2}], {i, 
    1, n}, {j, 1, m}];
triangles = Flatten[{Table[Triangle[
             {pts[[i + 1, j]], pts[[i, j + 1]], pts[[i + k, j + k]]}
             ], {i, 1, n - 1}, {j, 1, m - 1}, {k, 0, 1}]}]

Define a color The following defines a color based on the $x$ position of the triangle centroid, with noise (from black to red, basically).

col[triangle_] := 
 With[{center = RegionCentroid[triangle]}, 
  RGBColor[RandomReal[center[[1]]/n + {-.1, .1}], 0.1, 0.0]]

Result Draw each triangle with its corresponding color:

Graphics[Table[{col[triangles[[i]]], triangles[[i]]}, 
          {i, 1, Length@triangles}], PlotRangePadding -> 0]

And another run:

enter image description here

enter image description here

Possible improvements:

  • The color could be adjusted for a better match (in particular, yellow is almost missing).
  • The lines and aliasing should be removed.

This needs to be adjusted, but that is a starting point.

Mesh generation By adding noise to a regular triangular mesh:

n = 10;
m = n/2;
pts = Table[{i + .5*Mod[j, 2], j} + 0.2*RandomReal[{-1, 1}, {2}], {i, 
    1, n}, {j, 1, m}];
triangles = Flatten[{Table[Triangle[
             {pts[[i + 1, j]], pts[[i, j + 1]], pts[[i + k, j + k]]}
             ], {i, 1, n - 1}, {j, 1, m - 1}, {k, 0, 1}]}]

Define a color The following defines a color based on the $x$ position of the triangle centroid, with noise (from black to red, basically).

col[triangle_] := 
 With[{center = RegionCentroid[triangle]}, 
  RGBColor[RandomReal[center[[1]]/n + {-.1, .1}], 0.1, 0.0]]

Result Draw each triangle with its corresponding color:

Graphics[Table[{col[triangles[[i]]], triangles[[i]]}, 
          {i, 1, Length@triangles}], PlotRangePadding -> 0]

enter image description here

Possible improvements:

  • The color could be adjusted for a better match (in particular, yellow is almost missing).
  • The lines and aliasing should be removed.

Edit Using Antialising -> False, Blend and cropping the output with n = 20:

  col[triangle_] := 
 With[{center = RegionCentroid[triangle]}, 
  Blend[{Yellow, Red}, center[[1]]/n + RandomReal[{-.2, .2}]]]

 Style[Graphics[
  Table[{col[triangles[[i]]], triangles[[i]]}, {i, 1, 
    Length@triangles}], PlotRangePadding -> 0, 
  PlotRange -> {{2, n - 2}, {2, m - 2}}], Antialiasing -> False]

enter image description here

1
source | link

This needs to be adjusted, but that is a starting point.

Mesh generation By adding noise to a regular triangular mesh:

n = 10;
m = n/2;
pts = Table[{i + .5*Mod[j, 2], j} + 0.2*RandomReal[{-1, 1}, {2}], {i, 
    1, n}, {j, 1, m}];
triangles = Flatten[{Table[Triangle[
             {pts[[i + 1, j]], pts[[i, j + 1]], pts[[i + k, j + k]]}
             ], {i, 1, n - 1}, {j, 1, m - 1}, {k, 0, 1}]}]

Define a color The following defines a color based on the $x$ position of the triangle centroid, with noise (from black to red, basically).

col[triangle_] := 
 With[{center = RegionCentroid[triangle]}, 
  RGBColor[RandomReal[center[[1]]/n + {-.1, .1}], 0.1, 0.0]]

Result Draw each triangle with its corresponding color:

Graphics[Table[{col[triangles[[i]]], triangles[[i]]}, 
          {i, 1, Length@triangles}], PlotRangePadding -> 0]

And another run:

enter image description here

enter image description here

Possible improvements:

  • The color could be adjusted for a better match (in particular, yellow is almost missing).
  • The lines and aliasing should be removed.