MeshCells

MeshCells[mreg,d]

gives the cells of dimension d in the mesh region mreg.

MeshCells[mreg,cellspec]

gives the cells specified by cellspec.

Details

  • MeshCells is often used to get the symbolic cell h[{i1,}] from a cell index {d,i}.
  • The cells returned have the form h[{i1,}] where ik are coordinate index indicating point ik in the list of coordinates given by MeshCoordinates.
  • The mesh region mreg can be either MeshRegion or BoundaryMeshRegion.
  • The cell specification cellspec follows the standard form described for MeshRegion and BoundaryMeshRegion.
  • MeshCellCount can be used to find the maximum number of cells for each dimension.

Examples

open allclose all

Basic Examples  (3)

Mesh cells for a MeshRegion in 1D:

The 0D cells also include the end points of the line:

The 1D cells:

Mesh cells for a MeshRegion in 2D:

The 0D cells include all the corner points:

The 1D cells include all the edges:

The only 2D cell is used as input:

Mesh cells for a MeshRegion in 3D:

The 0D cells:

The 1D cells:

The 2D cells:

Scope  (7)

Mesh cells for a MeshRegion in 1D:

The 0D cells also include the end points of the line:

The 1D cells:

Mesh cells for a MeshRegion in 2D:

The 0D cells include all the corner points:

The 1D cells include all the edges:

The only 2D cell is used as input:

Mesh cells for a MeshRegion in 3D:

The 0D cells:

The 1D cells:

The 2D cells:

Mixed dimensions:

The indices given in MeshCells correspond to MeshCoordinates:

Construct a MeshRegion directly:

Create a GraphicsComplex:

Specify a list of 1D cell primitives:

Alternatively, you can specify a head and indices:

A list of 2D cell primitives:

Applications  (1)

Extract the lines from a MeshRegion to make a wireframe mesh:

The indices given in MeshCells correspond to MeshCoordinates:

Create the wireframe mesh:

Properties & Relations  (1)

The indices in MeshCells refer to the MeshCoordinates:

Possible Issues  (1)

Culling of unused coordinates may change cell indices:

The cell indices refer to MeshCoordinates, not the input coordinates:

Wolfram Research (2014), MeshCells, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshCells.html.

Text

Wolfram Research (2014), MeshCells, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshCells.html.

CMS

Wolfram Language. 2014. "MeshCells." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MeshCells.html.

APA

Wolfram Language. (2014). MeshCells. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeshCells.html

BibTeX

@misc{reference.wolfram_2023_meshcells, author="Wolfram Research", title="{MeshCells}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MeshCells.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_meshcells, organization={Wolfram Research}, title={MeshCells}, year={2014}, url={https://reference.wolfram.com/language/ref/MeshCells.html}, note=[Accessed: 19-March-2024 ]}