Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Possible problem in bezier_path.py

It seems that the path that is stored by BezierPath is not correct.

Let

p2d = [[(3.0,0.0),(3.0,0.13),(2.94,0.25),(2.8,0.35)],
  [(2.7,0.44),(2.6,0.5),(2.5,0.5)],
  [(2.36,0.5),(2.24,0.44),(2.14,0.35)],
  [(2.05,0.25),(2.0,0.13),(2.0,6.1e-17)]]

then

bezier_path(p2d)[0].path

is different than the given path p2d. There are several consequences to this, for example, the stored path cannot be fed again to bezier_path, so this won't work (results in weird errors):

bezier_path(bezier_path(p2d)[0].path)

and also affects the plot3d method of the class.

The issue seems to stem from line 64 of bezier_path.py:

vertices = self.path[0]

Since the list of vertices changes size after the line so does self.path. I believe the line should be

vertices = deepcopy(self.path[0])

Possible problem in bezier_path.py

It seems that the path that is stored by BezierPath is not correct.

Let

p2d = [[(3.0,0.0),(3.0,0.13),(2.94,0.25),(2.8,0.35)],
  [(2.7,0.44),(2.6,0.5),(2.5,0.5)],
  [(2.36,0.5),(2.24,0.44),(2.14,0.35)],
  [(2.05,0.25),(2.0,0.13),(2.0,6.1e-17)]]

then

bezier_path(p2d)[0].path

is different than the given path p2d. There are several consequences to this, for example, the stored path cannot be fed again to bezier_path, so this won't work (results in weird errors):

bezier_path(bezier_path(p2d)[0].path)

and also affects the plot3d method of the class.

The issue seems to stem from line 64 of bezier_path.py:

vertices = self.path[0]

Since the list of vertices changes size after the line so does self.path. I believe the line should be

vertices = deepcopy(self.path[0])