[Bf-committers] lattice spline interpolation

dlr13 at me.com dlr13 at me.com
Thu May 2 00:12:19 CEST 2013


Hi all.  I discussed updating the lattice spline a few months ago.  I have since done some more research and would like to propose a very simple improvement to the lattice deformer.  The current options are "Linear", "Cardinal", and "Bspline".  The Cardinal spline is set to a tension of 0.71 which can produce very wavy results when the lattice is dense.  However, if we changed the tension to 0.5, the spline becomes the popular Catmull-Rom spline and produces very nice results, results we can use here at NASA Ames to deform wings.  The Catmull-Rom spline is already being used in other parts of Blender, so it's natural to include it as an option in the lattice.

The changes to the code are extremely minor...3-4 source files.  1-2 lines in most cases, and only 12 or so more in one file with code that looks very similar to what is already there.  I can put together the patch in about an hour.

My proposal is this:

Add "Catmull-Rom" as an option for the spline interpolators in the lattice deformer.


That's it.  Quick and simple.  Doesn't alter any current functionality, it simply expands the current number of options from 3 to 4.

Can such a project be approved?  Thanks.



_____
David




On Feb 12, 2013, at 3:11 AM, Ton Roosendaal <ton at blender.org> wrote:

> Hi,
> 
> This code and the formula is like 18 years old, i'd welcome someone checking on improvements. Rather to make it really good, not just with a button to set the interplation value.
> 
> Your 'plot' didnt get through...
> 
> -Ton-
> 
> ------------------------------------------------------------------------
> Ton Roosendaal  Blender Foundation   ton at blender.org    www.blender.org
> Blender Institute   Entrepotdok 57A  1018AD Amsterdam   The Netherlands
> 
> On 11 Feb, 2013, at 23:26, dlr13 at mac.com wrote:
> 
>> Pardon me if this is the wrong list to send this to.  If so, I would appreciate someone pointing me in the right direction.  Thanks!
>> 
>> 
>> The Cardinal spline interpolation for lattices befuddles me. The tension-like variable (fc in the code) is set to 0.71, which I'm guessing is approximately 1/sqrt(2).  However, this gives very ugly and wavy results on long straight objects like an airplane wing. In fact, the slopes at the knots is just plain wrong.  However, when fc = 0.5, I get very nice cubic-spline-like behavior except at the end points where the code logic just seems to be wrong.  Nevertheless, the waviness at the knots is disconcerting in the current distribution of Blender. The plots below show what I mean.
>> 
>> 
>> 
>> 
>> Thoughts?  Any chance that fc (tension?) variable can be a parameter the user could control?
>> 
>> 
>> _____
>> David
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
> 
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers



More information about the Bf-committers mailing list