Collection of mostly command line tools / PHP scripts. Somewhat out of date.

⌈⌋ ⎇ branch:  scripts + snippets


Artifact [2e21c72cc9]

Artifact 2e21c72cc9ff03128771f990ec6f3471fa7e0a7c:

  • File inkscape/test/t.py — part of check-in [58300ed51a] at 2022-10-23 20:02:22 on branch trunk — implement repeatCount, some tests (user: mario size: 577)

# t: t
# title: calcmodespline


def _map(r_time, steps=[0.0, 0.5]):
    """ only linear [0, 0.33, 0.66, 1.0] here, values=[] would require interpretation in handlers """
    dist = 1.0 / len(steps)  # 0.25 for len=4
    offs = int(r_time * len(steps))   # 0.30 → map [1]
    steps = steps[:] + [1.0, 1.0]
    val_diff = steps[offs+1] - steps[offs] # 0.33-0.25
    off_diff = (r_time - dist * offs) / dist # offset [2]+0.1 to quantify value
    return steps[offs] + val_diff * off_diff

def test_map_calcmode_spline():
    for r in range(0, 21):
        print(_map(r/20.0))