Skip to content

Fix cloud sampling failure when the density for a single object is too low#2265

Merged
dgirardeau merged 2 commits intoCloudCompare:masterfrom
omarelladen:master
Dec 28, 2025
Merged

Fix cloud sampling failure when the density for a single object is too low#2265
dgirardeau merged 2 commits intoCloudCompare:masterfrom
omarelladen:master

Conversation

@omarelladen
Copy link
Contributor

When sampling points on a mesh using the CLI, the execution should not terminate when ccGenericMesh::samplePoints returns nullptr. This is specially important when an object of the mesh is too small to have its cloud generated (in this case sampledCloud->size() == 0), so the sampling of rest of the objects should continue, as it does in the GUI.

@omarelladen omarelladen changed the title Fix cloud sampling failure when the density of a single object is too… Fix cloud sampling failure when the density for a single object is too low Dec 20, 2025

if (!cloud)
{
return cmd.error(QObject::tr("Cloud sampling failed!"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could maybe still issue a warning?

@omarelladen
Copy link
Contributor Author

I added the same error message as in the GUI

Copy link
Member

@dgirardeau dgirardeau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the update!

@dgirardeau dgirardeau merged commit d56c750 into CloudCompare:master Dec 28, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants