This paper presents a new preprocessing algorithm to generate accurate initial conditions for particle-method-based CFD simulations with complex geometries. The algorithm is based on the improved Marching Cubes method (MC) with the newly proposed isosurface particle redistribution optimisation. It can not only produce topologically accurate isosurfaces and boundary particles that encompass the entire boundary surface but also offers a seamless method for evenly distributing internal fluid particles, eliminating the necessity for additional fluid field reconstruction algorithms. To address the issue of particle clustering on the surface boundary caused by MC intersection with sharp corners in complex geometries, we have introduced an iterative particle-moving algorithm. This algorithm aims to both achieve a uniform distribution of boundary particles across the surface and to recompute their normal vectors due to particles movement. In introducing our newly developed preprocessing algorithm, we have taken the initiative to systematically elucidate the entire process of generating boundary particles on complex surfaces using optimization theory, marking a pioneering effort in this regard. The developed particle preprocessing optimization techniques can use inputs from both the volume image data format from MRI/CT and standard CAD files, such as STL models. We have used various test cases with standard CAD geometries and complex real-world application geometries to validate and test the algorithms. The results demonstrate the impressive ability of our preprocessing toolkit1 to handle real complex geometries, along with the robustness and efficiency of the newly developed algorithms.