Page 1 of 1

The Exception:Point set is degenerate

Posted: Tue Jan 01, 2013 7:30 am
by mazelin
Hi,
When I new ConvexHull object, the exceptoion 'Point set is degenerate; convex hulls must have volume.' will throw.I don't know why?
Thank you!

Code: ConvexHull hull = new ConvexHull(verticesList, 1);

Re: The Exception:Point set is degenerate

Posted: Tue Jan 01, 2013 7:22 pm
by Norbo
That exception is thrown when the provided point set has no volume. For example, it may be a bunch of overlapping points in one spot, or perhaps a triangle. The convex hull algorithm cannot operate on such 'degenerate' point sets.

Re: The Exception:Point set is degenerate

Posted: Mon Nov 11, 2013 2:08 pm
by templar_vii
Which is the correct way to create a plain surface without volume, made out of vertices and triangleindices?

Re: The Exception:Point set is degenerate

Posted: Mon Nov 11, 2013 6:27 pm
by Norbo
If it's not supposed to be mobile, StaticMesh. If it is, MobileMesh.

Re: The Exception:Point set is degenerate

Posted: Tue Nov 12, 2013 6:56 am
by templar_vii
But the MobileMesh also throws the Exception "Point set is degenerate; convex hulls must have volume." if it has no volume. Maibe I'm doing something wrong.

Re: The Exception:Point set is degenerate

Posted: Tue Nov 12, 2013 8:01 pm
by Norbo
Is that in the latest version? If so, could you show the setup that reproduces the issue?

You should get an error if a volumeless MobileMesh is constructed as Solid, but I wouldn't expect that particular exception. I also found and fixed a couple of bugs in the MobileMeshShape initialization for Solid mode a few minutes ago, but it seems to be unrelated.

Re: The Exception:Point set is degenerate

Posted: Wed Nov 13, 2013 7:59 am
by templar_vii
I just downloaded the latest Version (commit e2ffc7834e35).
I still get the exception.

It's not that bad to me. It's more important to know, that MobileMesh is the way a volumeless freeform has to be created. It's also possible that I'm doing something wrong.

The callstack is:

new MobileMesh()
new MobileMeshShape()
UpdateSurfaceVertices()
ConvexHullHelper.GetConvexHull()
ComputeInitialTetrahedron() --> throws the exception

Many thanks Norno for your help!

Re: The Exception:Point set is degenerate

Posted: Wed Nov 13, 2013 10:35 pm
by Norbo
I wasn't able to reproduce an uncaught exception. The particular exception implied by that stack trace should never propagate outside of the inertia tensor calculation- something weird is happening there.

However, I went ahead and made another change for the sake of cleanliness and performance which should stop it from happening anyway.