'Shape union in processing?

I'm learning processing and trying to create an SVG file containing a complex shape (path) which should be a union of a hexagon and a rectangle. But, unfortunately, I can't find any set operations on PShape.

a hexrect



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source