ScriptSpot

Script

SpiroTube

By brttd · 2013-06-04

Version
1.5
Version requirement
2008
Date updated
2013-10-02
Votes
8
Description

Creates a cylindrical mesh, created around a series of X, Y and Z positions which are defined by 3 different functions. The functions can be easily changed using 7 variables (Segments, M, N, P, Q, H and T) which are all spinners.

There is a editor to more easily view and edit the functions, and a preset editor, which allows you to save settings for later use.

The mesh can be manipulated, with twisting and scaling of the radius (The radius can be changed using a regular, distance, or custom function. The tube can be rotated and twisted (with a bias)).

A Spline can be created following the same functions.

Thanks to:
www.blitzbasic.com/Community/posts.php?topic=57616
For the function to rotate one vector around another.
And:
www.mi.sanu.ac.rs/vismath/taylor2009/index.html
For the basic idea, and presets.

Additional Info

Installation... Copy the file to "C:\Program Files\Autodesk\3ds Max 20??\scripts\Startup\SpiroTube.ms". (Re)launch 3DS Max.

Updates:

V1.5 Rewrote. Presets and preset editor changed. Distance option added for radius change. Radius change now has a overall effect value, and the option to use none of the 3 options. Editor for functions added. Removed closet face option. Moved plugin to "Extended primitives" section.

V1.0 Added option to use the closet edge for the faces connecting start/end, when using twist this can fix twisted faces at the end. Changed a few other things.

V0.95 Added preset saver, and editor.

V0.9 Bias now works with negative values. when re-loading a scene, the selected preset doesnt change values. Added boxes(colorpickers) to each side of the x,y,z positions, to notify user of errors within the functions. Video below is not up to date.

Videos
Attachments

Tags: edit, function, Cylinder, mesh, plugin, Scripted, math, tube, custom, spirograph, spirotube

Comments (19)

Presets

brainsgonedead · 2014-07-10

Scrap that sorry, figured it out. I just saw the convert.ms script.

Thank You :)

brttd · 2014-07-10

Ok, no problem, glad it's working.

Presets

brainsgonedead · 2014-07-10

Hi, I have 3ds Max 2009 and the latest Spirotube V1.5.ms kept saying no presets loaded on everything I did. So I have tried version 1 and that works perfectly. Just thought I'd let you know in case it doesn't work with older versions of Max.

Great scipt, thanks :)

Derp Meowslurp · 2014-03-30

1.5 on max 2014 x 64 doesn't seem to function well at all.

it creates the tube, but none of the presets work, if i try to use them it pops up saying it can't change the trig functions to integers.

playing around with the spinners doesn't seem to work either.

v.1 worked ok, but i still got good results. I did change the category from "extended primitives" to "standard primitives" though i doubt that would have any effect. maybe it did. thanks for the script

brttd · 2014-03-31

It hasn't caused any trouble for me, does it tell you the line where the error occurred (the MAXScript listener should have it)?
If you used a different version (prior to using 1.5), you will have to reset, or convert the presets (one of my comments below has a small script to do so), the error sounds like a problem with the presets, you should be able to access the editor without it complaining about the presets, and in the advanced part you can reset them.

Also, if a MAXScript error comes up, (most of the time) you have to re-run the script for (any of) it to function again, the spinners are probably not working because of this.

Derp Meowslurp · 2014-04-08

Apologies for not gettting back with you faster;

I used your reset presets tool and now everything works deliciously well.

Thanks for the help; great script :)

brttd · 2014-04-08

No problem, glad it's working :)

V1.5 update

brttd · 2013-10-02

Re-wrote it, its not much better though :P
The presets have been changed, so run the script attached if you want to convert old ones into new ones(otherwise just open the preset editor, press "advanced", and then press "reset".

If anyone has any ideas about a better bias function(I havent found anything on the internet) help would be appreciated.

Attachments

lantlant · 2013-06-17

V0.8
V0.9
these versions can work in max9 :) (no service pack)

Updated it, not anything big though :P

brttd · 2013-06-11

Updated it, not anything big, but for the moment, its finished :)
Now has the option to use the closet edge when connecting start/end(only useful when using twist).
Unless someone has a suggestion, I wont be updating this for a while, but it will (hopefully) be optimized, especially in the preset editing part.

Thanks lantlant, nice render :)
No problem, notapix :)

Hi

rezoloot · 2014-03-26

Great work all round, love the script and just out of curiosity, what settings did you use to create the jewellery on the top left of this image, fascinating

brttd · 2014-03-27

Thank you :)
If you mean the image at the top of the page, P needs to be -2, Q needs to be a odd number, and T is Q+2. N needs to be low, and the frequency of radius deformation needs to be T.
If you mean lantlant's image, you would have to ask him, but some combinations of sin and cos for the x/y function should get you something similar.

notapix · 2013-06-05

---

brttd · 2013-06-05

Thanks, I am working on a way to save/edit presets, should be done soon.

Done!
Not perfect, I will have to make a few changes to it in the future, but it works.
When saving/editing presets, you need to reload the variables rollout(deselect and re-select the object) before the list of presets updates.
If no presets are there(which is true when first loading) it gets the default ones, and uses them(these can be edited and deleted).

notapix · 2013-06-06

ok, tnk very much.

max 2008

notapix · 2013-06-05

wow
great.
script works for my max2008 32bit.
is it possible add a function "save preset"(or parameter)?

very very good work. tnk :)

Very cool.

luxxeon · 2013-06-05

Excellent script. Makes it really easy to create a lot of interesting algebraic geometry, and explore mathematical functions. Well done. Keep it up.

brttd · 2013-06-05

Thanks :)
I have made a small(ish) update.
Bias now works with negative, reloading a scene now no-longer resets the values to a preset, and there is also a notification when a function doesnt work.
Using a spline will probably never become a option, it makes it lag quite a lot, and I can see no way to make it work better :\