mirror of
https://github.com/Ikatono/Bezier.git
synced 2025-10-28 20:45:33 -05:00
finished??
This commit is contained in:
@@ -3,7 +3,7 @@ from math import factorial as fact
|
|||||||
class Bezier:
|
class Bezier:
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
if len(args) == 1:
|
if len(args) == 1:
|
||||||
inp = list(args)
|
inp = list(args[0])
|
||||||
self.x = [i[0] for i in inp]
|
self.x = [i[0] for i in inp]
|
||||||
self.y = [i[1] for i in inp]
|
self.y = [i[1] for i in inp]
|
||||||
if len(args) == 2:
|
if len(args) == 2:
|
||||||
@@ -54,6 +54,8 @@ class Bezier:
|
|||||||
pnts = [self[i] for i in stepper(start, stop, step)]
|
pnts = [self[i] for i in stepper(start, stop, step)]
|
||||||
return [[i[0] for i in pnts], [i[1] for i in pnts]]
|
return [[i[0] for i in pnts], [i[1] for i in pnts]]
|
||||||
else:
|
else:
|
||||||
|
if not (0 <= t <= 1):
|
||||||
|
raise ValueError('t value must be in range [0, 1]')
|
||||||
n = len(self.x) - 1
|
n = len(self.x) - 1
|
||||||
x = 0
|
x = 0
|
||||||
y = 0
|
y = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user