Example scripts for command-line meshing

Provides a system for patient-specific cardiovascular modeling and simulation.
POST REPLY
User avatar
Akash Gupta
Posts: 15
Joined: Thu Jun 09, 2016 6:58 am

Example scripts for command-line meshing

Post by Akash Gupta » Thu Jul 11, 2024 9:55 am

Hello,
I have a bunch of patient geometries that I need to mesh, and I'd like to script the meshing process. Are there any example scripts that I could refer to that would do the following:
  • Import an STL file
  • Generate faces
  • Mesh using TetGen
  • Export surface and volume meshes
I've seached this forum, and I've found links to scripts in the SimVascular-Tests Github repository for meshing. I'm not sure of how to import the stl and generate faces though. Also, the repository seems to be about 3 years old now. Are there any up to date example scripts available? Thanks!

User avatar
David Parker
Posts: 1653
Joined: Tue Aug 23, 2005 2:43 pm

Re: Example scripts for command-line meshing

Post by David Parker » Thu Jul 11, 2024 10:19 am

Hello,

This script https://github.com/SimVascular/SimVascu ... l-model.py reads an STL file and meshes it.

Meshing STL files can be difficult because the STL triangulation of CAD models is typically poor, try to create an STL file with triangles that have a good aspect ratio. Image isosurfaces should be ok.

Cheers,
Dave

User avatar
Akash Gupta
Posts: 15
Joined: Thu Jun 09, 2016 6:58 am

Re: Example scripts for command-line meshing

Post by Akash Gupta » Thu Jul 11, 2024 11:47 am

Thank you for the quick reply! These are patient geometries so it's something I have to work with. If I could control the file format for my models, which ones would work best with SimVascular?

User avatar
David Parker
Posts: 1653
Joined: Tue Aug 23, 2005 2:43 pm

Re: Example scripts for command-line meshing

Post by David Parker » Thu Jul 11, 2024 2:10 pm

Hello,

It is not really the file format that matters but the geometry (triangles) that are stored there. The geometry obtained from imaging data needs to be well-defined: manifold, no zero areas, decent aspect ratios.

Cheers,
Dave

POST REPLY