Script needed - draw spline beween 2 dummies

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

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tommym's picture

draw spline beween 2 dummies

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

Paul

Graph's picture

(     -- sinkF determines

(
 
 
	-- 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

Raphael Steves

Admin's picture

For those who find this via

For those who find this via search in the future - a couple solutions were posted on CG Architect thread.

http://forums.cgarchitect.com/61142-max-script-needed-draw-spline-beween...

Christopher Grant
Admin, ScriptSpot.com

Anubis's picture

In the MaxScript Reference

In the MaxScript Reference has a topic "MAXScript FAQ > How do I create a line between two points?" that will helps you.

my recent MAXScripts RSS (archive here)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.