We have developed an efficient algorithm for simulating the equilibrium shape of a microdroplet placed on a flat substrate that has a fine, discontinuous, and arbitrarily shaped hydrophilic/hydrophobic patterned surface. The method uses a hybrid energy-minimization technique that combines the direct search method to determine the droplet shape around solid/liquid contact lines with the gradient descent method for the other parts of the droplet surface. The method provides high-convergence at a low computational cost with sufficient mesh resolution, providing a useful tool for the optimal design of printed electronic devices.