The Exception:Point set is degenerate

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
mazelin
Posts: 6
Joined: Thu Dec 13, 2012 1:50 am

The Exception:Point set is degenerate

Post 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);
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: The Exception:Point set is degenerate

Post 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.
templar_vii
Posts: 17
Joined: Wed Nov 06, 2013 2:56 pm

Re: The Exception:Point set is degenerate

Post by templar_vii »

Which is the correct way to create a plain surface without volume, made out of vertices and triangleindices?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: The Exception:Point set is degenerate

Post by Norbo »

If it's not supposed to be mobile, StaticMesh. If it is, MobileMesh.
templar_vii
Posts: 17
Joined: Wed Nov 06, 2013 2:56 pm

Re: The Exception:Point set is degenerate

Post 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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: The Exception:Point set is degenerate

Post 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.
templar_vii
Posts: 17
Joined: Wed Nov 06, 2013 2:56 pm

Re: The Exception:Point set is degenerate

Post 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!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: The Exception:Point set is degenerate

Post 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.
Post Reply