[Bf-python] Curve API

Brent Burton brentb at io.com
Thu Mar 31 07:32:43 CEST 2005


Stephen Swaney wrote:
> On Wed, Mar 30, 2005 at 04:34:21PM -0600, Brent Burton wrote:
> 
>>Who "owns" the Curve code, [...]
> Me
> Did you have something in mind?
> 

Hi Stephen,
I have a few ideas that I'd like to bounce of you to see
if they mesh with what you envision with the Curve API.

1. Setting/Converting curve types.  This is analogous to
    the Poly/Bezier/Nurb Convert buttons in the Curve Edit
    Panel.  New methods:
      Curve.setCurveType(curveNumber, typeEnum)
      Curve.getCurveType(curveNumber) returns typeEnum
      CurNurb.setCurveType(typeEnum)
      CurNurb.getCurveType() returns typeEnum
      typeEnum = POLY, BEZIER, NURB

2. Change Curve/CurNurb.appendPoint(p) where p is a 3-list.
    If a new Curve is created with this point, the Curve is
    a Poly curve.  If p is added to an existing Bezier, the
    control point is a vector point (and handles are auto
    generated based on previous neighbor).
    For a Nurb, perhaps append a w=1.0 and add it as in the
    4-list case?

3. Set types of each control point (vector, free, auto, etc)
    for Bezier CurNurbs.
    New methods might be:
      CurNurb.getControlType(pointNumber)
      CurNurb.setControlType(pointNumber, typeEnum)
    If the CurNurb.isNurb() is true, these methods shouldn't
    do anything. (Or should they? I'm not as familiar with nurbs).


I'm primarily interested in #2.  Recently I've been using
Blender to create roads from GPS data that is in a very
simple X,Y,Z (meters) coordinate system.  Importing that into
a basic Curve object without messing with handles (i.e., a Poly
Curve or Vector Bezier) would be easy and fairly efficient.

What do you think?

-bpb




More information about the Bf-python mailing list