MeshPrimitives

MeshPrimitives[mreg,d]

gives the graphics primitives for cells of dimension d in the mesh region mreg.

MeshPrimitives[mreg,cellspec]

gives the primitives specified by cellspec.

Details

  • The primitives returned have the form prim[{p1,p2,}] where pk are points with explicit coordinates.
  • 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 primitives for each dimension.

Examples

open allclose all

Basic Examples  (2)

Mesh primitives for a MeshRegion in 2D:

The 0D cell primitives include all the corner points:

The 1D cell primitives include all the edges:

The only 2D cell primitive is used as input:

Mesh cell primitives for a MeshRegion in 3D:

The 0D cells:

The 1D cell primitives:

The 2D cell primitives:

Scope  (8)

Mesh primitives for a MeshRegion in 1D:

The 0D cell primitives include the end points:

The 1D cell primitives include all the line segments:

Mesh primitives for a MeshRegion in 2D:

The 0D cell primitives include all the corner points:

The 1D cell primitives include all the edges:

The only 2D cell primitive is used as input:

Mesh cell primitives for a MeshRegion in 3D:

The 0D cells:

The 1D cell primitives:

The 2D cell primitives:

Specify a list of 1D cell primitives:

Alternatively, you can specify a head and indices:

Use a pattern to get every odd 0D cell primitive:

All 0D cell primitives:

A list of 2D cell primitives:

A list of mixed-dimensional cell primitives:

Specify a list of 0D cell primitives from a 2D BoundaryMeshRegion:

Specify a list of 0D and 1D cell primitives from a 3D BoundaryMeshRegion:

Properties & Relations  (1)

MeshCellCount can be used to find the maximum number of primitives for each dimension:

Introduced in 2014
 (10.0)