You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason, the top row value is outside of the size of the costMatrix std::vector when I am decomposing this model in debug mode.
The size of the vector is 4005, and the top_row value is 4005. https://github.com/SarahWeiii/CoACD/blob/main/src/process.cpp#L181
Just to add - since this is accessing bad data, you can run coacd on the same mesh many times and get different results as far as # of shapes, points, etc.
if (p1 < costSize)
{
rowIdx = (addrI * p1) >> 1;
size_t top_row = erase_idx;
for (size_t i = 0; i < p1; ++i)
{
//I ADDED THIS CHECK BECAUSE OUT OF BOUNDS STUFF WAS HAPPENING UNTIL I CAN FIGURE OUT WHAT IS GOING ON HEREif (rowIdx < costMatrix.size() && rowIdx < precostMatrix.size() &&
top_row < costMatrix.size() && top_row < precostMatrix.size())
{
if (i != p2)
{
costMatrix[rowIdx] = costMatrix[top_row];
precostMatrix[rowIdx] = precostMatrix[top_row];
}
}
++rowIdx;
++top_row;
}
++top_row;
rowIdx += p1;
for (size_t i = p1 + 1; i < (costSize + 1); ++i)
{
//I ADDED THIS CHECK BECAUSE OUT OF BOUNDS STUFF WAS HAPPENING UNTIL I CAN FIGURE OUT WHAT IS GOING ON HEREif (rowIdx < costMatrix.size() && rowIdx < precostMatrix.size() &&
top_row < costMatrix.size() && top_row < precostMatrix.size())
{
costMatrix[rowIdx] = costMatrix[top_row];
precostMatrix[rowIdx] = precostMatrix[top_row];
}
top_row++;
rowIdx += i;
assert(rowIdx >= 0);
}
}
Really hoping someone smarter than me can figure out what the proper fix is here though.
I don't know what this is even supposed to be doing or what a cost matrix is so it's hard to fix.
For some reason, the top row value is outside of the size of the costMatrix std::vector when I am decomposing this model in debug mode.
The size of the vector is 4005, and the top_row value is 4005.
https://github.com/SarahWeiii/CoACD/blob/main/src/process.cpp#L181
Model: https://drive.google.com/file/d/1Z1TG8CQqk_eUBzhLKfzvWFQh8ACBlSRN/view?usp=share_link
Code example: (Too long for pastebin)
https://drive.google.com/file/d/1eG44C6UPMUqGZjLxwxXyjIVD6zIzuabh/view?usp=share_link
The text was updated successfully, but these errors were encountered: