mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-03-25 11:51:08 +08:00
Sync changes from upstream repository
Co-authored-by: Andrew Le Bihan <andy@mcneel.com> Co-authored-by: Dale Fugier <dale@mcneel.com> Co-authored-by: Dale Lear <dalelear@mcneel.com> Co-authored-by: David Eränen <deranen@gmail.com> Co-authored-by: Greg Arden <greg@mcneel.com> Co-authored-by: Jussi Aaltonen <jussi@mcneel.com> Co-authored-by: Lowell <lowell@mcneel.com> Co-authored-by: Mikko Oksanen <mikko@mcneel.com> Co-authored-by: Pierre Cuvilliers <pierre@mcneel.com> Co-authored-by: Steve Baer <steve@mcneel.com> Co-authored-by: chuck <chuck@mcneel.com> Co-authored-by: piac <giulio@mcneel.com> Co-authored-by: wfcook <wfcook@mcneel.com>
This commit is contained in:
@@ -634,15 +634,15 @@ ON_PointCloud* ON_PointCloud::RandomSubsample(
|
||||
// For (min <= r < max): min + RandomNumber() % (max-min)
|
||||
const int point_index = gen.RandomNumber() % last_point_count;
|
||||
|
||||
destination_point_cloud->m_P.Swap(point_index, last_point_count);
|
||||
destination_point_cloud->m_P.Swap(point_index, last_point_count - 1);
|
||||
if (bHaveNormals)
|
||||
destination_point_cloud->m_N.Swap(point_index, last_point_count);
|
||||
destination_point_cloud->m_N.Swap(point_index, last_point_count - 1);
|
||||
if (bHaveColors)
|
||||
destination_point_cloud->m_C.Swap(point_index, last_point_count);
|
||||
destination_point_cloud->m_C.Swap(point_index, last_point_count - 1);
|
||||
if (bHaveValues)
|
||||
destination_point_cloud->m_V.Swap(point_index, last_point_count);
|
||||
destination_point_cloud->m_V.Swap(point_index, last_point_count - 1);
|
||||
if (bHaveHidden)
|
||||
destination_point_cloud->m_H.Swap(point_index, last_point_count);
|
||||
destination_point_cloud->m_H.Swap(point_index, last_point_count - 1);
|
||||
|
||||
last_point_count--;
|
||||
if (last_point_count <= 0)
|
||||
|
||||
Reference in New Issue
Block a user