#### Topic: Implicit Revisited

Hi.

A recent discussion here touched on the subject of the Procedural Implicit Objects. Actually I did not realize that the plugin was still/again working, but I began to feel that I had some 'unfinished business with those, so decided to give them a new try.

(And for reasons, that don't need to be repeated here again, I ended up doing these on AoI 2.4.1)

Then to work!

At first I had no idea what to do ... I only got some occasional faint shadows showing up in the object preview window, telling at least that something was happening, but I did not quite understand what, until I connected a Polar transformation to the Value-output.

And there we go: A hole through the Universe:

This was a kind of unexpected but as there obviously was a circle with radius of 1 unit there, it occurred to me to try the right right side of the equation of circle ... So I unplugged the the Polar and connected the expression to the output.

Of course it should be **sqrt(x*x+y*y)**, but forgetting the square root did not matter as the radius happened to be 1.

The next thing to do was to figure out, where that radius is defined.

On the graphic procedural windows you rarely need to check what is behind the **Edit-menu**, but In the case of PIO it is actually very essential, so there it was: **The properties**.

So the X, Y and Z match the size of the cube and the Cutoff matches the radius of the hole. Even more importantly, where the output value is greater than than the cutoff value, there is material. Otherwise not. The surface of the object is then where the expression equals the cutoff value. What really was happening was:

**1.0 = sqrt(x^2 + y^2)**

Well.... Handling equations 'naturally' is a bit clumsy if you have to worry about the hidden constant value on the left side, so I changed the **Cutoff to 0.0** and rewrote the expression into:

**sqrt(x^2 + y^2) - 1.0**

-- and the hole was still there.

As you might think, a hole as such is not yet a very useful object. To the least, the material side needed to be changed. That turned out to surprisingly easy: I just turned the above expression negative:

**- sqrt(x^2 + y^2) + 1.0**

And here we have a cylinder:

And adding the z-factor makes it a sphere!

**- sqrt(x^2 + y^2 + z^2) + 1.0**

Of course multiplying the x, y and z factors by numbers would make it an ellipsoid. -- No pictures of those experiments available....

Then I decided to give a try to a parabola: At first the basic equation needed to be changed to be all on one side:

**y = x^2**

---> **0.0 = x^2 - y**

where **0.0 is the Cutoff value in the Properties**. -- The rest is, what you'd type into the Expression module.

And yes! -- The cube was cut by a parabola ! -- Picture added.

Then I did a few modifications to it. First I changed it from X-Y to X-Z coordinates and flattened it by multiplying the Z by 4.0. (The easiest way of reducing the curvature of a parabola is not to go dividing the X but to multiply the projection dimension. In this case Z.)

Here I used the piece as a "2 and 1/2 - dimensional" parabolic reflector to create a caustics pattern. *The yellowish spot in the middle is a misplaced point light. Sorry for that.*

Then I took, the Y-dimension into the game. In the following, the expression is:

**x^2 + y^2 - z*4.0**

So far, so good.

Now I wanted to do a boolean with the cylinder and the parabolic form. An intersection to be exact.

It would seem logical to use operators like Max and Min to combine the volumes that are created by expressions, but that turned out to be a little more complex. For example the Max-operator seems to make a union of two volumes, but the surface looks just weird.

The correct way of making booleans is to multiply the expressions by each other. Just multiplying the cylinder with the parabolic cave produces this:

What happens is that

- there is material, where both expression are positive.

- there is not material where one of them is positive and one negative.

- there is again material, where both are negative.

Now, to get rid of the last portion, it needs to be multiplied by another negative value. For that we'd need the **sign **function, but that was not available in the procedural math (or if it is, let me know!) To obtain the sign the expressions needs to be divided by its absolute value.

I'll skip the logical contemplation about all the combinations of pluses and minuses and just put the final wiring here.

Note that the signs are filtered by the **Max **operator.

And what we have is here:

The lighting conditions do not do justice to it ... Here is an attempt to create a caustics pattern with it. *The same misplaced light here as above.*

It would have been really cool to make a caustics pattern into space, either by this reflector or by a lens, but unfortunately the 2.4 generation was not yet able to produce scattering with secondary rays of light (reflected from a surface or traveled through an object, that is...)

One more thing, I did with that one is, that I reduced the size of the box in the Properties:

Now as the edge of the disc is at Z=0.5, removing the empty space speeds up rendering. Though actually the Z-dimension of the box should be *a tiny bit larger* than 1.0. When it is 1.0 there are three surfaces at the edge intersecting and that makes the edge a bit noisy. If the box is a bit larger, the job is easier for the ray tracer.

One more experiment to go: Moving and resizing the volumes and making a union:

For this one I created two spheres with radius 0.5 and moved them 0.4 units up and down:

**- sqrt(x^2 + (y+0.4)^2 + z^2) + 0.5****- sqrt(x^2 + (y-0.4)^2 + z^2) + 0.5**

....and combined the like in the intersection case above. The only difference is that the signs are filtered by a **Min **operator.

And to make sure, that it really is a union, you can use the Properties box to take a slice of the very middle of it:

Yes it is!

Now there is one thing that still bothers me a bit.... I know that there is a way to combine different volumes so that they are blended together smoothly. I can't remember how that happens, but I know, I used it in the Dripping Icicle video all those years ago.

I'll add the files later. -- Got some checking up to do first. Until then: Enjoy!

EDIT 1: added missing pictures & something else small.

Edit 2: Oh -- well

*Last edited by peteihis (June 2, 2015, 11:58 pm)*

*...there's more to the picture than meets the eye...*