Patient-specific surgical simulations based on medical imaging allow surgeons to plan and practice surgical interventions before conducting surgeries and many studies demonstrate that the simulations can improve surgical outcomes. Researchers have devoted great efforts in recent decades and developed various biomechanical models based on finite element methods and meshfree methods to simulate surgeries accurately. However, such simulations are still not adopted in clinical environments. A key reason is that the simulations depend crucially on the knowledge in preparing meshes or admissible node distributions for numerical analysis, while surgeons lack the expertise. To solve the challenge, we have developed an automatic unstructured mesh generation algorithm, FlowMesher, which can be used to generate unstructured meshes and admissible node distributions for domains in any shape with minimum or even no user intervention. The core idea of the FlowMesher is that a mesh domain is considered as an “airtight container” into which fluid particles are “injected” at one or multiple selected interior points. The particles repel each other and occupy the whole domain somewhat like blowing up a balloon. When the container is full of fluid particles and the flow is stopped (the fluid particle distributions is admissible node distributions), a Delaunay triangulation algorithm is employed to link the fluid particles together to generate an unstructured mesh (which is then optimized using a combination of automated mesh smoothing and element removal in 3D). The application of FlowMesher is not limited to numerical simulations. Based on the FlowMesher, an automatic complex topology structure generation method has been developed and used to fabricate a 3D printed shoe sole prototype according to a diabetic’s foot pressure distribution. The overarching goal is to produce 3D printed shoes and insoles to adjust foot pressure distributions properly and therefore prevent diabetic foot and lower limb complications that are suffered by about 10% of 463 million people living with diabetes (IDF Diabetes Atlas statistics).