4D printing encodes self-actuating deformation during the printing process, such that objects can be fabricated flat and then transformed into target 3D shapes. While many flattening algorithms have been introduced for 4D printing, a general method customized for FDM (Fused-Deposition Modeling) printing method is lacking. In this work, we vary both the printing direction and local layer thickness; and extend the shape space to continuous-height-field surfaces without the requirement of symmetry. We introduce an end-to-end tool that enables an initially flat sheet to self-transform into the input height field. The tool first flattens the height field into a 2D layout with stress information using a geometry-based optimization algorithm, then computes printing tool paths with a path planning algorithm. Although FDM printing is the fabrication method in this work, our approach can be applied to most extrusion-based printing methods in theory. The results exemplify how the tool broadens the capabilities of 4D printing with an expanded shape space, a low-cost but precise coloring technique, and an intuitive design process. CCS CONCEPTS • Computing methodologies → Interactive simulation; Mesh geometry models; Physical simulation; • Human-centered computing → Graphical user interfaces; • Applied computing → Computer-aided manufacturing.