# How can I plot a smooth region based on data?

Consider some region region, chosen for simplicity as a parallelepiped:

region= Parallelepiped[{0, 0, 0}, {{1, 0, 0}, {1, 1, 0}, {0, 1, 1}}]


Let us generate points that belong to this region:

pt = RandomPoint[
Parallelepiped[{0, 0, 0}, {{1, 0, 0}, {1, 1, 0}, {0, 1, 1}}],
10000];
Show[BoundaryMeshRegion[region,
MeshCellStyle -> {1 -> Directive[Thick, Black],
2 -> Directive[Opacity[0.1], Interpreter["Color"]["aqua"]]},
BoxRatios -> {1, 1, 1}, Boxed -> True, Axes -> True],
ListPointPlot3D[pt]] Next, let us assume the following task: suppose we have points that belong to some unknown region. Let us use the same points set pt for simplicity. In principle, we may visualize the region by using ListPointPlot3D. However, there is a problem: if the number of points is large, then this command is very slow and slows the interface down. Also, continuous figures look much prettier.

Is it possible, using pt, to visualize the region without using ListPointPlot3D, but instead somehow continuously, such that the result would look like the BoundaryMeshRegion plot? E.g., to "interpolate" the set of boundary points from pt in order to obtain a smooth function, and then just plot it?

• Perhaps ConvexHullRegion is what you are looking for? Jun 24 at 15:07

I think you are after BoundingRegion:

br = BoundingRegion[pt, "MinConvexPolyhedron"];

Graphics3D[{
Directive[Opacity[0.1], RGBColor[{0, 1, 1}]],
br,
Black, Opacity[0.3], Point[pt]
}] Above I am using your own definition of the list of points pt.

Another way will be to use alpha shapes. This is available as ConcaveHullMesh in MMA. Using your points pt we can get the following. I am setting the alpha parameter to 4 here.

Show[ConcaveHullMesh[pt, 4, Lighting -> {{"Directional", LightGreen, {{1., 0, 1.5}, {0, 0.5, 0}}}},BaseStyle -> Directive[Opacity[0.3], LightYellow]],
ListPointPlot3D[pt, PlotStyle -> Blue], Boxed -> True, Axes -> True, AxesStyle -> Black] • Use GradientFittedMesh.
SeedRandom;
pt = RandomPoint[
Parallelepiped[{0, 0, 0}, {{1, 0, 0}, {1, 1, 0}, {0, 1, 1}}],
10000];
reg = GradientFittedMesh[pt, PerformanceGoal -> "Speed",
VertexNormals -> Automatic,
MeshCellStyle -> {{2, All} -> Opacity[0.5, Brown], {1, All} ->
Opacity[0.5, Green]}] • 13.1 ReconstructionMesh.
ReconstructionMesh[pt,Method->{"AlphaShape","Alpha"->1}] A possible solution using ConvexHullMesh:

chm = ConvexHullMesh[pt]
Length /@ {pt, MeshPrimitives[chm, 0]}


{10000, 122}

Graphics3D[{
Directive[Opacity[0.2]]
, Blend[{Cyan, Gray}]
, chm
, region
, Blue, AbsolutePointSize
, Point@pt
}
] 