As a kind of fully actuated system, omnidirectional multirotor aerial vehicles (OMAVs) has more flexible maneuverability than traditional underactuated multirotor aircraft, and it also has more significant advantages in obstacle avoidance flight in complex environments. However, there is almost no way to generate the full degrees of freedom trajectory that can play the OMAVs' potential. Due to the high dimensionality of configuration space, it is challenging to make the designed trajectory generation algorithm efficient and scalable. This paper aims to achieve obstacle avoidance planning of OMAV in complex environments. A 6-DoF trajectory generation framework for OMAVs was designed for the first time based on the geometrically constrained Minimum Control Effort (MINCO) trajectory generation framework. According to the safe regions represented by a series of convex polyhedra, combined with the aircraft's overall shape and dynamic constraints, the framework finally generates a collision-free optimal 6-DoF trajectory. The vehicle's attitude is parameterized into a 3D vector by stereographic projection. Simulation experiments based on Gazebo and PX4 Autopilot are conducted to verify the performance of the proposed framework.