0
$\begingroup$

If we take the documentation example for BoundingRegion and change "MinDisk" to "MinConvexPolygon" it no longer works:

pts = {{3, 10}, {6, 3}, {10, 2}, {2, 8}, {3, 3}};
BoundingRegion[pts, "MinConvexPolygon"]
Graphics[{{Yellow, %}, Point[pts]}, ImageSize -> Tiny]

gives the error:

"BoundaryMeshRegion is not a Graphics primitive or directive".

BoundingRegion[pts, "MinConvexPolygon"] does give a working Graphics object that I can use in plots. But how do I change the color in this case?

$\endgroup$

1 Answer 1

3
$\begingroup$

You can use BoundaryMeshRegion to change the mesh cell styles:

BoundaryMeshRegion[
    BoundingRegion[pts, "MinConvexPolygon"],
    MeshCellStyle -> {2 -> Orange}
]

enter image description here

In Mathematica 12 BoundaryMeshRegion is supported as a Graphics primitive:

pts={{3,10},{6,3},{10,2},{2,8},{3,3}};
BoundingRegion[pts,"MinConvexPolygon"]
Graphics[{{Yellow,%},Point[pts]},ImageSize->Tiny]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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