Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem with plotting a 3d Bezier curve

I have a problem with plotting a Bezier spline in 3d.

In 2d this simply works:

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)]]

bezier_path(p2d)

But when I want to plot it in 3d, this line

bezier_path(p2d).plot3d()

or

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

bezier3d(p3d)

both give me the following error: TypeError: unable to convert -(t - 1)^3 to an integer.

What am I doing wrong?

Problem with plotting a 3d Bezier curve

I have a problem with plotting a Bezier spline in 3d.

In 2d this simply works:

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)]]

bezier_path(p2d)

But when I want to plot it in 3d, this line

bezier_path(p2d).plot3d()

or

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

bezier3d(p3d)

both give me the following error: TypeError: unable to convert -(t - 1)^3 to an integer.

What am I doing wrong?