--- /dev/null
+-- Package of geometric operations on SDF objects
+
+local function union(s1, s2)
+ return function (location)
+ local p1 = s1(location)
+ local p2 = s2(location)
+
+ if p1.dist < p2.dist then
+ return {dist = p1.dist, texture = p1.texture}
+ else
+ return {dist = p2.dist, texture = p2.texture}
+ end
+ end
+end
+
+Operations = {
+ union = union
+}
+
+return Operations