How to calc. tangent of a spline point [SOLVED]
-
On 27/02/2015 at 01:30, xxxxxxxx wrote:
I have a linear spline in the shape of a triangle.
Now I want to change the interpolation of one of the points from hard to soft.
How can I calculate the "soft interpolation" tangent of that point?Note: I do not want to use the c4d "Soft Interpolation" command.
I want to calculate the tangent in that point myself.-Pim
-
On 01/03/2015 at 21:27, xxxxxxxx wrote:
Hi pgroof,
Could it be that SplineHelp.GetTangent(), which is the closest I could find when searching the help, is what you need?
Otherwise, if the commands and methods supplied by Cinema 4D are not sufficient for your needs, you'll have to figure out the mathematical formulas yourself.
Joey Gaspe
SDK Support Engineer -
On 02/03/2015 at 00:30, xxxxxxxx wrote:
Thanks, SplineHelp will do.
-Pim
-
On 02/03/2015 at 11:17, xxxxxxxx wrote:
Hi Pim,
Thanks for letting me know, I'll close the topic as solved. I had to truncate the name to fit in the solved tag.
Joey Gaspe
SDK Support Engineer -
On 03/03/2015 at 03:26, xxxxxxxx wrote:
Hi Pim,
I had this one in my script collection,
if you want to calc it by your own to have more flexibility:#_______________________________________________________ #Soft interpolation lenRight = (pointList[i+1] - pointList[i]).GetLength() lenLeft = (pointList[i-1] - pointList[i]).GetLength() lenAverage = (lenLeft + lenRight)/2 if lenAverage > lenRight: lenAverage = lenRight elif lenAverage > lenLeft: lenAverage = lenLeft orientation = (pointList[i+1] - pointList[i-1]).GetNormalized() tangent = orientation * lenAverage / 4 spline.SetTangent(i, -tangent, tangent)
Best wishes
Martin -
On 03/03/2015 at 03:34, xxxxxxxx wrote:
Thanks Martin.
Indeed it gives me more functionality.-Pim