49 assert (input_normals_ !=
nullptr);
50 output.resize (input_->size ());
51 if (extract_removed_indices_)
52 removed_indices_->resize (input_->size ());
56 for (std::size_t i = 0; i < input_->size (); i++)
58 const NormalT &normal = (*input_normals_)[i];
59 const PointT &pt = (*input_)[i];
60 const float val = std::abs (normal.normal_x * pt.x + normal.normal_y * pt.y + normal.normal_z * pt.z);
62 if ( (val >= threshold_) ^ negative_)
66 if (extract_removed_indices_)
67 (*removed_indices_)[ri++] = i;
70 PointT &pt_new = output[cp++] = pt;
71 pt_new.x = pt_new.y = pt_new.z = user_filter_value_;
72 if(!std::isfinite(user_filter_value_))
73 output.is_dense =
false;
79 removed_indices_->resize (ri);
81 output.width = output.size ();
88 assert (input_normals_ !=
nullptr);
89 indices.resize (input_->size ());
90 if (extract_removed_indices_)
91 removed_indices_->resize (indices_->size ());
95 for (
const auto& idx : (*indices_))
97 const NormalT &normal = (*input_normals_)[idx];
98 const PointT &pt = (*input_)[idx];
100 float val = std::abs (normal.normal_x * pt.x + normal.normal_y * pt.y + normal.normal_z * pt.z);
102 if ( (val >= threshold_) ^ negative_)
104 else if (extract_removed_indices_)
105 (*removed_indices_)[z++] = idx;
108 removed_indices_->resize (z);