Skip to content

Commit 6700816

Browse files
committed
fix merge corner case
1 parent 29ececd commit 6700816

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/process.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,12 @@ namespace coacd
281281
{
282282
// Search for lowest cost
283283
double bestCost = INF;
284-
const size_t addr = FindMinimumElement(costMatrix, &bestCost, 0, (int32_t)costMatrix.size());
284+
const int32_t addr = FindMinimumElement(costMatrix, &bestCost, 0, (int32_t)costMatrix.size());
285+
if (addr < 0)
286+
{
287+
logger::warn("No more convex hulls to merge, cannot reach the given convex hull limits");
288+
break;
289+
}
285290

286291
if (params.max_convex_hull <= 0)
287292
{

0 commit comments

Comments
 (0)