In the following example calculation the 3-ary relations are represented by their logical tensor,
their Venn diagrams and cubes dual to the Venn diagrams.
The dimension 3 is necesseary because 3-ary relations are to be represented.
The 24=16 is a random power of two. Tensors like this one represent the relations in a four element universe.
#include "colors.inc"
background {color White}
camera { angle 8
location <65,45,-150>
look_at <7.6, 7.5, 8>
up < 0, 1, 0>
right < 1, 0, 0>
}
light_source { <50,30,20>
color White
shadowless
}
light_source { <-1,20,-1>
color White
shadowless
}
difference{
box {
< -0.1,-0.1,-0.1>,
< 16.1,16.1,16.1>
pigment{color Black}
}
union{
box{
< -8,-8,-8>,
< 8,8,8>
pigment{color Black}
scale <1.02,0.995,0.995>
}
box{
< -8,-8,-8>,
< 8,8,8>
pigment{color Black}
scale <0.995,1.02,0.995>
}
box{
< -8,-8,-8>,
< 8,8,8>
pigment{color Black}
scale <0.995,0.995,1.02>
}
translate<8,8,8>
}
no_reflection
}
sphere{<0,0,0>,0.3
pigment{color Black}
}
/////////////////////////////////////////////////////// red
#declare unit0 =
box{
< 15.98,15.98,15.98>,
< 15.02,15.02,15.02>
pigment{color Red}
};
#declare v1 = <-1, 0, 0>;
#declare v2 = < 0,-1, 0>;
#declare v3 = <-1,-1, 0>;
////////////////////////////////////////
declare unit1 =
union{
object{unit0}
object{unit0 translate v1}
object{unit0 translate v2}
object{unit0 translate v3}
}
declare unit2 =
union{
object{unit1}
object{unit1 translate 2*v1}
object{unit1 translate 2*v2}
object{unit1 translate 2*v3}
}
declare unit3 =
union{
object{unit2}
object{unit2 translate 4*v1}
object{unit2 translate 4*v2}
object{unit2 translate 4*v3}
}
object{unit3}
object{unit3 translate 8*v1}
object{unit3 translate 8*v2}
object{unit3 translate 8*v3}