Right now this code is in the testbed, which has a different license than the main Box2D library (zlib). The testbed uses other tools/libs that might have different restrictions. It should always be safe to use the Box2D library in a commercial product. Credit is appreciated, but not required.
Deformable and breakable body - sample
General DiscussionI'm having a little trouble with the mesher. Setting the minimum angle to below 30 seems to have no effect. I am getting things with a large number of triangles (which is nice for when they break or for making soft bodies out of them, but not that nice for trying to make a good convex decomposition).
minAngle (SetAngle() function) is designed only as an internal used function (quality measures). So dont use it 😉
Actually, I can not put a "zlib" license into TringleMesh, because an important idea ( recursive triangle eating) is from another author, as referenced in the sourcecode. If somebody has an equivalent or better idea to do this, we could "zlib" TriangleMesh.
Actually, I can not put a "zlib" license into TringleMesh, because an important idea ( recursive triangle eating) is from another author, as referenced in the sourcecode. If somebody has an equivalent or better idea to do this, we could "zlib" TriangleMesh.
Well, when i change a few of the settings though TriangleMesh::SetOptions() I can get the minimal triangulation that I'm looking for, but it includes the convex hull as well. I just want that except with the concave polygon outlines.
Also I'm pretty sure this method:
http://local.wasp.uwa.edu.au/~pbourke/p ... iangulate/
uses the same refinement algorithm, so if anyone can hack it up, that would be awesome.
Also I'm pretty sure this method:
http://local.wasp.uwa.edu.au/~pbourke/p ... iangulate/
uses the same refinement algorithm, so if anyone can hack it up, that would be awesome.
tmO_CONVEXHULL flag can be turned off/on via SetOptions
nimodo wrote:Actually, I can not put a "zlib" license into TringleMesh, because an important idea ( recursive triangle eating) is from another author, as referenced in the sourcecode. If somebody has an equivalent or better idea to do this, we could "zlib" TriangleMesh.
The real questions when it comes to licensing code using that idea are (keeping in mind that I'm most definitely not a lawyer):
1) Have you actually used code from other sources in your implementation? (i.e. is it copyrighted?)
2) Is the method patented?
If neither of these is the case, then as far as I know your code is totally unencumbered and you are free to license it as you wish. I know the recursive triangle eating thing is used in Triangle, but it appears that Labelle is a student of Shewchuck (who did Triangle), so it's possible there is some legal constraint on the idea, I'm not entirely sure. Careful, though - if for some reason you don't have the right to re-license the code, you probably don't have the right to distribute it in the first place (as in, on this thread) unless a separate agreement has been worked out.
In my experience, many academics are more than happy to allow use of ideas (or even code, in some cases) for open source purposes as long as they get credit and you ask nicely, so if you'd like to put it under zlib, you can always ask permission. It's not a bad idea to drop a line even if you already know the code is fine to use, because most people are pleased to see that their work is useful to someone else, and it definitely increases the probability they will continue to make their work available publicly.
Even if it's not possible to zlib it, though, this is a very useful utility for off-line work, thanks for writing it!
I'm finding that this isn't tweakable enough for my purposes. I'd like for it to make a constrained delaunay triangulation using the minimum number of triangles. Unfortunately the mesher generates too many of them, and sometimes blows up and makes an insanely large number of them... Then theres the problem of merging triangles. Now i guess since this isnt the convex decomposition thread I shouldn't complain so much, but damn it looked so promising!
You shouldnt expect wonders from this little 28kb mesher 😉
But neverless, I updated it a little bit....
Try md.SetOptions(tmO_BASICMESH)
@ewjordan, thx for your suggestions.
Yes I studied the triangle codes from referenced authors, so i got the idea of triangle eating. I think for now its ok in the testbed as it is.
But neverless, I updated it a little bit....
Try md.SetOptions(tmO_BASICMESH)
@ewjordan, thx for your suggestions.
Yes I studied the triangle codes from referenced authors, so i got the idea of triangle eating. I think for now its ok in the testbed as it is.
nimodo wrote:You shouldnt expect wonders from this little 28kb mesher 😉
But neverless, I updated it a little bit....
Try md.SetOptions(tmO_BASICMESH)
Thanks a bunch! So I still need to make the segment list and indicate where the holes are, even if I just have a concave polygon, right? (just make the concavities "holes")
you may try that...
if you use the updated version you could try simplified: tmO_BASICMESH|tmo_SEGMENTBOUNDARY, and you will retrieve lesser triangles than with tmo_MINIMALGRID
but, i doubt that you will get in ANY case the min. number 🙂
if you use the updated version you could try simplified: tmO_BASICMESH|tmo_SEGMENTBOUNDARY, and you will retrieve lesser triangles than with tmo_MINIMALGRID
but, i doubt that you will get in ANY case the min. number 🙂
Original thread: https://box2d.org/forum/viewtopic.php?t=836