Softimage Forum (Read Only)
Welcome to Autodesk’s Softimage Forums. Share your knowledge, ask questions, and explore popular Softimage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Parametric Formula Plugin

22 REPLIES 22
Reply
Message 1 of 23
DanCanada
2267 Views, 22 Replies

Parametric Formula Plugin

With this thread, I will explain the Parametric Formula plugin.

Motivation.

I design the plugin to fill a need for generating shapes using parametric equations found over the internet. The plugin was as much an experiment with NURBS as it was with math formula.

Installation

Download the plugin here at the Area Download section. The plugin is called, of course, Parametric Formula. The plugin was coded using Softimage 7.01 so it should work with this version up. I have not tested the script with earlier version.

Decompress the file and Install it in your plugin directory of Softimage. This is a self-install plugin, it should be detected by Softimage on startup. If not, use the plugin manager to load the plugin.

You will found the plugin in your primitive selection menu.

Math functions

When the UI open up, you will notice the default setting of the sphere primitive. The plugin is coded in JScript and most math.functions have been implemented within. You will notice that formulas don't have the math prefix. That is because the plugin is coded to accept both version such as math.cos(n) or just plain cos(n).

Also coded are new math functions such as cosh, sign, ln and several others. In my next post, I will provide tables of these math functions and parameters.

Limitations

This plugin is slow. On my low spec machine (AMD 4400 X4 Dual core), I generate complex NURBS in approximately three to four seconds with subdivisions set at 100 for both u and v. I have limited the u and v subdiv to a maximum of 1000 (that is 1,000,000 Control points evaluated on 14 formulas/subformulas). If you want to stess test your machine, go ahead, but don't blame Softimage or your computer if they go on strike or worst, stand up and walk off your desk in protest.

The plugin does not include a complex number function. So if you provide formula that generate complex number such as sqrt(-1), you will not see a nurbs surface on screen or in the quick render. Some formulas can be made to remain within the real domain by restricting the u min, u max, v min and v max. Check the kiss surface preset for an example where v max was restricted to less than 1 to prevent the formula to calculate imaginary numbers.

The plugin create one Nurbs surface. If you need to generate multiple surfaces, you will have to generate the object in piecemeal or, if you are a programmer, modify the code to feed the nurbs count of AddNurbsSurfaceMesh2.

Be aware that the plugin will create self-intersecting surfaces, non-manifold and internal control points, edge and polys. Softimage and Mental Ray will throw warning during render, but so far, it has provided good render for me.

Your render will show a nasty seam, that it because I have coded the surface to overlap control points in order to close the surface. You can avoid the seam if you generate the surface with linear degree, or use the nurbs to mesh to convert it to poly (work sometime).

Presets

I have provided approximately 121 presets with the plugin, open them up and check them all to see how to enter formulas and generate nurbs and meshes. Don't forget to lock the UI if you want to experiment. Start with the plane and simple formulas like the saddle.

Because you are working with Nurbs, you will notice the x, y, z, and w in the interface. The w parameter control the weight influence of that control point on the nurbs surface. In most cases you will leave the value to it's default of 1. One preset for the sphere has an example where I fed the w with a sine function. The result was a slicing of the sphere. The w is an interesting twist in generating parametric equations.

So have fun with NURBS, mathematics and parametric formulas in Softimage!

Cheers!

Dan
22 REPLIES 22
Message 2 of 23
Leendert68
in reply to: DanCanada

Nice...
Might be a good idea to mention that the download can be found in the download section here @ the Area...
Message 3 of 23
DanCanada
in reply to: Leendert68

Thanks Hirazi Blue. I have corrected my earlier text. Cheers!

Dan
Message 4 of 23
DanCanada
in reply to: DanCanada

Here is a quick view of the UI.

Message 5 of 23
DanCanada
in reply to: DanCanada

And of the presets

Message 6 of 23
DanCanada
in reply to: DanCanada

In my last post I talked about the math equation that this plugin can use.

The plugin is coded in Jscript. Jscript comes with its own mathematical functions and constants. You write them as follows

Math.constant
Math.function( )

But writing Math. is not intuitive, so I programmed small functions to take care of this. The plugin will still take the Math. form if you so desire.

By convention, Jscript constants are capitalized. Below is a table with the various functions:

Message 7 of 23
DanCanada
in reply to: DanCanada

The JScript Math Functions and .....

Message 8 of 23
DanCanada
in reply to: DanCanada

Expended functions

Message 9 of 23
DanCanada
in reply to: DanCanada

You write a function like so

pow((c1*c2),2)+sin(c3)


in the interface. when ready, press the button to create your nurbs and see the result in the viewport.

Look at some presets first to see how its done.

Good luck!

Dan
Message 10 of 23
DanCanada
in reply to: DanCanada

A few shapes created from the provided presets to wet your appetite!

Message 11 of 23
DanCanada
in reply to: DanCanada

Experimenting with the superformula. You can find the formula on Paul Bourke website at

http://local.wasp.uwa.edu.au/~pbourke/geometry/supershape3d/

Message 12 of 23
Leendert68
in reply to: DanCanada

Wouldn't it be a good idea to package some (if not all) of the info on this page in some kind of extended readme file included in the rar-archive?
Message 13 of 23
DanCanada
in reply to: Leendert68

That is my intention, I am already working on a simple parametric formula primer to go with the next version. The thread is to get people up to speed with the plugin.

Good site to go for formulas to try:

Paul Bourke website at:

http://local.wasp.uwa.edu.au/~pbourke/geometry/

POVRay website at:

http://www.econym.demon.co.uk/isotut/parametric.htm

Wolfram MathWorld at:

http://mathworld.wolfram.com/topics/Geometry.html

and

Bruce Puckett website at:

http://krypton.fhda.edu/~bpuckett/gallery/parametric/parametric.index

Dan

P.S. Thank You Hirazi Blue for the announcement on si-community!
Message 14 of 23
DanCanada
in reply to: DanCanada

In his website, Paul Bourke provides an interesting formula called the SuperEllipse

Transformed to Softimage Parametric_Formula it is:

x = sign(cos(u)) * pow(abs(cos(u)),c1) * sign(cos(v)) * pow(abs(cos(v)),c6)
y = sign(sin(u)) * pow(abs(sin(u)),c1)
z = sign(cos(u)) * pow(abs(cos(u)),c1) * sign(sin(v)) * pow(abs(sin(v)),c6)

bounded by u from 0 to 2*PI and v from 0 to PI


For c1 between 0.2 and 3 and for c6 between 0.2 and 3, we get quite interesting shapes.

Here some examples. Try It!

Message 15 of 23
Anonymous
in reply to: DanCanada

That seems pretty good to me and I hope you will keep up the good work in future as well.
Message 16 of 23
DanCanada
in reply to: Anonymous

Thank you Nensi.

I have had to stop working on the plugin for a bit due to higher work priorities but things are slowing down now that I can go back to it.

Future work includes:

a. New create mesh button to create a polygon mesh instead of converting nurbs to mesh.
b. Automatic UV for mesh
c. Optimization of the plugin
d. Implicit formulas
e. Help file

f. Maybe even try to use ICE to create the shapes (that would be interesting, got some ideas a la Grasshopper/Rhino but I need to dig very deep on that one, I don't take "you can't do it" for an answer)

I have generated some interesting seashell shapes. I will put the formulas up soon.

Cheers!
Message 17 of 23
Anonymous
in reply to: DanCanada

Thanks for sharing this.
Message 18 of 23
Anonymous
in reply to: DanCanada

You eliminate theta.
cos theta = x + 4
sin theta = y - 1
But cos^T + sin^2T = 1
Equation of circle is (x + 4)^2 + (y - 1)^2 = 1
Message 19 of 23
DanCanada
in reply to: DanCanada

Hi XBox360

What is your question?

BTW cos^2T + sin^2T = 1 therefore

(x+4)^2+(y-1)^2=1 will be the unit circle centered at position (-4,1)
Message 20 of 23
DanCanada
in reply to: DanCanada

Seashell formula experiments with PFormula.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report