INNER CODE UNIT · Python

_qCurveToOne

varunsalian/debrify · dev/launch_animations/generate_recreations.py:43

    def _qCurveToOne(self, control, end):
        start = self._getCurrentPoint()
        a = tuple(start[i]+(control[i]-start[i])*2/3 for i in (0, 1))
        b = tuple(end[i]+(control[i]-end[i])*2/3 for i in (0, 1))
        self._curveToOne(a, b, end)
    def _closePath(self):
        if len(self.v)>1 and self.v[-1] == self.v[0]:
            self.ins[0] = self.ins.pop(); self.v.pop(); self.outs.pop()
        self.paths.append({'ty': 'sh', 'ks': prop({'v': self.v, 'i': self.ins, 'o': self.outs, 'c': True})})
    def _endPath(self): self._closePath()

class Artwork:
    def __init__(self, name, w, h, duration, background, text):
        self.name, self.w, self.h, self.text = name, w, h, text
        self.frames = round(duration*FPS)
        self.background = background
        self.layers, self.assets = [], []
        self.index = 0

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…