Convex hull generation failing

Hello,

Our art team often uses the “Mesh to Collision” modeling tool to generate convex decompositions.

This tool causes warnings on some assets.

LogChaos: Warning: Convex hull generation produced zero convex particles, collision will fail for this primitive.
LogPhysics: Warning: TConvex Name:BodySetup /Game/Environment/SM_Example.SM_Example:BodySetup_0, Element [104] has no Geometry

I’ve identified the cause to be in “void FConvexBuilder::Build”, there’s logic to detect if the verts form a plane.

This is implemented in “static bool IsPlanarShape” and will fail if the first 3 verts in the set are colinear.

The algorithm builds a plane off of the first 3 verts and works from there. If they are colinear, it’s not able to build the plane properly.

In that case, the function IsPlanarShape returns true but provides a zero vector as the plane normal.

Regards,

[Attachment Removed]

Hello,

I’ve got an update on this.

We’ve identified another failure case, this time the initial points weren’t colinear but the IsPlanarShape function disagreed with TExtremePoints3 on classifying the point cloud as a plane.

Here’s the input data for reference.

+		[0]	{1505.14832, 2059.47095, 961.376648}	Chaos::TVector<float,3>
+		[1]	{1495.95801, 2059.42871, 961.285950}	Chaos::TVector<float,3>
+		[2]	{1505.14832, 2059.42871, 961.286011}	Chaos::TVector<float,3>
+		[3]	{1496.36475, 2059.42871, 961.286011}	Chaos::TVector<float,3>
+		[4]	{1470.01379, 2059.42871, 961.286011}	Chaos::TVector<float,3>
+		[5]	{1487.58105, 2059.42871, 961.286011}	Chaos::TVector<float,3>
+		[6]	{1470.01379, 2059.47095, 961.376648}	Chaos::TVector<float,3>
+		[7]	{1487.58105, 2059.47095, 961.376648}	Chaos::TVector<float,3>
+		[8]	{1487.58105, 2059.47095, 961.376648}	Chaos::TVector<float,3>
+		[9]	{1495.95801, 2059.47095, 961.376587}	Chaos::TVector<float,3>
+		[10]	{1496.36475, 2059.47095, 961.376587}	Chaos::TVector<float,3>
+		[11]	{1491.97290, 2059.47095, 961.376587}	Chaos::TVector<float,3>
+		[12]	{1491.97290, 2059.47095, 961.376648}	Chaos::TVector<float,3>

The reason for the discrepancy is that TExtremePoints3 is much more deliberate in how it builds the plane and it seems to pick a plane that minimizes the distance to the plane for every single point in the set.

We worked around this by modifying the IsPlanarShape function to just use TExtremePoints3 under the hood.

[Attachment Removed]

Hi,

thanks for reporting this bug and providing a workaround. Would you be able to provide a minimal repro project containing simplified failure case assets or some repro steps? This would be needed to file a bug report with Epic and speeds up bug fixing.

Thank you,

Sam

[Attachment Removed]

Hi,

Thanks a lot for this repro asset. I filed a bug report with Epic and will post a link here when the issue becomes available on the public issue tracker.

Thanks,

Sam

[Attachment Removed]

Hello Sam,

Sorry for the late reply I was away for a while.

We did run into other failure cases even when using both workarounds. Here is an example offending uasset file. It’s complaining about elements 6 and 7 when loading the asset

LogChaos: Warning: Convex hull generation produced zero convex particles, collision will fail for this primitive.
LogChaos: Warning: Convex hull generation produced zero convex particles, collision will fail for this primitive.
LogChaos: Warning: Convex hull generation produced zero convex particles, collision will fail for this primitive.
LogChaos: Warning: Convex hull generation produced zero convex particles, collision will fail for this primitive.
LogPhysics: Warning: TConvex Name:BodySetup /Game/TestAsset.TestAsset:BodySetup_0, Element [6] has no Geometry
LogPhysics: Warning: TConvex Name:BodySetup /Game/TestAsset.TestAsset:BodySetup_0, Element [7] has no Geometry

Cheers,

Benjamin

[Attachment Removed]

Hi,

the issue is now available publicly at this link so you can track its progress.

Thanks again,

Sam

[Attachment Removed]