Meshing a tangeny with the blunt tangency approach

A customer shared a problem with us today that he said he would be happy to have us share publicly. The issue is how to mesh an object like this, where there are two objects joined with a tangency.


Here’s a zoom of the issue of tangencies with hex mesh:

That element is

A) Very poor quality
B) Ready to invert

Here is an approach to blunt the tangency under vertex/modify. It allows you to tweak the geometry and reduce the tangency, yielding a minimum shape metric > .5 . Picture below, Python script below that.


4
3

reset
create cylinder radius .75 z 10
create brick x 4 y 1.5 z 2
vol 2 move x 2 z 3
subtract vol 1 from 2 keep_tool
unite body all

blunt tangency vertex 11 angle 30 depth .25
blunt tangency vertex 12 angle 30 depth .25
blunt tangency vertex 13 angle 30 depth .25
blunt tangency vertex 14 angle 30 depth .25

create vertex location curve 2 fraction .5 from vertex 2
create vertex location curve 1 fraction .5 from vertex 1
split surface 27 through vertex 35 36

webcut volume 1 sweep surface 18 perpendicular inward through_all
webcut body 1 with sheet extended from surface 18
webcut body 4 with sheet extended from surface 26

composite create surface 43 20 21 keep angle 15
composite create surface 16 17 44 keep angle 15
composite create surface 34 49 keep angle 15
composite create surface 36 48 keep angle 15
composite create surface 52 28 29 keep angle 15
composite create surface 24 25 53 keep angle 15

imprint all
merge all
mesh vol all