ArrayMesh

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)

A 1D array mesh:

A 2D array mesh:

A 3D array mesh:

Scope  (2)

Create a 1D array mesh:

2D array mesh:

3D array mesh:

ArrayMesh works on SparseArray:

Options  (14)

DataRange  (1)

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

Specify a different range:

DataReversed  (1)

DataReversed allows you to reverse the order of rows:

Reverse the order of rows:

MeshCellHighlight  (2)

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

Individual cells can be highlighted using their cell index:

Or by the cell itself:

MeshCellLabel  (2)

MeshCellLabel can be used to label parts of an ArrayMesh:

Individual cells can be labeled using their cell index:

Or by the cell itself:

MeshCellMarker  (1)

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

Use MeshCellLabel to show the markers:

MeshCellShapeFunction  (2)

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

Individual cells can be drawn using their cell index:

Or by the cell itself:

MeshCellStyle  (3)

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

Individual cells can be highlighted using their cell index:

Or by the cell itself:

Give explicit color directives to specify colors for individual cells:

PlotTheme  (2)

Use a theme with grid lines and a legend:

Use a theme to draw a wireframe:

Applications  (15)

Cellular Automaton  (5)

A two-dimensional cellular automaton evolution:

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

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

Show a "glider" in the Game of Life:

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

Mean cell values:

Image  (2)

Convert a 2D image to a MeshRegion:

Cells and styles:

The mesh:

Convert a 3D image:

Cells and styles:

The mesh:

Pattern  (2)

Generate a simple 2D pattern:

3D pattern:

More involved patterns:

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

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

SubstitutionSystem  (4)

A 1D Cantor mesh:

Length of the Cantor set at each stage:

The formula:

Steps in constructing a Cantor set:

Create an analogous 2D nested object:

3D Menger sponge:

Game Design  (2)

Build a 2D chessboard:

3D chessboard:

Generate tetrominoes, shapes composed of four squares each:

Color tetrominoes:

Properties & Relations  (6)

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

ArrayMesh consists of intervals in 1D:

Rectangles in 2D:

Hexahedrons in 3D:

ArrayPlot can be used to generate a plot:

Show plot:

MatrixPlot can be used to generate a plot:

Show plot:

Find a boundary mesh region by using BoundaryMesh:

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

Use RescalingTransform:

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.

CMS

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

BibTeX

@misc{reference.wolfram_2024_arraymesh, author="Wolfram Research", title="{ArrayMesh}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/ArrayMesh.html}", note=[Accessed: 21-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_arraymesh, organization={Wolfram Research}, title={ArrayMesh}, year={2016}, url={https://reference.wolfram.com/language/ref/ArrayMesh.html}, note=[Accessed: 21-December-2024 ]}