Hi!
Here is a simple example of what you would do earlier:
from dolfin import *
res = 100
r1 = Rectangle(0, 0, 1, 2)
r2 = Rectangle(0.4, 0.4, 0.6, 0.7)
mesh = Mesh(r1 - r2, res)
This chunk of code as you have discovered returns the CGAL error. When applying mshr the syntax is slightly different:
from dolfin import *
from mshr import *
r1 = Rectangle(Point(0,0), Point(1,2))
r2 = Rectangle(Point(0.4, 0.4), Point(0.6, 0.7))
# Define domain and resolution
domain = r1 - r2
res = 100
# Generate mesh
mesh = generate_mesh(domain, res)
Just a basic example but you get the idea, check out mshr on bitbucket for more info: https://bitbucket.org/benjamik/mshr