{ 3D_SPHEREBOX.PDE An empty 3D sphere inside a box. } title 'Empty 3D Sphere in a box' coordinates cartesian3 variables definitions K = 0.1 { conductivity } R0 = 1 { radius } box = 2*R0 zsphere = SPHERE ((0,0,0),R0) { hemisphere shape } equations extrusion surface z=-box surface z = -zsphere { the bottom hemisphere and plane } surface z = zsphere { the top hemisphere and plane } surface z=box boundaries region 1 { left box } start(-box,-box) line to (-box,box) to (0,box) to (0,-box) to close region 2 { right box } start(box,box) line to (box,-box) to (0,-box) to (0,box) to close limited region 3 { sphere exists only in region 3 } layer 2 start (0,-R0) arc(center=0,0) angle=180 plots grid(x,y,z) paintregions grid(y,z) on x=0 paintregions end