point = {{(2 2^(1/3))/3, (2 2^(1/3))/3, (2 2^(1/3))/
3}, {-((2 2^(1/3))/3), (2 2^(1/3))/3, (2 2^(1/3))/3}, {(
2 2^(1/3))/3, -((2 2^(1/3))/3), (2 2^(1/3))/3}, {(2 2^(1/3))/3, (
2 2^(1/3))/
3, -((2 2^(1/3))/3)}, {-((2 2^(1/3))/3), -((2 2^(1/3))/3), (
2 2^(1/3))/3}, {-((2 2^(1/3))/3), (2 2^(1/3))/
3, -((2 2^(1/3))/3)}, {(2 2^(1/3))/
3, -((2 2^(1/3))/3), -((2 2^(1/3))/3)}, {-((2 2^(1/3))/3), -((
2 2^(1/3))/3), -((2 2^(1/3))/3)}, {0, 1/2^(2/3), 2^(
1/3)}, {0, -(1/2^(2/3)), 2^(1/3)}, {0, 1/2^(
2/3), -2^(1/3)}, {0, -(1/2^(2/3)), -2^(1/3)}, {1/2^(2/3), 2^(1/3),
0}, {-(1/2^(2/3)), 2^(1/3), 0}, {1/2^(2/3), -2^(1/3),
0}, {-(1/2^(2/3)), -2^(1/3), 0}, {2^(1/3), 0, 1/2^(
2/3)}, {-2^(1/3), 0, 1/2^(2/3)}, {2^(1/3),
0, -(1/2^(2/3))}, {-2^(1/3), 0, -(1/2^(2/3))}};
reg = ConvexHullMesh[point, MeshCellStyle -> {{1, All} -> Red}]
This current method:
poly = MeshPrimitives[ConvexHullMesh[point], 2];
total = Function[part,
Select[poly,
RegionDistance[InfinitePlane @@ part, RandomPoint[#]] <
10^-5 &]] /@ poly // DeleteDuplicatesBy[#, Sort[#] &] &;
g12 = Polygon /@ (#[[
FindShortestTour[#] // Last]] & /@ (DeleteDuplicates /@
Apply[Sequence, total, {2, 3}])) //
Graphics3D[{Yellow, EdgeForm[Red], #}, Boxed -> False] &
Are there more smart method to get rid of the redundant red line?
Answer
Graphics3D[{Yellow, EdgeForm[Red],Polygon@*VertexList@*Graph /@
FindCycle[NearestNeighborGraph[point // N, 3], {5}, All]}]
Comments
Post a Comment