top2iges: A Portable MATLAB Code for Converting Topology Optimization Results into IGES Files with NURBS Representation
摘要
Topology optimization typically yields material distributions defined on finite element or isogeometric grids, a discrete format that hinders direct geometry reconstruction, CAD editing, and downstream engineering simulation. To address this interoperability gap, this paper presents a portable MATLAB framework for converting two-dimensional optimization results into trimmed NURBS representations, exported as standardized IGES files. The proposed methodology integrates image-based connected-component analysis for reliable boundary detection, a smoothness-adjustable curve-fitting scheme for precise contour reconstruction, and a compact IGES-writing routine that preserves the parametric structure of the optimized design. The framework is solver-agnostic, accommodating diverse topology optimization data types, including structured meshes, unstructured polygonal meshes, and isogeometric analysis outputs. The MATLAB code is open-source, enabling other researchers to reproduce and extend the proposed workflow. The effectiveness of the method is demonstrated through a series of representative benchmark problems, showing that the generated IGES models support seamless geometric modification and high-fidelity finite element analysis. Overall, this tool provides a practical and portable bridge between numerical topology optimization and downstream CAD/CAE workflows.