ScriptSpot

Script

Mesh Fixing Tools

By ennetws · 2013-08-07

Version
1.3
Other software required
3ds Max
Date updated
2013-11-13
Votes
7
Description

This script include state of the art methods that can help fix bad or broken meshes:

  • [ code | paper ] Marco Attene: A lightweight approach to repairing digitized polygon meshes. The Visual Computer 26(11): 1393-1406 (2010).
  • [ code | paper ] Alec Jacobson, Ladislav Kavan, Olga Sorkine-Hornung: Robust inside-outside segmentation using generalized winding numbers. SIGGRAPH (2013).
  • [ code | paper ] Bernstein G., Fussell D.: Fast, Exact, Linear Booleans. Computer Graphics Forum 28, 5 (2009), 1269–1278.

In order to load in 3ds max, go to "Utility" (the hammer icon) --> MAXScript --> Open Script --> then load the 'MeshFixUtility.ms'. You can now drop down to the 'Meshfix Utility' and see buttons for the tools. Select an object then click the one you want.

The three tools are Meshfix, Winding numbers, and Cork library. Meshfix is a fast and general tool that fix a number of problems in meshes such as duplicated verts or faces, the newer winding number approch is better at dealing with many dissconnected parts. The cork library is added to help merge highly complex shapes.

All executables are compiled for Windows 32 bit, and have been tested on 3ds max 2014 x64 on Windows 8. Unfortunately, the winding number method requires Matlab 2012 32-bit and some basic setup for extracting and setting some paths.

Demo

Videos
Attachments

Tags: clean up, object, boolean, 3d, Check, fix, mesh, repair, problems

Comments (17)

Need a bit more explanation

RobH2 · 2015-01-14

Not being a programmer I'm not sure what you mean by:

"Unfortunately, the winding number method requires Matlab and some basic setup for extracting and setting paths."

--Does that mean it won't work in Max on a 64 bit machine?
--Or that you have to install Matlab?
--Or that we don't need to worry about it because it works and unless we are doing something with paths we won't need to worry.

I don't know what you are trying to say about it. Can you explain a bit?

The reason I ask is that I can't get the script to work on Windows 7 x64 with Max 2015 Design. If I try to 'Fix' a mesh with 'Meshfix-Attene' I get the error:

--Runtime error: CenterPivot requires a node.

'Winding Numbers' gives me this error:

--Runtime error: FileStream cannot create: C:\Temp\winding_demo_win32\Clip.obj

If I then go to C:\Temp and manually create the folder 'winding_demo_win32' and run it I get this error:

--No ""addModifier"" function for "ERROR"

textures

sdSDG · 2014-12-11

All of my textures are lost. How to fix this?

GODLIKE · 2014-10-13

Thank you for this, dude!

Script

Nick · 2013-11-14

Is it just me being senile, or is there no actual script in the zip?

whoops!

ennetws · 2013-12-04

Thanks for alerting me Nick, you are right. I updated the package that was missing some DLLs and forgot to add the scripts. Now it should be working :)

Sorry about that

AMAZing

op61 · 2014-02-18

Hi, Im new here,and this is amazing. thank you.

Martin Breidt · 2013-08-13

Thanks for sharing, looks really useful, will have to test it on some dense meshes...

lantlant · 2013-08-10

Runtime error: CenterPivot requires a node... :/

RE: Runtime error: CenterPivot

ennetws · 2013-08-11

Hi lantlant, can you send me the mesh you are fixing and I'll try to figure out what went wrong.

Keep in mind that these tools don't always work as expected. Sometimes, in really bad meshes, I have to use tools like ProBoolean and some manual effort before I fix the mesh.

Fixed

ennetws · 2013-08-11

Hi lantlant, the mesh you sent was challanging but I was able to fix it:

https://www.dropbox.com/s/x7a9hh0z3j7616j/test-mesh01.max

What I did was first fix the normals of some polygons so they are pointing outside and consistant with others. Then I split the seperate parts of the mesh and fix them with Meshfix. The main challange was the largest part which needed adding more polygons manually. Thanks for this challanging case, it helped me learn a lot :)

lantlant · 2013-08-11

Thank you.
I should be a script that will automatically do it for .. and may even be run as a batch.
And my room is cleaning out the script :)

Serg · 2013-08-10

What libraries from Matlab are needed ? or need Installed full aplication ? or This original advertisement Matlab ?

vitalquaD · 2013-08-09

Where can I download matlab and how to get it to work?

MathWorks, MATLAB

ennetws · 2013-08-10

Unfortunelty MATLAB is a large proprietary software, you could take a look at getting a trial version https://www.mathworks.com/products/matlab/trial.html.

This is only required for the Winding Number method. The other two are standalone.

Thank you

kurt · 2013-08-09

a nice tool

Welcome

ennetws · 2013-08-09

I hope it worked for you.