Construction

Construction script:

Auto-update

What is this?

This is a playground for geometric ruler-and-compass constructions.

It is also a place to showcase David Lance Goines' "A Constructed Roman Alphabet". He has granted me permission to place this set of constructions on the web. A number of changes have been made from the original constructions listed in the book to make the resulting curves water-tight and precisely smooth when they should be. All the changes maintain the original look of the letters as close to the original spirit as possible.

Syntax

The code is ported from a C++ implementation, which I didn't really comment, and the syntax is only partially documented. A temporary comment dump is listed below, which doesn't document all the supported commands (see the Javascript source for this page for full syntax details).

// Syntax:
//   [command] [params]
// command may be the following:
//   point
//   line
//   circle
//   bisect
//   divide
//   drawline
//   drawarc
// The params depend on the command. Several common param types are listed below
//   [name] - a name attached to an object (point, line, circle), cannot have spaces or commas
// ----------
//
//
//  point
//  =====
//    point [name] at [loc]
//                    [loc] = [point name]
//                            [curve name],[curve name]
//                            [curve name] = [line name]
//                                           [circle name]
//   When the intersection between a line and a circle is taken, of the two
//   possible intersections, the one farthest down the direction of the line
//   is used.
//
//  line
//  ====
//   Lines have a directionality associated with them. They are simultaneously
//   directed line segments as well as infinite lines
//    line [name] from [point name] to [point name]
//                between [circle name] and [circle name]
//   For two circle intersections, the line is oriented in the following way:
//   Take the vector from the first circle's center to the second circle's center,
//   rotate it 90 degrees CCW, that is the direction of the line.
//
//  circle
//  ======
//    circle [name] at [point name] through [point name]
//                                  radius [line name]
//   The first point is the center, the second is a point through which the circle
//   passes. In the second form, the radius is taken as the length of the line's
//   defining line segment.
//
//  bisect
//  ======
//   Generates the bisector point of a line segment
//    bisect [line name] at [name]
//   The new point's name comes second
//
//  divide
//  ======
//   A more generalized operation than bisect; divides a segment into an arbitrary
//   rational ratio.
//    divide [line name] by [int],[int] at [name]
//   For integers a,b, define t = a/(a+b). The line segment is from A to B.
//   The new point is at A + t*(B-A).
//   Obviously, a+b cannot be zero.
//
//  drawline
//  ========
//   Normally all objects are drawn lightly. This forces a line segment to be drawn
//   at normal length in a darker shade.
//    drawline [line name]
//
//  drawarc
//  =======
//   Normally all objects are drawn lightly. This forces an arc segment to be drawn
//   in a darker shade.
//    drawarc [circle name] from [point name] to [point name]
//   This allows portions of circles to be drawn using the specified points to denote
//   starting and ending angles. From the circle center, a ray is cast to the points.
//   These rays define the delimiting angles for the arc. The arc is drawn from the
//   first angle, travelling CCW until the second angle is reached.

Todo