implemented segments
This commit is contained in:
5
path.py
5
path.py
@@ -9,6 +9,8 @@ class Path:
|
||||
self._init_normals()
|
||||
|
||||
def _init_normals(self) -> None:
|
||||
pt0 = self.points[0]
|
||||
self.normals.append(Vec2(pt0.y, -pt0.x))
|
||||
for i in range(1, len(self.points) - 1):
|
||||
pt1 = self.points[i-1]
|
||||
pt2 = self.points[i]
|
||||
@@ -22,3 +24,6 @@ class Path:
|
||||
d = -d
|
||||
|
||||
self.normals.append(d)
|
||||
|
||||
ptl = self.points[-1]
|
||||
self.normals.append(Vec2(ptl.y, -ptl.x))
|
||||
Reference in New Issue
Block a user