# Demonstration of compartments
# This file shows a compartment comprised with logic

graphics opengl

dim 2
boundaries x 0 100
boundaries y 0 100
frame_thickness 0

species red green blue
boxsize 20

difc all 3

color red red
color green green
color blue blue
display_size all 3

time_start 0
time_stop 100
time_step 0.01

start_surface walls
action both all r
color both 0 0 0
panel rect +x 0 0 100
panel rect -x 100 0 100
panel rect +y 0 0 100
panel rect -y 0 100 100
end_surface

start_surface left
action both all reflect
color both 0.6 0.6 0.6
thickness 1
panel sphere 40 50 30 30
end_surface

start_surface right
action both all reflect
color both black
thickness 1
panel sphere 60 50 30 30
end_surface


start_compartment left
surface left
point 30 50
end_compartment

start_compartment right
surface right
point 70 50
end_compartment

start_compartment intersection
compartment equal left
compartment and right
end_compartment

start_compartment either
compartment equal left
compartment xor right
end_compartment

start_compartment outside
compartment equalnot left
compartment andnot right
end_compartment

compartment_mol 500 red intersection
compartment_mol 500 green either
compartment_mol 500 blue outside


end_file

