Im trying to use BooleanRegion[]
on an .stl file.
The imported .stl file is called pores and is of type MeshRegion
(MeshRegionQ[] and RegionQ[] give both True
).
Here is also a snippet of ?pores:
pores = MeshRegion[{{6141.84, 3115.36,9443.80},...,{5617.29,3599.17,8546.06}}, {Polygon[{{1,2,3}, ..., {5253,6518,2148}}]}]
pores represent pores of a material, that was scanned. What I'm trying to do is subtracting these pores from a box=BoundingRegion[pores]
, which yields the rest of the material. When I try doing this with
BooleanRegion[#1 && ! #2 &, {box, pores}]
it gives me the input back unevaluated. Same happens when I try using RegionDifferece[]
. I tested all possible combinations. However what is working as expected is
BooleanRegion[#1 ∨ #2 &, {box, pores}]
There is also an example in the Help of BooleanRegion[]
and RegionDifference[]
especially for MeshRegions, that exactly fits my case and works fine as long as is dont plug in the .stl Data (pores).
Therefore i had a look at the Data itself and figured out that the MeshRegion
of the pores uses polygons and RegionBound[]
uses Tetrahedrons. So I thought there might be a problem, because the pores are represented by surfaces. Thus I tested the following with 1 pore only
pore=Delaunay[MeshCoordinates[pore]]
BooleanRegion[#1 && ! #2 &, {box, pore}]
The Delaunay[MeshCoordinates[pore]]
gives you tetrahedron elements as well, but the results are not evaluated as before.
It seems that im not the only one encountered that problem: Is BooleanRegion limited to only the most trivial cases? Here a similar problem occured, but the author was able to use BooleanRegion for non-discretized regions and discretize everything afterwards. As far as i know i cant make a undiscretized region out of a MeshRegion, can I? Is there a way to make BooleanRegion[]
work?