I'm struggling to understand the behaviour of ConvexHullMesh (or rather the non-behaviour). I have a polygon p
p = { {0, 0}, {1, 0}, {1/2, 1/2}, {1, 1}, {0, 1}}
which I can display in a nice way like by e.g.:
Show[Graphics[{LightBlue, EdgeForm[Gray], Polygon[p]}], Graphics[ {PointSize[Large], Red, Point[#]}] & /@ p]
Now I construct the convex hull
q = ConvexHullMesh[p];
which displays a somewhat featureless rectangle. Having a closer look at q
q // InputForm
I get
BoundaryMeshRegion[{{0., 0.}, {0., 1.}, {1., 0.}, {1., 1.}}, {Line[{{1, 3}, {3, 4}, {4, 2}, {2, 1}}]}, Method -> {"EliminateUnusedCoordinates" -> True, DeleteDuplicateCoordinates" -> Automatic, "VertexAlias" -> Identity, "CheckOrientation" -> True, "CoplanarityTolerance" -> Automatic, "CheckIntersections" -> Automatic, "BoundaryNesting" -> {{0, 0}}, "SeparateBoundaries" -> False, "PropagateMarkers" -> True, "Hash" -> 1136472811504667718}]
so the obvious (?) idea is to replace the head of q (i.e. BoundaryMeshRegion) by a suitably defined function f that uses the argument to display the convex hull in a 'nicer' way. Ignoring the exact implementation of f, the 'usual' way fails, as
f @@ q
just redisplays the rectangle. Head[q] gives the expected BoundaryMeshRegion, but Apply (or @@) somehow fails to replace the head. Similarly, the alternative q[[1]] to access the argument of the head fails.
What am I missing?
Or to be more precise:
How do I change the appearance of
ConvexHullMesh?Why does the above solution not work?









Meshobjects directly. – RunnyKine Aug 24 '14 at 19:19