Math modeling spline

Math modeling spline

Anonymous
Not applicable
688 Views
1 Reply
Message 1 of 2

Math modeling spline

Anonymous
Not applicable

Hello, can i make splines using math equations? I need a wavy spline, like an equation “y = sin x”. 

A9B09D70-EA6E-468E-ABA7-E52BDCB70F57.jpeg

0 Likes
689 Views
1 Reply
Reply (1)
Message 2 of 2

leeminardi
Mentor
Mentor

To be honest, I'm not sure if a B-spline can exactly reproduce a sine curve.  This link describes how to set B-spline control vertices to get a good fit. Unfortunately, 3ds Max does not let you easily define a spline via control vertices.

 

In the attached file I created a segmented approximate spline (the red line) with a series of vertices that are points on a sine curve at intervals of 1/8 pi. I created the sine-spline Maxscript (see below) from data generated by Excel to make the spline.

I then created a spline with 5 Bezier vertices at intervals of 1/2 pi.  The tangent handles of the 5 vertices were adjusted to approximate the spline-data points knowing the the slope of the spline at 0 and 2*pi must be the mirror of the slope at pi.

I think the resulting spline that is defined by 5 points is a pretty good fit.   You can copy it and scale it in x or y to fit your needs.

image.png

 

lee.minardi