from dolfin import *
if not has_cgal():
print "DOLFIN must be compiled with CGAL to run this demo."
exit(0)
# Define 3D geometry
box = Box(0, 0, 0, 1, 1, 1)
sphere = Sphere(Point(0, 0, 0), 0.3)
cone = Cone(Point(0, 0, -1), Point(0, 0, 1), 1., .5)
g3d = box + cone - sphere
# Test printing
info("\nCompact output of 3D geometry:")
info(g3d)
info("\nVerbose output of 3D geometry:")
info(g3d, True)
# Plot geometry
plot(g3d, "3D geometry (surface)")
# Generate and plot mesh
mesh3d = Mesh(g3d, 32)
info(mesh3d)
plot(mesh3d, "3D mesh")
interactive()