MeshPrimitives[mreg,d]
给出网格区域 mreg 中维度为 d 的单元的图形基元.
MeshPrimitives[mreg,cellspec]
给出由 cellspec 指定的基元.
MeshPrimitives
MeshPrimitives[mreg,d]
给出网格区域 mreg 中维度为 d 的单元的图形基元.
MeshPrimitives[mreg,cellspec]
给出由 cellspec 指定的基元.
更多信息
- 返回的基元具有格式 prim[{p1,p2,…}],其中 pk 是具有显式坐标的点.
- 网格区域 mreg 可以是 MeshRegion 或者 BoundaryMeshRegion.
- 单元指定 cellspec 遵循为 MeshRegion 和 BoundaryMeshRegion 描述的标准格式.
- MeshCellCount 可用于求解每个维度中基元的最大数目.
范例
打开所有单元 关闭所有单元基本范例 (2)
二维空间中 MeshRegion 的网格基元:
ℛ = MeshRegion[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, Polygon[{1, 2, 3, 4}]]MeshPrimitives[ℛ, 0]Show[ℛ, Graphics[{Red, %}]]MeshPrimitives[ℛ, 1]Show[ℛ, Graphics[{Red, %}]]MeshPrimitives[ℛ, 2]三维空间中 MeshRegion 的网格单元基元:
ℛ = MeshRegion[{{0, 0, 0}, {2, 0, 0}, {2, 2, 0}, {0, 2, 0}, {1, 1, 2}}, Tetrahedron[{{1, 2, 3, 5}, {1, 3, 4, 5}}], MeshCellStyle -> 2 -> Opacity[0.3]]MeshPrimitives[ℛ, 0]Show[ℛ, Graphics3D[{Red, %}]]MeshPrimitives[ℛ, 1]Show[ℛ, Graphics3D[{Red, %}]]MeshPrimitives[ℛ, 2]Show[ℛ, Graphics3D[{Opacity[0.2, Red], %}]]范围 (8)
一维空间中 MeshRegion 的网格基元:
ℛ = MeshRegion[{{0}, {1}, {2}}, {Line[{1, 2}], Point[3]}]MeshPrimitives[ℛ, 0]MeshPrimitives[ℛ, 1]二维空间中 MeshRegion 的网格基元:
ℛ = MeshRegion[{{0, 0}, {1, 0}, {1, 1}, {0, 1}}, Polygon[{1, 2, 3, 4}]]MeshPrimitives[ℛ, 0]Show[ℛ, Graphics[{Red, %}]]MeshPrimitives[ℛ, 1]Show[ℛ, Graphics[{Red, %}]]MeshPrimitives[ℛ, 2]Show[ℛ, Graphics[{Red, %}]]三维空间中 MeshRegion 的网格单元基元:
ℛ = MeshRegion[{{0, 0, 0}, {2, 0, 0}, {2, 2, 0}, {0, 2, 0}, {1, 1, 2}}, Tetrahedron[{{1, 2, 3, 5}, {1, 3, 4, 5}}], MeshCellStyle -> 2 -> Opacity[0.3]]MeshPrimitives[ℛ, 0]Show[ℛ, Graphics3D[{Red, %}]]MeshPrimitives[ℛ, 1]Show[ℛ, Graphics3D[{Red, %}]]MeshPrimitives[ℛ, 2]Show[ℛ, Graphics3D[{Opacity[0.2, Red], %}]]ℛ = MeshRegion[{{0, 0, 0}, {2, 0, 0}, {2, 2, 0}, {0, 2, 0}, {1, 1, 2}}, Tetrahedron[{{1, 2, 3, 5}, {1, 3, 4, 5}}], MeshCellStyle -> 2 -> Opacity[0.3]]MeshPrimitives[ℛ, {1, {2, 5, 6}}]Show[ℛ, Graphics3D[{Red, %}]]MeshPrimitives[ℛ, {Line[{1, 2, 5, 1}]}]Show[ℛ, Graphics3D[{Red, %}]]ℛ = MeshRegion[{{0, 0, 0}, {2, 0, 0}, {2, 2, 0}, {0, 2, 0}, {1, 1, 2}}, Tetrahedron[{{1, 2, 3, 5}, {1, 3, 4, 5}}], MeshCellStyle -> 2 -> Opacity[0.3]]MeshPrimitives[ℛ, {0, _ ? OddQ}]Show[ℛ, Graphics3D[{PointSize[Large], Red, %}]]All 零维单元基元:
MeshPrimitives[ℛ, {0, All}]Show[ℛ, Graphics3D[{PointSize[Large], Red, %}]]ℛ = MeshRegion[{{0, 0, 0}, {2, 0, 0}, {2, 2, 0}, {0, 2, 0}, {1, 1, 2}}, Tetrahedron[{{1, 2, 3, 5}, {1, 3, 4, 5}}], MeshCellStyle -> 2 -> Opacity[0.3]]MeshPrimitives[ℛ, {2, {2, 5}}]Show[ℛ, Graphics3D[{Opacity[0.2, Red], %}]]MeshPrimitives[ℛ, {{0, 5}, {1, 1}, {2, 5}}]Show[ℛ, Graphics3D[{PointSize[Large], Red, %}]]从二维 BoundaryMeshRegion 指定零维单元基元的列表:
ℛ = BoundaryMeshRegion[{{0, 0}, {1, 0}, {0, 1}}, Line[{1, 2, 3, 1}]]MeshPrimitives[ℛ, {Point[{1, 3}]}]Show[ℛ, Graphics[{PointSize[Large], Red, %}]]从三维 BoundaryMeshRegion 指定零维和一维单元基元的列表:
ℛ = BoundaryMeshRegion[{{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}, Polygon[{{1, 2, 3}, {1, 2, 4}, {2, 3, 4}, {1, 3, 4}}]]MeshPrimitives[ℛ, 0 | 1]Show[ℛ, Graphics3D[{PointSize[Large], Red, %}]]属性和关系 (1)
MeshCellCount 可用于查找每个维度中基元的最大数目:
ℛ = MeshRegion[{{0, 0, 0}, {2, 0, 0}, {2, 2, 0}, {0, 2, 0}, {1, 1, 2}}, Tetrahedron[{{1, 2, 3, 5}, {1, 3, 4, 5}}], MeshCellStyle -> 2 -> Opacity[0.3]]{MeshCellCount[ℛ], Length /@ MeshPrimitives[ℛ, All]}文本
Wolfram Research (2014),MeshPrimitives,Wolfram 语言函数,https://reference.wolfram.com/language/ref/MeshPrimitives.html.
CMS
Wolfram 语言. 2014. "MeshPrimitives." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/MeshPrimitives.html.
APA
Wolfram 语言. (2014). MeshPrimitives. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/MeshPrimitives.html 年
BibTeX
@misc{reference.wolfram_2026_meshprimitives, author="Wolfram Research", title="{MeshPrimitives}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MeshPrimitives.html}", note=[Accessed: 04-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_meshprimitives, organization={Wolfram Research}, title={MeshPrimitives}, year={2014}, url={https://reference.wolfram.com/language/ref/MeshPrimitives.html}, note=[Accessed: 04-November-2026]}