ScriptSpot

Forum topic · Scripts Wanted

Script needed - draw spline beween 2 dummies

By erniesbot · 2010-07-05

Description

Hi Chaps,

I am working on a project that requires the creation of hundreds of pylon towers, and am looking for a efficient method of linking wires between them.

This may be asking a bit much but ideally i want a script that:

Can draw a spline between 2 selected dummies, create a vertex in the centre of the spline and drop that vertex down in the Z axis by an amount based upon the distance beween to 2 points. So quite a lot really

Can anyone point me in the direction of a similar script, or one i may be able to modify to suit requirments?

Many thanks.

Comments (4)

draw spline beween 2 dummies

tommym · 2011-01-30

Hi guys,
I find this topic very interesting too, do you think by moving the said dummies
it is possible to animate accurate movements of the spline like amplitude and
rotation of a Triple Helix ?
Paul

Graph · 2010-07-06


(
	
	
	-- sinkF determines the z height of the centerPoint ;  1 = offset by pos1 and 2 distance , 0.5 = half the distance ... 
	fn makeWire pos1 pos2 sinkF:0.23 = 
	(

		local dir = normalize (pos2-pos1)
		local dist = (distance pos1 pos2)/2.0
		local pos = pos1 + dir * dist
		pos.z -= (dist*sinkF)
		
		local new_spline = splineShape ()
			addNewSpline new_spline
				addKnot new_spline 1 #smooth #curve pos1
					addKnot new_spline 1 #smooth #curve pos
				addKnot new_spline 1 #smooth #curve pos2
			updateshape new_spline
		
		return new_spline
	)
	makeWire $Sphere002.center $Sphere003.center
	
	
	
	
)

have phun

Anubis · 2010-07-05

In the MaxScript Reference has a topic

"MAXScript FAQ > How do I create a line between two points?"

that will helps you.