Quote Originally Posted by old man emu View Post
My question is:

Can this formula
http://paulbourke.net/geometry/torus/supertoroid3.gif

be written in a way that OpenScad can produce an object from it?
Quote Originally Posted by Mjolinor View Post
Because you can only define variables to work on primatives the only way this can be done is to define a very small sphere (or cube) and then move that through the values of x y z that you want. I will give you any shape but it will take massive processing power to do anything complex.
This is an interesting test of the powers of OpenScad. I think Mjolinor is right about it taking a lot of processing power. But I think it can be done very successfully. At the highest level, I would define a module that used a 'for' loop on n1 and n2 to send them through their range. (That way, you can generate each shape in your table up above.) I would have this module call the toriod() module that I wrote. And I would display this torroid and some suitable translate() based on n1 and n2 so I could generate the same table.

In the toriod() module I would use a nested 'for' loop to vary theta and phi over their range. I would generate a small sphere at each of the (x,y,z) coordinates that got generated from these loops. And here is the difference from what Mjolinor suggests.

All of that logic inside the toriod() module's loops would be inside a hull() statement. I think OpenScad will draw a hull around those points so you get a nice, smooth skin.