General recipe for designing photonic crystal cavities | Synapse