Learn your reflections and rotations
There are a lot of variations of the basic reflection and rotation, so it pays to know what the subtle differences are. Key to tables:
- Command: Name of the command in Verbose mode.
- Transform: Whether Charcoal should attempt to flip or rotate the characters as it mirrors or rotates them. For instance, a
/
might become \
after a rotate or flip.
- Keep Original: Whether Charcoal should merge the result with the original canvas.
- Overlap: (Only applies when Keep Original is Yes.) Determines the position of the axis of reflection/rotation, in half characters from the border. In the case of reflections, equivalent to the number of rows/columns that are not affected and end up in the middle of the result. In the case of rotations, the rotated copy is allowed to overwrite clear areas (but not spaces) in the original.
Reflections
| Command | Transform | Keep Original | Overlap |
|-------------------------|-----------|---------------|---------|
| Reflect | No | No | n/a |
| ReflectCopy | No | Yes | 0 |
| ReflectOverlap | No | Yes | 1 |
| ReflectOverlapOverlap | No | Yes | n |
| ReflectTransform | Yes | No | n/a |
| ReflectMirror | Yes | Yes | 0 |
| ReflectButterfly | Yes | Yes | 1 |
| ReflectButterflyOverlap | Yes | Yes | n |
The direction of reflection is optional. The default is to reflect once to the right. For those reflections that keep the original, a multiple direction is allowed, which simply repeats the command for each direction. (This means that for instance ReflectMirror(:¬)
will actually create four copies in total.)
The cursor is moved along with the reflection (even when the original is kept).
Rotations
| Command | Transform | Keep Original | Overlap |
|-------------------------|-----------|---------------|---------|
| Rotate | No | No | n/a |
| RotateCopy | No | Yes | 0 |
| RotateOverlap | No | Yes | 1 |
| RotateOverlapOverlap | No | Yes | n |
| RotateTransform | Yes | No | n/a |
| RotatePrism | Yes | Yes | 0 |
| RotateShutter | Yes | Yes | 1 |
| RotateShutterOverlap | Yes | Yes | n |
For those rotations that keep the original, there is an optional origin of rotation. The default is the bottom right of the canvas. Allowable values are any of diagonal directions.
The amount of rotation (in 45° increments) is optional. The default is 2, i.e. 90° anticlockwise (counterclockwise). For those rotations that keep the original, there are two alternative options: a multidigit integer specifies to rotate the canvas once for each digit and then merge the results, while an integer list simply repeats the command for each rotation, with variable results depending on how the canvas changes in between.