WOLFRAM

ArrayMesh[array]

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

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

A 1D array mesh:

Out[1]=1

A 2D array mesh:

Out[1]=1

A 3D array mesh:

Out[1]=1

Scope  (2)Survey of the scope of standard use cases

Create a 1D array mesh:

Out[1]=1

2D array mesh:

Out[2]=2

3D array mesh:

Out[3]=3

ArrayMesh works on SparseArray:

Out[1]=1

Options  (14)Common values & functionality for each option

DataRange  (1)

DataRange allows you to specify the range of mesh coordinates to generate:

Out[1]=1
Out[2]=2

Specify a different range:

Out[3]=3
Out[4]=4

DataReversed  (1)

DataReversed allows you to reverse the order of rows:

Out[1]=1

Reverse the order of rows:

Out[2]=2

MeshCellHighlight  (2)

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

Out[1]=1

Individual cells can be highlighted using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

MeshCellLabel  (2)

MeshCellLabel can be used to label parts of an ArrayMesh:

Out[1]=1

Individual cells can be labeled using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

MeshCellMarker  (1)

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

Out[1]=1

Use MeshCellLabel to show the markers:

Out[2]=2

MeshCellShapeFunction  (2)

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

Out[1]=1

Individual cells can be drawn using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

MeshCellStyle  (3)

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

Out[1]=1

Individual cells can be highlighted using their cell index:

Out[1]=1

Or by the cell itself:

Out[2]=2

Give explicit color directives to specify colors for individual cells:

Out[1]=1

PlotTheme  (2)

Use a theme with grid lines and a legend:

Out[1]=1

Use a theme to draw a wireframe:

Out[1]=1

Applications  (15)Sample problems that can be solved with this function

Cellular Automaton  (5)

A two-dimensional cellular automaton evolution:

Out[1]=1

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

Out[1]=1

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

Out[1]=1

Show a "glider" in the Game of Life:

Out[3]=3

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

Out[1]=1

Mean cell values:

Out[2]=2

Image  (2)

Convert a 2D image to a MeshRegion:

Cells and styles:

The mesh:

Out[4]=4

Convert a 3D image:

Out[1]=1

Cells and styles:

The mesh:

Out[4]=4

Pattern  (2)

Generate a simple 2D pattern:

Out[1]=1

3D pattern:

Out[2]=2

More involved patterns:

Out[3]=3

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

Out[2]=2

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

Out[3]=3

SubstitutionSystem  (4)

A 1D Cantor mesh:

Out[1]=1

Length of the Cantor set at each stage:

Out[2]=2

The formula:

Out[3]=3

Steps in constructing a Cantor set:

Out[1]=1

Create an analogous 2D nested object:

Out[1]=1

3D Menger sponge:

Out[1]=1

Game Design  (2)

Build a 2D chessboard:

Out[4]=4

3D chessboard:

Out[8]=8

Generate tetrominoes, shapes composed of four squares each:

Out[1]=1

Color tetrominoes:

Out[3]=3

Properties & Relations  (6)Properties of the function, and connections to other functions

The output of ArrayMesh is always a full-dimensional MeshRegion:

Out[1]=1
Out[2]=2

ArrayMesh consists of intervals in 1D:

Out[1]=1
Out[2]=2

Rectangles in 2D:

Out[3]=3
Out[4]=4

Hexahedrons in 3D:

Out[5]=5
Out[6]=6

ArrayPlot can be used to generate a plot:

Out[2]=2

Show plot:

Out[3]=3

MatrixPlot can be used to generate a plot:

Out[2]=2

Show plot:

Out[3]=3

Find a boundary mesh region by using BoundaryMesh:

Out[1]=1

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

Out[1]=1

Use RescalingTransform:

Out[3]=3
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.

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 ]}

@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 ]}

@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 ]}