# Random points on the Cuboid, and using FindShortestTour

How to plot a random points on the Cuboid?

Graphics3D[{Yellow, Opacity[0.3], Cuboid[{0, 0, 0}, {1, 3, 1}]}, Boxed -> False] And how can I use FindShortestTour for the given random points on the cuboid?

It's easy to generate random points and use FindShortestTour inside cuboid

pts = RandomPoint[Cuboid[{0, 0, 0}, {1, 3, 1}], 500];
Graphics3D[{Blue, PointSize[Medium], Point[pts]}] Graphics3D[{Line[pts[[FindShortestTour[pts][]]]],
PointSize[Medium], Blue, Point[pts]}] but I need to generate random points on the cuboid surface

• So not plot but to generate, and you mean cuboid surface? – Kuba Dec 23 '16 at 8:40
• @Kuba yes, I mean cuboid surface.. – vito Dec 23 '16 at 8:52
• It comes down to finding a distance function on the surface of the cuboid, so it might be a good idea to first ask on math.SE how to define the distance function. – C. E. Dec 23 '16 at 9:39
• Use RegionBoundary to get the cuboid surface – Simon Woods Dec 23 '16 at 9:50
• For generating random points on a cuboid's surface, see this earlier question; however, as C.E. says, you'll need to define what would be the distance of, say, two points on opposing faces of a cuboid. – J. M. will be back soon Dec 23 '16 at 11:30