Hi there
Hope the question is not So crazy.
Creating a spline shape in 3ds max, using “Line”
when we choose “Smooth” at both initial type & drag type at creation method.
What is the mathematical name of the created curve or spline?
I mean it is not the bezier curve
What is the mathematical name of the curve Or spline when we create in 3ds max?
it IS a bezier-curve
exactly a “Cubic Bezier Curve”
corner: in/out handle-positions are same as point position
smooth: in/out tangent are mirrored and “connected”
bezier corner: in/out tangents can be adjusted independent (not connected)
Thanks for the reply
Actually i was looking for the math behind the smooth curve as I described.
If i understand the bezier curve well.
This is a math for 6 point bezier curve
https://wikimedia.org/api/rest_v1/media/math/render/svg/61482d89a436cf5f0fd78c1d80d0b304cece69f8
and here it is my try for the bezier curve.
delete objects
myshape = Ngon radius:80 cornerRadius:0 nsides:6 circular:off scribe:1 wirecolor:yellow
convertToSplineShape myshape
ikctrl =spline_IK_control helpersize:30 linkTypes:2
addmodifier myshape ikctrl
ikctrl.createHelper (ikctrl.getKnotCount())
Total_pos = ikctrl.helper_list
delete myshape
--- the point position based on bezier curve
for i=1 to 11 do
(
t=(i-1)*.1
NewPos =
((1-t)^5)*(Total_pos[1].pos)+\
((5*t)*((1-t)^4))*(Total_pos[2].pos)+\
(10*(t^2)) * (((1-t)^3)*(Total_pos[3].pos))+\
(10*(t^3)) * (((1-t)^2)*(Total_pos[4].pos)) +\
(5*(t^4)) * ((1-t)*(Total_pos[5].pos))+ ((t^5)*(Total_pos[6].pos))
Test_pt = point pos:NewPos wirecolor:green size:10
)
But I’m looking for this yellow (spline) curve and the Red point’s positions on it without creating the spline.
Smooth_Curve= splineShape name:"wire" wirecolor:yellow --vertexTicks:on
addnewSpline Smooth_Curve
num = Total_pos.count
for i=1 to num do ( addKnot Smooth_Curve 1 #smooth #curve Total_pos[i].pos )
updateShape Smooth_Curve
--- the point position I'm looking for
for i=1 to 11 do
(
t=(i-1)*.1
NewPos = interpCurve3D Smooth_Curve 1 t
Test_pt = point pos:NewPos wirecolor:red size:10
)
you can actually create a spline without creating a scene node first
g = (dotNetClass "Autodesk.Max.GlobalInterface").Instance
KTYPE_AUTO = 0
KTYPE_CORNER = 1
KTYPE_BEZIER = 2
PARM_UNIFORM = 0
PARM_ARCLENGTH = 1
PARM_CENTRIPETAL = 2
PARM_CUSTOM = 3
sp = g.spline3d.create KTYPE_CORNER KTYPE_CORNER PARM_UNIFORM
for i = 0 to 5 do
(
k = g.SplineKnot.create()
p = [ cos (i * 60), sin (i * 60), 0 ] * 50.0
k.knot.x = p.x
k.knot.y = p.y
k.knot.z = 0
k.Ktype = KTYPE_CORNER
sp.AddKnot k -1
)
sp.SetClosed 1
-- .<Autodesk.Max.IPoint3> InterpCurve3D <System.Single>u <System.Int32>ptype
SPLINE_INTERP_SIMPLE = 0
SPLINE_INTERP_NORMALIZED = 1
delete helpers
for i = 0.0 to 1.0 by 0.025 do
(
pt = sp.InterpCurve3D i SPLINE_INTERP_SIMPLE
point pos:[ pt.x, pt.y, pt.z ] centermarker:on cross:off wirecolor:(yellow * i + red * (1.0 - i))
)
for cubic beziers you need this one
https://wikimedia.org/api/rest_v1/media/math/render/svg/504c44ca5c5f1da2b6cb1702ad9d1afa27cc1ee0
your’s is a 5th order curve, thats a complex thing
for much more info about bezier-curves and lots of math see here:
anything you need to draw, get tangents/normals, splitting/connecting, distance, whatever…