Say I have a mesh region which encloses a region. How do I get a mesh region where this region is filled? Take for example the meshregion below:
reg=MeshRegion[List[List[1.`,0.`],List[2.`,0.`],List[3.`,0.`],List[4.`,0.`],List[5.`,0.`],List[4.5`,2.5`],List[0.5`,2.5`],List[2.5`,0.5`],List[2.5`,4.5`],List[5.`,1.`],List[5.`,2.`],List[5.`,3.`],List[5.`,4.`],List[5.`,5.`],List[4.`,5.`],List[3.`,5.`],List[2.`,5.`],List[1.`,5.`],List[0.`,5.`],List[0.`,4.`],List[0.`,3.`],List[0.`,2.`],List[0.`,1.`],List[0.`,0.`],List[5.`,6.`],List[5.`,7.`],List[5.`,8.`],List[4.9`,7.`],List[4.`,8.`],List[0.5`,5.`]],List[Polygon[List[List[23,24,1],List[7,22,23],List[1,2,8],List[3,8,2],List[1,8,23],List[7,23,8],List[21,7,20],List[7,21,22],List[30,19,20],List[20,7,9],List[20,18,30],List[18,20,9],List[17,18,9],List[9,16,17],List[8,3,4],List[6,4,10],List[10,4,5],List[15,9,6],List[10,11,6],List[12,13,6],List[11,12,6],List[6,13,15],List[16,9,15],List[29,28,27],List[15,25,28],List[14,25,15],List[26,27,28],List[25,26,28],List[15,13,14],List[6,8,4]]]]]
Note that the mesh region is not concave and I want to preserve that so taking the convex hull is not solving the issue.
Related I would like to know how to get the filled mesh region of everything to a certain side of a mesh (until some cut-off).
The requested outputs would in this case be something matching: (but of course automatized)
Region@RegionUnion[reg, Rectangle[{0, 0}, {5, 5}]]
and the completion to the right (with cut-off 10)
Region@RegionUnion[reg, Rectangle[{0, 0}, {5, 5}], Rectangle[{5, 0}, {10, 8}]]
completion to above
Region@RegionUnion[reg, Rectangle[{0, 0}, {5, 5}],
Rectangle[{0, 0}, {10, 10}]]
I would like to also fill holes in cases that the boundary to the outside is a point. See for example the following region:
MeshRegion[List[List[1.`,0.`],List[2.`,0.`],List[3.`,0.`],List[4.`,0.`],List[5.`,0.`],List[4.5`,2.5`],List[0.5`,2.5`],List[2.5`,0.5`],List[2.5`,4.5`],List[5.`,1.`],List[5.`,2.`],List[5.`,3.`],List[5.`,4.`],List[5.`,5.`],List[4.`,5.`],List[3.`,5.`],List[2.`,5.`],List[1.`,5.`],List[0.`,5.`],List[0.`,4.`],List[0.`,3.`],List[0.`,2.`],List[0.`,1.`],List[0.`,0.`],List[5.`,6.`],List[5.`,7.`],List[5.`,8.`],List[4.9`,7.`],List[4.`,8.`],List[0.5`,5.`]],List[Polygon[List[List[23,24,1],List[7,22,23],List[1,2,8],List[3,8,2],List[21,7,20],List[7,21,22],List[30,19,20],List[20,18,30],List[17,18,9],List[9,16,17],List[8,3,4],List[10,4,5],List[10,11,6],List[12,13,6],List[11,12,6],List[16,9,15],List[29,28,27],List[14,25,15],List[26,27,28],List[25,26,28],List[15,13,14]]]]];