Skip to content

Presets

isotile.list_presets

list_presets() -> dict[str, str]

The names of the tiling presets and their descriptions.

isotile.list_edge_curve_presets

list_edge_curve_presets() -> dict[str, str]

The names of the edge curve presets and their descriptions.

isotile.edge_curve_preset

edge_curve_preset(
    name: str, shape: str = "J", amplitude: float = 0.1
) -> Array

Control points of a named curve on the canonical edge, with the constraint of the edge shape enforced.

The curve is built for a free (J) edge and then projected by enforce_symmetry: for U and S the first half of the curve is kept and the second half generated, so a wave on a U edge becomes two bumps and a bump on an S edge becomes a bump followed by a dent. Whether a curve gives a valid prototile depends on the type and the amplitude; test it with check_prototile.

Parameters:

  • name (str) –
  • shape (('I', 'J', 'U', 'S'), default: "I" ) –

    Edge shape; "I" returns the segment.

  • amplitude (float, default: 0.1 ) –

    Largest distance of the curve from the segment, as a fraction of the edge length.

Returns:

  • (m, 2) ndarray –

    Control points from (0, 0) to (1, 0) (21 points, or 2 for "straight" and for "I").

Raises:

  • ValueError –

    If the name or shape is unknown.

isotile.edge_curves_from_preset

edge_curves_from_preset(
    tiling_type: int | TilingType,
    name: str,
    amplitude: float = 0.1,
) -> dict[int, Array]

The curve of a preset for every shape id of a type that can be curved, as the edge_curves argument.

Parameters:

Returns:

  • dict of int to (m, 2) ndarray –

    Shape ids of J, U and S edges; empty for a type with only I edges.