I'm using an old function which uses ConvexHull
from the obsolete ComputationalGeometry
package. I understand this is superseded by ConvexHullRegion
. However, I need to know which points are on the lower boundary legs of the convex hull and ConvexHull returns this information. In the plot below, the points $(0,8),(3,6),(6,4),(9,2),(12,0)$ are on the (single) lower leg of the polygon and those points are returned by ConvexHull. But ConvexHullRegion
only returns the vertexes of the hull. For example, using the obsolete ConvexHull
function:
Needs["ComputationalGeometry`"];
myPoints = {{0, 8}, {2, 7}, {3, 6}, {4, 6}, {5, 5}, {6, 4}, {8,
3}, {9, 2}, {12, 0}};
chIndexes = ConvexHull[myPoints];
Sort@myPoints[[chIndexes]]
(* {{0, 8}, {2, 7}, {3, 6}, {4, 6}, {6, 4}, {8, 3}, {9, 2}, {12, 0}} *)
returns all 8 points on the boundary of the hull:
But if I use:
RegionBoundary[ConvexHullRegion[myPoints]] /. Line[x_] -> x
{{0, 8}, {12, 0}, {4, 6}, {0, 8}}
this is only returning the vertex points of the convex hull.
I'd prefer to switch to ConvexHullRegion
if it's easy to do so because the obsolete ConvexHull may be removed in future revisions of Mathematica but haven't figured out how to do this but maybe missing something. Or is there no built-in construct to do this?