Closed waseemkhan1989 closed 5 years ago
I never tried to use my code with stl mesh. I mean have you tried with the same parameters in the script to decimate your stl model via the meshlab GUI app (using Quadric Edge Collapse Decimation (with texture)). I have decimated successfully many obj models using the tool. I am interested to know. Also are you using Python 3.x?
Hi,
Thanks for reply. I was only able to simplify one .obj model and simplification for other .obj models are even not working. You can see result of one of the .obj files:
C:\3DMeshBulkSimplification-master>python simplify.py Vorrichtung.obj Vorrichtung_s.obj 15000 True
Detecting Meshlab server Hosting Operating System ...
You appear to be on Windows machine ... Number of Arguments Given to the script: 5 arguments. TexturesFlag: True meshlabserver cmd = meshlabserver -l TEMP3D_measure_topology_log.txt -i "Vorrichtung.obj" -s "TEMP3D_measure_topology.mlx" START OF MESHLAB STDOUT & STDERR Loading Plugins: Current Plugins Dir is: C:/Program Files/VCG/MeshLab/plugins Total 241 filtering actions Total 12 io plugins Log is saved in TEMP3D_measure_topology_log.txt Opening a file with extention obj FilterScript Reading filter with name Compute Topological Measures no additional memory available!!! memory required: 531456 LOG: 2 V: 11019 E: 33375 F: 22250 LOG: 2 Unreferenced Vertices 0 LOG: 2 Boundary Edges 0 LOG: 2 Mesh is composed by 62 connected component(s)
LOG: 2 Mesh is two-manifold LOG: 2 Mesh has 0 holes LOG: 2 Genus is 115 manifold = True non_manifold_E = 0 non_manifold_V = 0 vert_num = 11019 edge_num = 33375 face_num = 22250 unref_vert_num = 0 boundry_edge_num = 0 part_num = 62 hole_num = 0 genus = 115
Number of faces of original mesh is: 22250
Creating a folder to store the decimated model ...........
Beginning the process of Decimation ........... meshlabserver cmd = meshlabserver -i "Vorrichtung.obj" -o "15000/Vorrichtung_s.obj" -m vc vn fc wt -s "C:\Users\WASEEM\AppData\Local\Temp\tmpgbb129m0.mlx" START OF MESHLAB STDOUT & STDERR Loading Plugins: Current Plugins Dir is: C:/Program Files/VCG/MeshLab/plugins Total 241 filtering actions Total 12 io plugins Opening a file with extention obj Mesh C:/Users/WASEEM/Desktop/3DMeshBulkSimplification-master/Vorrichtung.obj loaded has 11019 vn 22250 fn output mesh C:/Users/WASEEM/Desktop/3DMeshBulkSimplification-master/15000/Vorrichtung_s.obj vertex color, vertex normals, face color, wedge tex coords, Apply FilterScript: 'C:/Users/WASEEM/AppData/Local/Temp/tmpgbb129m0.mlx' FilterScript Reading filter with name Simplification: 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: Simplification: Quadric Edge Collapse Decimation (with texture) no additional memory available!!! memory required: 531456 Problem with filter: Simplification: Quadric Edge Collapse Decimation (with texture) Failed to apply script file C:/Users/WASEEM/AppData/Local/Temp/tmpgbb129m0.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 "Vorrichtung.obj" -o "15000/Vorrichtung_s.obj" -m vc vn fc wt -s "C:\Users\WASEEM\AppData\Local\Temp\tmpgbb129m0.mlx"" Where do we go from here? r - retry running MeshLab (probably after you've fixed any problems with the input files) c - continue on with the script (probably after you've manually re-run and generated the desired output file(s) x - exit, keeping the TEMP3D files and log xd - exit, deleting the TEMP3D files and log Select r, c, x (default), or xd: c Continuing on ...
Process of Decimation Finished ...
Copying textures (PNG and JPEG) into the folder of decimated model....
Found the LIST of images in PNG and JPEG (textures): ['MMSEV_Bump_v1s.png', 'MMSEV_Color_v2s.png', 'MMSEV_Reflect_v1s.png', 'MMSEV_spec_color_v1s.png', 'MMSEV_Spec_v1s.png']
Any idea?
Regards, Waseem Khan
You have a problem with the decimation filter in your Meshlab process "Problem with filter: Simplification: Quadric Edge Collapse Decimation (with texture)". Can you do the same exact decimation manually via the GUI application? Can you give the content of C:/Users/WASEEM/AppData/Local/Temp/tmpgbb129m0.mlx please? usually it is deleted when finished
Your script should print many "Simplifing heap size XXXX ops XXX" which you do not have in your output. Can your python script access the Windows temp folder?
the mlx file contain the parameters of decimation: `<!DOCTYPE FilterScript>
Hi, I tried the simplification with Meshlab gui and I got this error: failure of filter: "Simplification: Quadratic Edge collapse Decimation(with texture)" Mesh has some inconsistent tex coordinates(some faces without texture)
Actually my model has texture color on its certain small portion, not on overall model but I want to keep this texture color on a very tiny portion of it after simplification.
I run again the same model file and got this file in prints in the same path "C:\Users\WASEEM\AppData\Local\Temp\tmpd2_zu2qn.mlx"" and its contents are in the text file which is attached text.txt :
Regards, Waseem
Ah! one last thing. You can not decimate to a number of faces that do not preserve the integrity of the mesh at least with the default parameters in the script. Same as in decimating manually in the GUI app so play around with parameters. Can your model be decimated to 15K faces in the GUI Meshlab
So the script works fine as long as the GUI app works fine with the parameters of Quadratic edge collapse algorithm, in other words if you can do it in the GUI app you should be able to do in the script. So the problem is in your models. please check this https://sourceforge.net/p/meshlab/discussion/499533/thread/530abebc/
Thanks for your replies. That problem is solved. Actually meshlab only works "with texture" option when whole model has texture color on it otherwise meshlab or your script only works without texture option. I tried another model file which is .3DS and simplification is working on it in meshlab but not with your python script. The prints are following:
C:\Users\WASEEM\Desktop\3DMeshBulkSimplification-master>python simplify.py beetle.3DS beetle_s.3DS 100000 False
Detecting Meshlab server Hosting Operating System ...
You appear to be on Windows machine ... Number of Arguments Given to the script: 5 arguments. TexturesFlag: False meshlabserver cmd = meshlabserver -l TEMP3D_measure_topology_log.txt -i "beetle.3DS" -s "TEMP3D_measure_topology.mlx" START OF MESHLAB STDOUT & STDERR Loading Plugins: Current Plugins Dir is: C:/Program Files/VCG/MeshLab/plugins Total 241 filtering actions Total 12 io plugins Log is saved in TEMP3D_measure_topology_log.txt Opening a file with extention 3DS FilterScript Reading filter with name Compute Topological Measures no additional memory available!!! memory required: 8738160 LOG: 2 V: 200476 E: 526752 F:327228 LOG: 2 Unreferenced Vertices 0 LOG: 2 Boundary Edges 71922 LOG: 2 Mesh is composed by 9495 connected component(s)
LOG: 2 Mesh has 51 non two manifold edges and 108 faces are incident on these edges
LOG: 2 Mesh has 5711 non two manifold vertexes and 34472 faces are incident on these vertices
LOG: 2 Mesh has a undefined number of holes (non 2-manifold mesh) LOG: 2 Genus is undefined (non 2-manifold mesh) manifold = False non_manifold_E = 0 non_manifold_V = 0 vert_num = 200476 edge_num = 526752 face_num = 327228 unref_vert_num = 0 boundry_edge_num = 71922 part_num = 9495 non_manifold_edge = 51 non_manifold_vert = 5711 hole_num = undefined genus = undefined
Number of faces of original mesh is: 327228
Creating a folder to store the decimated model ...........
Beginning the process of Decimation ........... Default output mask for file extension "3ds" is not currently supported Traceback (most recent call last): File "C:\Users\WASEEM\AppData\Local\Programs\Python\Python37\lib\site-packages\meshlabxml\mlx.py", line 417, in run cmd += ' %s' % output_mask[index] IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "simplify.py", line 104, in
From the prints, it seems to me that .3DS files are not supported with your script.
Hi,
I tried to simplify some .OBJ models but your script seems to have some problem. Following is what I got when I tried to run:
C:\3DMeshBulkSimplification-master>python simplify.py Vorrichtung.stl Vorrichtung_s.stl 10000 True
Detecting Meshlab server Hosting Operating System ...
You appear to be on Windows machine ... Number of Arguments Given to the script: 5 arguments. TexturesFlag: True meshlabserver cmd = meshlabserver -l TEMP3D_measure_topology_log.txt -i "Vorrichtung.stl" -s "TEMP3D_measure_topology.mlx" START OF MESHLAB STDOUT & STDERR Loading Plugins: Current Plugins Dir is: C:/Program Files/VCG/MeshLab/plugins Total 241 filtering actions Total 12 io plugins Log is saved in TEMP3D_measure_topology_log.txt Opening a file with extention stl FilterScript Reading filter with name Merge Close Vertices Reading Param with name Threshold : RichAbsPerc Reading filter with name Change the current layer Reading Param with name mesh : RichMesh Reading filter with name Compute Topological Measures no additional memory available!!! memory required: 1869000 LOG: 2 Successfully merged 0 vertices no additional memory available!!! memory required: 525456 no additional memory available!!! memory required: 525456 LOG: 2 V: 10769 E: 32871 F: 22250 LOG: 2 Unreferenced Vertices 0 LOG: 2 Boundary Edges 0 LOG: 2 Mesh is composed by 59 connected component(s)
LOG: 2 Mesh has 504 non two manifold edges and 1032 faces are incident on these edges
LOG: 2 Mesh has 4 non two manifold vertexes and 52 faces are incident on these vertices
LOG: 2 Mesh has a undefined number of holes (non 2-manifold mesh) LOG: 2 Genus is undefined (non 2-manifold mesh) manifold = False non_manifold_E = 0 non_manifold_V = 0 vert_num = 10769 edge_num = 32871 face_num = 22250 unref_vert_num = 0 boundry_edge_num = 0 part_num = 59 non_manifold_edge = 504 non_manifold_vert = 4 hole_num = undefined genus = undefined
Number of faces of original mesh is: 22250
Creating a folder to store the decimated model ...........
Beginning the process of Decimation ........... meshlabserver cmd = meshlabserver -i "Vorrichtung.stl" -o "10000/Vorrichtung_s.stl" -s "C:\Users\WASEEM\AppData\Local\Temp\tmprt194ltq.mlx" START OF MESHLAB STDOUT & STDERR Loading Plugins: Current Plugins Dir is: C:/Program Files/VCG/MeshLab/plugins Total 241 filtering actions Total 12 io plugins Opening a file with extention stl Mesh C:/Users/WASEEM/Desktop/3DMeshBulkSimplification-master/Vorrichtung.stl loaded has 66750 vn 22250 fn output mesh C:/Users/WASEEM/Desktop/3DMeshBulkSimplification-master/10000/Vorrichtung_s.stl Apply FilterScript: 'C:/Users/WASEEM/AppData/Local/Temp/tmprt194ltq.mlx' FilterScript Reading filter with name Merge Close Vertices Reading Param with name Threshold : RichAbsPerc Reading filter with name Change the current layer Reading Param with name mesh : RichMesh Reading filter with name Simplification: 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 3 actionsfilter: Merge Close Vertices no additional memory available!!! memory required: 1869000 LOG: 2 Successfully merged 0 vertices Successfully merged 0 vertices filter: Change the current layer no additional memory available!!! memory required: 525456 Successfully merged 0 vertices filter: Simplification: Quadric Edge Collapse Decimation (with texture) no additional memory available!!! memory required: 525456 Successfully merged 0 vertices Problem with filter: Simplification: Quadric Edge Collapse Decimation (with texture) Failed to apply script file C:/Users/WASEEM/AppData/Local/Temp/tmprt194ltq.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 "Vorrichtung.stl" -o "10000/Vorrichtung_s.stl" -s "C:\Users\WASEEM\AppData\Local\Temp\tmprt194ltq.mlx"" Where do we go from here? r - retry running MeshLab (probably after you've fixed any problems with the input files) c - continue on with the script (probably after you've manually re-run and generated the desired output file(s) x - exit, keeping the TEMP3D files and log xd - exit, deleting the TEMP3D files and log Select r, c, x (default), or xd: c Continuing on ...
Process of Decimation Finished ...
Copying textures (PNG and JPEG) into the folder of decimated model....
Found the LIST of images in PNG and JPEG (textures): ['MMSEV_Bump_v1s.png', 'MMSEV_Color_v2s.png', 'MMSEV_Reflect_v1s.png', 'MMSEV_spec_color_v1s.png', 'MMSEV_Spec_v1s.png']
Any idea, how to resolve it?