4
$\begingroup$

There are cases when there exist several different shortest curves with exactly the same length.

Do you have a better idea than mine which is adding obstacles to first found curve so that algorithm is forced to find a second curve?

Here for cube we have six such curves so I would have to add 1, 2, 3, 4 and 5 obstacles to find them all. The process is manual because you do not know which route the algorithm choses.

The following describes only the first added obstacle... I think the rest is obvious.

FindShortestCurve[RegionBoundary@Cube[],{1/2,1/2,1/2},-{1/2,1/2,1/2}];
HighlightRegion[Region[Style[Cube[],Opacity[0.5]]], %]
ArcLength[%%]
RootApproximant[%]

enter image description here

RegionUnion[Cube[],Ball[{0,1/2,-1/2},1/10]]//BoundaryDiscretizeRegion//RegionBoundary;
FindShortestCurve[%,{1/2,1/2,1/2},-{1/2,1/2,1/2}];
HighlightRegion[Region[Style[%%,Opacity[0.5]]], %]
ArcLength[%%]
RootApproximant[%]

enter image description here

$\endgroup$
3
  • $\begingroup$ A staring point. surfaces = MeshPrimitives[Cube[], 2]; line = FindShortestCurve[ RandomSample[surfaces, 5] // RegionUnion, {-1/2, -1/2, -1/2}, {1/2, 1/2, 1/2}]; Graphics3D[{{Red, line}, Opacity[.2], surfaces}] $\endgroup$ Commented Oct 20 at 0:49
  • $\begingroup$ Are you interested only in geodesics on cubes, polytopes, or more general surfaces? $\endgroup$ Commented Oct 20 at 7:42
  • $\begingroup$ @yarchik I think cube could be solved analytically so general method would be better. $\endgroup$ Commented Oct 21 at 8:49

1 Answer 1

2
$\begingroup$
c=Cube[];
{p1,p2}={{1/2,1/2,1/2},-{1/2,1/2,1/2}};
first=FindShortestCurve[RegionBoundary@Cube[],p1,p2];
NestList[(f|->{f,FindShortestCurve[RegionUnion[f]//BoundaryDiscretizeRegion//RegionBoundary,p1,p2]})@Append[#[[1]],Ball[#[[1,Floor[Length[#[[1]]]/2]]]&@#[[2]],1/10]]&,{{c},first},5][[All,2]];
HighlightRegion[Region[Style[c,Opacity[0.5]]], %]
ArcLength/@%%

enter image description here

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.