This paper proposes a novel density-based method for structural design considering restrictions of multi-axis machining processes. A new mathematical formulation based on Heaviside function is presented to transform the design field into a geometry which can be manufactured by multi-axis machining process. The formulation is developed for 5-axis machining, which can be also applied to 2.5D milling restriction. The filter techniques are incorporated to effectively control the minimum size of void region. The proposed method is demonstrated by solving the compliance minimization problem for different machinable freeform designs. The length to diameter (L:D) ratio geometric constraint is introduced to ensure the machinable design, where deep hole or narrow chamber features are avoided using proposed method. Several two- and three-dimensional numerical examples are presented and discussed in detail.