This paper presents a new trajectory planning algorithm for three-dimensional autonomous UAV volume coverage and visual inspection. The algorithm is an extension of a state-of-the-art Heat Equation Driven Area Coverage (HEDAC) multi-agent area coverage algorithm for three-dimensional domains. With a given target exploration density field, the algorithm designs a potential field to achieve the minimization of the remaining density and generate trajectories using potential gradients to direct UAVs to the regions of higher potential, i.e., higher values of remaining density. Collisions between the agents and agents with domain boundaries are prevented by implementing the distance field and correcting the agent's directional vector when the distance threshold is reached. A unit cube test case is considered to evaluate this trajectory planning strategy for volume coverage. The case demonstrates successful collision avoidance even inside a crowded domain with a hundred UAVs exploring it. For visual inspection applications, the algorithm is supplemented with camera direction control. A field containing the nearest distance from any point in the domain to the structure surface is designed. The gradient of this field is calculated to obtain the camera orientation throughout the trajectory. Three different test cases of varying complexities are considered to validate the proposed method for visual inspection. The simplest scenario is a synthetic portal-like structure inspected using three UAVs. The other two inspection scenarios are based on realistic structures where UAVs are commonly utilized: a wind turbine and a bridge. When deployed to a wind turbine inspection, two simulated UAVs traversing smooth spiral trajectories have successfully explored the entire turbine structure while cameras are directed to the curved surfaces of the turbine's blades. In the bridge test case, commonly used as a test case in scientific publications focused on UAV inspection, an efficacious visual inspection of a complex structure is demonstrated by employing a single UAV and five UAVs. The proposed methodology is successful in planning the UAV visual inspection. It offers flexibility in various setup parameters and is applicable in real-world inspection tasks.