Quadric edge collapse decimation - problems with skripting
A processing system for 3D triangular meshes
Brought to you by:
cignoni,
granzuglia
Hey,
for decimation of 3d-scandate I did some experiment with the scripting-function (meshlabserver). MeshLab works great with the exported mlx-script at default-configuration. As soon as I put some special requirements into my script (like ' preserve topology' or 'planar simplification') , the exported files won't be processed with these configuration, the file size correlates with the original files in my 'input' folder.
Are these additional features excluded in the scripting-process?
Thanks a lot for help.
(MeshLab 1.3.3 Win 10 64bit)
Last edit: Felix H 2016-11-01
Felix,
Meshlabserver can certainly use these other parameters to the decimation filter. If you're having issues you may have an error in the mlx file or elsewhere in your process. Did the command line output indicate any errors or issues?
Editing the mlx files by hand can be problematic and is no fun, so I've written a Python library to help generate and run scripts, MeshLabXML. If you have some basic Python skills you may want to check it out. A sample script to decimate a model would be similar to the following:
Note that I exclusively use version 1.3.4BETA on Windows 64, as some filters only work with meshlabserver in this version. Most filters should still work with version 1.3.3, but this hasn't been tested much.
Thanks @Tim Ayres for the great explanation. Could you explain the way to use the same script for .obj files
Hey Tim,
thank you very much for this helpful answer. There aren't any error messages while using the scripting function. It nice to know that the manual editing of script can be a problem.
I will try out your MeshLabXML-Database, thanks!
Felix
Hello Tim,
I'm new to MeshLab and while trying to execute your script i'm keep receiving the following message:
*Total 12 io plugins
Opening a file with extention obj
Mesh E:/Erez/server/4b2a36a144cf44ca93470df1c72a82cd.obj loaded has 243204 vn
440832 fn
output mesh E:/Erez/server/fileout.obj
vertex color, vertex normals, face color, wedge tex coords, Apply FilterScript:
'E:/Erez/server/simplify.mlx'
FilterScript
Reading filter with name Quadric Edge Collapse Decimation (with texture)
Reading Param with name TargetFaceNum : RichInt
Reading Param with name TargetPerc : RichFloat
Reading Param with name QualityThr : RichFloat
Reading Param with name PreserveBoundary : RichBool
Reading Param with name BoundaryWeight : RichFloat
Reading Param with name OptimalPlacement : RichBool
Reading Param with name PreserveNormal : RichBool
Reading Param with name PlanarQuadric : RichBool
Reading Param with name Selected : RichBool
Reading Param with name Extratcoordw : RichFloat
Starting Script of 1 actionsfilter: Quadric Edge Collapse Decimation (with texture)
filter Quadric Edge Collapse Decimation (with texture) not foundFailed to apply
script file E:/Erez/server/simplify.mlx
Houston, we have a problem.
MeshLab did not finish successfully. Review the log file and the input file(s) to see what went wrong.
MeshLab command: "meshlabserver -i "4b2a36a144cf44ca93470df1c72a82cd.obj" -o "fileout.obj" -m vc vn fc wt -s "simplify.mlx""
Where do we go from here?*
Can you please help out?
Thank you,
Gilad.
Hi Gilad,
The MeshLabXML API has changed somewhat after the new MeshLab release in 2016.12; it is now object-based. The reason the old script no longer works is that the "Quadric Edge Collapse Decimation (with texture)" filte'rs name was changed in 2016.12 to "Simplification: Quadric Edge Collapse Decimation (with texture)". I just pushed a new version to PIP which you may want to try. Below is a conversion of the simplification script above to the new API, I hope you agree that this is an improvement.
Please let me know if you have any other questions.
Thanks,
Tim
Hi Tim
Thanks for your comments and help but this did not work for me.
Works like a charm!
Last edit: hb1987 2018-05-14