Notifications
Clear all

[Closed] Catenary Curves?

Has anyone looked into getting this math equation to work for creating a spline in max?

I know max creates arc’s similar to this. But not quite exactly the same as seen here?

http://en.wikipedia.org/wiki/Catenary

I’d love to be able to create ropes at the proper draping like these below.


18 Replies

Does anyone know how to get something like this working in max with a spline.

Where we could pick a start and end point, then users would input the value for weight.

Easy way


delete objects
fn makeWire posStart posEnd sink:0.25 btw:0.5 =
(
	local catenary = splineShape wirecolor:black
	local dir = normalize (posEnd - posStart)
	local dist = (distance posStart posEnd) * btw
	local posMiddle = posStart + dir * dist
	posMiddle.z -= (dist * sink)
	splKnots = #(posStart, posMiddle, posEnd)
	addNewSpline catenary 
	for i = 1 to splKnots.count do addKnot catenary 1 #smooth #curve splKnots[i]
	updateshape catenary
	catenary
)
sphArr = for i = 1 to 5 collect sphere radius:5 wirecolor:yellow pos:[(100*i-100),0,100]
while sphArr.count > 1 do
(
	makeWire sphArr[1].pos sphArr[2].pos sink:(random 0.25 1.5) btw:(random 0.2 .8) 
	deleteItem sphArr 1
)


interesting… i’ve played with it a long time ago. to generate knots with some step is not a problem. but for me will be fun to play with a math to write the Cutenary curve to the Bezier curve convertion.

1 Reply
(@gazybara)
Joined: 11 months ago

Posts: 0

the only one who knows how to implement cool math formula in mxs are you.
I withdraw aside and watch your magic.

are you sure that i will share it?

Of course, not. I’m not requested this so… show at least some interesting mind blowing example

Oh, snap!

I imagine that Denis is actually an alien prince sent here to learn about our ways and toy with our puny minds.

I’m looking around on the internet for other explanations of the math. hopefully one well enough that I can better understand it haha.

http://easycalculation.com/graphs/catenary.php

y = (a)cosh(x/a)
or
y = (a/2)
(e^x + e^(-x))

as i said the Catenary equation is transparent. the idea is to get good approximation with Bezier

Page 1 / 2