Skip to content

Commit

Permalink
Return all points when a PointView does not have count points
Browse files Browse the repository at this point in the history
Fix #3447
  • Loading branch information
chambbj committed May 13, 2021
1 parent 6c28993 commit 94e7701
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion filters/FarthestPointSamplingFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,16 @@ PointViewSet FarthestPointSamplingFilter::run(PointViewPtr inView)
{
// Return empty PointViewSet if the input PointView has no points.
PointViewSet viewSet;
if (!inView->size() || (inView->size() < m_count))
if (!inView->size())
return viewSet;

// Return inView if input PointView has fewer than count points.
if (inView->size() < m_count)
{
viewSet.insert(inView);
return viewSet;
}

PointIdList ids = Segmentation::farthestPointSampling(*inView, m_count);

PointViewPtr outView = inView->makeNew();
Expand Down

0 comments on commit 94e7701

Please sign in to comment.