Skip to content

Commit

Permalink
Merge pull request CGAL#4677 from sgiraudot/PSP-Fix_upsampling_bbox-GF
Browse files Browse the repository at this point in the history
Fix initialization of Bbox_3 in edge_aware_upsample_point_set()
  • Loading branch information
sloriot authored Apr 29, 2020
2 parents 8450b9d + 428e47e commit 074084c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,19 @@ void Rich_grid<Kernel>::init(std::vector<Rich_point<Kernel> > &vert,

radius = _radius;

x_side = (unsigned int)ceil((bbox.xmax() - bbox.xmin()) / radius);
y_side = (unsigned int)ceil((bbox.ymax() - bbox.ymin()) / radius);
z_side = (unsigned int)ceil((bbox.zmax() - bbox.zmin()) / radius);
std::size_t x_size = (std::size_t)ceil((bbox.xmax() - bbox.xmin()) / radius);
std::size_t y_size = (std::size_t)ceil((bbox.ymax() - bbox.ymin()) / radius);
std::size_t z_size = (std::size_t)ceil((bbox.zmax() - bbox.zmin()) / radius);

x_side = (x_side > 0) ? x_side : 1;
y_side = (y_side > 0) ? y_side : 1;
z_side = (z_side > 0) ? z_side : 1;
x_size = (x_size > 0) ? x_size : 1;
y_size = (y_size > 0) ? y_size : 1;
z_size = (z_size > 0) ? z_size : 1;

indices.resize(x_side * y_side * z_side + 1, -1);
indices.resize(x_size * y_size * z_size + 1, -1);

x_side = int(x_size);
y_side = int(y_size);
z_side = int(z_size);

std::sort(rich_points.begin(), rich_points.end(), Z_Sort<Kernel>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ edge_aware_upsample_point_set(

// copy rich point set
std::vector<Rich_point> rich_point_set(number_of_input);
CGAL::Bbox_3 bbox(0., 0., 0., 0., 0., 0.);
CGAL::Bbox_3 bbox;

typename PointRange::const_iterator it = begin; // point iterator
for(unsigned int i = 0; it != end; ++it, ++i)
Expand Down

0 comments on commit 074084c

Please sign in to comment.