# Find all intersection points of complete graph

I want to create a picture like this: This picture was found in Regular Polygon Divisionby Diagonals.

But these codes are too old to run.

I think I can use GraphicsMeshFindIntersections to find all the intersection points.

lines=Line/@Tuples[CirclePoints,2];
pts=GraphicsMeshFindIntersections[lines]
Graphics[{{Thickness[0.005],lines},{Directive[Red,PointSize[0.02]],Point[pts]}}] Looks it meets a bug. I need another way or try to fix it.

• Indeed, there seems to be a problem with GraphicsMeshFindIntersections[]. In the meantime: use Subsets[] instead of Tuples[]: Line /@ Subsets[CirclePoints, {2}] Nov 13, 2017 at 5:33
• Still have bug when $n$ is bigger, just try $n=8$ . Nov 13, 2017 at 5:49

This is a brute-force solution that works in version 11.1, but not in the latest version:

lines = Line /@ Subsets[CirclePoints, {2}];
pts = DeleteCases[RegionIntersection @@@ Subsets[lines, {2}], _EmptyRegion];

Graphics[{lines, Directive[Red, PointSize[Large]], pts}] In 11.2, the corner points are missed: because RegionIntersection[] apparently lost the ability to find intersections of two line segments sharing an endpoint in 11.2:

RegionIntersection[Line[{{0, 0}, {1, 0}}], Line[{{0, 0}, {0, 1}}]]
EmptyRegion


where 11.1 would give the result Point[{{0, 0}}].

• Just did.$\phantom{}$ Nov 13, 2017 at 6:20
• For workaround, you can convert coords to numerical values. lines = N[lines]. Nov 13, 2017 at 14:04