man(7)

✨ NAME ✨

meshfix β€” a surface mesh cleaning and repairing utility. She fixes. She cleans. She eats and leaves no crumbs. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

meshfix <file1> [<file2>] [OPTIONS]

🌸 DESCRIPTION 🌸

okay so bestie, gather round, because meshfix is a surface mesh repairing and cleaning tool and it's genuinely iconic. It was written by Marco Attene</>, Mirko Windhoff</>, and Axel Thielscher</>. The deets about this tool live in the paper below, no cap:

M. Attene - A lightweight approach to repairing digitized polygon meshes. The Visual Computer, 2010. (c) Springer.

Here's the tea on how it actually runs: meshfix processes file1 and saves the result to <file1>_fixed.off. If you pass a file2 too (optional, bestie), it gets merged with the first one. Two files, one glow-up. 🫢

The input formats it will accept are OFF, PLY and STL. That's it, that's the list. ✨


πŸ’… OPTIONS πŸ’…

This program accepts the following input parameters, and honestly? Every single one of them matters. Read them all, don't skip. πŸ“‹

  • -a <epsilon_angle> β€” Allowed range is 0 < epsilon_angle < 2, and the default is 0 (degrees). Yes, degrees. Don't come at me.
  • -j β€” Join the 2 biggest components if they overlap, and remove the rest. Two become one, everything else gets evicted. πŸ’€
  • -jc β€” Join the closest pair of components. Just the closest ones, like soulmates fr fr.
  • -h|(--help) β€” Print this help and exit. Classic.
  • --shells <n> β€” Only the n biggest shells are kept. The rest? Gone. πŸ™ˆ
  • -o <output> β€” Set the output filename (without extension). You're the main character, you name it.
  • -q β€” Quiet mode, don't write much to stdout. Introvert mode activated.
  • -u <steps> β€” Uniform remeshing of the whole mesh, and steps must be > 0.
  • --vertices <n> β€” Constrain the number of vertices to n. Heads up: this only works with -u.
  • --no-clean β€” Don't clean. Chaos mode, respectfully.
  • --smooth <n> β€” Apply n laplacian smoothing steps. Soften the vibe. 🌈
  • -s|(--stl) β€” Result is saved in STL format instead of OFF.
  • -w|(--wrl) β€” Result is saved in VRML1.0 format instead of OFF.
  • --fsmesh <n> β€” Result is saved in FreeSurfer format instead of OFF.
  • --xshift <d> β€” Shift the x-coordinates of vertices by d when saving the output. Only works with --fsmesh; it's used to deal with a small FreeSurfer glitch. iykyk. 🩹
  • --msh β€” Result is saved in gmsh format for debugging (including vertex and triangle masks).
  • --cut-outer <d> β€” Remove triangles of the 1st that are outside of the 2nd shell.
  • --cut-inner <d> β€” Remove triangles of the 1st that are inside of the 2nd shell. It dilates the 2nd by d; fills holes and keeps only the 1st afterwards.
  • --decouple-inin <d> β€” Treat the 1st file as the inner component and the 2nd file as the outer component. Resolve overlaps by moving inner's triangles inwards.
  • --decouple-outin <d> β€” Treat the 1st file as the outer component and the 2nd file as the inner component. Resolve overlaps by moving outer's triangles inwards.
  • --decouple-outout <d> β€” Treat the 1st file as the outer component and the 2nd file as the inner component. Resolve overlaps by moving outer's triangles outwards. Constrain the min distance between the components to be > d.
  • --fineTuneIn <d> <n> β€” Used to fine-tune the minimal distance between surfaces. A minimal distance d is ensured, and it's reached in n substeps. When you're using the surfaces for subsequent volume meshing by gmsh, this step prevents too-flat tetrahedra. No squished little guys on my watch. πŸ“
  • --fineTuneOut <d> <n> β€” Similar to --fineTuneIn, but ensures the minimal distance in the other direction. Mirror moment. πŸͺž
  • --dilate <d> β€” Dilate the surface by d. And heads up: d < 0 means shrinking. Negative d = glow-down.
  • --intersect β€” If the mesh contains intersections, the return value is 1.
  • --intersect -o fname.msh β€” If the mesh contains intersections, the return value is 1. In addition, save the mesh with the intersections highlighted in Gmsh format. Same flag, but now with receipts. πŸ”₯

πŸ‘‘ SEE ALSO πŸ‘‘

cgalmesh(7), cgalsurf(7), cgalsimp2(7), cgalpoly(7), cork(7), jmeshlib(7)


πŸŽ€ AUTHOR πŸŽ€

Marco Attene (attene@ge.imati.cnr.it), Mirko Windhoff, Axel Thielscher and Qianqian Fang (fangqq@gmail.com)


okay that's the whole page bestie, you ate that. πŸ’– This was version 1.2-alpha from 30 June 2020, served fresh out of the man(7) section. go fix those meshes, you've got this πŸ¦‹βœ¨