<p>Suppose we have a suface without self-intersection, then we can store it numerically using grid samples from its signed distance funtion. But what for the self-intersecting case, can we still use the SDF tech?</p>

CC BY-SA 4.0
2022-08-23T18:27:07.087Z
Yes but you may have to redefine the orientation of the surface in order to get a consistent sign. An even more exotic case is if you have a non-orientable surface, then you cannot get a consistent sign  either way. However you can always compute a non-signed distance field. Basically to have a proper sign you need to be able to uniquely determine what is "inside" and "outside", e.g. this is also problematic if you don't have a closed surface/.
lightxbulb
CC BY-SA 4.0
2022-08-28T07:38:11.653Z
@lightxbulb : And in this case, can we calculate its hessian matrix correctly, with distance function fitted by interpolation on grid samples? There will be sigular points where graidents are zero for self-intersecting surfaces.
Andy
CC BY-SA 4.0
2022-08-28T09:26:09.767Z
Hessian of what function? And how is this related to the discrete sdf you want?
lightxbulb
CC BY-SA 4.0
2022-08-28T14:04:28.960Z
@lightxbulb : It's the Hessian of the self-intersecting surface's distance function. If we only have the discrete sdf, can we calculate the Hessian accurately?
Andy
CC BY-SA 4.0
2022-08-28T14:36:05.963Z
You can compute a discrete analogue of it sure. You can approximate the $x$ derivative: $\partial_x f(i,j) \approx f_{(i+1),j} - f_{i,j}$, and similarly for $y$. For the boundaries either use reflecting, clamped, or toroidal boundary conditions depending on what you want the extension of the function to be beyond its boundaries.
lightxbulb
<raytracing><mesh><geometry>
How can we represent a self-intersecting surface without analytic expression in computer?
Andy
# How can we represent a self-intersecting surface without analytic expression in computer?

(Asked by: username_0 on 2022-08-23)

Suppose we have a suface without self-intersection, then we can store it numerically using grid samples from its signed distance funtion. But what for the self-intersecting case, can we still use the SDF tech?

**Tags:** raytracing, mesh, geometry

> **Comments:**
> **username_1**: Yes but you may have to redefine the orientation of the surface in order to get a consistent sign. An even more exotic case is if you have a non-orientable surface, then you cannot get a consistent sign  either way. However you can always compute a non-signed distance field. Basically to have a proper sign you need to be able to uniquely determine what is "inside" and "outside", e.g. this is also problematic if you don't have a closed surface/.  
> **username_0**: @username_1 : And in this case, can we calculate its hessian matrix correctly, with distance function fitted by interpolation on grid samples? There will be sigular points where graidents are zero for self-intersecting surfaces.  
> **username_1**: Hessian of what function? And how is this related to the discrete sdf you want?  
> **username_0**: @username_1 : It's the Hessian of the self-intersecting surface's distance function. If we only have the discrete sdf, can we calculate the Hessian accurately?  
> **username_1**: You can compute a discrete analogue of it sure. You can approximate the $x$ derivative: $\partial_x f(i,j) \approx f_{(i+1),j} - f_{i,j}$, and similarly for $y$. For the boundaries either use reflecting, clamped, or toroidal boundary conditions depending on what you want the extension of the function to be beyond its boundaries.  

---

## 0 answers

