Hi Ian

ian.rees wrote:Doing the geometry with a parameter rather than a template would probably be good in general

I made this change to the code so now number of corners is a constructor parameter rather than a class template parameter.

ian.rees wrote:This isn't quite right, but there probably is a general rule. For example, imagine a 4-sided polygon with one angle (same argument for two angles) constrained to 90 degrees, and all sides equal length. Either a square or an 'L' could satisfy those requirements

You are right about that. However, those two cases are the solutions of the general problem, with the sketcher we just care about if the solutions are locally well defined. There is no way of moving from the square to the 'L' in a gradual way that satisfies the constraints.

I think the real question is how we specify the rules of a regular polygon. Below are three different possibilities for the hexagon.

- hexagon_constraints.png (42.06 KiB) Viewed 3230 times

top left have all sides equal length and all corners on a construction circle.

top right specifies all angles (specifying the last angle is redundant) and four lines equal length ( corners - 2?)

bottom (implemented) all sides equal length and 3 angles ( corners - 3 )

I think the top right is most well specified, but all the angular constraints clutter the sketch more than I like. The bottom one is nice for a hexagon, but as you pointed out not well defined, and for a larger number of corners suffers from the same problems as the top right one. I personally prefer the one inside a construction circle since this gives a center point which I can attach to something. I've used this extensively to create pockets for nuts. However that one isn't well specified either, both a pentagram and a pentagon satisfies these constraints in the case of five corners for example.

/Johan