[Bf-committers] curves/surfaces/NURBS

Jonathan Merritt j.merritt at pgrad.unimelb.edu.au
Tue Jul 5 01:55:23 CEST 2005


Hi Emmanuel,

Emmanuel Stone wrote:

>At this point, before I get started on the coding, I thought it would
>be a good idea to ask for people's suggestions for the design of this
>project. I am new to Blender's codebase (and Nurbana's) and even
>though I am familiar with parametric curves and surfaces I feel that I
>don't have enough knowledge (yet) of Blender's internals to design
>this entirely on my own.
>
>Suggestions as to how to approach the implementation of this project
>would be much appreciated.
>  
>

I'm surprised you haven't been innundated with replies, so I thought I'd
offer a few thoughts.  Bear in mind that Ton is the super-guru here, so
always follow his directions if they differ from mine! :-)

Firstly there are book-keeping issues; do you have Nurbana compiled? 
Can you link it OK during a build of the rest of Blender?  I remember
you mentioned having some problems with this early on.

I would begin by actually using Blender's NURBS for a while.  Learn
about the sort of manipulations you can do with them in edit mode, and
spend a bit of time figuring out how all that relates back to the
underlying code.  This will help you to learn about not only the code,
but also about the limitations and strengths of the existing system
(which is pretty simple, so it shouldn't take long! :-).  I've found
that "instrumenting" Blender's functions with printf() calls, then using
the program and examining the log of output is a wonderful way to
confirm how things are working.  If you're using Linux/Unix in the
absence of an IDE, then grep will quickly become your best friend in
finding functions and structs and building up a map of what's going on.

Once you understand how Blender is working with NURBS, the next thing to
look at would be the compatability between Blender's parametric surfaces
and those in Nurbana.  Are NURBS surfaces represented in the same way in
the two programs?  Is there going to be difficulty in converting
back-and-forth in your C wrapper?  If so, can Blender's representation
be changed to simplify the process?  One of the complicating factors
here might be the apparent co-existence of curves (1D) and surfaces (2D)
in the same place in many spots in Blender's code.  I haven't looked
into this in detail, but I personally found it a bit confusing.

By the time you're familiar with how Blender and Nurbana internally
handle everything, you should probably have a few ideas about a road-map
for replacing the existing functionality.  Something to think about now
is workflow.  Blender has a very "shallow" workflow for *mesh*
datablocks (ie: no object history, modifiers, etc.).  Is this
appropriate for NURBS?  I tend to think that some kind of object history
for parametric surfaces is a Good Thing (TM).  However, a shallow
workflow for NURBS does work well in Rhino, for example, and is more
Blender-esque.

I hope the above helps.  I've found that familiarity with Blender's code
*is* a bit of an impediment... I'd like to see modules with a couple of
pages of comments at the start explaning how everything links together,
and full docs for each function.  The only way around this is really
just to jump in there and start tinkering.  You have a nice playground
in the SoC tree, so just go nuts! :-)

Jonathan Merritt.



More information about the Bf-committers mailing list