[Bf-python] Some questions on 2.28 documents
Stephen Swaney
sswaney at swbell.net
Sat Aug 30 19:45:06 CEST 2003
Tatsuya Nakamura wrote:
> Followings are my questions list:
> 1-a) Curve class "getControlPoint"
> Now I explain all of my questions.:
> 1) Curve class
[snip]
> 1-a) About "getControlPoint" method. The document says
> "Returns depends upon the curve's type,
> type bezier : a list of three coordinates,
> type nurbs : a list of nine coordinates."
>
> I made a test script like this.:
> >> from Blender import Curve
> >> # Get a Bezier Curve in current scene
> >> c = Curve.Get('Curve')
> >> print c.getControlPoint(0,0)
> >> print c.getControlPoint(0,1)
> >> # Get a Nurbs Curve in current scene
> >> c1 = Curve.Get('Curve.001')
> >> print c1.getControlPoint(0,0)
> >> print c1.getControlPoint(0,1)
> >> print c1.getControlPoint(0,2)
> >> print c1.getControlPoint(0,3)
> (Before run this script, you need to put a Bezier Curve and a Nurbs Curve
> in current scene.)
> And the result of this script are like this.:
> >> [<nil>, <nil>, <nil>, <nil>, <nil>, <nil>, <nil>, <nil>, <nil>,
> -1.5, -0.5, 0.0, -1.0, 0.0, 0.0, -0.5, 0.5, 0.0]
> >> [<nil>, <nil>, <nil>, <nil>, <nil>, <nil>, <nil>, <nil>, <nil>, 0.0,
> 0.0, 0.0, 1.0, 0.0, 0.0, 2.0, 0.0, 0.0]
> >> [-1.5, 0.0, 0.0, 1.0]
> >> [-1.0, 1.0, 0.0, 1.0]
> >> [1.0, 1.0, 0.0, 1.0]
> >> [1.5, 0.0, 0.0, 1.0]
> The first two lines are for the points on the Bezier and the next four lines
> are for the Nurbs. It seems that these results are different from what the
> document says. Does any one explain the result about it? I attached my
> test blend file (sampleCurves01.blend) which includes my script to this
> mail.
>
Tatsuya-san:
The 9 nil values returned at the front of the list for a Bezier curve
was the result of a bug. A patch to fix this was submitted to the
bf-python list.
The correct return is 9 values: x,y,z coords for the 3 vertices that make
up a bezier control point ( 3 coords x 3 points = 9 vals )
For a bezier curve you get 9 values: the 'control point' and its two handles.
For a nurb, you get 4 values. These are homogenous coordinates for the
control point.
Stephen
--
Stephen Swaney
sswaney at swbell.net
More information about the Bf-python
mailing list