I really like the functionality of Mathematica for mesh-based regions,
and have enough understanding of it. But this problem bothers me.
There is a similar question, but the functionality used now obsolete.
Let we have mesh region (for simplicity MeshCellMeasure made large enough):
region = DiscretizeRegion[Annulus[{0, 0}, {1/2, 1}, {0,3 Pi/2}], {MaxCellMeasure -> {"Length" -> 0.15}, ImageSize -> 150}]
I need to separate the interior — all that is not RegionBoundary@region.
And in the form in which it is obtained at primary discretization;
literally everything that is not highlighted red:
bound = RegionBoundary@region;
Show[region,
HighlightMesh[
bound, {Style[1, Red], Style[0, PointSize[Medium], Red]}]]
I was only able to do it this way:
coords = MeshCoordinates@region;
boundCoords = MeshCoordinates@bound;
verts = Range@Length@coords;
boundVerts = Flatten[Position[coords, #] & /@ boundCoords, 2];
interior =
ConcaveHullMesh[coords[[Delete[verts, Partition[boundVerts, 1]]]]]
In fact, it is simplest form of erosion, but I can't get it nor with RegionErosion nor with Erosion.
I’m sure it can be made simpler and more contemporary,
thanks for help in advice!








interior = RegionDifference[region, bound]? – user64494 Jan 19 '24 at 16:51