Rigorous and Efficient Fabrication-Oriented CAD and Optimization of Complex Waveguide Networks