What is the general way to make a function f(x,y) that consists of drawing one or more closed curves (not necessarily well-behaved, just as long as they're closed) in the xy plane and letting the function be 0 in the exterior and 1 in the interior or interiors?
Sure, it could be smooth curves like the image but it could also be voronoi cells, or polygons, or anything.