088 isosurface new python syntax...

HI all, are there some descriptions of how to form functions correctly for the isosurface SOP in 088?

the default sphere is now me.curPos[0] * me.curPos[0] + me.curPos[1] * me.curPos[1] + me.curPos[2] * me.curPos[2] - 1

but I can’t figure out how to make say, what would’ve been noise($X,$Y,$Z) in days of yore.

any clues to get me started? (apart form a week at codeacademy of course)

rod.

So,trying to answer my own question, I searched for curPos in the wiki and got to the isosurface class page…

derivative.ca/wiki088/index. … eSOP_Class

so curPos is a member of the isosurface class

I’m still not sure how I get from the old $X2 + $Y2 + $Z2 to the python version…
me.curPos[0] * me.curPos[0] + me.curPos[1] * me.curPos[1] + me.curPos[2] * me.curPos[2] - 1

also, here is another place I’m looking…

derivative.ca/wiki088/index. … _in_Python

I’m still at a loss as to how I can pythonize the noise ($X,$Y,$Z) expression or, more generally, translate any or the existing Touch expressions into python form.

As usual, the documentation needs a lot of love but it’s early days yet of course.

any clues as to where I should go next?

rod.

The beginnings of a RFE here…

imagine that you put down an Iso surface SOP, switch its parameter mode to t-script, type in
$X*$X + $Y*$Y + $Z*$Z - 1 then switch the parameter mode to Py.

and the expression automagically changes to me.curPos[0] * me.curPos[0] + me.curPos[1] * me.curPos[1] + me.curPos[2] * me.curPos[2] - 1

okay, it already does with this default expression but imagine if noise($X,$Y,$Z) changed to its python equivalent? yeah, I know, that would take some time.

we really do need a table of the python equivalent to each expression though and pretty soon - or a method for deriving one from the other.

r.

I’ve started that page here:
derivative.ca/wiki088/index. … quivalents

not finished yet though. I don’t think there is a noise(x,y,z) equivalent yet.

Thanks Malcolm,

should I be importing a noise function from a library such as numPy etc.?

rod.

hello,

i’m messing around with the iso surface SOP. i’ve found some great tutorials like this one:

econym.demon.co.uk/isotut/index.htm

is it possible to combine two or more functions in a single line?

or- is it possible to evaluate a multi line python script located elsewhere, like as a text DAT, within the “func” parameter? something like a glsl mat, where we could write a longer script to be evaluated.

Yes.
You can always make a call from the parameters to a function in a DAT making use of the mod object.

derivative.ca/wiki088/index. … _On_Demand

Here’s an simple attached example, with an animated variable.

Also note, that any expression errors cause the SOP to be painfully slow.
Ive just fixed that for the next upcoming build.

Cheers
Rob.
iso.tox (662 Bytes)

that. is. super. rad.

exactly what i was looking for!

BTW if anybody’s looking for great isosurface resources for beginners- check out:

k3dsurf.sourceforge.net
imaginary.org/program/surfer

the code generated by these programs works fine in Touch Designer.

Until the next release, may be best to start with 5x5x5 divisions while editing, and then upping the resolution once its done.

Ps. Great links!