An apparatus includes an assembly and hollow templates. The assembly includes multiple hinges mounted thereon. The assembly is configured to rotate about a first axis, and each of the hinges is additionally configured to rotate about a respective second axis. The hollow templates are fitted on the respective hinges and are each configured to contain a balloon-based distal end of a medical instrument, each template having a patterned opening through which one or more electrodes are deposited on the distal end.