Open jratcliff63367 opened 2 years ago
It seems previous version give a better result than version 4, this is what i got in version 4
Regarding previous version is the performance improvement branch and version 3.1 are the same?
I just compared the bunny with version 3.1 vs. 4.0 and 4.0 looks better to me. You can tweak parameters too. Also, your screenshot appears to show the DebugView app. The 4.0 version doesn't run with the DebugView app, is this something you built and updated yourself? I still see it references alpha and beta, for example, which are not in 4.0.
Ah right about the debug view i did still use the old version, that might what causing the issue
Hello,
I am trying to decompose an aortic arch which requires a high resolution and a high number of convex hulls. I am working with MuJoCo (more exactly with MuJoCo and mujoco-py) and I want to export the files as separate stl as mujoco-py cannot work with .obj
yet.
I was wondering if there is a way to output the files as .stl
or somehow convert the subparts of the .obj
to .stl
.
Thank you in advance!
@tudorjnu You can use the TriMesh
Python library to do the conversion from .obj
to .stl
.
@science-code thank you for the response. However, as far as I can tell it will do the conversion of the full mesh resulting in a single '.stl' instead of each convex hull being in its own '.stl'.
@tudorjnu If I remember correctly, you can loop through the convex hulls of your convex decomposition. This means that you can save each hull in the desired .stl
format using TriMesh.
@science-code It seems that the only way to go through is if the decomposition happens within trimesh itself. If it happens outside of it it seems like it is not working and the information is lost after the trimesh.load
I think there is a misunderstanding. The is not a tool. This is a library that you are supposed to integrate into your own tool chain. The application provided 'TestVHACD.exe' is only for demonstration/learning purposes.
I could easily make it save out the individual convex hulls as a series of files, if that is a specific feature request.
Is that what you are asking for?
Hello @jratcliff63367 ! Thank you very much for the response and the amazing work!
I am using the Linux version but indeed I was thinking that it would be nice to have the option to export the series of .stl
objects or the .mtl
so that Blender can read the convex hulls from the file.
Well, the correct way to do this would be to integrate the library into blender. That said, making it save out the hulls as a series of STL and/or wavefront OBJ files is fairly trivial to implement.
I would expect it to be something as "export meshes to specified folder" just after the merging phase.
It would be amazing if that can be done! If I would be more proficient I would have done the changes myself. However I am not and it would take me a significant amount of time.
Thank you very much for the response @jratcliff63367 !
Ok, I just made this change. If you use the option: '-o obj' it will save each one of the convex hulls out as a wavefront OBJ file. So, if there are say 64 hulls, you will get 64 wavefront OBJ files. However, a better approach is to use the option: '-o stl' in which case it will save the results out in a single ASCII STL file where each convex hull is within it's own logical 'solid' grouping. I have tested that both options work.
It saves the files in the same directory as the source mesh.
So, if for example the source mesh is in: /mnt/c/bunny.obj then the output will go to: /mnt/c/bunny_decompose.stl
Thank you very much @jratcliff63367! Sorry for the slow response, I was trying to change the individual outputs from multiple .obj
to multiple .stl
but I am not sure how to do it. Perhaps you may see this as trivial.
When I was trying to import them to blender it turns out that blender can only load one .obj
at a time. I needed it in order to make the transfer as I can only use multiple .stl
.
I managed to re-export the scene as .obj
instead of stl and it worked to import all objects in this manner. Thank you again for your prompt help!
So you are saying that when I save it as an STL where each convex hull is clearly marked as an individual 'solid' object, that doesn't work? I can add an option to save the STL out as a series of files if that is necessary, but since the format natively supports multiple sub-objects that doesn't seem like it should be necessary.
Hello @jratcliff63367 !
I could see that they were separated within the STL file. It seems like Blender does not pick up the individual pieces but it concatenates them instead without access to the subparts.
However, I could get them out using trimesh afterwards by exporting the scene as obj.
For me the help offered is more than enough and as long as I can get the individual STL I am more than happy ☺️.
Thank you very much again for the help!
Ok, I will add an option to save it as a series of stl files too. But this library should really be natively integrated into Blender. If blender is open source I can see about making a pull request.
Thank you very much! Really appreciating all the support 😁
V-HACD has been almost entirely rewritten. All older versions are now considered deprecated and are no longer supported.
If you want access to the old version, you can find it on a branch called 'version.3.1'.
Version 4.0 is faster, more robust, and has bug fixes. The tuning parameters are now fully documented and explained; as is the algorithm.
V-HACD is now delivered as a single header file only.