PDA

View Full Version : Have you seen an LScript with curves in all the right places?



rakker16mm
01-08-2008, 01:04 AM
I asked in the "Threads in Forum : LW - Community" about how I might be able to generate a true involute curve in modeler and Layout, but the question is a bit on the technical side and a little further into the nether regions of mathematics than most lightwave users care to delve.

http://www.newtek.com/forums/showthread.php?t=78230

It was pointed out to me that I might get a little more traction over here in the LScript Discussion forum. So here I am.

Any way to recap:

Involute curves are very useful for generating tooth profile on involute gears. They are also very handy for animation. For instance the path a tether ball follows as it swings around the tether pole is very close to an involute curve. Just add a little gravity to the mix and your cooking with gas. (http://mathworld.wolfram.com/Involute.html)

Here is another example of and involute curve: http://xahlee.org/SpecialPlaneCurves_dir/Involute_dir/involute.html

I don't know if any one finds these curves as beautiful as I do but if you are working on an LScript that generates curves I would like to hear back from you. Maybe you even have a related LScript I could take a look at. I would really appreciate any help you can give me.


PS: In addition to involute curves there are a number of other curves that are very useful and also very beautiful. Here are some examples on the web.

A Visual Dictionary of Special Plane Curves (http://xahlee.org/SpecialPlaneCurves_dir/specialPlaneCurves.html)

I am especially fond of the Equiangular Spiral (http://xahlee.org/SpecialPlaneCurves_dir/EquiangularSpiral_dir/equiangularSpiral.html), Lituus (http://xahlee.org/SpecialPlaneCurves_dir/Lituus_dir/lituus.html), Clothoid (http://xahlee.org/SpecialPlaneCurves_dir/Clothoid_dir/clothoid.html), Epicycloid and Hypocycloid (http://xahlee.org/SpecialPlaneCurves_dir/EpiHypocycloid_dir/epiHypocycloid.html).

jeremyhardin
01-08-2008, 05:06 AM
I seem to recall aurora on the forums having a math-esque lscript or plugin, but I don't remember it.

Are you wanting this to be a modeler script, or motion, or render, or what?

rakker16mm
01-08-2008, 12:25 PM
I seem to recall aurora on the forums having a math-esque lscript or plugin, but I don't remember it.

Are you wanting this to be a modeler script, or motion, or render, or what?

That's a tough question. If I had to choose I would probably pick modeler because I could still use it to create a path for Layout. On the other hand many of these 1D curves are so elegant it would be wonderful to have easy access to them in Layout.

I'm just starting to look at LScript, but it will probably be a while before I will be able to write anything this useful. I had kind of hoped some one had beaten me to it. In some ways I am a little surprised I haven't been able to find a straight forward way of doing this, but I haven't given up hope yet that the answer is hiding some where deeper in the program.

dpont
01-08-2008, 02:36 PM
You could start by studying this:
http://www.flay.com/plugs/downloads/f_Helix.zip

Denis.

rakker16mm
01-09-2008, 03:22 AM
You could start by studying this:
http://www.flay.com/plugs/downloads/f_Helix.zip

Denis.

Thank you Denis,

I took a look at the script. It seems like a good one for me to study especially since it isn't too long. I have some different ideas how I might approach generating and using the curves, but I will have to do more research before I can tell what is going to work best.

fusion2007
02-02-2008, 01:07 AM
Dpont!Thanks lot you link.

stib
02-02-2008, 10:05 PM
Thanks for that Dictionary of curves link. I'm always up for a bit of beauty and truth in my life.

Looking at that script, the bit that does the maths is very simple. Just bung in your equation of choice here:


thepoint.y += HeightInc;
radius += radiusInc;
thepoint.x = radius * cos (rad(degrees));
thepoint.z = radius * sin (rad(degrees));

You'd also have to change the requester sliders to relate to the parameters of your curve. Thats' not too hard. Look at the LScript Index (http://dodgy.ghostoutpost.com/Lscript/Lscript%20Index.html) and refer to the control commands section.

good luck with it.

rakker16mm
02-02-2008, 10:28 PM
Thanks for that Dictionary of curves link. I'm always up for a bit of beauty and truth in my life.

Looking at that script, the bit that does the maths is very simple. Just bung in your equation of choice here:


thepoint.y += HeightInc;
radius += radiusInc;
thepoint.x = radius * cos (rad(degrees));
thepoint.z = radius * sin (rad(degrees));

You'd also have to change the requester sliders to relate to the parameters of your curve. Thats' not too hard. Look at the LScript Index (http://dodgy.ghostoutpost.com/Lscript/Lscript%20Index.html) and refer to the control commands section.

good luck with it.

Thank you stib,

It is very helpful to see ht equation translated into code. I will definitely have to put it to work. I just upgraded to LW9 friday and have been playing with relativity. It looks like I may be able plug quite a few equations there as well.

Best