Generating smooth, complex geometries
This is more a technical question as to the possibilities with Gmsh as opposed to a troubleshooting issue. I am trying to generate a geometry similar to the picture below
I cannot see how this is possible, even with the OCC kernel and boolean operations. I have looked into fillet, chamfer, thrusections etc and see no examples where one generates a smooth geometry that goes from negative to positive curvature as shown in the picture.
This geometry is basically a sphere with a cylinder fused to it, however I have no way of making the transition smooth and in a controllable way, i.e, such that I can control the rate of change of angle of the surfaces's unit normal vector with respect to the rate of change of arclength along the surface. A sphere with cylinder fused to it is shown below
The simple code for which is as follows:
r2 = 0.3
r1 = 1 # inputted radius of sphere
r3 = sqrt((r1*r1)-(r2*r2)) # positional distance of cylinder to cut into sphere
gmsh.model.occ.addSphere(0, 0, 0, r1, 1) # volume 1
gmsh.model.occ.addCylinder(r3, 0, 0, r1, 0, 0, r2, 2) # volume 2
gmsh.model.occ.fuse([(3,1)], [(3,2)], 3)
gmsh.model.occ.synchronize()
Or maybe there is a way to smooth the discontinuous boundary that interfaces the cylinder to the sphere?
Any suggestions would be greatly appreciated.
Thanks,
Yoshua