<p>Inigo Quilez has an <a href="https://iquilezles.org/articles/distfunctions/" rel="nofollow noreferrer">explanation</a> of smooth operations to join sdfs.</p>
<p>I am trying to get something close to the convex hull of multiple sdfs. For starters let;s consider a simple case of 3 cubes int eh following configuration:</p>
<p><a href="https://i.sstatic.net/nwTGH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nwTGH.png" alt="enter image description here" /></a></p>
<p>The convex hull would be a very, very similar shape, with the exception that the region inside the l shape would be a diagonal slope.</p>
<p>I tried using smooth joining operations with a high weight, but I get this</p>
<p><a href="https://i.sstatic.net/O4sQa.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/O4sQa.png" alt="enter image description here" /></a></p>
<p>The area I expected to be filled is indeed filled, but everything else bloated up. I am trying to come up with a mathematical formula to test if a point would be inside the convex hull.</p>

CC BY-SA 4.0
2022-06-13T03:44:14.810Z
Here's a counterexample: take 2 spheres pretty close to infinitely far away. Then the cylinder between those is part of the convex hull. The CSG operations on the other hand will not reproduce it.
lightxbulb
CC BY-SA 4.0
2022-06-13T04:29:40.213Z
wdym? On that specific example you can use extrusion to get the cylinder.
Makogan
CC BY-SA 4.0
2022-06-13T04:49:30.583Z
The point was that smooth join will not work even for very simple cases.
lightxbulb
CC BY-SA 4.0
2022-06-13T04:56:57.383Z
I understand, I am asking if there is a way to get something close to the convex hull, even if it only works when the shapes are within a certain distance or something along those lines.
Makogan
<raytracing><glsl><mathematics><computational-geometry><signed-distance-field>
Getting something close to the convex full of SDFs using CSG operations
Makogan
# Getting something close to the convex full of SDFs using CSG operations

(Asked by: username_0 on 2022-06-12)

Inigo Quilez has an [explanation](https://iquilezles.org/articles/distfunctions/) of smooth operations to join sdfs.

I am trying to get something close to the convex hull of multiple sdfs. For starters let;s consider a simple case of 3 cubes int eh following configuration:

[![enter image description here](https://i.sstatic.net/nwTGH.png)](https://i.sstatic.net/nwTGH.png)

The convex hull would be a very, very similar shape, with the exception that the region inside the l shape would be a diagonal slope.

I tried using smooth joining operations with a high weight, but I get this

[![enter image description here](https://i.sstatic.net/O4sQa.png)](https://i.sstatic.net/O4sQa.png)

The area I expected to be filled is indeed filled, but everything else bloated up. I am trying to come up with a mathematical formula to test if a point would be inside the convex hull.

**Tags:** raytracing, glsl, mathematics, computational-geometry, signed-distance-field

> **Comments:**
> **username_1**: Here's a counterexample: take 2 spheres pretty close to infinitely far away. Then the cylinder between those is part of the convex hull. The CSG operations on the other hand will not reproduce it.  
> **username_0**: wdym? On that specific example you can use extrusion to get the cylinder.  
> **username_1**: The point was that smooth join will not work even for very simple cases.  
> **username_0**: I understand, I am asking if there is a way to get something close to the convex hull, even if it only works when the shapes are within a certain distance or something along those lines.  

---

## 0 answers

