top | item 42518047

(no title)

bun_terminator | 1 year ago

> some of the established practice on generating SDFs from masks is incorrect

SDFs are for some reason riddled with false beliefs. Earlier this year it drove me nuts to learn that boolean operations for SDFs are not correct

discuss

order

edflsafoiewq|1 year ago

What do you mean by "boolean operations for SDFs are not correct"?

kevingadd|1 year ago

Most of them are approximations instead of exact, so they can produce incorrect SDFs.

msk-lywenn|1 year ago

How would you even do a boolean operation over two distances ?

ChadNauseam|1 year ago

Inigo Quilez (who is basically the CEO of SDFs in my book) has a page on this: https://iquilezles.org/articles/interiordistance/.

The goal isn't boolean operations over distances themselves, because as you point out that makes no sense. What you often want though is boolean operations over the surfaces the functions are returning the distance to. For example, you have one function that gives the distance to the surface of a sphere, and another that gives the distance to the surface of a cube, and you want to AND them, to get a function that gives you the distance to whichever surface is closer. That explanation probably doesn't make any sense, so just check out the page I linked which has some great visualizations.

ww520|1 year ago

I believe the "boolean" operations is really set operations - union, intersection, subtraction, etc.