Agent-based geometry generation and optimization