A tool was developed for optimizing 3D marine structures subjected to fluid forces and stresses. It was used to optimize a NACA 0009 hydrofoil, leading to a 12.4% efficiency increase, 7.3% weight reduction, and 45% higher cavitation inception speed, while satisfying stress and cavitation constraints. The tool can optimize complex marine propellers and turbines to reduce fuel use and emissions in maritime transport, responsible for 90% of world trade.