is an annotation of MeshRegion and BoundaryMeshRegion objects that gives the centroids of mesh cells.
MeshCellCentroid
is an annotation of MeshRegion and BoundaryMeshRegion objects that gives the centroids of mesh cells.
Details
- AnnotationValue[{ℛ,itemspec},MeshCellCentroid] will give the centroids for all cells in a MeshRegion or BoundaryMeshRegion object ℛ specified by itemspec.
- MeshCellCentroid is intrinsic to the cell and cannot be modified using Annotate, AnnotationDelete, or AnnotationValue.
Examples
open all close allBasic Examples (2)
Find the centroids for the cells in a BoundaryMeshRegion object:
ℛ = BoundaryDiscretizeRegion[Disk[], MaxCellMeasure -> {"Length" -> .5}]AnnotationValue[{ℛ, 1}, MeshCellCentroid]//ShortShow[ℛ, Graphics[{Red, Point[%]}]]Find the centroids for the cells in a MeshRegion object:
ℛ = DiscretizeRegion[Disk[], MaxCellMeasure -> .15]AnnotationValue[{ℛ, 2}, MeshCellCentroid]//ShortShow[ℛ, Graphics[{Red, Point[%]}]]Scope (1)
Cell indices can be used to get MeshCellCentroid:
ℛ = DelaunayMesh[RandomReal[1, {6, 2}]]Get the centroid of the second, third, and fourth faces:
AnnotationValue[{ℛ, {2, {2, 3, 4}}}, MeshCellCentroid]Show[ℛ, Graphics[{Red, Point[%]}]]Properties & Relations (1)
RegionCentroid is equal to a weighted sum of the highest-dimensional cell centroids:
ℛ = DelaunayMesh[RandomReal[1, {10, 2}]]The weight for each cell is its proportion of the total measure:
weights = AnnotationValue[{ℛ, RegionDimension[ℛ]}, MeshCellMeasure] / RegionMeasure[ℛ];Total[weights * AnnotationValue[{ℛ, RegionDimension[ℛ]}, MeshCellCentroid]] == RegionCentroid[ℛ]Possible Issues (1)
MeshCellCentroid cannot be modified:
mr = MeshRegion[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, Polygon[{{1, 2, 3}, {3, 4, 1}}]]Annotate[{mr, 2}, MeshCellCentroid -> {.5, .5}]See Also
Related Guides
History
Text
Wolfram Research (2014), MeshCellCentroid, Wolfram Language function, https://reference.wolfram.com/language/ref/MeshCellCentroid.html.
CMS
Wolfram Language. 2014. "MeshCellCentroid." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MeshCellCentroid.html.
APA
Wolfram Language. (2014). MeshCellCentroid. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeshCellCentroid.html
BibTeX
@misc{reference.wolfram_2026_meshcellcentroid, author="Wolfram Research", title="{MeshCellCentroid}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MeshCellCentroid.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_meshcellcentroid, organization={Wolfram Research}, title={MeshCellCentroid}, year={2014}, url={https://reference.wolfram.com/language/ref/MeshCellCentroid.html}, note=[Accessed: 13-June-2026]}