Skip to main content
added 26 characters in body
Source Link
Henrik Schumacher
  • 112.9k
  • 7
  • 197
  • 339

I do not really understand what you mean by "patch" but of you look for the (triangle) face index lists of the convex hull in terms of the original vertices, this should work:

R=ConvexHullMesh[X]; lookuptable = AssociationThread[ Range[MeshCellCount[R, 0]], Flatten[Nearest[X -> Automatic, MeshCoordinates[R]]] ]; faces = Partition[ Lookup[ lookuptable, Flatten[MeshCells[R, 2, "Multicells" -> True][[1, 1]]] ], 3 ] 

I do not really understand what you mean by "patch" but of you look for the face index lists of the convex hull in terms of the original vertices, this should work:

lookuptable = AssociationThread[ Range[MeshCellCount[R, 0]], Flatten[Nearest[X -> Automatic, MeshCoordinates[R]]] ]; faces = Partition[ Lookup[ lookuptable, Flatten[MeshCells[R, 2, "Multicells" -> True][[1, 1]]] ], 3 ] 

I do not really understand what you mean by "patch" but of you look for the (triangle) face index lists of the convex hull in terms of the original vertices, this should work:

R=ConvexHullMesh[X]; lookuptable = AssociationThread[ Range[MeshCellCount[R, 0]], Flatten[Nearest[X -> Automatic, MeshCoordinates[R]]] ]; faces = Partition[ Lookup[ lookuptable, Flatten[MeshCells[R, 2, "Multicells" -> True][[1, 1]]] ], 3 ] 
Source Link
Henrik Schumacher
  • 112.9k
  • 7
  • 197
  • 339

I do not really understand what you mean by "patch" but of you look for the face index lists of the convex hull in terms of the original vertices, this should work:

lookuptable = AssociationThread[ Range[MeshCellCount[R, 0]], Flatten[Nearest[X -> Automatic, MeshCoordinates[R]]] ]; faces = Partition[ Lookup[ lookuptable, Flatten[MeshCells[R, 2, "Multicells" -> True][[1, 1]]] ], 3 ]