This is an offspring of answering another question.
Consider
data = {{4.4, 14}, {6.7, 15.25}, {6.9, 12.8}, {2.1, 11.1},
{9.5, 14.9}, {13.2, 11.9}, {10.3, 12.3}, {6.8, 9.5},
{3.3, 7.7}, {0.6, 5.1}, {5.3, 2.4}, {8.45, 4.7},
{11.5, 9.6}, {13.8, 7.3}, {12.9, 3.1}, {11, 1.1}};
vor = VoronoiMesh[data];
All indices of the interior faces can be obtained with
i2 = MeshCellIndex[vor, {2, "Interior"}] (* undocumented *)
thence
HighlightMesh[vor, Style[i2, Red]]
It works also for points (0
) and lines (1
):
i0 = MeshCellIndex[vor, {0, "Interior"}]
i1 = MeshCellIndex[vor, {1, "Interior"}]
I found (by trial-and-error) that there's also "Boundary"
:
b0 = MeshCellIndex[vor, {0, "Boundary"}]
b1 = MeshCellIndex[vor, {1, "Boundary"}]
giving
Unfortunately,
MeshCellIndex[vor, {2, "Boundary"}]
{}
doesn't work.
Questions:
- Is there something similar to
"Interior"
for the bordering faces (i.e., the missingMeshCellIndex[vor, {2, "Boundary"}]
output)? They can be obtained withComplement[MeshCellIndex[vor, 2], i2]
, but it looks too cumbersome compared to the"Interior"
simplicity. - Regarding the lines (
1
),"Interior"
and"Boundary"
don't give all of them (i.e., the ones leading from the interior to the boundary); the remaining can be obtained withComplement[MeshCellIndex[vor, 1], b1, i1]
, but again it would be nice to have a one-word description.