1
$\begingroup$

I know much of the stuff in ConvexHullMesh needs some TLC convexhullmesh-inconsistency

But, can anyone see why this would produce inconsistent output:

Case 1 (expected behavior):

sp = SpherePoints[5];
chSphere = ConvexHullMesh[sp];
Head[chSphere]
chSphere["Faces"]

Case 2 (expected behavior):

rp = RandomReal[{-1, 1}, {5, 3}];
chRP = ConvexHullMesh[rp];
Head[chRP]
chRP["Faces"]

Case 2 (inconsistent behavior)

dodCH = ConvexHullMesh[PolyhedronData["Dodecahedron", "Vertices"]]
Head[dodCH]
dodCH["Faces"]

dodCH = ConvexHullMesh[PolyhedronData["Dodecahedron", "Vertices"],  FlatFaces -> True] (*or using undocumented FlatFaces*)
Head[dodCH]
dodCH["Faces"]

I can find a work-around. But, I wish I didn't have to.

$\endgroup$
3
  • 1
    $\begingroup$ Surprisingly, if I start from a fresh kernel (using kernel quit) it doesn't work and I get the problem with "Faces". But if I execute in a different cell (and ignore the output of) BoundaryMeshRegion@Dodecahedron[]; then run your code again, amazingly it works. There is clearly some kind of stateful bug in the object ConvexHullMesh produces which is exposed when calling dodCH["Faces"] and disappears after running BoundaryMeshRegion@Dodecahedron[] $\endgroup$ – flinty Jul 17 '20 at 21:08
  • 1
    $\begingroup$ That’s an interesting observation. Thanks. That explains why I was having such trouble making the post—I’d run the code to make sure that my post made sense. it would work and then run it again and it wouldn’t. Bizarre bug. $\endgroup$ – Craig Carter Jul 17 '20 at 21:46
  • $\begingroup$ Indeed bizarre. As most of the other "Properties" of MeshRegions. An efficient workaround in this case would be the (also undocumented) MeshCells[dodCH, 2, "Multicells" -> True][[1, 1]]. $\endgroup$ – Henrik Schumacher Jul 18 '20 at 6:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.