ArrayMesh
✖
ArrayMesh
generates a mesh region from an array of rank d in which each cell has a geometric dimension d and represents a nonzero value of the array.
Details and Options

- ArrayMesh is generated from a grid where cells are intervals, squares, or cubes, and grid points are uniformly spaced integer points.
- ArrayMesh arranges successive rows of array down and successive columns across.
- ArrayMesh has the same options as MeshRegion, with the following additions:
-
DataRange Automatic the range of mesh coordinates to generate DataReversed False whether to reverse the order of rows - ArrayMesh works with SparseArray objects.

Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Scope (2)Survey of the scope of standard use cases

https://wolfram.com/xid/0bim24j6-hu0p9b


https://wolfram.com/xid/0bim24j6-fdvkfs


https://wolfram.com/xid/0bim24j6-idkoss

ArrayMesh works on SparseArray:

https://wolfram.com/xid/0bim24j6-dai66c

Options (14)Common values & functionality for each option
DataRange (1)
DataRange allows you to specify the range of mesh coordinates to generate:

https://wolfram.com/xid/0bim24j6-ewpnb1


https://wolfram.com/xid/0bim24j6-c5e4q9


https://wolfram.com/xid/0bim24j6-fl0z4t


https://wolfram.com/xid/0bim24j6-cil14m

DataReversed (1)
DataReversed allows you to reverse the order of rows:

https://wolfram.com/xid/0bim24j6-cdijct


https://wolfram.com/xid/0bim24j6-m2w17p

MeshCellHighlight (2)
MeshCellHighlight allows you to specify highlighting for parts of an ArrayMesh:

https://wolfram.com/xid/0bim24j6-e2kcpr

Individual cells can be highlighted using their cell index:

https://wolfram.com/xid/0bim24j6-cwcidd


https://wolfram.com/xid/0bim24j6-2fki6

MeshCellLabel (2)
MeshCellLabel can be used to label parts of an ArrayMesh:

https://wolfram.com/xid/0bim24j6-bl33rv

Individual cells can be labeled using their cell index:

https://wolfram.com/xid/0bim24j6-bort25


https://wolfram.com/xid/0bim24j6-be468t

MeshCellMarker (1)
MeshCellMarker can be used to assign values to parts of an ArrayMesh:

https://wolfram.com/xid/0bim24j6-klxbw7

Use MeshCellLabel to show the markers:

https://wolfram.com/xid/0bim24j6-wi9ar

MeshCellShapeFunction (2)
MeshCellShapeFunction can be used to assign values to parts of an ArrayMesh:

https://wolfram.com/xid/0bim24j6-cgbxok

Individual cells can be drawn using their cell index:

https://wolfram.com/xid/0bim24j6-eypeya


https://wolfram.com/xid/0bim24j6-f41ype

MeshCellStyle (3)
MeshCellStyle allows you to specify styling for parts of an ArrayMesh:

https://wolfram.com/xid/0bim24j6-o7aweo

Individual cells can be highlighted using their cell index:

https://wolfram.com/xid/0bim24j6-ca7yws


https://wolfram.com/xid/0bim24j6-h8b5ha

Give explicit color directives to specify colors for individual cells:

https://wolfram.com/xid/0bim24j6-9msou

Applications (15)Sample problems that can be solved with this function
Cellular Automaton (5)
A two-dimensional cellular automaton evolution:

https://wolfram.com/xid/0bim24j6-it4j2t

Show a sequence of steps in the evolution of a 3D cellular automaton:

https://wolfram.com/xid/0bim24j6-6xr0e

Use an outer-totalistic 2D cellular automaton to generate a maze-like pattern:

https://wolfram.com/xid/0bim24j6-fn1sgs

Show a "glider" in the Game of Life:

https://wolfram.com/xid/0bim24j6-k8x02a

https://wolfram.com/xid/0bim24j6-b5ttz4

https://wolfram.com/xid/0bim24j6-cup90a

Patterns generated by a sequence of 2D nine-neighbor rules:

https://wolfram.com/xid/0bim24j6-dcf9kz


https://wolfram.com/xid/0bim24j6-kgemwq

Image (2)
Convert a 2D image to a MeshRegion:

https://wolfram.com/xid/0bim24j6-ct2s9f

https://wolfram.com/xid/0bim24j6-grdd9m

https://wolfram.com/xid/0bim24j6-gr290v

https://wolfram.com/xid/0bim24j6-bmzie6


https://wolfram.com/xid/0bim24j6-w1ntyx


https://wolfram.com/xid/0bim24j6-xjoigy

https://wolfram.com/xid/0bim24j6-2x3v2p

https://wolfram.com/xid/0bim24j6-d8v7v5

Pattern (2)

https://wolfram.com/xid/0bim24j6-r9gb0


https://wolfram.com/xid/0bim24j6-lza55


https://wolfram.com/xid/0bim24j6-n6n9b

Construct a Seidel mesh, i.e. a mesh region with tunnels going in every direction without crossing:

https://wolfram.com/xid/0bim24j6-fegfn9

https://wolfram.com/xid/0bim24j6-f1mo4m

By converting to a boundary mesh and styling it, it becomes easier to comprehend:

https://wolfram.com/xid/0bim24j6-c3j8tk

SubstitutionSystem (4)

https://wolfram.com/xid/0bim24j6-iby5gu

Length of the Cantor set at each stage:

https://wolfram.com/xid/0bim24j6-f5kb


https://wolfram.com/xid/0bim24j6-tho3p

Steps in constructing a Cantor set:

https://wolfram.com/xid/0bim24j6-l23yw9

Create an analogous 2D nested object:

https://wolfram.com/xid/0bim24j6-l71i2c


https://wolfram.com/xid/0bim24j6-j5nb7l

Game Design (2)

https://wolfram.com/xid/0bim24j6-k87gt4

https://wolfram.com/xid/0bim24j6-jl6kjf

https://wolfram.com/xid/0bim24j6-fvjc0z

https://wolfram.com/xid/0bim24j6-go2mqx


https://wolfram.com/xid/0bim24j6-bufnyf

https://wolfram.com/xid/0bim24j6-bwswuo

https://wolfram.com/xid/0bim24j6-ekga9k

https://wolfram.com/xid/0bim24j6-ckeze1

Generate tetrominoes, shapes composed of four squares each:

https://wolfram.com/xid/0bim24j6-9cl1r6


https://wolfram.com/xid/0bim24j6-3d7fq5

https://wolfram.com/xid/0bim24j6-cfo3k6

Properties & Relations (6)Properties of the function, and connections to other functions
The output of ArrayMesh is always a full-dimensional MeshRegion:

https://wolfram.com/xid/0bim24j6-ghy46g


https://wolfram.com/xid/0bim24j6-gzo2mh

ArrayMesh consists of intervals in 1D:

https://wolfram.com/xid/0bim24j6-mnr925


https://wolfram.com/xid/0bim24j6-z0dup


https://wolfram.com/xid/0bim24j6-cvwv09


https://wolfram.com/xid/0bim24j6-gwk1z


https://wolfram.com/xid/0bim24j6-hb84fz


https://wolfram.com/xid/0bim24j6-fnic5d

ArrayPlot can be used to generate a plot:

https://wolfram.com/xid/0bim24j6-ctgeq3

https://wolfram.com/xid/0bim24j6-dll4xj


https://wolfram.com/xid/0bim24j6-bd5mmf

MatrixPlot can be used to generate a plot:

https://wolfram.com/xid/0bim24j6-brd4xy

https://wolfram.com/xid/0bim24j6-e7j86b


https://wolfram.com/xid/0bim24j6-cdmshz

Find a boundary mesh region by using BoundaryMesh:

https://wolfram.com/xid/0bim24j6-bh438e

DataRange-> range is equivalent to using RescalingTransform[{...}, range]:

https://wolfram.com/xid/0bim24j6-ld8c8x

Use RescalingTransform:

https://wolfram.com/xid/0bim24j6-fnvf06

https://wolfram.com/xid/0bim24j6-cu6dma

Wolfram Research (2016), ArrayMesh, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayMesh.html.
Text
Wolfram Research (2016), ArrayMesh, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayMesh.html.
Wolfram Research (2016), ArrayMesh, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayMesh.html.
CMS
Wolfram Language. 2016. "ArrayMesh." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ArrayMesh.html.
Wolfram Language. 2016. "ArrayMesh." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ArrayMesh.html.
APA
Wolfram Language. (2016). ArrayMesh. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArrayMesh.html
Wolfram Language. (2016). ArrayMesh. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArrayMesh.html
BibTeX
@misc{reference.wolfram_2025_arraymesh, author="Wolfram Research", title="{ArrayMesh}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/ArrayMesh.html}", note=[Accessed: 08-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_arraymesh, organization={Wolfram Research}, title={ArrayMesh}, year={2016}, url={https://reference.wolfram.com/language/ref/ArrayMesh.html}, note=[Accessed: 08-May-2025
]}