kmammou / v-hacd Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/v-hacd
License: BSD 3-Clause "New" or "Revised" License
Automatically exported from code.google.com/p/v-hacd
License: BSD 3-Clause "New" or "Revised" License
Add a merge stage to combine convex-hulls if the volume of their convex-hull is
equal to sum of their volumes
Original issue reported on code.google.com by [email protected]
on 23 Nov 2014 at 8:49
Implement queue data structure to avoid relying on STL
Original issue reported on code.google.com by [email protected]
on 23 Nov 2014 at 8:52
Hi Kmamou
Greetings
We love your Addn but am having difficulties with your repository. I note this update blender_vhacd eliminates the error in blender preferences and the shows a further error in run.py
Please note in the blender 2.8 console it reports:
fake module: addon missing ‘bl_info’ gives bad performance ! ‘C:\…\…\AppData\Roaming\BlenderFoundation\Blender\2.8\scripts\addons\run.py’
Is this ‘run.py’ file you are using different too ours from v-hacd-master zip is 1.25kb and without bl_info? Do you have a later version please?
Please note this does all work in 2.79 but not in 2.8 . I have the feeling that your repository does not contain all the files to make this fabulous software work. Would you be so kind and provide your latest run.py please so that We can move forward ?
Thank you for your assistance.
I'm on mac and seem to be having a similar issue to a few people before, however am unable to fix it in the same way others have (in issues 13 and 14).
Once I have installed v-hacd as an add on to blender, and added the testVHACD path to the VHAC field, pressing OK causes nothing to happen but an error of "no meshes to process!" appears.
Im fairy certain that i'm installing/using the add on in the correct way as I have tried the same method on windows and it works perfectly.
In console the error shows as
Dyld Error Message:
Library not loaded: /opt/local/lib/libgcc/libgomp.1.dylib
Referenced from: /Users/USER/Downloads/*/testVHACD
Reason: image not found
Which is similar to that of issue 13, which was solved as
"My gcc folder is not in /opt/local. After placing it there it starts the convex decomposition."
However i lack any gcc, opt or local folders.
Hello - is there a way to use generated convex hulls to split the mesh according to the decomposition? It would be very helpful in object destruction where convex decomposition splits object into meaningful parts - more suitable for destruction of objects like chairs etc. than cell fracture.
I think it would be monumentally helpful if the paramaters used to generate the demos could be provided.
I'm having a hard time figuring out how to get the plugin to produce more than 3 or 4 rough hulls of my object!
Would appreciate it!
When trying to use V-HACD with a set of points on a plane that is paralle with xy plane then I get a crash. In my opinion the culprit is Volume::Voxelize function. There is ComputeBB called which calculates the bounding box of the points. Then double d[3] = { m_maxBB[0] - m_minBB[0], m_maxBB[1] - m_minBB[1], m_maxBB[2] - m_minBB[2] }; is calculated where d[2] = 0 which is used in
m_dim[0] = 2 + static_cast<size_t>(dim * d[0] / d[2]);
m_dim[1] = 2 + static_cast<size_t>(dim * d[1] / d[2]);
that skyrocket + causes a memory spike since these values are used in the following memory allocation.
As discussed via email, it would be great to have some kind of a context
variable that allows mainly for two things:
* Be able to cancel the execution of long running V-HACD functions. There has to be a reasonable tradeoff between response time and performance. Execution does not need to interrupt immediately but with an approximate grace period of, say between 10 and 30 seconds. I need to set this from an outside thread (in a callback?) and the function will stop at the next given opportunity. Preferably including cleanup of temp data.
* The same mechanism should be able to give me an approximation of progress. Ideally in percent of total time. Again, this doesn't need to be precise. Just a rough indication for the user to know how long this will take.
I suggest a context object interface that is implemented by the user and can be
passed in. It could look like this:
namespace VHACD {
struct IControlFlow {
// called by vhacd to tell the total progress.
// (optional, could resort to always 100 percent)
// it would be ideal if this would be called only
// once and not change afterwards but I guess that
// would be hard to achieve
void set_total_progress(std::size_t p) throw () = 0;
// called by vhacd to indicate how much progress
// has been made. Must be between 0 and set_total_progress()
void set_progress(std::size_t p) throw () = 0;
// called by vhacd regularily
// if it returns false, the algo is aked to stop at
// the next given occasion
bool continue() throw () = 0;
}
}
The user will implement this object and pass it to ApproximateDecomposition().
Would be awesome.
Thanks,
Stephan
Original issue reported on code.google.com by [email protected]
on 2 Dec 2014 at 9:00
It would be nice if the lib could compute the inertia tensor of each hull at the same time it computes volume.
Bullet's convex hull inertia tensor computation seems to treat all the mass as if condensed in the vertices, so the inertia is innacurate, mostly on elongated objects.
The inertia tensors's three coordinates of each hull could be output perhaps in a text file.
Thank you for reading this feature enhancement petition.
I'm on Mac. After installing the blender plugin and adding the //v-hacd-master/bin/osx/testVHACD path to field VHAC, When I press OK on the pop-up window to start the convex decomposition, it does nothing just gives an error 'no meshes to process!'. Despite my mesh being selected in Object mode.
I've tried it with a simple mesh such as a cube mesh and gives the same error. I've also tried adding the osx path inside 'bin-no-ocl' and 'bin-no-ocl-omp' folders instead, same error. I'm also not sure if I need to change the 'add V-HACD paths preset' field or only to add the path to 'path to testVHACD executable.
I've identified one problem as it says 'dyld: Library not loaded: /opt/local/lib/libgcc/libgomp.1.dylib'
My gcc folder is not in /opt/local. After placing it there it starts the convex decomposition. I think there should be a field in the gui that allows for specifying the path to gcc.
However, even after I've copied my gcc to the above path, initiating VHACD results in a few minutes of processing with log in terminal, but in the end, without any error message in terminal, the 'no meshes to process!' error shows up again in Blender and no ACD mesh is created.
I copy here the terminal log just in case:
Exporting mesh for V-HACD: /var/folders/b8/8bjj90812dqd2bdgzqllpmgm0000gn/T/Suzanne.off...
Running V-HACD...
/Users/user/Code/v-hacd-master/bin/osx/testVHACD --input "/var/folders/b8/8bjj90812dqd2bdgzqllpmgm0000gn/T/Suzanne.off" --resolution 100000 --depth 20 --concavity 0.0025 --planeDownsampling 4 --convexhullDownsampling 4 --alpha 0.05 --beta 0.05 --gamma 0.00125 --pca 0 --mode 0 --maxNumVerticesPerCH 32 --minVolumePerCH 0.0001 --output "/var/folders/b8/8bjj90812dqd2bdgzqllpmgm0000gn/T/Suzanne.wrl" --log "/var/folders/b8/8bjj90812dqd2bdgzqllpmgm0000gn/T/Suzanne_log.txt"
Hi,
I was wondering if it was possible specify an option to do a convex such that the longest length of a convex "piece" is always aligned to the x,y, or z axis.
this would enable creation of tight fitting AABBs after the result of v hacd
I watched the Youtube video and this add-on looks great. Instead of just visualize the result in Blender, just wonder if this add-on can export the decomposed sub-meshes? Or is it possible to use this add-on as a standalone program since I am pretty new to Blender.
Any comment is appreciated.
Hi
I just downloaded v-hacd blender add-on with testVHACD.exe for 64 bit windows.
I load an obj file to blender then select it in blender object mode then in tools--> V-HACD
i set testVHACD.exe path and click V-HACD button but I got error saying "no meshes to process".
Can you please help?
Blender 2.79b
\v-hacd\bin\win64\
Hi,
When i create Suzanne and Apply Standard V-HACD calcualtion all collision meshes (and tesselated mesh when use genrated mesh is true) are generated as children from the right ear.
Is it possible to generate the collision meshes as children from the selected mesh?
best,
Sascha
This issue is mostly related to #59. I'm trying to decompose a relatively simple rectangular mesh with two holes as follows:
The algorithm does not seem to find a decomposition where the holes are preserved:
The green highlighting indicates the generated mesh. As you see, it does not take into account the holes. This happens for any combination of settings I tried, including increasing the resolution, the number of points per CH, the number of convex hulls and decreasing the minimum volume as per the advice in #59.
Can you shed some insight in how to get more detailed results in such a basic mesh as this?
Further more, the generated mesh does not really fit the original mesh perfectly as can be seen here:
Is that related to the first issue or is that something else?
I love V-HACD. it really is a life saver!
Is there any explanation of how I should realistically be setting the parameters? For example, I am trying to figure out which combination of parameters would results in the most faithful decomposition vs, which combination would result in a very crude approximation. I can't seem to figure it out by trial and error. Your help is greatly appreciated. Thank you.
The user callback that displays progress is not called often enough to prevent
a GUI application from going into "not responding" mode. The total percentage
complete goes to 15% very quickly, then stalls for a couple of minutes and
jumps to 90%, then finishes quickly. In order to be useful, that callback
should really get called a lot more often, so the user doesn't think there is
something wrong with the program.
Original issue reported on code.google.com by [email protected]
on 16 Dec 2014 at 5:45
Like the one shown in the pictures.. Trying to make collisions for an entire map object is hard when splitting into multiple parts.
Error occurs when there are space before line endings, I recommend changing line 569 of src/test/main.cpp
to
if (pch && *pch != '\n')
I'm creating 3D letter using THREE.TextGeometry and THREE.Mesh and would like to have it collide with other letters using Cannon.js, much like http://schteppe.github.io/cannon.js/demos/collisions.html How do I run v-hacd ? I'm sorry for such a basic question, but I couldn't figure it out.
Hi
in blender when i click on V-HACD and the click OK button but I got testVHACD.exe system error saying:
"The program can't start because VCOMP140.DLL is missing from your computer. Try reinstalling the program to fix this problem."
I am on windows 10 64 bit.
In src/VHACD_Lib/CMakeLists.txt, The LIB_TYPE variable with should be used for configuring a shared library (DLL) is not used in add_library(vhacd ...
I've attached a fixed CMakeLists.txt
CMakeLists.txt
Also it would be nice to add something similar to
set(CMAKE_DEBUG_POSTFIX "_d")
at the top of the root CMakeLists.txt. This will add a postfix to debug binaries, which allows them to be in the same directory as their release counterparts.
Gino
hi,
I noticed the files in win32 and win64 folders and wanted to ask if this package is also usable in Ubuntu.
So far from what I tired I got the "No meshes to process!" error.
Thanks.
Hello! Author of V-HACD toolkit for Houdini here :)
I see that m_maxConvexHulls is set by default to 1024. But is there a max limit to this parameter?
Also, now that m_gamma & m_depth are gone and we have m_maxConvexHulls & m_projectHullVertices & m_convexhullApproximation parameters instead, could you update this page:
http://kmamou.blogspot.ca/2014/12/v-hacd-20-parameters-description.html
I use Cmake to make the Code run on VS2017. The program runs well, however, the segmentation results looks not as well as the showing examples. There are crevices among separated individuals. I want to konw how to eliminate these crevices and make the results as perfect as the showing examples.
Add parameter to control the max # of vertices for convex-hulls
Original issue reported on code.google.com by [email protected]
on 23 Nov 2014 at 8:47
Is it somehow feasible to join the resulted set of convex hulls into one solid object without intersecting geometry? I am more than satisfied with outer shape that this addon does, however, there is bunch of separate objects in the resulting output that cannot be actually merged together due to intersecting faces. That feature can be used by many people who are doing any sort of gamedev production for getting object collision shapes.
I'm trying to decompose this gear:
Using the following parameters:
How should I improve the quality of the decomposition?
I would like that the central hole will be as circular as possible.
While trying to use VHACD with simple cube, it works, while trying to use it on a more complicated model
http://i.imgur.com/njQwN3L.png
i get the no meshes to process error
http://i.imgur.com/QFBFl9m.png
here's my console log
https://pastebin.com/hECg9TnB
world_azeroth_elwynn_passivedoodads_trees_elwynntreecanopy0.000_log.txt
system info:
https://pastebin.com/CZ3KJHPU
Hi @kmammou I have an obj on which no output is produced by testVHACD. The executable runs and produces no error output -- it just reprints its usage and parameter settings. No output .wrl file is produced.
This problem only happens on some OBJ files that I've tried, but not on others (on the other ones I've verified that a correct convex decomposition is produced).
I've attached an example mesh causing the problem. (I've renamed its extension ".txt" because github doesn't allow uploading of files with the ".obj" extension, but it is an obj file.)
If you could let me know what's going wrong that would be fantastic.
Hi, dear author,
would you mind to give a simple code script for enable the collision with v-hacd in blender ? i am not albe to perform v-hacd collison , So i am not able to see any difference between them, i can simply got the v-hacd mesh, but not know how to use it in collision, the default collision shape in blender is convex-hull.
Thanks advance.
After this commit 6d2d84a testVHACD version built from sources stopped working cause of:
I can't send pull request because it break compatibility with already existing binaries for Windows/OSX, so bugfix must contain blender plugin fix and updated binaries.
Hi, trying to integrate this to http://github.com/godotengine/godot
Unfortunately, we also bundle Bullet, so your code just repeats Bullet classes.
Can you switch to another quick hull library, or modify the Bullet code to not clash?
Thanks
Thanks for the great work. I was wondering is there any constraints for the input? Say, the input has to be a watertight mesh or the code can solve any meshes even the open ones?
Hi,
how do i set v-hacd up do generate only "simple" volumes (triangle, quads).
Or is it not possible?
Sorry for asking in issues area.
Thanks
For my use case, it would be helpful to run the add-on on all selected mesh objects via a blender python script.
I need to generate hulls for a large number of object meshes and export each component to a seperate .stl
file so being able to programmatically invoke v-hacd would be helpful.
I am trying to determine the cause of all my convex hull being rotated 180 degrees around the z-axis. Does anyone know why this would be happening?
Will there be an update for this tool to work with blender 2.81?
getting this error when I try to run it:
Traceback (most recent call last):
File "C:\Users\user1\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\object_vhacd.py", line 366, in execute
row = col.row()
File "C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\modules\bpy\ops.py", line 201, in call
ret = op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.import_scene.x3d" error, could not be found
location: :-1
When running the plugin, I receive a message saying there are no meshes selected followed by this Symbol not found error in the console:
dyld: Symbol not found: __ZTTNSt7__cxx1119basic_ostringstreamIcSt11char_traitsIcESaIcEEE
Referenced from: /Users/blake/vhacd-scripts/testVHACD
Expected in: /usr/lib/libstdc++.6.dylib
in /Users/blake/vhacd-scripts/testVHACD
I am running on macOS 10.14.6
Hi, I tried to build the binary on my GNU/Linux Debian 9.3 with NVIDIA 970 graphics card (driver 375.82) and I encountered these issues:
the original install/run.py
script does not work, but replacing in the cmake
fuction, the line cmd = "cmake" + arg + "../" + src_dir
with cmd = [" cmake ", arg," ../ "+ src_dir]
everything works fine
after having successfully built the binary and then installed and configured the add-on in Blender (2.78a), I have decomposed the Suzanne
monkey successfully, but in the log
Suzanne_log.txt
have resulted some OpenCL related errors.
bye
It seems that voxelization is the slowest part of V-HACD at the moment, and could be sped up using OpenCL. Do you think this is worth doing? Would you be open to such a contribution?
For those of us who don't have OpenCL installed could you make the inclusion of
FindOpenCL optional.
In src/VHACD_Lib/CMakeLists.txt and src/test/CMakeLists.txt
change "include (FindOpenCL)" to "include (FindOpenCL OPTIONAL)".
Original issue reported on code.google.com by [email protected]
on 17 Jan 2015 at 6:03
At the moment there are a lot of large files in this repo, which makes it difficult to use as a submodule. Splitting the lib code from the supporting files, screenshots, etc, would make that much better.
Feel free to close if you don't want to do this.
Using v-hacd as a shared library will generate a .dll file but no .lib file.
https://medium.com/@yzhong.cs/visual-studio-does-not-generate-lib-file-for-a-dll-project-b09302fdf5b0
Searching the entire project for declspec
only returns 3 instances of __declspec()
which are located in btScalar.h
.
I built a project with the latest V-HACD code and was try to speed up Hull generation by using the oclAcceleration option. However, the call to clEnqueueNDRangeKernel in VHACD.cpp returns CL_OUT_OF_RESOURCES.
I googled this problem and a post suggested reducing the local work size parameter. I reduced it from 4096 to 128 and then the call was successful ( no larger values would work ).
Running with this value however did not improve performance over not running GPU acceleration.
This library seems really great!!!!, only really unclear how to use.
Don't see this issue post as bitching, it's just to adress issues!
The blender addon documentation goes to google code which redirects to the root to github without documentation (apart from a brief overview).
The doc folder only contains images.
I installed the add on succesfully in blender.
For the VHACD Path, I have no idea if I should link to the one in bin, bin-no-ocl, bin-no-ocl-omp. I tried all 3 of them but no luck.
When selecting a mesh in blender and pressing the V-HACD button it does create a *.off file in the data folder but I also get the message 'No meshes to process!'.
Also this menu is really small:
Maybe this helps as well. I'm not sure how to continue.
If I navigate in terminal to the bin/osx
folder and type this in terminal:
./testVHACD
Then I get:
dyld: Library not loaded: /usr/local/opt/gcc/lib/gcc/6/libgomp.1.dylib
Referenced from: /Users/doekewartena/Downloads/v-hacd-master 2/bin/osx/./testVHACD
Reason: image not found
Trace/BPT trap: 5
Does the decomposition process preserve (or transfer) UV map from the original mesh on the convex chunks?
If not, could you please add such option, if possible ? Thanks
P.S. I use Blender 2.8x
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.