lcc
lcc defines a set of concentric circular arcs as 2D curves, in any phase, one curve for each radius.
Syntax
lcc x_centre z_centre angle_begin angle_end radius_1 [radius_2 ...] ;
(x_centre, z_centre) is the centre in the local plane of 2D curves. The two angles are in degrees. Each radius gives one arc.
What it does
For each radius, James adds one 2D curve: an arc about the centre that runs from angle_begin to angle_end. The curves are numbered in order, starting one above the highest curve number defined so far. If no curve exists yet, they are 1, 2, 3 and so on. A curve defined by ld before the lcc therefore moves the numbering up.
When James applies it
When it is read. lcc is legal in the Control, Part and Merge phases.
Rules James adds
- The angle changes steadily from the beginning to the end. When
angle_beginis larger thanangle_endthe arc turns clockwise, and nothing wraps through 360 degrees. - A span of more than a full turn is kept as written. A span of zero is an arc of zero length. Every
lcccurve is one arc, so it has no other length, and the engine refuses it with an error, exit 2. - A negative radius reflects the arc through the centre.
- An argument list that is too short, with no radius or no end angle, is an error (E0104).
Diagnostics
- E0104: the command lacks an angle or a radius.
Example
The script tests/corpus/181-lcc-three-arcs/input.tg, which make test runs:
c lcc makes three concentric arcs, numbered 1 to 3
lcc 0 0 0 90 1 2 3;
The centre is the origin and the angles run from 0 to 90 degrees, so each curve is a quarter circle. The radii 1, 2 and 3 make three curves, numbered 1, 2 and 3. The IR holds three 2D curves, each with one arc segment.