# Tag Info

11

Update 2: workflow to create perfectly cubical voxels In update 1, I discovered that although MaxCellMeasurewill allow you to control the resolution of the base mesh, ToElementMesh makes some internal choices to refine the mesh. Unfortunately, this refinement makes it virtually impossible to guarantee that the voxels are perfect cubes. Therefore, I created ...

6

ClipPlanes is useful here DynamicModule[{vp={1.3,-2.4,2},latitude,longitude}, latitude=Line@Table[{Sin[ϕ]Cos[θ],Sin[ϕ]Sin[θ],Cos[ϕ]},{ϕ,0.,Pi,Pi/10},{θ,0.,2Pi,2Pi/60}]; longitude=Line@Table[{Cos[ϕ]Sin[θ],Sin[ϕ]Sin[θ],Cos[θ]},{ϕ,0.,Pi,Pi/10},{θ,0.,2Pi,2Pi/60}]; Graphics3D[{ (*{Opacity[0.2],Sphere[]},*) AbsoluteThickness[1], {ClipPlanes->Dynamic@Append[vp,0]...

4

Here's one way to solve the problem by explicitly modeling the interface region (note that this is explained in more detail here). We start 1st by defining some helper functions. Mesh helper functions (edited) These helper functions are similar to those described in the OP but have a couple of additions. (*Import required FEM package*) Needs["NDSolve`...

3

Add the options MeshFunctions {# &, #2 &, #3 &} and Mesh -> 10 when you create surfacegraph: surfacegraph = ParametricPlot3D[sur[r, phi] + gauss[r*Sin[phi], r*Cos[phi]], {r, 0, 1}, {phi, 0, Pi}, MeshFunctions -> {# &, #2 &, #3 &}, Mesh -> 10]; Show[handle, surfacegraph, boundary, PlotRange -> {{-0.5, 2}, {-0.6, ...

Only top voted, non community-wiki answers of a minimum length are eligible