Commit 6e87e1e4 authored by lars.quentin's avatar lars.quentin 💬
Browse files

init_func actually doesnt need a parameter

parent e36e65e4
......@@ -145,20 +145,15 @@ class AbstractBezierCurve(ABC):
self._bezier_points = m
self._dimension = self._bezier_points.shape[0]
self._cnt_ts = cnt_ts
self.func = self.init_func(m)
self.func = self.init_func()
self._curve = None
self.box = []
@abstractmethod
def init_func(self, m: np.ndarray) -> Callable:
def init_func(self) -> Callable:
"""
Method returns the function to calculate all values at once.
Parameters
----------
m: np.ndarray:
array containing the Bezier Points
Returns
-------
Callable:
......@@ -362,22 +357,17 @@ class BezierCurve(AbstractBezierCurve):
see AbstractBezierCurve
"""
def init_func(self, m: np.ndarray) -> Callable:
def init_func(self) -> Callable:
"""
Method returns the function to calculate all values at once.
Parameters
----------
m: np.ndarray:
array containing the Bezier Points
Returns
-------
Callable:
function representing the Bezier Curve
"""
_, n = m.shape
m = sy.Matrix(m)
_, n = self._bezier_points.shape
m = sy.Matrix(self._bezier_points)
t = sy.symbols('t')
for r in range(n):
m[:, :(n - r - 1)] = (1 - t) * m[:, :(n - r - 1)] + t * m[:, 1:(n - r)]
......@@ -398,15 +388,10 @@ class BezierCurveThreaded(AbstractBezierCurve):
see AbstractBezierCurve
"""
def init_func(self, m: np.ndarray) -> Callable:
def init_func(self) -> Callable:
"""
Method returns the function to calculate all values at once.
Parameters
----------
m: np.ndarray:
array containing the Bezier Points
Returns
-------
Callable:
......@@ -448,9 +433,9 @@ class BezierCurveThreaded(AbstractBezierCurve):
def init() -> None:
m = csv_read('test.csv') # reads csv file with bezier points
b1 = BezierCurve(m)
m = csv_read('test2.csv') # reads csv file with bezier points
b2 = BezierCurve(m)
b2.show_funcs([b1])
b2 = BezierCurveThreaded(m)
b1.show_funcs()
b2.show_funcs()
if __name__ == "__main__":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment