# Isosurface Spiral Function

## Recommended Posts

I just discovered the Isosurface SOP, and I am especialy interrested in the "Implicit Function", easy and light way to make volumes. I looked around on the internet for different equations to add in that parameter and found some, like this one to make a torus :

(1-.15*(\$X^2+\$Y^2+\$Z^2)^2) -(1-(\$X^2 + \$Z^2))*10

But I still can't find the equation of a 3d spiral like they do with POV-ray. Maybe some of you know other function equations to use for the Isosurface, and especialy to use as spiral?

##### Share on other sites

Thanx a lot for this link of Algebraic Surfaces that works very well.

But unfortunately, I still can't find any spiral shape or any kind of vortex non-symetrical shape.

##### Share on other sites

This took me a bit of working out but the following should give you a helicoid:

\$X*tan(\$Z/ch("c"))-\$Y

with "c" being an extra parameter. "c" is very sensitive to changes so I haven't been able to make a beautiful spiral yet but a value of 0.002 should get you started.

##### Share on other sites

Just re-reading your post there. Perhaps you just want to try the snoise and turb expression.

##### Share on other sites

Marc, thanks for the link !!!

##### Share on other sites

Thanx Macha for your equation. I used it with a sin and cos function, and it works pretty well :

\$X*cos(\$Y*ch("c"))+ \$Z*sin(\$Y*ch("c"))

We could even get an helix like a screw, combining this with a tube (with "r" as the tube radius, and "R" as the helix radius, or something like that):

(\$X*cos(\$Y*ch("c"))+ \$Z*sin(\$Y*ch("c"))) * ch("r") - (\$X^2 + \$Z^2)-ch("R")

But still, it is not exactly the spiral shape i was looking for, and I still can't find it (see attached picture)

##### Share on other sites

Haven't gotten the spiral yet but I thought this was cute.

((\$X^2 + \$Y^2 - 1)^2 + \$Z^2)*((\$Y^2 + \$Z^2 - 1)^2 + \$X^2)*((\$Z^2 + \$X^2 - 1)^2 + \$Y^2) - ch("ff")^2*(1 + ch("bb")*(\$X^2 + \$Y^2 + \$Z^2))

Keep 'em coming!

Matt.

##### Share on other sites

Sorry, I'm getting a bit carried away with this, , but I noticed that we can add and position new objects within the expression.

Whereas the previous one was copy-stamped this one isn't. Once we have an object we can add a new one by multuplying it, and position it by offsetting the x,y,z, and scaling it by adding a float. Like so:

((2*(\$X+.5)^4 + 2*\$Y^4 + 2*\$Z^4 - 0.2)*

(2*(\$X-.5)^4 + 2*\$Y^4 + 2*\$Z^4 - 0.2))*

(2*(0.5-\$X)^4 + 2*(1.1+\$Y)^4 + 2*\$Z^4 - 0.2)*

(2*(0.5-\$X)^4 + 2*(\$Y)^4 + 2*(1+\$Z)^4 - 0.2)*

(2*(0.6-\$X)^6 + 2*(1.2+\$Y)^6 + 2*(1.1+\$Z)^6 - 0.02)*

(2*(0.5+\$X)^4 + 2*(1.1+\$Y)^4 + 2*(\$Z)^4 - 0.2)*

(2*(0.5+\$X)^4 + 2*(1.1+\$Y)^4 + 2*(1+\$Z)^4 - 0.2)*

(2*(0.5+\$X)^2 + 2*(\$Y)^2 + 2*(1+\$Z)^2 - 0.5)*

(2*(0.35-\$X)^2 + 2*(1-\$Y)^2 + 2*(0.7+\$Z)^2 - 0.5)

It is conceivable that we could write a script that automates such things.

Completely useless of course.

##### Share on other sites

It seems that the net is pretty much devoid of spirals like this. The reason, I believe, is that most of the equations generating such surfaces are algebraic equations, meaning they can only contain polynomials with integer exponents. So, functions like sin and cos are in the strict sense not allowed. However, that does not mean spirals are impossible. If you can use functions other than those made of polynomials (and Houdini can) then it is possible. It's just that there's not much of it around on the net.

On the other hand, you can make a series expansion to the desired degree of precision. So, like this:

(\$X*(1-(1.5*\$Z)^2/2+(1.5*\$Z)^4/24-(1.5*\$Z)^6/720+(1.5*\$Z)^8/40320-(1.5*\$Z)^10/3628800)+\$Y*((1.5*\$Z)-(1.5*\$Z)^3/6+(1.5*\$Z)^5/120-(1.5*\$Z)^7/5040+(1.5*\$Z)^9/362880-(1.5*\$Z)^11/39916800))^2*(\$X^2+\$Y^2-1)*(\$X^2+\$Y^2-6)+16

Edited by Macha

##### Share on other sites

wonderfull thread, and experiments, could you put that complex equations in a file, to give an idea of the correct usage?

##### Share on other sites

wonderfull thread, and experiments, could you put that complex equations in a file, to give an idea of the correct usage?

Copy-paste it into the isosurface sop. Sometimes you need to adjust the bounding values and up the res.

##### Share on other sites

This one generates a spiral. However, the crossections don't sweep properly with the curve (always parallel to one axis) (Apparently this is a hard mathematical problem to solve)

pow(\$X-ch("r2")*sin(ch("o")*\$Z),ch("n")) +

pow(\$Y-ch("r2")*cos(ch("o")*\$Z),ch("n"))-

pow(ch("r1"),ch("n"))

with n=2, r1= 0.2, r2 = 0.4

##### Share on other sites

And here some pointless implicit isosurface equation madness!

It consists of a helix, a sheared and twisted torus, and some other undefined stuff, as well as scaling, moving,union and intersect of those objects.

min(min( (( (\$X+ch("xoff"))^2 + ((\$X+ch("xoff")) + (((\$Y-ch("zoff"))^2 + (\$Z-ch("zoff"))^2)^0.5) * ch("s"))^2 + (\$Z-ch("zoff"))^2 + (ch("r2")^2)-ch("r1")^2)^2 -

(4*ch("r2")^2)*((\$X+ch("xoff"))^2+((\$X+ch("xoff")) + (((\$Y-ch("zoff"))^2 + (\$Z-ch("zoff"))^2)^0.5) * ch("s"))^2)),pow((\$X)-ch("r2")*sin(ch("o")*\$Z),ch("n")) + pow(\$Y-ch("r2")*cos(ch("o")*\$Z),ch("n"))-pow(ch("r1"),ch("n")) ),

(max(2- (cos((\$X*ch("mx")) + ch("t")*(\$Y*ch("my"))) + cos((\$X*ch("mx")) - ch("t")*(\$Y*ch("my"))) + cos((\$Y*ch("my")) + ch("t")*(\$Z*ch("mz"))) + cos((\$Y*ch("my")) - ch("t")*(\$Z*ch("mz"))) + cos((\$Z*ch("mz")) - ch("t")*(\$X*ch("mx"))) + cos((\$Z*ch("mz")) + ch("t")*(\$X*ch("mx")))),(\$X*ch("mx"))^2+(\$Y*ch("my"))^2+(\$Z*ch("mz"))^2-2)))

##### Share on other sites

But I still can't find the equation of a 3d spiral like they do with POV-ray. Maybe some of you know other function equations to use for the Isosurface, and especialy to use as spiral?

I don't know about you, but I don't see why one would want to use the Isosurface SOP to create spiral. If you want a volume, then just convert a regular spiral curve into one. From this page ( http://klatte.tripod.com/pov/helix.html ), it's not even using an implicit surface in POV-Ray.

##### Share on other sites

When I try to plug this into the isosurface node I get an error "bad parameter reference "ff"" and same thing for parameter "bb"

What is causing that?

Thanks

Alex

Sorry, I'm getting a bit carried away with this, , but I noticed that we can add and position new objects within the expression.

Whereas the previous one was copy-stamped this one isn't. Once we have an object we can add a new one by multuplying it, and position it by offsetting the x,y,z, and scaling it by adding a float. Like so:

((2*(\$X+.5)^4 + 2*\$Y^4 + 2*\$Z^4 - 0.2)*

(2*(\$X-.5)^4 + 2*\$Y^4 + 2*\$Z^4 - 0.2))*

(2*(0.5-\$X)^4 + 2*(1.1+\$Y)^4 + 2*\$Z^4 - 0.2)*

(2*(0.5-\$X)^4 + 2*(\$Y)^4 + 2*(1+\$Z)^4 - 0.2)*

(2*(0.6-\$X)^6 + 2*(1.2+\$Y)^6 + 2*(1.1+\$Z)^6 - 0.02)*

(2*(0.5+\$X)^4 + 2*(1.1+\$Y)^4 + 2*(\$Z)^4 - 0.2)*

(2*(0.5+\$X)^4 + 2*(1.1+\$Y)^4 + 2*(1+\$Z)^4 - 0.2)*

(2*(0.5+\$X)^2 + 2*(\$Y)^2 + 2*(1+\$Z)^2 - 0.5)*

(2*(0.35-\$X)^2 + 2*(1-\$Y)^2 + 2*(0.7+\$Z)^2 - 0.5)

It is conceivable that we could write a script that automates such things.

Completely useless of course.

##### Share on other sites

Some of the expressions have extra parameters. You can either replace them by a float or you can go to the little gear icon and create your own parameters (called ff, and bb, etc). That way you can change values inside the expression by just using a slider.

## Create an account

Register a new account