Skip to contents

General 3x3 space-filling curves

Usage

sfc_3x3_combined(seed, level = 0, rot = 0L, flip = FALSE)

# S4 method for sfc_3x3_combined
sfc_expand(p, code = NULL, flip = FALSE)

draw_rules_3x3_combined(flip = FALSE)

Arguments

seed

The seed sequence. In most cases, the seed sequence is a single base pattern, which can be specified as a single letter, then rot controls the initial rotation of the base pattern. It also supports a sequence with more than one base patterns as the seed sequence. In this case, it can be specified as a string of more than one base letters, then rot can be set to a single rotation scalar which controls the rotation of the first letter, or a vector with the same length as the number of base letters.

level

Level of the curve. Currently it is restricted to an integer no bigger than 5.

rot

Rotation of the seed sequence, measured in the polar coordinate system, in degrees.

flip

The same setting as in sfc_3x3_peano() or sfc_3x3_meander().

p

An sfc_3x3_combined object.

code

Ignore. The traverse codes are selected randomly.

Details

This type of 3x3 curve uses the combintation of base patterns from both the Peano curve and the Meander curve. On each level, the traverse path is randomly selected.

Examples

draw_multiple_curves(
    sfc_3x3_combined("I", level = 3),
    sfc_3x3_combined("I", level = 3),
    sfc_3x3_combined("I", level = 3),
    nrow = 1
)

draw_rules_3x3_combined()

draw_rules_3x3_combined(flip = TRUE)