Refactor quad geometry generation.