SDF, Volumes and Force Fields

You get an SDF if you subtract an offset from a distance field.

A few basic SDF’s

An SDF of a sphere does look like that …
sphere

Just plug the result to a Volume Cube node, and you will get a volume modell.

We could get a cylinder SDF from a sphere SDF. Just project input coordinates 3D to a 2D plane.

cylinder

SDF Booleans

Booleans could be realized with math nodes, using “Minimum” and “Maximum”.

Blender does offer “Smooth Minimum” and “Smooth Maximum”. They do enable smoothed Booleans.

Some SDF fun

If you add a noise texture offset to an SDF, you could get an interesting effect.

Happy Blending.

17 Likes

SDF Extrude for filled curves

An example

We could intersect extruded curves with a SDF sphere.

Intersect_with_Sphere

4 Likes

Looks very useful, thanks!

1 Like

Hi Silex, I am glad you like it.

Hey, this has some useful tips. Thanks for sharing!

Have you seen my SDF asset library? I think you would find it useful.

1 Like

Hi Zorro Weaver

I did not saw it before.
But I think I found your SDF topic.

( Edit )
I got your SDF Presets now. Will need some time, but thank you for sharing for free.

1 Like

Thanks for these tips ! it’s great !

2 Likes

No problem. If you have any interesting suggestions or contributions, let me know. We can work together!

1 Like

A node setup to create a SDF from a spline. To get it working, I had to convert it to a mesh line first.

The result …

Please note, there is “Scale by Radius gives zero?!” frame. If I enable multiply node inside this frame, the SDF spline thickness will scale to zero. A viewer node reveals that Radius values are non-zero. I am not sure what is going on here.
Do you have an idea how to access curve radius inside Spline SDF frame?

3 Likes

There is something interesting about SDF’s.

Looking at a mesh first, we could define a field which offsets whole mesh in normal direction:

MoveNormal

With a regular math-Add node we get a similar offset field for SDF. We just add a constant value to a SDF. It does act close to our “Normal Offset” from above.

This opens some interesting possibilities. Instead of a constant value we could offset a SDF with a float texture.


OffsetSDFMagic

6 Likes

Another attempt for a Curve SDF node.

The ‘Attribute Transfer’ node does not allow curves, forcing me to workaround with a ‘Curve to Points’ node.

Finally, a spline SDF which supports spline radius attribute.
The result looks like this.

High changes in slope or radius produce artifacts.

2 Likes

Slight changes on the Spline SDF nodes gave slight better results.

Playing with Curve SDF and texture offset.

6 Likes

A plane SDF

plane_sdf

Looks like this.

In this topic, offsets in normal direction have been discussed. But you also could create ‘natural’ patterns if you perturb the input position.

After input position of our Plane SDF has been perturbed like that, we get this:

This image required 1024^3 voxels. Very compute-heavy. But, you get structures difficult to create with ‘BaseMesh+Displace’ based geometry.

6 Likes

Damn, this has a lot of potential for organic modeling!

1 Like

Thank you for your positive feedback, Silex.
I love about SDF that they give max freedom from topology. Textures could help to get rid of artificial look of SDF’s.

Another attempt for a “Mesh to SDF” which ‘knows’ the difference from inside-mesh and outside-mesh.

I love our new Mix node.
Mesh to SDF and the Mix node give us a tool to blend arbitrary topology objects.

2 Likes

Leonard, I am trying to morph between two meshes, but I am new in GN. Is it possible to get your file and try to find out how you did it? For example, I see you have a group node, but I am unsure how to generate it. Where do you input your two meshes?

thank you

Try this.
sdf_morph.zip (743.8 KB)

1 Like

Hi Bruno.

With Strg+b you could create a group from node selection.

There is the node setup.
blend_sdf.blend (166.4 KB)

The first mesh is taken from the modifier-group’s Geometry input. The second mesh
is taken from the ‘Target’ input. You can set Target in the modifier stack.
blend_meshes

1 Like

Inspecting your solution. It is close. But look a bit closer at the Mix function. Actually, we blend the SDFs, not the vectors used to generate the SDF.

Happy Blending

2 Likes

What is you mix node? It shows up as “Undefined” in Blender 3.3. I guess it is a Color > MixRGB node?