2
$\begingroup$

I have a set of (x,y) coordinates. How can I link them together to form an ImplicitRegion?

$\endgroup$
2
  • 1
    $\begingroup$ Do VoronoiMesh or DelaunayMesh create the type of region you're looking for? Those are mesh regions. $\endgroup$
    – tad
    Dec 1 '20 at 23:58
  • 3
    $\begingroup$ Show[reg = ConvexHullMesh[data], Graphics[{Red, AbsolutePointSize[6], Point[data]}]] $\endgroup$
    – Bob Hanlon
    Dec 2 '20 at 0:02
1
$\begingroup$

Implicit region for the convex hull:

SeedRandom[0];
data = RandomReal[10, {20, 2}];
bdy = ConvexHullMesh[data];
normals = Region`Mesh`MeshCellNormals[bdy, 1];
bpts = MeshCoordinates[bdy][[MeshCells[bdy, 1] /. Line[{p_, ___}] :> p]];
reg = ImplicitRegion[
   MapThread[
    Dot[##] < 0 &, {normals, Transpose@({x, y} - Transpose@bpts)}], 
   Evaluate@Join[{{x}, {y}}, MinMax /@ Transpose@data, 2]];

Visualization:

Show[
 BoundaryDiscretizeRegion@reg,
 Graphics[{PointSize@Large, Point@data, PointSize@Medium, Red, 
   Point@bpts}]
 ]
$\endgroup$
1
$\begingroup$

Maybe this?

pts = RandomReal[{-2, 2}, {20, 2}];
reg = DelaunayMesh[pts];
HighlightMesh[reg, {Style[0, {PointSize[Large], Yellow}], 
  Style[1, Cyan], Style[2, Pink]}]

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.