1
$\begingroup$

ConvexHullMesh[pts] gives an object that excludes many of the points contained in pts. Here is a minimal example:

examplePts = {{125532/121135, 52654/111821, 1069901/1261496}, {81508/
    78653, 82423/175041, 561925/662552}, {111652/107741, 141253/
    299976, 1744659/2057072}, {44933/43359, 191656/407013, 691887/
    815776}, {204538/197373, 144143/306111, 89027/104968}, {109988/
    106135, 201670/428277, 1566859/1847408}, {52037/50214, 404989/
    860049, 245861/289880}, {165232/159443, 46737/99251, 501067/
    590768}, {76568/73885, 84344/179109, 454643/536016}, {89677/86535,
     39905/84742, 48377/57037}, {92782/89531, 238051/505518, 382991/
    451544}, {474886/458247, 163720/347673, 1974665/2328136}, {48318/
    46625, 26219/55678, 257943/304114}, {38558/37207, 67187/142677, 
    883575/1041736}, {45690/44089, 161360/342657, 294413/
    347108}, {53513/51638, 58343/123896, 273245/322156}, {177256/
    171045, 104893/222747, 341747/402916}, {13842/13357, 82498/175191,
     926989/1092920}, {96606/93221, 282587/600093, 775411/
    914204}, {52257/50426, 170791/362688, 486633/573740}, {189532/
    182891, 263053/558612, 745367/878784}, {100832/97299, 286324/
    608031, 930125/1096616}, {92272/89039, 70114/148893, 614397/
    724376}, {29312/28285, 82715/175653, 1219337/1437608}, {112480/
    108539, 160606/341061, 32027/37760}, {35591/34344, 99173/210603, 
    48875/57624}, {28741/27734, 10025/21289, 659477/777528}, {83426/
    80503, 33805/71788, 71729/84569}, {86908/83863, 129176/274317, 
    660583/778832}, {18352/17709, 57933/123026, 334607/394504}};
Show[
 ListPointPlot3D[examplePts], ConvexHullMesh[examplePts]
 ]

In MMA 12.1.1 for Linux this produces the following plot:

ConvexHullMesh

Note that many points that are in pts are not included in the convex hull. I provided the points already as rationalized data to show that the solution for a similar problem encountered in ConvexHullMesh sometimes excludes valid points from convex hull does not work to solve this problem. (The same problem still occurs when using real numbers.) Also the problem can be even more clear and not an issue of the line not being visible because it is thin in other examples but I wanted to post one with only 30 points.

It seems that bugs like this have been around for many versions of MMA so I don't have too high a hope of this being fixed any time soon. Is there any workaround?


If this issue has been solved in version 12.2 my question still stands and I am looking for a workaround in 12.1.

Note that the ConvexHullMesh is wrong and not just wrongly depicted in the plot. This can easily be seen from its FullForm that the largest included point is 1.0363015752208307 while there are many points greater than 1.03631.

$\endgroup$
4
  • $\begingroup$ Might help? mathematica.stackexchange.com/questions/223405/… $\endgroup$
    – Tomi
    Mar 29, 2021 at 17:05
  • $\begingroup$ @Kvothe: Your problem may be caused by graphic drivers. $\endgroup$
    – user64494
    Mar 29, 2021 at 17:55
  • $\begingroup$ @user64494, no the actual mesh is wrong as can be seen by looking at its full form. It is not just a plotting issue. $\endgroup$
    – Kvothe
    Mar 29, 2021 at 18:23
  • $\begingroup$ Does BoundaryMesh[DelaunayMesh[examplePts]] work in 12.1? $\endgroup$
    – Greg Hurst
    Apr 29, 2021 at 18:16

1 Answer 1

1
$\begingroup$

In 12.2

ConvexHullRegion[examplePts]

Polyhedron[Number of points:30 Number of faces: 34 ]

Region[%]

enter image description here

The result of Show[ListPointPlot3D[examplePts], Region[ConvexHullRegion[examplePts]]] is badly seen.

Addition. The commands

ConvexHullRegion[N[examplePts, 15]]

and

ConvexHullMesh[examplePts]

perform a similar result for me:

Show[ListPointPlot3D[examplePts], ConvexHullMesh[examplePts]]

enter image description here

Show[ListPointPlot3D[examplePts],Region[ConvexHullRegion[examplePts]]]

enter image description here

$\endgroup$
5
  • $\begingroup$ Okay maybe they just fixed it in 12.2 . Note that I can't fully see the convex hull is indeed correct since you did not include a plot of the points to provide some scale but I assume you checked and that it now works correctly. $\endgroup$
    – Kvothe
    Mar 29, 2021 at 17:19
  • $\begingroup$ @Kvothe: I use another command ConvexHullRegion instead of ConvexHullMesh. $\endgroup$
    – user64494
    Mar 29, 2021 at 17:23
  • $\begingroup$ Right but that command was introduced in 12.2. $\endgroup$
    – Kvothe
    Mar 29, 2021 at 17:38
  • 3
    $\begingroup$ @Kvothe: Upgrade your Mathematica. $\endgroup$
    – user64494
    Mar 29, 2021 at 17:39
  • 3
    $\begingroup$ Haha, if only life was so simple. $\endgroup$
    – Kvothe
    Mar 29, 2021 at 17:40

Your Answer

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

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