# 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[7],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[7], {2}] – J. M. is away Nov 13 '17 at 5:33
• Still have bug when $n$ is bigger, just try $n=8$ . – GalAster Nov 13 '17 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[7], {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[2]


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

• Please report.. – yode Nov 13 '17 at 6:18
• Just did.$\phantom{}$ – J. M. is away Nov 13 '17 at 6:20
• For workaround, you can convert coords to numerical values. lines = N[lines]. – halmir Nov 13 '17 at 14:04