Rounded brick/pill procedurally?

@LazyDodo 's Brick tricks addon has a rounded corner option that does this.