Skip to content

Commit

Permalink
Fix centroid computations for Iso_cuboid_3
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiraudot committed Oct 29, 2020
1 parent 913c29b commit 5e72746
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Principal_component_analysis_LGPL/include/CGAL/centroid.h
Expand Up @@ -714,7 +714,7 @@ centroid(InputIterator begin,
{
const Iso_cuboid& cuboid = *it;
FT unsigned_area = 2 * ((cuboid.xmax()-cuboid.xmin())*(cuboid.ymax()-cuboid.ymin()) + (cuboid.xmax()-cuboid.xmin())*(cuboid.zmax()-cuboid.zmin()) + (cuboid.ymax()-cuboid.ymin())*(cuboid.zmax()-cuboid.zmin()));
Point c = K().construct_centroid_3_object()(cuboid[0],cuboid[1],cuboid[3],cuboid[5]);
Point c = K().construct_midpoint_3_object()(cuboid[0],cuboid[7]);
v = v + unsigned_area * (c - ORIGIN);
sum_areas += unsigned_area;
}
Expand Down Expand Up @@ -747,7 +747,7 @@ centroid(InputIterator begin,
{
const Iso_cuboid& cuboid = *it;
FT unsigned_volume = cuboid.volume();
Point c = K().construct_centroid_3_object()(cuboid[0],cuboid[1],cuboid[3],cuboid[5]);
Point c = K().construct_midpoint_3_object()(cuboid[0],cuboid[7]);
v = v + unsigned_volume * (c - ORIGIN);
sum_volumes += unsigned_volume;
}
Expand Down

0 comments on commit 5e72746

Please sign in to comment.